hia. ((iohannes, sorry for the hijacked thread, its an old tic that
saves me time figuring out the email account subscribed to the pd-
list and avoid bounces, and since I changed the subject line the
mailserv shouldnt detour to an older thread :/ ...anyways.....))
anyone around who understands how can one send control data to a
stepper motor via the pduino aka firmata?
i guess i have to send a message with few values at the same time:
direction, speed, number of steps??
any help appreciated.
/a
ad wrote:
anyone around who understands how can one send control data to a stepper motor via the pduino aka firmata?
You have to set and clear the four digital outs that go to the motor.
i guess i have to send a message with few values at the same time: direction, speed, number of steps??
No it doesn't work that way. You have to explicitly set and unset each of the four control lines in a specific sequence. The speed you do it at determines how fast the motor turns. Each new step is a different pattern. To move the motor the coils have to be energized at one or the other side, not both. The sequence can be found by trial and error. When it's wrong the motor just jitters. It's not dangerous. Martin
On Oct 2, 2006, at 3:16 PM, Martin Peach wrote:
You have to set and clear the four digital outs that go to the motor.
i have the stepper turning by the way of a potentiometer, now is the
pd part where im stuck.
You have to explicitly set and unset each of the four control lines
in a specific sequence.
ok, but if one wants to do this by the way of, say an [hslider], if
possible. How can i get to set/unset 4 messages..uhmm? what would be
the right way to send those patterns to the arduino?
The speed you do it at determines how fast the motor turns. Each
new step is a different pattern.
clear,
The sequence can be found by trial and error. When it's wrong the
motor just jitters. It's not dangerous.
yes, i ve seen that, it doesnt even go as hot as a servo does.
tx again martin /a
You could probably just set the slider to control a metro that bangs the proper message sequence. This would effectively adjust the motor speed. (But I don't yet use Arduino, so I may be wrong.)
~Kyle
On 10/2/06, ad alejoduque@gmail.com wrote:
ok, but if one wants to do this by the way of, say an [hslider], if possible. How can i get to set/unset 4 messages..uhmm? what would be the right way to send those patterns to the arduino?
On Oct 2, 2006, at 4:55 PM, martin.peach@sympatico.ca
martin.peach@sympatico.ca wrote:
there are four messages that you sequence. With a slider it could
increment or decrement a counter that goes to a select that sends
one of four messages to the arduino. That will work if you move the
slider very slowly to avoid missed values.
i have tried with few metros banging the 4 pins of the arduino
8,9,10,11that "control" the stepper. Its been just random moves from
the stepper, i've read page 99 onwards of the document you suggested
but i just dont seem to know how to create the correct patterns in
pd, the stepper jumps in very small number of jumps then backwards
then onwards... this is sending a pulse with a [metro 100]..
On Oct 2, 2006, at 4:58 PM, Kyle Klipowicz wrote:
You could probably just set the slider to control a metro that bangs the proper message sequence. This would effectively adjust the motor speed.
took me a while to find the bytemask and debytemask objects/patches..
that should be included with the pduino release since the arduino-
test.pd patch needs them... (linux 0.3.9 extended test 2 here)..
after digging the list archives i finally found them (http://
lists.puredata.info/pipermail/pd-list/2006-06/039287.html), i thought
they will stop the jittering produced by the different bang
secuences.. nogo... the jumps are to few to be able to understand the
right secuence.
On Oct 2, 2006, at 5:11 PM, Christian Klippel wrote:
my idea would be the following: if it cant do already, change the arduino firmware to accept a byte
that gets send to a arduino port. usually, you need 4 bits for a stepper,
depending on the type. so you can mask away the unused 4 bits, and set the port- lines at once directly. this will give you a much smoother operation of the
stepper as well.
how to know if the pduino firmware, as you said, already do this? as
said above i've banging each pin in all kinds of combinations, the
stepper moves but i dont seem to find a clear pattern that help me
decipher the rest.
any other idea for a patch to get a hold on a stepper from pd using
the pduino? i thought this was easy or was already done from pd..
tx all for the help, /a
Am Dienstag, 3. Oktober 2006 00:39 schrieb ad:
[...snip...]
how to know if the pduino firmware, as you said, already do this? as said above i've banging each pin in all kinds of combinations, the stepper moves but i dont seem to find a clear pattern that help me decipher the rest.
any other idea for a patch to get a hold on a stepper from pd using the pduino? i thought this was easy or was already done from pd..
well, i have no idea about the arduino firmware actually. all that is needed is to set multiple pins at once. since it is open source, you should be able to find that out. or maybe someone else knows that already ;)
also, what kind of stepper motor do you have? 2-coils, 4-coils? unipolar, bipolar? with extra coils? for example, there are bipolar steppers that actually have 4 coils: 2x10 ohms and 2x1 ohms, so they _look_ as if they are unipolar, 4coils steppers, but they are not.
tx all for the help, /a
greets,
chris
hi again,
on a quick note, the sequence for using unipolar 4 coils steppers is:
A B C D coils A - D 1 0 0 0 step1 0 1 0 0 step2 0 0 1 0 step3 0 0 0 1 step4
this is the full step sequence. you can do half-steps as well, practically doubling the number of steps per revolution:
A B C D coils A - D 1 0 0 0 step1a 1 1 0 0 step1b 0 1 0 0 step2a 0 1 1 0 step2b 0 0 1 0 step3a 0 0 1 1 step3b 0 0 0 1 step4a 1 0 0 1 step4b
to make it turn continously, repeat the sequence. to change direction, step from 4 to 1 ....
if you want to use bipolar stepper motors, you need an extra h-bridge driver, so that the polarity of the coil driving voltage can be changed.
greets,
chris
hi,
Am Montag, 2. Oktober 2006 16:39 schrieb ad:
On Oct 2, 2006, at 3:16 PM, Martin Peach wrote: [...snip...]
ok, but if one wants to do this by the way of, say an [hslider], if possible. How can i get to set/unset 4 messages..uhmm? what would be the right way to send those patterns to the arduino?
my idea would be the following: if it cant do already, change the arduino firmware to accept a byte that gets send to a arduino port. usually, you need 4 bits for a stepper, depending on the type. so you can mask away the unused 4 bits, and set the port-lines at once directly. this will give you a much smoother operation of the stepper as well.
The sequence can be found by trial and error. When it's wrong the motor just jitters. It's not dangerous.
yes, i ve seen that, it doesnt even go as hot as a servo does.
you can either have the stepper unpowered when not moving. this will save energy, avoiding to get hot driver stages. the drawback is that the motor doesnt hold its position anymore, when you apply some torque to it. then you can leave the lines powered, to literally make the motor stick to the position. but this will cause a higher current draw, and may heat up the driver transistors.
also note that there is a way to control a stepper in half-steps as well, giving you twice the number of steps it usually has. it does so by hoding the rotor inbetween two positions.
regarding stepper motors, you may want to take a look at this link collection: http://www.doc.ic.ac.uk/~ih/doc/stepper/
tx again martin /a
greets,
chris
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list