I found an Arduino GCODE interpreter and modified it to suit my project. I considered using remote procedure calls, I thought about implementing Hewlett Packard Graphics Language ( HPGL) as used in pen plotters, but in the end for fun I decided to use GCODE as my drawing protocol - GCODE is how laser cutters and 3D printers and many other CNC machines are driven, so it seemed like good experience to learn a bit about how it worked. The computer will need to send drawing commands to the Arduino. Other people have also implemented systems using a Big Red Switch that you can hit in an emergency to shut down immediately) I should warn you that I trashed two of these devices while developing the software - if you drive the knobs too far and move the stylus off the screen, you pretty much ruin the device for use with a computer ever again! By the time I bought my third Etch-a-Sketch I had added code to the driver to get it to halt the motors if the stylus approached too close to the edge of the screen. Very simple hardware to build, anyone can do it - here are the parts you'll need: The motors are held in place by a couple of brackets and the brackets are held steady by being screwed into a block of wood. (Although there's internal backlash, but we'll come to that later) It works almost perfectly - there's virtually no slack or backlash introduced by the linkage. To cut a long story short I ended up discovering about metal drive shaft couplers which I used to directly connect the stepper shaft to the knob shaft. I tried a more high-tech timing-belt drive like the ones used in 3D printers but it wasn't very reliable either, likewise driving via gears was painful too. Despite the knobs being slightly knurled, friction drive with a belt doesn't work. Not every project works first time, and I have to confess I tried quite a few different mechanisms for turning the Etch-a-Sketch knobs with a motor. I'm also using the Adafruit stepper motor shield and their associated software to make the motors turn. I could just as easily have used a Raspberry Pi to do both jobs, but this was what I had handy. In my case I'm currently using an Arduino to drive the stepper motors and a Windows portable to drive the Arduino over a USB serial port. It's a great way to cut your teeth on learning how to build a CNC system - all you need are two stepper motors and a computer to send commands to it. Have a good look around on Instructables (and elsewhere if you look via Google) - there are lots of people who have built computer-controlled etch-a-sketch systems. Of course, we love robots, so naturally it's going to be a robotic Etch-a-Sketch :-) Now read on. We're going to build something very similar to a turtle graphics system - but we're going to use an Etch-a-Sketch instead of a robotic turtle. You can find regular LOGO systems on the web and also the really cool " Scratch" programming language uses the same ideas to draw lines. So modern turtle graphics on a computer is just like the turtle robots that Papert used in the 70's - you tell a simulated turtle to walk and turn with simple commands like FORWARD 10 and RIGHT 90 and the turtle will draw a square on the computer screen. He was very much the grandfather of the Maker Movement.) In particular he used programming as a learning tool to think and to reason out solutions to problems. (Seymore Papert was a teacher who proposed an educational philosophy called ' constructionism', which was basically encouraging kids to learn through making rather than passively absorbing other people's teachings. These turtle robots actually exist - they were invented in the early 70's and used with the programming language LOGO which was specifically designed by Marvin Minsky and Seymore Papert for teaching children. Now we pull out the robotic turtle and we tell it do do just that by typing commands on a keyboard. Now tell them that you have a trained turtle, and if you tell the turtle to do what the child just did, the turtle will also pace out a square on the ground. Explain after they've done this that they've paced out the shape of a square. Ask a child to stand in the middle of a room, walk forward ten paces, turn right, walk another ten steps, and keep repeating this until they get back to where they started. Turtle Graphics is a way of doing computer graphics that is based on a simple model that children can easily understand.
0 Comments
Leave a Reply. |