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
tx for any help again, /a
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
yoo martin, thanks again, as said in my post, i have the stepper already under control via a ULN2003A driver and a potentiometer.
im stuck in the pd part, no problems with comport or the serial but with the pd patch.
On 12/27/06, Martin Peach martin.peach@sympatico.ca wrote:
With pduino you can send each bit pattern at once, don't set the pins one at a time, it's too slow.
yeap, this is exactly what i will like to use pd for i was banging a [counter 1 4] but im not sure about speeds and how to get to each of the 4 pins that go from the arduino to the ULN2003A.
thats why i was asking for some pd patch for troubleshooting the possible pattern secuences.
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).
i guess is more related to the right pattern since the same circuit works when i use a potentiometer, as said before i will like to try it using the pduino if that is possible?
If you can show a diagram or photo of your setup I could probably help
you more...
http://img.photobucket.com/albums/v20/igortme/Arduino/Ejemplos/ESQUEMA_MOTOR... http://static.flickr.com/32/54357295_756c131217.jpg
I will try the SimpleMessageSystem Libraryhttp://www.arduino.cc/playground/Code/SimpleMessageSystemmaybe its easier.
thanks again, /a
alejo d wrote:
yoo martin, thanks again, as said in my post, i have the stepper already under control via a ULN2003A driver and a potentiometer.
im stuck in the pd part, no problems with comport or the serial but with the pd patch.
I don't have the patch here, it's at work, next week I go back...but it's easy: you just send messages containing a single number though comport. In your diagram you have the stepper on digital pins 8 9 10 11, which are respectively decimal 256, 512, 1024 and 2048. So if you wanted to turn pin 8 and 11 on, or example, you would send 256+2048: [2304( | [comport] So to do a complete sequence I did something like: [metro 15] | [counter 3] -- this is a counter that goes from 0 to 3. There's no standard counter in pd. It's useful to have one that can count backwards as well. | [sel 0 1 2 3 ] | | | | [2560 ( [1536 ( [1280 ( [2304( | | | | --All the messages go to the single inlet of comport. [comport]
Since there are only four possible patterns (1010, 0110, 0101, 1001), it's just a question of changing the order of the four wires at the output of the ULN2003A until the motor turns consistently in the same direction. Another issue is that you are feeding the motor 5V from the same power supply as the arduino, which might cause trouble if the stepping of the motor resets the microcontroller. Usually it's better to have a separate power supply for the motor. Just make sure to connect the two grounds together. And in your photo, it looks like everything is powered from the USB, which is virtually guaranteed not to work because the USB can't supply enough current to drive a motor.
Martin