
Gaggiuino and Topology Optimization
Similar to the other project-based classes I have talked about on this site, the professor assigned a final project instead of a final exam for this class. ME 556, Robotic Concepts, is a class where we learned the "Analysis of robotic systems; end effectors, vision systems, sensors, stability and control, off-line programming, simulation of robotic systems". As for the project, we, a team of three, were given two NEMA 17 stepper motors, an Arduino, and some sample code; and were told to create a robot that would take images and then draw them on the etch-a-sketch. At the end of the project we were told we created the most feature-set version of the robot the professor has ever seen. Some of the features we added were, image optimization for drawing on an etch-a-sketch, the ability to add personalized text to images, the option to free draw, and most importantly, improved speed for drawing. Notability the improved speed drawing was developed by me after the professor said it wasn't possible.
To start this project we began with a cardboard prototype, just to get the motors attached and test the sample code. We noticed that it was extremely slow. Drawing the image seen on the left in about 3 mins. I knew that that can't be the fastest it could run, but according to the professor, that's the fastest it could run using the existing code. So, I started researching ways to increase its speed. During that, we devised methods to decode images to a set of points that could be sent to the steppers to draw them out. We came up with first editing the image so that it could be more easily and it would allow us the added benefit to adjust the algorithm to draw the best picture, as different pictures require different decoding techniques.
I was correct in my suspicions and there was a way to speed up the code. I found that the reason behind it moving so slowly was that since we used MATLAB to process and drive the motors there was a communication delay between MATLAB and the Arduino. So, I wrote an Arduino script that would move the stepper motors to points stored within a matrix and made MATLAB just focus on the processing. The method of changing which device was actually moving the motors worked wonderfully! As you can see in the gif on the right, the robot now moves to the points much quicker(excuse the large size, it is needed so that you can see the line being drawn).
Along with the speed drawing, we added the ability to free draw where a user can draw on a MATLAB plot and the etch-a-sketch would then draw it in real life. We then added the feature to change the size of the image, and the ability to change the pixel size. Lastly, we added the ability to add text to the image, allowing the users to also change the font and the placement of the text.