Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ULN2803 Stepper Motor Circuit Help

Status
Not open for further replies.

godatguitar

New Member
Hi All

I am using a ULN 2803 to control 2 stepper motors, and the input to the IC is directly from an I/O port on an 8051 microcontroller.
The stepper motors are 24V, and "apparently" need 800mA each to operate. Does this sound correct? And is this safe with the ULN2803?

Basically, as I am aware the output is inverted, so to turn a coil from a motor on I apply a logic 0 to the corresponding input pin on the 2803.

Also, the circuits I have seen use a Zener diode on the power input to the uln2803, usually slightly higher voltage than the motors require. Apparently this protects back emf? Is this right? Basically I have a 27V, 1.3W zener diode, and i do not want to blow the IC up with too large a current or something.

Any help would be great.
Cheers guys
Paul
 
The stepper motors are 24V, and "apparently" need 800mA each to operate. Does this sound correct? And is this safe with the ULN2803?

No, the maximum current for each output is only 500mA. You should use something bigger like a ULN2064B (1.5A 50V) or ULN2065B (1.5A 80V).

Basically, as I am aware the output is inverted, so to turn a coil from a motor on I apply a logic 0 to the corresponding input pin on the 2803.

To turn a coil ON, you still have to apply a logic "1".

Also, the circuits I have seen use a Zener diode on the power input to the uln2803, usually slightly higher voltage than the motors require. Apparently this protects back emf? Is this right? Basically I have a 27V, 1.3W zener diode, and i do not want to blow the IC up with too large a current or something.

It depends on how you connect the zener diodes. The proper way to connect the 27V zener is to connect the anode to ground and the cathode to one of the coils. You would need 4 pieces of zener diodes. Another way is to connect a single zener diode to the common of the internal free wheeling diodes of the 2803. See the attached schematic. The higher the voltage the faster the current will decay when the coil is turned OFF. This will allow for higher speed stepping. The maximum voltage on the ULN2803 is 50V.
 

Attachments

  • 2803.GIF
    2803.GIF
    6.5 KB · Views: 16,881
Hi
Thanks for the info

Can you not use the outputs in parallel, ie, create an output of 1A x4 instead of 500mA x 8?
It means I would need two 2803's to control 2 motors. But I have read it can be paralleled, but just dont know how.

If not, do you have a better suggestion for controlling 2x 24V 800mA stepper motors? Am I doing it the best way? I am only able to get hold of 2803's or below, for some reason I cant find a local stockists of the others u mention.

Cheers
 
Sure you can try to connect them in parallel. I have done it without any ill effect. For example, pins 1&2 connected together and 17&18 connected together. However, I wouldn't push the output to 1A because any imbalance will stress the transistors to the breaking point.
 
help

i have 2 stepping motors (m42sp-5, working at 12V, 259mA) connected to ULN 2803, so according the second schema motion posted above, i'll need to use a 1,5V zener diodes. Is it right?

Sorry for my poor english and i'm a newbie. Tks.
 
Re: help

hoaivan said:
i have 2 stepping motors (m42sp-5, working at 12V, 259mA) connected to ULN 2803, so according the second schema motion posted above, i'll need to use a 1,5V zener diodes. Is it right?

Sorry for my poor english and i'm a newbie. Tks.
No you won't need 1,5V. You have to use 27V. Those zener's are used as free-wheeling diodes to protect the outputs of ULN2803. The high voltage spikes generated across an inductor due to falling magnetic field are supressed by these diodes. If you want in place of zener diodes, you can also use general purpose diodes like 1N4007(work ok for low speed of operation) or schottky diodes 1N4933 (high speed)etc.
 
tks kinjalgp for replying me.

look at my schema, are they right ? Is there any other solution better than this ?
 

Attachments

  • untitled_174.gif
    untitled_174.gif
    7.9 KB · Views: 13,156
  • IRcircuit.gif
    IRcircuit.gif
    6.8 KB · Views: 6,604
You circuit is ok excetpt that it is recommended to put 4.7k pull-up resistors on P0 of microcontroller.
 
The bottom circuit looks OK except that you should disconnect pin10 of the ULN2803 from the 12V rail. If it is connected, the external 27V zener diodes will have no effect. This will slow down rate the current decays in the steppers. It will result in poor high speed performance.

You may also replace all the zeners with a single 15V zener diode connected to pin 10 the same as my original schematic.
 
motion said:
You may also replace all the zeners with a single 15V zener diode connected to pin 10 the same as my original schematic.

how do you caculate that the zener didode must be 15V
 
The zener in this case to load the inversed voltage from motors as they free running, and it will help to stop the motor.

The supply voltage of your motor is only 12V. Therefore, if you use stepping from old floopy disk driver, you can use 12V zener here. But for safety, they usually 15V instead. 27V zener will cause slow control as you run on your motors. 15V is enough.

And you should connect only one zener for each motor. And you connect the zener from power supply to pin 10. You don't have to put as many zener as this.

You can search for SMACH application, it's a project of a student of Douglas W. Jones (author of stepping tutorial). And this is a good reference for driving stepping with ULN2803 or ULN2003.

Goodluck.
 
hoaivan said:
how do you caculate that the zener didode must be 15V

That's a good question. Falleafd is right with the explanation. However, upon further review...

The drawing below illustrates what is happening when you switch the transistor Q1 from ON to OFF. The current (I) through the winding does not turn off instantly. It will force its way through diode D1 and against zener D2. In order for it to flow, the windings will generate a voltage equal to the voltage drop through diode D1 and D3 which is equal to 15.7V. This voltage, plus the voltage at the winding center tap, will result in 27.7V to appear at Q1's collector.

The windings of the stepper motor act like a transformer. On the other side of the center tap, -15.7V will be induced. Since the voltage at the center tap is 12V, the voltage at the collector of Q2 is -3.7V (12-15.7=-3.7V). This might damage transistor Q2 if it is above 5V.

If the value of the zener diode were changed to 12V, the voltage at the collector of Q2 becomes -0.7V. I recommend to change to a 12V (or slightly less) zener diode.
 

Attachments

  • diode_207.jpg
    diode_207.jpg
    13.9 KB · Views: 5,625
thanks motion, i have another question for you:

how to control the speed of a stepper motor ? Just depend on the frequence of the pulse on 4 winding of the motor !
But what is the frequence that make my motor run fastest. (what is the delay time i must set between each time i setb on the outport of my microcontroller ?)
 
hoaivan said:
thanks motion, i have another question for you:

how to control the speed of a stepper motor ? Just depend on the frequence of the pulse on 4 winding of the motor !
But what is the frequence that make my motor run fastest. (what is the delay time i must set between each time i setb on the outport of my microcontroller ?)

It depends on various factors, mainly the design of the motor and the load on the motor - a heavier load will slow it's maximum stepping rate.

Easiest thing is to simple try it and see, increase the speed until it misses steps, then back it offf a little.
 
:arrow: Also remember that the faster a stepper motor goes, the less torque you are going to have. So make sure you are going to have enough torque to move the load at that speed.

The stepper data sheet will reveal some type of curve for the motor at different voltages, for your reference

Ivancho
 
The stepper run usually run at 4000 pulse per second with no load. And normally, we can run it at 100 pulse per second with strongest load of it.

A clever way to write a control for stepping on MC is following:


do this loop forever

increment the index
call stepping table
output the variable updated by stepping table
delay (t)
do something else here...

goto loop


stepping table should be like this

addwf pcl, f
retlw b'00000001' ; step1
retlw b'00000010' ; step2 ... and go on..


As you want to run it in half step mode, you can add step 1,5 to the table and go on..

After that, you can write a delay time function which is computed from the acceleration and velocity you want.

And of course, you should use a fixed acceleration and use PID control for the high level real time control.

You can then easily compute a accelerate table and decelerate table and then add it to the delay function.


Finally, you have a great low cost controller yourself.

As I see, your name looks like a vietnamese girl, doesn't it? Welcum to this forum.
 
hi,
i found this site recently.ppl here seem to real time experts.
I personally am doing a project for lift or elevator .This is my post on interent regarding the need to drive my dc motor.iam doing the project in a breadboard as of now.
the microcontroller output is not sufficient enuf to the l293d.
l293d requires 'high logic 1' input and gives max 36v voltage output.
i can make it run in my pcb(previously made,iam making new modifications to it ).but in my breadboard ,the o/p from the micro cont is not enuf to the l293d motor driver ic.
If i connect the input to 12 v supply then the ic responds..even for 5v there is no response..
please help me. thank you
 
how to interface stepper motor or dc motor to xc9572

hi all, im doing a project using cpld which requires connecting xc9572 with stepper motor or i can use dc motors also, can any1 help?
 
Status
Not open for further replies.

Latest threads

Back
Top