### Author Topic: LM338 powering a stepper motor?  (Read 4123 times)

0 Members and 1 Guest are viewing this topic.

#### aboodi

• Contributor
• Posts: 18
##### LM338 powering a stepper motor?
« on: January 10, 2014, 01:31:08 pm »
Hello guys/girls,

In this project I'm working with two stepper motors (3V, 2A each) from a 6V battery. I used a voltage regulator (LM338) to get 3V. I built the typical circuit provided in the LM338 datasheet. Then I used the output to power the two motor drivers.

The problem is that the measured current going out of the battery doesn't exceed 400mA. I tried to directly power the motor driver, and it was approximately 2.5A.

My guess is that the input impedance has something to do with the problem, and to come over it a MOSFET is needed. That is my guess, and i'm waiting to hear your interesting explanation/solutions.

thanks,
Abdullah

#### GeoffS

• Supporter
• Posts: 1267
• Country:
##### Re: LM338 powering a stepper motor?
« Reply #1 on: January 10, 2014, 01:36:58 pm »
A circuit diagram might help.

#### aboodi

• Contributor
• Posts: 18
##### Re: LM338 powering a stepper motor?
« Reply #2 on: January 10, 2014, 02:18:33 pm »
A simple diagram is attached.

#### Zbig

• Frequent Contributor
• Posts: 871
• Country:
##### Re: LM338 powering a stepper motor?
« Reply #3 on: January 10, 2014, 03:39:16 pm »
I'd rather look for some motors with voltage rating that matches your supply voltage or use a dedicated, current-limited stepper motor driver. It's very innefficient to use linear regulator for powering motors.

#### idpromnut

• Supporter
• Posts: 613
• Country:
##### Re: LM338 powering a stepper motor?
« Reply #4 on: January 10, 2014, 03:39:48 pm »
~2A out of a 6V battery?  If I understand correctly, the power that will drive the stepper is coming from the battery as well right? I think you should tell us what type of battery you are using/link the specs.  I would suspect that the battery does not have the capability to source 2A (unless when you said you "directly powered the motor driver" you were directly powering it from the battery?).

#### aboodi

• Contributor
• Posts: 18
##### Re: LM338 powering a stepper motor?
« Reply #5 on: January 10, 2014, 03:58:25 pm »
The battery is a lead-acid battery. And yes, It is capable of sourcing 4A.

Datasheet of battery: http://www.yuasabatteries.com/pdfs/NP_4_6_DataSheet.pdf

#### Kremmen

• Super Contributor
• Posts: 1283
• Country:
##### Re: LM338 powering a stepper motor?
« Reply #6 on: January 10, 2014, 04:10:34 pm »
You really need to check some L298 appnotes from the web because as it is now, your circuit will not work.
Nothing sings like a kilovolt.
Dr W. Bishop

#### aboodi

• Contributor
• Posts: 18
##### Re: LM338 powering a stepper motor?
« Reply #7 on: January 10, 2014, 04:11:13 pm »
The problem is supply voltage. The minimum supply voltage for the L298N has to be >Vih+2.5. Where Vih is the input high voltage, i.e. 5V. So the minimum supply voltage has to be 7.5V!!!!!!!!

Is there a solution guys??

#### SeanB

• Super Contributor
• Posts: 15379
• Country:
##### Re: LM338 powering a stepper motor?
« Reply #8 on: January 10, 2014, 04:15:01 pm »
You need to use the L298's built in current limiting to provide the current limiting function. The appnote has  this when used with the L297 controller. the IC does need at least 2.5V over the logic voltage to operate, so it really needs a 7V5 supply to operate properly with a 5V logic supply. Not going to operate well with a 6V SLA battery.

#### Kremmen

• Super Contributor
• Posts: 1283
• Country:
##### Re: LM338 powering a stepper motor?
« Reply #9 on: January 10, 2014, 05:28:02 pm »
There are a number of issues here. Firstly the voltages:

You have a microcontroller (MCU) that obnviously is supposed to control the steppers, right. That needs a supply and you have marked it as 5V. That is OK but what is not OK is where it is connected to. More about that.
The L298 bridge/driver also needs a supply voltage Vss for its internal logic. Normally you would want to make that the same as the MCU supply to ensure both have compatible signal levels. --> First modification you need to do is to create a +5V regulator and supply the MCU and L298 Vss from that.

