January - Debugging the Oscillator Class
Debugging was a grueling process, but the payoff was worth the effort.
My first debugging task was to get home() to work properly. After using print statements to check for hardware errors, I realized that the homing sensor for Stepper 0 was too far to detect anything. I removed one of the side panels to access the sensor and move it, but the motors grinded when I tested them. Mr. PZ helped me unstick the motors before I moved the homing switch once again. The sensor needed to be closer than it was before, but not as close as I had placed it the first time. When I moved onto the software errors, Mr. Harlow gave me a 3D model of the motor mechanism (figure 1) and explained how home() should work in theory. I noticed that the program homed them in the opposite order than what Mr. Harlow described. I made sure to fix the error so that Stepper 1 was homed before Stepper 0. Moving onto trial and error made me realize a glaring problem: the homing sensors were connected to the wrong motors, leading the motors to breeze their actual sensors. Once this error was fixed, I could confidently say that home() was fixed. Debugging was a grueling process, but the payoff was worth the effort.
The Earthquake Simulator is supposed to have horizontal and vertical motion, but only horizontal motion was implemented up to this point. Furthermore, Oscillator.py included immutable variables that were tailored to the horizontal axis. To fix this issue, I went through the class and made those variables adjustable parameters, allowing for more flexibility. The biggest change I made was initializing each stepper board outside of the Oscillator class, which allowed for the use of a try/finally statement that shuts the motors down when the program is no longer running (figure 1). Along the way, I ran into challenges with deciding which values should be parameterized, meaning there was a lot of trial and error. Next, I needed to make sure home() worked on the vertical axis, but I noticed that there was only one homing sensor installed. After meeting with Mr. Harlow, we noticed another problem: the vertical oscillator was slightly loose, causing the carriage to sit at an angle. I took apart the oscillator (figure 3) and found that there were only three screws holding the components together instead of four. Someone had broken a tap in the last hole, rendering the part defective. Mr. Harlow instructed me to tighten the screws with thread glue in the holes until a new part can be made.
DELTAs:
Courage and risk taking: I have participated in a program called the School for Scientific Thought with UCSB in the past, and, earlier this month, I discovered that one of their upcoming sessions will focus on earthquakes. Because I want to make sure the Earthquake Simulator is as accurate as possible, I applied for the program. This will hopefully be a fun background to base parts of the project off of. Because I am a returning student, my chances of acceptance were lower, but I still tried my best and got accepted into the program.
Empathy: When I started the Earthquake Simulator project, I didn't have the most comprehensive guide. I don't want a future software person to feel confused like I did, so I began working on adding onto the readme in GitHub with additional information on the program itself. I am going to include notes about why certain processes were included and which specifically could use improvements or updates.