Download fulltext01 - DiVA Portal
Transcript
66 6.5.1 CHAPTER 6. TESTS AND EXPERIMENTS Cyberbike model tests The Cyberbike Simulink model was extensively tested to determine why it would terminate after only a few time-steps. The model did originally use a fixed time-step of 0.02 seconds. [Sølvberg, 2007, chap.6.6] suggested that the cause of the problem could be related the old motherboard being too slow, so this was the first part to be examined. By running the bike drivers on the QNX workstation in "zero-return mode", 2.0 GHz of processing power was available; a significant increase over the measly 400 MHz of the Wafer 971A. It was quickly determined however, that model communicating with the Windows computer running Simulink still terminated only a few time-steps after being started. The error produced was "Memory fault (core dumped)". This gave reason to believe that the problem was not, at least primarily, related to processing speed. To determine the root of the problem, a lot of debugging messages where added to the core C files generated by RTW, trying to track down exactly where the memory fault appeared. Unfortunately, it became apparent that the exact point of failure was hard to track down, as the RTW framework is dependant upon a vast amount of files. Keeping it simple (stupid), quickly presented itself as a better alternative: Disable the S-function code, and see if the problem disappeared. This was done by simply stopping the device files from being sampled. And indeed, now the code initiated, executed and terminated properly. At this time it was attempted to sample just one device, but this resulted in an error message. To see if increasing the sample time could rectify the problem, the fixed time-step was at first set to 0.25 seconds. Now the model ran smoothly, successfully terminating when stopped through Simulink. At this point, all device files where enabled, and, by trying to bound the sample time from below, 0.15 seconds was determined as a stable value, constantly running without failure. Throughout the testing process, several bugs with the bike_io_wrapper.c code where fixed, some described in Section 5.4. 6.5.2 Bike demo tests The bike demo Simulink model was tuned and tested for stability. This was done separately for the steer and the pendulum by starting in centered position, with the angle close to zero, and set the reference to the face left after five seconds. Figure 6.2 shows how the steer position follows the reference for the final tuning, while Figure 6.3 shows the same for the pendulum. The stability of the control scheme was determined to be satisfactory as a "proof of concept" demonstration. The steer and pendulum should follow the reference to such a degree that a operating the two is possible within reasonable limits. 6.6 Device Peripherals and associated drivers All the drivers where, at the minimum, modified to work even with no hardware connected, so everything had to be properly tested for any bugs or errors with and without a