12/03/2018: Stepper motor control solved

12/03/2018: Stepper motor control solved

Zongxi Huang
D0E0F263-909F-44A1-8D0C-4E799FDEA441.MOV

In today's class, I successfully overcame the issue with controlling the stepper motors. At first, I tried to figure the problem using the code Luis gave me. Despite my efforts, I made little progress. I tried to combine elements of the new coding with a simpler example I used earlier. However, my decision to do so backfired as the motors ceased to move completely and showed no signs of moving after I imported the allegedly improved code. 

My unsuccessful attempt compelled me to look for other solutions. Looking into the studio's electronics inventory, I discovered the only TB6600 driver available to me. After finding a reliable tutorial on Youtube on how to use it to control stepper motors, I decided to attempt to discard the motor shield temporarily and incorporate the driver into my Arduino setup. Though I followed all of the instructions, I was still unable to control the stepper motors.  However, just as I was about to discard the driver, I remembered that there was always the possibility that I had wired up the motor incorrectly. As such, I swapped the position of the wires from the negative port to the positive port. In doing so, I corrected the problem of conflicting current direction within the stepper motor and I was able to control the motors to create a back and forth swinging motion. 

Using this progress, I moved on to create a code that could control the stepper motor using the motor shield. When this attempt was successful, I decided to try to control 2 motors at the same time. After some experimentation and research, I was able to control two stepper motors simultaneously. Unfortunately, due to a lack of time, I was unable to make further progress today. 

Tomorrow, I plan on creating a code that would control the motion of the leg, which I plan on completing this week.