axial loading
4.8 M kl data acquisition system
A portable computer-based data acquisition system was used to enable measurements to be made in unrestricted locations, forces to be viewed in almost real time, and data to be readily available for further processing and analysis. The output from the UHF receiver, translated to RS232 voltage levels, is fed to the serial port on the PC. Data is continuously arriving at this port at 9600 Baud, encoded as described in #4.4A 3. Software resident on the PC performs several tasks to enable the incoming data to be captured, decoded, displayed and optionally stored, in real time. The ability to capture data as it is generated, with only the small delays involved in the various conversions between strain measurement and data logging, avoids the need for any separate memory or data buffer either at the subject or the data logger. Furthermore, events can be displayed almost as they happen, which can be useful in observing particular events and their effects. The first computer used to perform these operations was a
16MHz 386SX portable PC having a maths coprocessor and VGA resolution. The data acquisition software was initially written in a high level language called ASYST™, and as written only allowed the data to be viewed after an acquisition. This was not only inconvenient but unreliable since data was sometimes not received correctly, this only becoming evident if the acquisition was optionally plotted on the screen. A further acquisition would then have to be made. A great improvement was made after implantation in the first subject, who happened to be a professional software engineer, and he rewrote the code in the C language. This enabled the data to be written to the screen as it was received, thus confirming valid data acquisition. This acquisition software was subsequently extended for the Mk2 system, which due to the additional processing required a more powerful PC to enable real time display. At that time small ‘handbook’ 40 MHz 486 PCs were becoming available, and one of these was purchased for the Mk2 data acquisition. Figure 4.47 shows the first M kl prosthesis together with the ‘programmer / subject’ (IM) after the operation, during a measurement session. The subject is wearing the external electronics box, connected to the external coil strapped around the right leg. The original data logging 386PC is also shown with
the original radio receiver below. The following sections describe the operations of the Mkl real time software, specified by the writer but programmed by the first Mkl subject.
%
Figure 4.47 The first Mkl prosthesis (left) prior to implantation, and the subject (right) during a data acquisition session.
4.8.1 Data capture and decoding
The initial task for the decoding software is to detect the 4 frame count bits in the fourth byte. This is done by capturing successive bytes into one of 4 buffers in turn and checking which buffer has an incrementing count for the same sequence of 4 bits. (The 16550 UART in the PC serial port manages the serial data and interprets the bytes correctly.) When such an incrementing count has been detected over several frames a 'locked in' flag is set on the display. Idle bytes are ignored.
The contents of each byte may now be directed to the appropriate buffer in order to reconstruct the two 13 bit strain channels, and the temperature and humidity channels. Knowing which buffer contains which parts o f which channel, the software is able to reconstruct the original data by reading the buffers and performing logical and arithmetic operations. Priority is given to servicing the interrupts from the serial UART. The temperature, humidity and battery voltage bytes are reconstructed in a similar way but over a major frame o f 16 normal frames, and this data is therefore updated less frequently. No data from these 3 auxiliary parameters is saved.
After reconstructing the numbers transmitted for the two original strain channels, the constant offset o f 1900 which had been subtracted for data compression [#4.4.4.3] is added back on, and the linear algorithm derived during calibration is used to convert these countvalues (digitised periods of the telemetered pulse intervals) to axial force.
4.8.2 Data display and logging
On selecting a particular subject’s prosthesis from a main menu the forces are calculated using the calibration algorithms for that prosthesis. The calculated forces for both channels are written to the VGA screen as the data becomes available. A single vertical axis calibrated in kN is used for both channels. The data is scrolled horizontally to show the recent force history. The display is given a lower software priority than servicing the incoming data and the speed with which the screen is updated depends on the CPU speed. A 16MHz 80386 with maths coprocessor is fast enough to display the Mkl forces with no noticeable delay. Data is continuously displayed in the above way without being logged. Upon a keystroke, the succeeding preset period of data (normally 10 seconds) is saved to disk, and the user is prompted to enter a filename for that record, the subject's initials being added automatically to the filename.