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.

L297-L298 stepper motor control

Status
Not open for further replies.

banh

New Member
Hi,
I'm going to connect the circuit to control step motor using both L297, L298 as in the L297 specification.

A few things i widh to ask:

what should the CONTROL pin's value be: 0 or 1?
WHat's the effect of HALF/FULL Step (provided i use the same CLOCK all the time)? is it correct that i does not change the speed but just have a higher resolution of the motor revolution?
 
banh,

because you are vietnamese, you can come to www.diendandientu.com to see my translated tutorial of Stepping control of Douglas W. Jones. He's my "online" teacher. He's taught meeh via email for 2 years.

If you wanna see the original document, search for Douglas W. Jones

Its a wonderful Stepping control tutorial.

The torque in these 2mode of full step and half step is different.

At full step, if you enable 2 winding at a time, you get 1.4 times stronger torque than normal. But at half step, the torque will change each half step, 1, 1.4, 1, 1.4 ...etc. Half step is the combination of 2 full step mode.

Half step creat higher resolution.

revolution = cycle, it depends on the number of pulse, not on the half step or full step modes.

With full step, you need N pulses to turn the motor a revolution, in half step, you need 2N pulses. Pulses here means a control vector.
 
Thanks falleafd,

what i'm still blurr is the value of the CONTROL input of the L297? Can it take any value?
 
is it correct that if i use ABCD, i don need to use INH1, INH2? In this case CONTROL should be 1?
 
No, INHx are connected to enable bit of L298, and they are outputs of L297. You cannot control it normally. To control these pins, you need CONTROL input to select the mode of control.

ABCD is connect to the inputs of L298, to generate pulses on dual H bridge. INH is used to stop the L298. It's active LOW, because as output low on INH, it inhibits (stop) ENABLE bit on L298.

You can use CONTROL signal to select the chopper on ABCD or INH. You only need to use control HIGH (chopper on ABCD) if you need this technique.
 
about Vref for L297, how to calculate?
say, Rsens=0.5 Ohm, and my motor takes 2A -> Vref is 1V?
 
Yes.

Vref of a driver chip is the output, that you can use your ADC to measure this voltage, and disable the driver if the Vref higher than the max Vref.

Your motor is normally running at 2A, but at starting it may rearch 3A. So you cannot stop the motor at 3A. You can use a controller to lock the driver if it's at 3A for very long time or if it's higher than 3A.

So, in this case, your Vref should be 3A * 0.5Ohm = 1.5V.

However, try to choose Vref ~ 5V which applied to VDD of your uC. In this case, you can use your comparator but not a ADC to control the driver.

Why? Because, some uC do not support ADC, but it supports comparator, such as: 16F628, or 16F628A.
 
i don't understand,

Vref is the input into L297? how come you say "Vref of a driver chip is the output, that you can use your ADC to measure this voltage".
inside L297 already has comparators with Vref as inputs so that it will chop whenever voltage (by current of motor & Rsense) exceeds Vref.
So Vref is the volatge we should set for the L297, correct (i.e. it is input to L297) ?
 
Oh, sorry, I said about the Vref on uC, that I use to control L298. SenseA, and SenseB are connected to Vref of uC, that is why I say Vref is the output from driver chip.

However, a internal comparator of L297 can be used, and you can apply the max voltage to chopper the driver, if the current is going too high.

However, I don't use it in my driver, because as I said, a high current could be created at the beginning (especially with DC motors), so if you chop down the chip, you cannot control the driver anylonger.

That why I use SenseA, and SenseB connect directly to microcontroller. I use software to detect the high current. If high current is higher than normal current for so long time, I'll cut down the chip. For short circuit protection, you should use hardware. Software is used in this case to protect the chip and the motor if you apply a heavy load, or the motor is stopped by external forces.

With stepping it seems to be oki with comparator protection, so you can use the Vref inputs as you want.
 
what should the CONTROL pin's value be: 0 or 1?

It depends on the motor that is connected, the desired speed and the efficiency you're trying to achieve.

Setting it to 0 will send current control thru to INH1 & INH2. This turns OFF all transistors in the H-bridge when the current exceeds the reference level. This will result in current to decay faster and will allow the motor to run faster but hotter. This is used for steppers with high inductance.

