[PD] pd2stepper round II

Martin Peach martin.peach at sympatico.ca
Wed Dec 27 20:24:29 CET 2006


alejo d wrote:
> hia, some months ago there was a thread about controllin' step motors 
> from pd to the arduino, it went as it often goes, into a very 
> technical discussion and at the end im not sure if it is or is not 
> possible to control this kind of motors via pduino or any other way.. 
> i just want to be able to use the board and the motors from pd, can 
> that be achived with the actual pduino?
>
> can anyone share a pd patch for doing so, im sending a sequence of 
> values to the pins in the arduino where the stepper is connected 
> (previously tested the wiring and it all works fine with a 
> potentiometer) but it only tics and doesnt move no matter the pattern 
> i try.
>
> this is the thread where things where being discussed:
> http://www.mail-archive.com/pd-list@iem.at/msg00315.html
In that message I said that I tried it and it worked for me.
Without knowing any details of your circuit I can't say anything except 
generalities:
First, almost no microcontroller is able to drive any kind of motor 
directly. You need some kind of power transistor or relay in between.
Second, there are two main types of stepper motor - unipolar and 
bipolar. A typical unipolar motor has 6 wires - three for each coil. One 
wire of each triplet is connected to the middle of the coil, the others 
are at the ends. Unipolar motors are easiest to drive. You need 4 
transistors, one on each end of each coil. The middle of the coils is 
always attached to the positive power supply (usually 5-24V).
Bipolar motors need an h-bridge setup since you have to invert the 
polarity of each coil. This takes 8 transistors altogether.
Third, you have to experiment with different sequences until you get the 
motor to move properly. The link here has examples of sequences:
http://www.appliedmotionproducts.com/support/wiring.php
Fourth, the timing is important: not too fast or the motor doesn't have 
time to step, too slow and it heats up because current is passing 
through the coils but no work is being done. About 15 milliseconds per 
step works for a small motor.

With pduino you can send each bit pattern at once, don't set the pins 
one at a time, it's too slow.
So if you get ticking and not continuous motion it usually means that 
either your pattern is wrong or that your drive isn't sufficient (not 
enough voltage or not using transistors, or transistors not fully on).
If you can show a diagram or photo of your setup I could probably help 
you more...

Martin





More information about the Pd-list mailing list