Go Down

Topic: L297 stepper motor controller (Read 21 times) previous topic - next topic

Flat Stanley

Jan 27, 2006, 04:17 am Last Edit: Jan 27, 2006, 04:27 am by stinky Reason: 1
I have been investigating stepper motor control for the last couple of months. I've been looking at lots of different solutions and right now I think that using the l297 chip is probably the best balance of features, price and useability.

First, here is what I have found about this chip that might be useful for others interested in stepper control.....

some useful docs....

STmicroelectronics l297 notes...

STmicroelectronics l297 datasheet...

my understanding and brief summary....

The l297 can create the control signals for bipolar, unipolar and variable reluctance stepper motors.

In all cases, you can digitally select full stepping, half stepping and wave stepping modes.

The motor takes one step for each pulse sent from the arduino board. Direction is decided by taking a pin HIGH or LOW.

The l297 has another important feature. It includes two PWM chopper circuits to regulate the current in the motor windings. ??? what does that mean?? well, i found this page...


It's a nice and easy going explanation on stepper motors in general and it includes this bit on chopper  control of steppers...

'To increase the torque at higher speeds, stepper motors are driven at several times their voltage rating. A designer might use 5 volt steppers and then run them at 12 or 14 volts. To avoid destroying the motors, the current through the windings is monitored and power is cut off when the current reaches a critical level. When it falls back down, the power is reapplied. This technique is known as "chopper drive" and it allows the motor to increase its top speed.'

So that kinda explains the functions of the chip.

I don't yet understand how to implement the chopper drive properly. Also, I have not yet tried any circuits!! but from reading and researching, I believe the following to be true....

If you don't want the chopper drive......

If you want to control a bipolar stepper, you can use the l297 with the l293.

If you want to control a unipolar stepper, you can use the l297 with the L702B or any darlington transistor array. I'm not sure if you would need a buffer.

If you do want the chopper drive......

If you want to control a bipolar stepper, you can use the l297 with the l298.

If you want to control a unipolar stepper, you can use the l297 with the ULN2075B

In all cases, you will need a few extra components to complete the circuit.

So, now I have some questions for you!

Does anybody have any experience using the chip?? or any good circuit designs for using it??

The chip has an input Vref. This is used for giving the reference voltage for controlling the Chopper circuit. Can anybody explain how to connect up this pin??

I would like to compile circuit designs using the l297 to control bipolar and unipolar steppers, with and without chopper control. I want to find the easiest possible solution for each circuit. ;) Please post if you already have a good solution for one of these circuits.

I will now start trying some circuits, i'll post when I get one working.

Thank YOU!

PS. maybe I made some mistakes above. Please correct me! I'm just a beginner still!
my hobby --  www.jonathanbryan.com

my life --  www.ifranks.com  [link]www.silver-collector.com[/link] [link]www.da


Jan 27, 2006, 03:06 pm Last Edit: Jan 27, 2006, 03:07 pm by Daniel Reason: 1

I made some stepper motor drivers with the L297 and L298 five years ago, and they still work great!

The schematic for it is on page one of the L297/298 datasheet: http://www.allelectronics.com/spec/L297.pdf#search='L297'

Here is what I recall from building them:

- the L297 will give you three-pin control of the motor: on/off, direction and step.

- The L298 takes care of the power circuitry. I hooked some quite large steppers up to it and it never failed.. almost indestructible.

- Use a heatsink for the L298. I put the whole circuit in a Hammond 1590B box, and the box acts as a heatsink.

- Use an onboard regulator (7805) to provide nice clean power to the L297, and lots of bypass capacitors.

- I recall that while there were a lot of settings, as you mention above, they mostly weren't critical... I just put a  trimpot on for Vref etc, and tuned it so that it worked well.

- Be sure to use some nice Schottky diodes on the motor leads to suppress transients, which are quite large on a good-sized stepper motor. I think OnSemi
will still send you a few dozen or so free diodes as samples, but you have to pay shipping now it seems:

good luck!

Flat Stanley

Thanks Daniel! You keep coming to my rescue ;D

I am planning to try the schematic on the l297 datasheet. I'm glad to hear that this one worked well for you! I have a few questions about it....

1. As i am planning to control the l297 from the arduino board, can i just use 5V output from that to power the l297 or do you suggest an external power supply using the 7805??

2. In the schematic there is a .33 capacitor and 22K resistor connected to the 'osc' pin. What is their purpose??

3. I'm new to electronics. I will investigate tonight, but perhaps you can explain... what is a trimpot and how do i connect it to the vref pin?? How do I know when it is adjusted right??

4. Am i right that the l297/l298 setup is for bipolar steppers only?? If so, have you tried some other setup using the l297 with unipolar steppers??

If you can answer any of these questions, I would be very grateful! Thanks / Jonathan
my hobby --  www.jonathanbryan.com

my life --  www.ifranks.com  [link]www.silver-collector.com[/link] [link]www.da


hi jonathan

1. The 5v cominoug from arduino when connected to the USB are supplied from the computer. this means that if you overload it you risk damaging the computer (altough it's a very remote risk)
Whenever you plan to power anything bigger than a couple of LED use an external power supply. Anyway motors (unless tiny) should not be powered from the regulated 5V supply but should use the unregulated voltage supplied to the board (this usually floats between 7.5 and 9v)

2. Going from memory the OSC pin determines the PWM frequency used to drive the motors. if you change those values you change the pwm freq.

3. a trimpot is a potentiometre that can be adjusted with a screwdriver. connect one end of the trimpot to 5v, the other end to ground and the pin in the middle to vref. tweak until the motor runs smoothly

4. You can use it with unipolars. you'll have to hook up the motor in a different way. (look http://www.st.com/stonline/products/literature/an/1734.pdf here for details)

you can drive the 298 directly from arduino if you dont need any of the sofisticated features it has.

for simple circuits a nice L293D (D not E or B) has power drivers and diodes integrated..  you can see a circuit here http://www.potemkin.org/cms/Pid/StepperMotor



Jan 28, 2006, 05:03 am Last Edit: Jan 28, 2006, 05:06 am by Daniel Reason: 1
for power, you need a separate supply (in the manufacturer's schematic they specify 36V, but I uses 12V/2A), and from this suply you can just drop in a 5V regulator for the L297, an LM78L05 or a LM7805 will work fine.  As Massimo says, you shouldn't load the Arduino with anything more than a few milliamps! The driver will draw such large currents that connecting it's power suply to the Arduino's risks passing the power supply transients back to the Arduino.  

Go Up