Setting it to 1 will send current control thru to ABCD. The freewheeling motor current will decay slower. The current will fluctuate less and so there is less ripple, less core loss and run cooler. Low inductance motors will benefit from this control method.

WHat's the effect of HALF/FULL Step (provided i use the same CLOCK all the time)? is it correct that i does not change the speed but just have a higher resolution of the motor revolution?

With the same clock, running at half steps will reduce the RPM to half that of full steps. Half steps will reduce vibration and acoustic noise.
 
My circuit is as attached. however i found that Motor is very "weak", and slow. WHat factors do you think i can change to improve?
 

Attachments

  • 297-298.jpg
    297-298.jpg
    62.4 KB · Views: 4,581
i fix the problem already. I forgot to connect gnd for L298.
btw,
what is the effect of the capacitor & resistor into pin OSC? experiment, i don't see any change it made (e.g. i change the capacitor, or i even get rid of it)?
 
i fix the problem already. I forgot to connect gnd for L298.
btw,
what is the effect of the capacitor & resistor into pin OSC? experiment, i don't see any change it made (e.g. i change the capacitor, or i even get rid of it)?
from the datasheet, this detemine the chopper rate, but seems that it don't have effect. :confused:
 
Last edited:
Hi,

Just to note, you can use a motor driver voltage much higher than 6v
to get the motor to go faster. If the chopper circuit is working right
the chip will not burn out the motor as it will regulate the current
by chopping it.
Typical voltages are 30v or more, even with 5v rated coil motors.
 
Hi,

Just to note, you can use a motor driver voltage much higher than 6v
to get the motor to go faster. If the chopper circuit is working right
the chip will not burn out the motor as it will regulate the current
by chopping it.
Typical voltages are 30v or more, even with 5v rated coil motors.

hi MrAl,

but, it is already much higher than 6v as it can reach 46V (on the L298 datasheet), another important thing, the voltage depends on the motor caracteristics !!

or didn't I understand you ?
 
It depends on the motor that is connected, the desired speed and the efficiency you're trying to achieve.

Setting CONTROL to 0 will send current control thru to INH1 & INH2. This turns OFF all transistors in the H-bridge when the current exceeds the reference level. This will result in current to decay faster and will allow the motor to run faster but hotter. This is used for steppers with high inductance.

Setting CONTROL to 1 will send current control thru to ABCD. The freewheeling motor current will decay slower. The current will fluctuate less and so there is less ripple, less core loss and run cooler. Low inductance motors will benefit from this control method.



With the same clock, running at half steps will reduce the RPM to half that of full steps. Half steps will reduce vibration and acoustic noise.


great explanations,

but there are things which are not yet clear into my mind,
the datasheet says about the INH1:
Active low inhibit control for driver stage of A and B phases.
When a bipolar bridge is used this signal can be used to ensure
fast decay of load current when a winding is de-energized. Also
used by chopper to regulate load current if CONTROL input is low.

does this mean that:
-if CONTROL is set to 0V, will there still be a protection from high current since INH1 and INH2 are disactivated ? cause I've read that those two pins Disable the L298 when high current is detected .
-does the CONTROL pin set depends on the motor kind (bipolar or unipolar) ?

another thing:

from the datasheet, three driving modes are possible :
*NORMAL DRIVE MODE
*HALF STEP MODE
*WAVE DRIVE MODE

the second and third modes needs INH signals (so CONTROL = 1 volt) and not the first mode, why ?

Two inhibit signals are also generated by
the L297 in half step and wave drive modes.

in the timings page 5 and 6, INH signals are present with phase signals (A,B,C,D), isnt this contrary to what was written before :
-CONTROL: Control input that defines action of chopper.
when low, chopper acts on INH1 and INH2;
when high, chopper acts on phase lines ABCD.


thanks in advance.
 
Last edited:
hi MrAl,

but, it is already much higher than 6v as it can reach 46V (on the L298 datasheet), another important thing, the voltage depends on the motor caracteristics !!

or didn't I understand you ?


Oh ok no problem then, i thought the schematic showed 6v.

Wait a minute...the schem posted by banh *does* show 6v, that's why i commented in the first place.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top