tambien / oscuino

[MOVED] OSC implementation for the Arduino Platform
https://github.com/CNMAT/OSC
22 stars 15 forks source link

stepper motor?? #11

Open batchku opened 12 years ago

batchku commented 12 years ago

i can't get stepper motors working.

i see that one must adjust the code loaded to the arduino; the code doesn't indicate which pin is the "step" and which is the "dir".

it also doesn't indicate how one might work with more than one stepper motor.

both are necessary....

but even with the one, i can't get the stepper to respond. i'm using this driver:

http://www.pololu.com/catalog/product/1182

tambien commented 12 years ago

i can add the option of multiple stepper motors. but there is a tough design problem which is that the stepper motor binds to pins so it has to by default be #ifdef'ed out. and then adding more steppers means that there is more code that users have to go in and alter. i'm going to play around with a solution which allows for more dynamic stepper binding. i'll post a reply to let you know how it goes.

for now. i added the option of using the 4 pin stepper invokation.

batchku commented 12 years ago

still not sure what the deal is with pin assignments and stepper numbers. is it true that for now we need to go into the arduino sketch to hard code the pin numbers and enable steppers?

if so, possible to do this with some basic serial communication, i.e. a command from max to set stepper_enable and step/dir pin numbers?

tambien commented 12 years ago

ok. i reworked the stepper thing. i looked at the source for stepper and realized that there is no harm having the steppers enabled by default. there are now 4 stepper motors available and you can set them up with an oscuino message. "/t/3/a 100 3 4" is the same as calling the constructor Stepper(100, 3, 4). You can also use the 4 pin version.

i don't have a stepper motor to test with. so try it out and let me know. i updated the readme to reflect those changes.

batchku commented 12 years ago

as you know, in addition to the motor itself, you also need some driving circuitry for steppers. the arduino community standard is something like this:

http://www.schmalzhaus.com/EasyDriver/

sparkfun sells it.

it's this board that takes only 2 pins (step and direction). i'm not totally clear on what the "4 pin version" is; perhaps it's for driving a stepper motor with two h-bridges? i.e. something like this:

http://www.pyroelectro.com/tutorials/stepper_motor/hbridge.html

some clarity is needed here.

it would of course be immeasurably helpful if you had a stepper motor and a stepper motor driver in order to test. if you don't have acces/can't get one, perhaps i can send you a stepper and driver. it's imperative for debugging this feature properly.

incidentally, you have some servos?

a

tambien commented 12 years ago

I don't have a stepper right now. i'll order one this week.

though, i do have a servo.

batchku commented 12 years ago

in the mean time, let me know how i can try to test. i have steppers and driver boards. i need to know how to indicate dir/pin and step/pin