The week started off with my rewriting all of the Arduino and sensor code for the MSK, after forgetting to save and losing the code that I did have. (Not such a big deal, as it was only 30 lines or so that needed to be rewritten.) I rewrote the code to have more features than the old code did, like the ability to write custom angles to the servo, and the ability to modify default values (e.g. Change what angle the servo gets set to if the sensor is triggered.) I also restructured the code to use methods instead of having everything running in the main loop. Ultimately, losing those thirty or so lines was probably a good thing. Of course, I expect that I’ll have to rewrite the code a few more times before the end of this project, whether it’s to allow for the control of multiple servos or to simply remove debug functions.
Upon completing the new Arduino code, I also dug up some code for a utility called “Processing”. After a bit of rewriting, I was able to get the Processing code to work with my sensor. As seen in the picture, this new code allows for a real time graph of the muscle sensor data to be generated, something that is particularly useful in finding proper electrode placement.
Of course, electrode placement is still a big problem, since I haven’t been able to get very consistent results thus far with the MSK. This is why I was very happy to receive a confirmed working EMG for experimentation from a teacher here at Westtown. With the new, (seemingly more sensitive) EMG, I’ve been able to get some great results in figuring out where to place electrodes. Perhaps more importantly, now that I have access to two EMGs, I can try sensing different muscles at the same time. If I can sense different muscles at the same time, I can control multiple servos, and the hand will be able to do more things – for example, the thumb could be controlled independently of the fingers. This new EMG differs from the one that I have currently in that it uses a different type of electrode and in that the output is not rectified. See below for an example (not mine) of an unrectified (top) vs a rectified (bottom) wave:
Note that the rectified wave has no dips below a certain point, while the unrectified wave does. This raw EMG output has been something that I’ve been interested to see.
By the end of the week, I want to have the Arduino and muscle sensor working to trigger the servo 100% of the time. After that, I can begin working on connecting the servo to the 3D printed hand, and a rudimentary prototype of the EMG control system can be tested. I’d also like to put the code that I have thus far on a GitHub repository. I’ll include a link to the repository after I create it.