Then there is the L298 Vs supply. If you check the L298 datasheet it specifies an absolute maximum rating of 50V for that input. This should be a clue. In fact it is the positive power rail for the motors. So you need a hefty supply capable of producing the amperage the motor connected to this bridge needs.
Another non-obvious fact is that the voltage rating indicated in the stepper specs is _not_ an indication of the actual voltage you should provide to the Vs rail. Typically the working voltage is much, much higher than the nominal voltage of the motor. It could easily be like 20-30 volts or more for your motors, depending on exactly how the drive coils are connected and what the resulting coil inductance will turn out to be. Some high-inductance steppers need closer to 100 V before they are able to produce their nominal torque at any appreciable speed. So please _really_ do read some L298 application notes freely available in the net.

Finally, your drawing provides no clue how you have planned to provide the step sequencing necessary to make the stepper actually move. Your safest bet is to do what SeanB suggests and hook up an L297 sequencer chip that will handle the phasing signals for you. Additionally, it will provide the non-trivial logic needed for pwm current control without which you either burn your motors or not get them to move at all. Again, _do_ find a L297 app note and get familiar with it.

I don't want to discourage you but there is a wide gap between your drawing and a functional stepper control and drive circuit. The bright side of the coin is that all info needed to close that gap is easily available behind a couple of googles.
Nothing sings like a kilovolt.
Dr W. Bishop

#### aboodi

• Contributor
• Posts: 18
##### Re: LM338 powering a stepper motor?
« Reply #10 on: January 10, 2014, 06:17:01 pm »
Thanks for the explanation.

For the logic supply, I use an Arduino and it has a built-in 5V regulator, so I use that to supply the motor drive.

The Arduino Mega controls the motor driver and supplies the logic voltage (5V), as well.

So, the only problem I see is the motor supply voltage. And you explained that the motor voltage needed is not the rated voltage, not even close for high inductance motors. Thanks.

You asked me to google app notes for the L298. Isn't that the datasheet itself?

Abdullah

#### woodchips

• Frequent Contributor
• Posts: 527
• Country:
##### Re: LM338 powering a stepper motor?
« Reply #11 on: January 10, 2014, 06:26:21 pm »
I agree with Kremmen, the voltage rating of a stepper is irrelevant.

The problem is that the motor is inductive, so slowing the rate of rise of the current. The way this is overcome is to run the motor from a much higher voltage with a resistor in series. Time constant of an LR circuit is L/R. The resistor actually greatly increases the achievable step rate of the motor.

Obviously the current needs to be limited, but only after the initial current spike.

#### Kremmen

• Super Contributor
• Posts: 1283
• Country:
##### Re: LM338 powering a stepper motor?
« Reply #12 on: January 10, 2014, 11:48:34 pm »
Thanks for the explanation.

For the logic supply, I use an Arduino and it has a built-in 5V regulator, so I use that to supply the motor drive.
No, you will not. You can try but it will only crash your Arduino. What you can do is to power the _logic_ supply i.e. Vss of the L298, but definitely not the power rail Vs. Please make a clear difference between the _drive_ part which is power and the logic part.
Quote

The Arduino Mega controls the motor driver and supplies the logic voltage (5V), as well.
Yes, that will work.
Quote

So, the only problem I see is the motor supply voltage. And you explained that the motor voltage needed is not the rated voltage, not even close for high inductance motors. Thanks.

You asked me to google app notes for the L298. Isn't that the datasheet itself?

Abdullah
Well, the datasheet contains all you really need including how to apply the L297 chip to create the sequencing and current limitation. If you understand what is written there then the info will be enough to correctly implement a stepper drive. But other than the datasheet there are numerous application notes scattered around the net to illuminate various points of the design task.
Nothing sings like a kilovolt.
Dr W. Bishop

#### aboodi

• Contributor
• Posts: 18
##### Re: LM338 powering a stepper motor?
« Reply #13 on: January 11, 2014, 06:36:34 pm »
yeah yeah, I meant the logic supply. Sorry, I wasn't careful when I was posting the reply.
Of course, the Arduino wouldn't be able to supply over 40 mA/pin.

And I will definitely check the "L298 app note"

Thank you all really much, especially Kremmen. ^_^

Smf