COMPUTER FORUM INTERNATIONAL JOURNAL OF SPORT BIOMECHANICS, 1986,2,210-214 An Application of a Computer Based Real-Time Data Acquisition and Feedback System David /. Sanderson The purpose of this experiment was to assess the efficacy of using real-time generated computer feedback of a selected biomechanical variable, force, for modifying the pattern-of-force application of inexperienced cyclists while they cycled at a steady rate (60 rpm) and power output (approximately 112 watts). Positive results would imply that the technique of using biomechanical variables as augmented feedback could be applied in a learning study in such a way to train for the enhancement of performance of cyclists. This approach differs from the traditional one of using novices performing novel tasks. Even though the cyclists were inexperienced, they nonetheless knew how to cycle and thus modifications of the pattern of force application were made to an already existing complex skill. Before beginning the experiment it was necessary to identify a phase of the pedaling cycle and the associated biomechanical features that would lend themselves to this manner of modification. Additionally, selection of the variable had to be achieved within the constraints of the available hardware and software. It was decided that the forces applied to the pedals during the recovery phase, the period from botton dead center of the pedal stroke to top dead center, could be reduced with training. However, rather than attempting to reduce the forces applied over the whole 180" of the pedaling cycle, a 90" portion of this segment was selected for modification. This sector of interest began at 225 " after top dead center (TDC) and extended to 3 1 5 O after TDC. Briefly, the experimental design was to have a group of cyclists riding an instrumented stationary cycle from which the left and right pedal forces could be recorded by a computer acquisition system. These forces were to be used to m w a visual image on a graphics monitor positioned in front of the riders. David J. Sanderson is with the Biomechanics Research Laboratory at The Pennsylvania State University, University Park, PA 16802. DATA ACQUISITION 21 1 The visual image was to be used to help the riders reduce the pedal forces to zero in the sector of interest. Each of the riding sessions lasted 32 min and was conducted over 10 days. It was important that the riders not come to depend upon the computergenerated feedback. Therefore, the feedback was removed gradually and in an orderly fashion. Because it has been shown that this type of feedback is most beneficial in the early stages of learning, the early sessions had relatively more feedback than later sessions. The presentation of visual feedback was organized into three trials with three blocks per trial. Each block consisted of pairs of periods with and without feedback. The presentation of the feedback was withdrawn according to the following schedule: for the first 5 days, the feedback included pairs of alternating periods of 5 min with and 5 min without. For the next 2 days the feedback was presented in pairs of 3 min with and 7 min without. In the final 3 days of training, the feedback was presented in intervals of 1 min with and 9 min without. During the first 2 min of every ride, the feedback was off. The main computer program, then, had to perform a number of tasks. It had to read data from the instrumented pedals, process mean and variance scores, modify an image on the graphics processor and, finally, store the data permanently on a hard disk. This all had to be done while the cyclist rode at a steady cadence. Thus the data collection and display had to stay synchronized with the cyclists. Bike and Computer Instrumentation The apparatus used in this study was based on a 57.5-cm bicycle frame mounted on a rigid platform. The crank attached to the frame was instrumented such that TDC for the right crank and continuous crank position could be recorded as analog signals. To the cranks were attached pedals from which left and right pedal angle, relative to the crank, and left and right shear and normal components of the applied force to the pedals could be recorded. Altogether, 11 analog and one digital channel of data provided input to the minicomputer for subsequent analysis. A phototransistor was located on the chain ring and bottom bracket in such a fashion that a TTL-compatible pulse was generated at TDC of the right crank. This pulse was provided to the computer through the digital channel and was used to initiate and control the timing of sampling. The 11 analog channels of information were recorded simultaneously by a PDP 11/34 minicomputer. This computer was linked to a Megatek 7000 series graphics computer capable of hardware transformations of a graphics image. All data were converted to digital format using a 12-bit analog-to-digital converter (LPS11-S) under control of the minicomputer. The computer program used to control data acquisition and the presentation and withdrawal of the visual feedback was written in Fortran 77 (ver 5.0) running under an RSX-11M operating system (ver 4.2). The visual feedback consisted of a graphics image processed on the basis of the forces applied during the 90" sector of the recovery phase. The actual image consisted of a single vertical bar representing the average mean force during the 90" sector, averaged for each leg. The amplitude of the bar was determined by the average magnitude of the mean resultant force applied to each pedal dur- 212 SANDERSON ing the recovery segment. This image was presented to the cyclists on the monitor (47 cm screen) positioned in front of the cyclist. The graphics processor responded to Fortran callable software, which allowed for turning the image on or off with a single call as well as controlling the hardware transformations. Thus, the demands for scaling and the presentation and withdrawal of the image could be handled by the system software. Software Bsign The computer program was responsible for a number of tasks. The need to ensure synchrony of the computer acquisition and display with the cadence of the cyclists required careful consideration of the temporal aspects of the hardware and software capabilities. The program had to sample the data, compute the score, modify the graphics image and, finally, present the image to the cyclists. This synchrony had to be maintained for the whole 32 min of each training ride. With those restrictions in mind, the following program was developed. The overall flow of the program was to sample only the four channels of data from the force components at a sample rate of 100 Hz for 250 msecs for each leg during the 90" sector. These data were sampled for five consecutive cycles. During the sixth cycle the program computed the mean resultant force applied by each leg for the 90" segment of the recovery phase and then, using this mean value, transformed the graphics image. There were seven consecutive cycles between each new feedback update. The mean force was printed on the operator's terminal. At the end of each minute of the session, the mean of that minute was stored in an array and, at the end of the session, stored on disk for future processing. Thus, at the end of the whole training period, the minute average and variance for each subject were available for statistical analysis. Program Sequence The program steps are described in this section. Because the source code was specifically written for the PDP 11/34 and the Megatek 7000 series graphics system in this laboratory, its uniqueness restricts the direct applicability to other systems. However, the general flow and philosophy should be of interest. I. Initialization. The first stage was to initialize the graphics computer, the arrays for the data storage, and the disk for data storage, and then request from the user the intervals of feedback on and off. The force pedals were then sampled with the feet off the pedals to determine a baseline. The previously recorded calibration factors for the force pedals were also read from disk. 2. Starting. When the operator was ready and the cyclist was at the appropriate cadence, the whole routine was begun by the operator entering a carriage return. The program first obtained the real time using the executive directive GTIM$. Using this as the starting time, the program computed the time for the periods of on and off feedback in terms of the time of day. For example, if the starting time was 8:05, then the on and off times for the first training ride would be off until 8:07, on until 8:12, off until 8:17, on until 8:22, off until 8:27, on until 8:32, and off until 8:37. The program kept track of these times and used them at the appropriate points to determine program flow. DATA ACQUISITION 213 3. Loop Control-Top Dead Center Pulse. The computer then monitored the digital input port to see when the next pulse from the phototransistor, located at TDC of the right crank, occurred. This routine simply made the program wait for a pulse on this port before allowing it to continue. 4. Wait. Once this pulse was detected, the program issued the ISA standard executive directive (WAIT) to delay the task for a specified interval. This interval was 125 msecs. The TDC pulse occurred when the right crank was at TDC and thus the left crank was at bottom dead center (BDC). There was a 45" arc through which the left crank would move in 125 msecs, thus putting it at the beginning of the sector of interest. The selection of a cadence of 60 rpm and a sample rate of 100 Hz provided a useful way to structure the computer program to deal with 45O intervals of 125 msecs each. 5. Record Left Pedal Forces. The program then recorded the forces applied to the left pedal during the subsequent 90" interval, or 250 msecs. At 100 Hz sample rate, 25 points for each of the two channels were recorded. These values were stored in a temporary array for later processing. 6. Wait. At this point the right crank was now positioned 135" after TDC, and thus a further rotation of 90" of the crank was required before the right crank was at the beginning of the sector of interest. Thus, the program issued a WAIT directive for a further 250 msecs. 7. Record Right Pedal Forces. After that interval the right pedal forces were recorded and the data stored in a temporary array, as was done in step 5. 8. Loop Control. This sequence, beginning at step 3, was repeated for five complete pedaling cycles. Synchrony of the sampling process and the cycling cadence could be maintained because sampling of both channels was completed before the right crank returned to TDC. Thus, looping back to step 3 ensured a call to the wait-for-top-dead-center pulse before continuing. Any lack of synchrony would be confined to a single cycle, thus minimizing errors. 9. Process Data. At the end of five complete cycles, the program then computed the sum and the sum squared of the average force for the 90" sector for the left and right components of the pedal force. These were computed because they were the minimum data required to compute the mean and variance of the pedal forces to be used for the graphics modification and final analysis. The forces for the left and right pedals were stored separately. 10. Graphics Image ModiJication. The next step was to compute the mean force for the left and right pedals and then average these two values to determine the scaling factor for the graphics image. Earlier in the program the timing of the on and off intervals had been determined (step 2). At this point, these times were checked with the present time with a call to GTM$. If the graphics image was on, then the alterations would be observed by the cyclists. If it was an off period, the image was altered but the cyclists would not see that alteration. 11. Are We Done? The program now checked the time, with a call to GTIM$, to see if the total time had been reached. If not, then a further check of the image status was made. This check could result in the image being switched off or on, depending upon where in the sequence the rider was. At this time the computer determined whether the program was to continue or if there was more time left for training. If there was more time, then it returned to step 3 waiting for the next TDC pulse. During the period between the modification of the image, the image remained stationary. SANDERSON 214 12. Write to Disk. If the training ride had been completed, the final step was to store the recorded force on a hard disk for later processing. These data were in the form of the sum and the sum squared of the pedal forces for the left and right legs for each minute of the ride. These data were then analyzed by other programs. Summary This discussion has presented an approach to the use of a standard computerbased data acquisition system coupled with a graphics processor for the modification of a complex movement. The final version of the program was achieved after many stages of development. The time required for the calculations and the constraints of the cycling rate affected the amount and sophistication of the feedback. Newer computer systems could likely be applied to higher cadences or more complex changes because of the reduced time for processing. The success of the experiment, however, suggests that this would be a useful melding of computer technology, skill acquisition, and biomechanics. It could be a way to use biomechanics to modify existing patterns of motion, and could lead to new ways of assessing or improving performance. Acknowledgement The computer program presented here was developed by the author as part of a doctoral thesis. The support and guidance of the supervisory committee of Drs. P.R. Cavanagh, R.C. Nelson, J.B. Shea, and H.J. Sommer 111 is gratefully acknowledged.