In Depth 2019 has been going well so far, but there is lots left to do if I want to have anything for In-Depth night. For the past week and a bit my mentor has been extremely busy with UBC exams and wrapping up the semester, but I still was able to see him, twice. The first time I went to learn was all day on a Saturday, then the following Friday for our second meet. Friday was a little crazy since he was busy with multiple other projects while still trying to teach me. So far, I have built the general skeleton of the arm, and I have mounted 2 stepper motors. Take a look of the arm in action:
In the video, I am using something called a potentiometer which outputs an analog signal that has values from 0 – 1023. My code will tell the stepper motor (in reality the code gives instructions to the stepper motor driver that then operates the motor by quickly switching the polarity of the copper coils within the motor) to either go a certain direction if the potentiometer reads below 300, or if the other direction if the potentiometer reads above 700, if the potentiometer reads within 300-700, then the code will not send any instructions to the driver, meaning the motor will not turn. There is also a complicated mechanical part to the arm as well, but I will explain this in detail in future evaluations.
For the majority of our conversations, the white and black hat is used, since we are usually talking about very technical problems and solutions that require precise facts to be discussed and evaluated.
When I asked this question, I wore the blue hat, as I was setting up a conversation.
(Blue hat) Me: So why can’t we plug the stepper motor directly into the microcontroller, instead of using the driver?
(White hat) Mentor: That’s a great question, but because the stepper motor is simply just a few electromagnets and a shaft, it lacks the sophistication of say, a servo motor.
(Yellow / black hat) Me: Meaning we would have to manually change the polarity to initiate the steps (make the motor turn)?
(White hat) Mentor: Yes, which will be challenging, and hard to control. The driver basically takes the instructions we send it, via the microcontroller, and using an H bridge, will take the simpler instructions and use them to turn the stepper motor.
(he went on to explain more details using the white hat)
(Green hat) Me: Ahh, ok, I see that it makes much more sense to use a driver, but would it make any sense to try and create our own stepper motor driver?
(Red hat) Mentor: Probably not, a successful driver needs a lot of work to build and could take up a lot of valuable time.
(Black hat) Me: So why spend all that time when you can grab one on Amazon for a few bucks.
Here is my code, see if you can find the statements which read the potentiometer values: