Help building a h-bridge for a stepper motor

Thread Starter

Zapnologica

Joined Jun 15, 2012
41
Thanks i had a look at them. Will get round to playing some time soon.

Ok so i ade progress with the h bridge. it was just a tiny short some where.

Now i am on to the next task.. I need to design current limiters.

As the bipolar stepper motors i have are only 7omhs so hook those up to a power supply at 20v and see what they draw?? quite abit.

I need to limit them to like 2 or 3A.

Can i use a voltage regulator to do this?? I know u can do current limiting with them. But i think 3A is asking quite allot?

I ideally would like for it to also be adjustable so that i can fine tune it to whichever motor i plug in.
Here are two schematics that i thought might work. What do you think?


I have two LM338 and a bunch of 317s .
 
Last edited:

shortbus

Joined Sep 30, 2009
10,045
Current limiting to stepper motors is usually done with PWM. This and many other reasons is why a dedicated stepper driver is a better and easier way to go. :)
 

Thread Starter

Zapnologica

Joined Jun 15, 2012
41
Current limiting to stepper motors is usually done with PWM. This and many other reasons is why a dedicated stepper driver is a better and easier way to go. :)

Dedicated Stepper Driver being?

As far as i know. I am building a dedicated stepper driver. each coil of the stepper has an individual h-bridge. Controlled by and ardruino. The ardruino could still PWM into the inputs of my h-bridge couldn't it?

and can you please elaborate on current resistance with pwm? as far as i was aware it was used for voltage?
 

strantor

Joined Oct 3, 2010
6,798
and can you please elaborate on current resistance with pwm? as far as i was aware it was used for voltage?
Saying that PWM is a voltage control is only marginally correct. An inductor opposes changes in the flow of current. So when you apply PWM voltage to an inductive load (your coil), the result is that the inductor "averages out" the pulses and current through it remains more or less stable, while the voltage (in actuality) is rapidly changing across it. When you take this more or less stable current and multiply it by impedance, the numbers say that you have a steady voltage which is X% of applied voltage (X= PWM duty cycle). Although this is not entirely true, the truth is that the voltage is going up and down, it doesn't really matter, the effect is the same.

So actually IMO it would be more accurate to call PWM a current control than a voltage control.
 

Thread Starter

Zapnologica

Joined Jun 15, 2012
41
Oh ok, that makes sense to me!

So then will i be able to use PWM on my bridge i am building?

Also how do i determine the Current to go through my motor coil?
What formula do i use? cause surely changing the timing of the PWM will intern effect the current?
 

strantor

Joined Oct 3, 2010
6,798
As the bipolar stepper motors i have are only 7omhs so hook those up to a power supply at 20v and see what they draw?? quite abit.

I need to limit them to like 2 or 3A.
20V/7ohms = 2.85A, right where you want to be.
 

Thread Starter

Zapnologica

Joined Jun 15, 2012
41
Oh ok. I Get you. Then I must have made a mistake some where, cause if I put the bipolars into the h-bridge. They get hot! That being the motor! Its gets very warm. Which I don't think is good for it?

Does that mean the motors cant take 2.8A?
 
Last edited:

shortbus

Joined Sep 30, 2009
10,045
Dedicated Stepper Driver being?

As far as i know. I am building a dedicated stepper driver. each coil of the stepper has an individual h-bridge. Controlled by and ardruino. The ardruino could still PWM into the inputs of my h-bridge couldn't it?

and can you please elaborate on current resistance with pwm? as far as i was aware it was used for voltage?
While an Ardino or similar uC can be used for driving a stepper motor, it is a harder way of doing it.:) A dedicated stepper driver is a chip that has the stepper logic built in plus other features that are needed for driving a step motor. Features such as reversal of the direction, pause motor movement while holding location, current control, over-under voltage shut down, micro stepping, etc. All with writing no code that needs to be exactly correct.

If building a CNC or other type machine, unless your writing the whole operating system, using a uC for the steppers can get to be a problem. Most of the existing CAM programs just give a couple of signals to drive the step motors. Like a pulse for the actual movement and speed, a high or low signal for direction of rotation.

Most all things that you would by ready made have a dedicated driver for the step motors in them. They have been around since the beginning of steppers. And will make things much easier for you. Google "bipolar stepper driver chip". Not saying that a uC can't be used just that a driver chip is easier in the long run.:)
 

Thread Starter

Zapnologica

Joined Jun 15, 2012
41
I see what you are saying.

I am kind of doing both. My ardruino is not really controlling the stepper motors. I have cnc software on the arduino that receives g-code from the computer and it then sends out a step and direction for each axis so 6 pins in totally ( 2 for each axis). This the gets put into a stepper driver shield, that then does all the stuff you where talking about, but it only supports 750ma. so i am basically just building an AMP for it. to juice up its signals.

phase two of the project will be incorporating of the stepper driver chip.. so that i can only send 2 signals per axis into my board and not 4.
 

Thread Starter

Zapnologica

Joined Jun 15, 2012
41
Ok this is what i have:

i am using this stepper driver:
http://robotics.org.za/index.php?route=product/product&path=92&product_id=170

Now this plugs onto my ardruino which then has grbl loaded on it. So the ardruino doesn't control the steppers. it just says step and direction for the 3 motors.

Now i originally bough that shield and then i realized that it can only do 750ma (it claims, i don't know if that is per chip or per coil) but then when i plugged in my bipolar motor: http://www.nmbtc.com/pdf/motors/PM42L048.pdf

The chip on the stepper driver got exteamly hot. so i gathered it was drawing more than 750ma. which it was when i tested. So now i just build a 8 way h bridge ( the h-bridge was also to just learn electronics and get familiar with them, i only started on them now). then the outputs from that stepper shield go into the inputs off my hbridge.

And now this all worked perfectly. it controlled both the motors. but now i still have the current problem, just now the actual motor its self gets really warm. So to me it is drawing allot of current. because its coil is only 7Ω.

And as far as i know the stepper driver that i am using does not have the ability to use pwm to control the current on the bi-polar?

is it possible to put like a inline pwm?

So i have my inputs from that shield. then it goes through my pwm modulator and then from that into my h-bridge? that way the transitors on the h bridge will control the current due to the pwm? which i can then adjust?

please not that i know these motors are to small for my application. but i am at university and i really cant afford to buy bigger ones. And these just work if thier voltage is above 18v, so i need the strength from the volts.

I have hopefully given all the data that you might need.
 

shortbus

Joined Sep 30, 2009
10,045
I know nothing of micro controllers so can't help with that part. But step motors do run hot and so that will in return make controllers/drivers run hot. In a CNC application when a program is running it usually has one coil of the motor on,even when no motion is happening on that axis. To keep the axis locked from moving, and loosing position. That coil will cause heat in both the motor and controller.
 

Thread Starter

Zapnologica

Joined Jun 15, 2012
41
To what extent though? Warm I understand! But if I plug the stepper into 24v straight I can't even hold the motor! That's how hot it gets? Is that ok. Can I just leave it like that?

I don't mind heat as long as the componets still work!!
 

Thread Starter

Zapnologica

Joined Jun 15, 2012
41
To what extent though? Warm I understand! But if I plug the stepper into 24v straight I can't even hold the motor! That's how hot it gets? Is that ok. Can I just leave it like that?

I don't mind heat as long as the componets still work!!
 

colinb

Joined Jun 15, 2011
351
You are putting 2 to 3 amps through the coil, dropping 24 V. That means each coil is dissipating about (2.5 A) * (24 V) = 60 W of heat! That is massive. Think about how hot a 60 W incandescent light bulb gets even in free space, e.g., in a table lamp. What is the current rating of your stepper motor? Is it really rated for 3 amps at 24 V?

Note that the stepper driver electronics will be dropping some voltage too, maybe up to one volt or so, meaning a couple of watts of heat there as well.
 

Thread Starter

Zapnologica

Joined Jun 15, 2012
41
its only rated to 600ma, thats my whole problem that no one seems to get.

The motor IS drawing more power that it needs. and that is due to its low resistance.

How to i fix this?
 

strantor

Joined Oct 3, 2010
6,798
As the bipolar stepper motors i have are only 7omhs so hook those up to a power supply at 20v and see what they draw?? quite abit.

I need to limit them to like 2 or 3A.
its only rated to 600ma, thats my whole problem that no one seems to get.

The motor IS drawing more power that it needs. and that is due to its low resistance.

How to i fix this?
Be fair, this is the first time you've stated the current limit of the motor in this thread. You actually said, as quoted, that you wanted to put 2 or 3A through it.

If you were going to limit your current with a resistor, it would need to be 33Ω 12W. That's a lot of wasted power, and it drops only 4.2V across the motor. I would recommend using PWM to limit the current.
 

colinb

Joined Jun 15, 2011
351
Or use a step-down dc-dc converter like a buck regulator to regulate the current if you want constant current. PWM is simpler though and should provide just as good results.
 

Thread Starter

Zapnologica

Joined Jun 15, 2012
41
ok fair,

But can i add a "inline" pwm generator ?

So i get my signal in from my stepper driver, then i need to take the non pwm and make it pwm.
 

strantor

Joined Oct 3, 2010
6,798
Looking at the code on the page for your stepper diver (i assume you're using that code?) they are using the digitalwrite function for stepping. I think you could probably modify the code to use the analogwrite function, so long as it's using the arduino pins (don't remember which ones) that are able to function as PWM outputs. If it's not using those pins, you may be able to modify the board to use those pins instead.
 
Top