C. Software Modifications

Because the high voltage level changed from 10 V to 3.3 V, several of the constants in the original Rokhvarg algorithm had to be changed. The Kalman Filter and FSFB gain coefficients did not have to be changed.

The original Rokhvarg computer routine would output its status to the computer monitor. The user would use the keyboard to signal the start and end of the experiment. Each trial run would last for 3 seconds (although this could be changed). During the experiment, the computer routine would record the measured position of the payload and the estimated force response of the solenoids into an array for every 800-μs iteration. At the end of the experiment, the computer routine would write the data for the last trial run to a file. This data file can be analyzed in Matlab.

The Arduino serial monitor is used in the retrofitted controller. The user can type “OK” in the serial monitor to start and finish the experiment. The status of the plant would be output to the serial monitor. At the end of the experiment, the Arduino sketch would write the data for the last trial run to a comma separated values (.CSV) file on the Metro M4's flash memory. I modified the file output code so that it will write , in addition to the payload displacement and force response, the drive current supplied to each solenoid. I also wrote a routine that would automatically send the data to Matlab via serial communication. A Matlab script would automatically plot the data. Finally, I added some code that would allow a user to easily change the payload travel frequency.

Figure V.C.1: Arduino Serial Monitor