Week 9 – Finishing Touches
John W -
Hey Everyone! We’re in the end game now and so this week is going to mostly be about polishing things up. I was out of the lab on Monday celebrating my birthday so this week is a bit shortened, but I still made some great progress.
My first move was adding additional tolerances to the front plate and reprinting it (I used the “offset face” feature to do this). I had just been using the backplate to hold the fingers because the motors would rub against the walls of the front plate and make terrible sounds. I had to rip off the fingers and re-glue them to the front plate, which took a few hours of tearing and re-gluing (it did significant damage to the backplate, but this isn’t an issue). This tolerance will also allow me to slot together the front and back plate more easily. The next step is to re-print the backplate as well to add more tolerances there, as the plates currently aren’t able to slot together with the motors inside.
My next step was to return to working on the circuit. I was pretty happy with the motor control setup but I wanted to incorporate the encoder feedback from the motors to track the current rotational status of the fingers. The encoders I’m using provide 2 outputs: interrupt and direction. The interrupt output records every “tick” of the encoder, where a tick is equal to the smallest unit of rotation that the motor can encode (think of the smallest lines on a ruler as “ticks”). The direction output gives the direction. Both of these pins are digital; so the “interrupt” pin will go from low to high whenever it hits a tick (and then back down to low, resetting it) and the direction pin will output either high or low corresponding to forward or backwards (forwards and backwards are arbitrary when it comes to these motors so we’ll have to use code to make sure that every motor has the same forward direction defined).
The Arduino IDE actually has a built in way to detect whenever a digital pin is interrupted (and it allows you to specify which kind of change, either low – high or high – low, you’d like to read) and to call a function while it happens; meaning I don’t have to constantly run a while loop to read the pins over and over again.
Unfortunately; I only have 4 digital pin spaces left so I have to get creative. What I’m going to do is, instead of reading the direction output from the encoder, I’m just going to have a direction variable that I change whenever I send the signals to the motor controller to change the direction of the motor. This leaves only 4 encoder pins for 4 slots (meaning I have just enough space). I set up the necessary variables and functions in the code in order to track and update the angle values of the fingers, but I’m not able to test this code until I print out an updated backplate that will allow the hand to function properly again.
I additionally started researching ways to make the circuit I had built more stable. For a few weeks now, the pin wires have been easily popping out of the breadboard. While I unfortunately wont have enough time to explore PCB design as I had originally considered, I can still use soldering to permanently attach the wires and stop them from popping out. I ordered a very cheap soldering kit and a protoboard (essentially a breadboard that utilizes soldering instead of pin holes to connect components).
That’s all for this week,
John