Hello all,
I am working on what is for me a huge project to move an object around on a table from underneath using an XY Plotter.
The set up is basically an object (with a magnet on its bottom), atop a table. Under the table is a hidden XY Plotter bed moving around a corresponding magnet on the plotter's head. I am using two NEMA high torque stepper motors and Arduino.
So far:
- I have the architecture of the plotter set up (it's a pulley and spool system)
- I have the two stepper motors spinning
- I have Arduino able to talk to the motors (using stepper.h and simple code from Tom Igoe)
- I can get Processing to send signals to Arduino (so that I can test motion through keyboard commands)
- I can move them around and do simple things. Here's a video of me trying to make it draw a "circle": MFADT Thesis components test - XY Plotter draws a circle on Vimeo
- I own, but have not installed, 6 limit switches
Here's where I need guidance with:
-
Interpolation: right now, my code (which is in its current incarnation here: http://breerubinmfadt.tumblr.com/post/19749648817/current-code )is very rudimentary.
My coding skills are pretty slim and I can kind of suss out how to interpolate by running the motor a few steps one way and then running the other motor, getting pathetic-looking "pixelated" shapes (if you watch the video, you will see how non circular my circle is).
-
1a.I found Arduino Forum this topic on moving two motors "seemingly" at the same time, but I don't fully understand how to create smoother interpolation.
-
1b. In addition to moving in one direction, how do I get the code to interpolate into a circular fashion? I want to be able to move the thing around in tight circles
-
Interrupting the code
This part relates to the whole project being an interactive piece. At certain points in its routines, I want the routines to be interrupted if a proximity sensor detects a person in the room, and then it will go into other routines. For example, if it's circling casually, and a user enters the room, it stops, appears to think, and then slowly moves "toward" the person in the room. I'm going to do this with OpenCV, so I have to have the computer send 'interrupts' into the routines. At the moment, I have the code running through Processing, so that if I press a key, the motors will spin in a certain routine, but I cannot interrupt them by pressing a key until the routine is done.
-
2a. How do I make it so that, at any point in a given "routine", the action can be stopped based on a signal?
-
2b. How do I get the limit switches to also send interrupts?
Anyway, I know there're a lot of questions here, but maybe some of you gurus have answers/guidance for me? That would be super amazing!
The project blog is here, in case you're curious: http://breerubinmfadt.tumblr.com/
Cheers in advance!!!