카테고리 없음

Stepper Motor Driver Ic L297 Driver

schoosuradlis1976 2020. 2. 16. 14:41

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.

  1. Bipolar Stepper Motor Driver

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.

Bipolar Stepper Motor Driver

Maybe I made some mistakes above. Please correct me! I'm just a beginner still! Hi 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: 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!

Thanks Daniel! You keep coming to my rescue 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. 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?? In the schematic there is a.33 capacitor and 22K resistor connected to the 'osc' pin. What is their purpose??

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??

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. 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. 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 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 massimo. I'm getting closer to actually trying to build this thing! Just a few more questions.

I'm gonna start with this circuit. I have a few simple questions.

Daniel - you recommended a 12V/2A power supply. I can only find basic AC adapters at maximum 1.2A. Could you give me a link to one like you recommend?? - I just didn't look properly - Forget this stupid question! The diagram suggests using the L6210 which is a '2 schottky bridge motor controller'.

This seems to be discontinued. Would you recommend another IC or is it cheaper to use seperate diodes?? Daniel suggested Schottky diodes.

Can you give me a part number?? I have found so many different diodes. I don't understand how to select the appropriate one. Also, maybe I'm confused, but I was thinking, can I use the l293d instead of the L6210?? Daniel - you wrote 'Use an onboard regulator (7805) to provide nice clean power to the L297, and lots of bypass capacitors'. Does this mean that I need to use some capacitors with the 7805 or are they included inside the 7805?? If i do need to use the 7805 with some external capacitors, how do I wire it up??

Very simple one. Does 'Rs1Rs2=0.5ohms' mean that both resistors should equal 0.5 Ohms or that the total resistance of Rs1 and Rs2 should equal 0.5ohms?? Thanks for helping out a slow learning electronics geek wanabe! Hi Jonathon, in terms of the power supply current, the bigger the better, but of course this all depends on the size of motor(s) you will use. Forget the 'IC Bridge' diodes. Just use discrete ones.

In the diagram they call them 'fast diodes' which is synonymous with Schottky diodes. Try one of these Digikey part numbers, it's not very critical: SR305DICT-ND or SR306DICT-ND. Basically any Schottky diode with a 50V voltage rating and a 2 or 3 amp current rating will do the trick. The bigger the motor, the bigger the power supply. If you can solder SMT parts, then you can get a package with all the diodes in it, see 'Schottky barrier diode arrays' in the curent Digikey catalog. For the regulator you need the old standby circuit for the 7805. See the diagram here: which is part of an excellent explanation of motor controls done by ITP at NYU: Throw in a few extra 100uF capacitors on both sides of the regulator, just to be safe.

In my stepper driver, I used.47ohm power resistors for RS1 and RS2. They are there to sense the current flow int he motor windings.

Two one-ohm 1/2 watt resistors in parallel for each one will do the trick. Sounds like you aren't an electronics newbie anymore, you're doing great!

Daniel - 'Throw in a few extra 100uF capacitors on both sides of the regulator, just to be safe.' (which reminds me. What apps do you use for your schematics and PCBs??

I found tinyCAD and freePCB - Should I try something else?? Now back to the topic.) What I don't understand is. What is the point of the 5V / 9V Power output pins on the Arduino board?? If i remember correctly, when arduino is powered by an external supply (ie not USB), the 9V pin actually outputs the same voltage as the supply voltage. So, if I run arduino on a 12V power supply, don't I get the clean 5V and unregulated 12V that i need? Hello jonathan For schematic diagrams I recommend Eagle Cad. You can find it on.

Controller

There is a free edition that works up to 100mm x 80mm of pcb (on the schematic side there are virtually no limitations) When I need to make beautiful schematic diagrams I use eagle, export into EPS and open it in illustrator. Do a select all, change the font to a nice one and I get a print ready schematic. BTW Arduino is designed always on Eagle.

Going back to your circuit. What you need around a 7805 is just 2 capacitors per side. 100n to clean up higher frequency noise and an electrolitic capacitor of 100uF or more that is used for compensating voltage fluctuactions. When your motor starts there is a power surge and the voltage generally drops. The large capacitors compensate for this by releasing the 'energy' they have 'stored'. Jonathon: I think Massimo is in Sweden and I am in Canada, near the pacific, so here is part two of your international answer! In terms of the 12V motor supply and the clean 5v supply, the answer lies with the motor.

When a stepper motor turns on, it draws large amounts of current into its windings. A small motor could draw 10 amps for a few milliseconds, for example. These large current draws make the supply voltage drop, unless your power supply can handle it. Supply voltage drops are bad news for microprocessors! This is why the two supplies are always best spearated: never run any inductive load from the same supply as the microprocessor. You are asking for unpredictable trouble if you do. Another reason for separating the supplies is to prevent noise from getting back into the microprocessor.

Motors and inductors put out a large voltage spike when their fields collapse, and you don't want this to get back into the microprocessor supply, so you use a separate supply. The general rules are: - try not to drive anything with an arduino pin that draws more than a few milliamps- say 10ma or so. try not to drive large loads that source their current from the arduino's regulator, as this might interfere with the stability of the Atmega8's power supplies.never drive an inductive load that sources it's current from the processor power supply! Use a separate supply.

Hope this helps! Daniel PS: the larger the filter cap on the motor side of the regulator, the better: there really isn't a limit, but in practice anything up to 470uF on the 12V side would be reasonable. You can add as much as you want. Well, I've certainly been finding both of your advice very helpful! So i would second that motion! I'm planning to breadboard the circuit very soon, so I will post some pictures of that, and the final schematic that I use. After this, I intend to make a circuit using the l297 and the ULN2075B to control a unipolar stepper.

Also I have a nice working circuit that uses a TTL 74194 shift counter as the transalator. I'll post some picures of that too (under a different topic). I'm interested to compile a group of circuits to control both unipolar and bipolar steppers, that offer a range of price vs functionality options. Just for the record. Jonathan is in London, the capital of rain and tea! (and i changed my user name to 'flat stanley' for those who remember my 'little accident' just after the London workshop!).

I am currently building a stepper motor circuit for a small robot. The circuit consist of the L297 and SLA7024M motor driver. I have now constructed two of these and both seems to have some issues. I intend on driving both in half step mode, but I have tried both for testing purposes.

For both circuits it seems like the L297 works as it should, as I have looked at the outputs on a oscilloscope, and the sequence match what I want. I have never worked with steppers before so not sure what to expect, but I think something is wrong here. In both cases I used a 1ohm 2.5W resistor as current sensing resistor, and used a potentiometer to limit the Vref to 0.5V. From the datasheet this sould result in a Iout of 0.5A. Circuit 1: The motor spins slow and steady at 50Hz, but as I increase the frequency (100-700Hz) the motor starts twitcing in the same spot. At high frequencies(1kHz) the motor runs fine but the speed is a little higher then I need. Also as the frequency is increased the the motor randomly change direction.

I use an arduino with a simple code I found online, the arduino is controling the pulse(speed), direction(cw/cww) and enable pins of the L297. The half/full is connected to the 5V bus which will set it in half step mode (it also work on full step). Circuit 2: This circuit really buggs me, it was working fine at one moment, but now it seems that the circuit don't supply the motor from the high voltage line.

The motor rotate at 50Hz but only pulls about 0.05A. If I increase the frequency the speed goes up, but not nearly as fast as the other one.

Obviously because it dosent get enough current. So I'm wondering if the IC might be destroyd? I would think it would be wierd since I have used a bench supply and never alowed more then 1.5 A.

I have trippled checked all connection and they all seem fine. Here's the links to the datasheets. Motor: RS 440-420 5V, 0.5A Unipolar Stepper L297: SLA7024M: I also have some questions regarding the datasheets. L297: It is stated that the minimum clock time is 0.5us, is this really the clock signal? Wouldnt that be 2MHz?

The motors run at 50-2000Hz but over that the motor stops and get very warm. Some other information This chip is a nightmare to work with as the pin layout does not match up with standard protoboards or veroboards. My solution was to solder a piece of wire to each pin which I then soldered to the verobord. The IC is literally two of the same circuit to drive each phase of the motor.

The datasheet provides a circuit diagram on how to connect it. The changes I have made is to use a 1Ohm resistor for Rs and a potentiometer for R2. I have meassured the pins and they show a 0.5V on Vref, which should be right.

Hope someone can help me! Please let me know if I left something out. Stepper motors have some nasty pitfalls for the unwary. Careful system design is required to get good performance out of them, not as simple as they seem. The first problem is most likely mechanical resonance, at certain speeds the stepping energy is dissipated in torsional vibrations at the resonant frequency of the rotor, this causes the motor to lose torque and stall. The solution is to avoid this resonant frequency by accelerating through it rapidly, this can prevent the resonance from building up and stalling the motor.

You need a really smooth input pulse train to accomplish this acceleration, any jumps or jerks in the pulse train can cause the motor to stall. For best performance, the acceleration curve needs to be tuned to the motor and load. Also be aware that the dynamics of the drive train can be important too- gear backlash can cause serious problems with noise and vibration. The inherent inductance of the motor limits the rate that the coil current can rise when switching from one winding to another, this limits torque at higher speeds.

Driving the motor from a higher supply voltage will increase the high speed torque via more rapid current build up when switching. Commercial stepper drives often use high voltages to get the coil current up as fast as possible. Please provide a schematic showing the connections.

Are you driving from an MPU, or just a bunch of switches? If you are sensing the coil current and doing a PWM, you can drive each coil from a higher voltage. I've heard at least a factor of 2 over the motor rating, but the higher, the better. Torque come from coil current - not voltage. If you are not sensing current, and just driving from a voltage supply, you cannot simply raise the voltage, but you need to ensure you do not exceed current ratings and thermal ratings. I've seen stepper motors get pretty warm. Thank you all so much for your replies.

I will try to answer all of you in this post. I have acctually got both circuits working today.

In the first case I am guessing it had something to do with resonant frequencies which I have was told about, and this effect was reduced when I held the motor tighter. In the other case I found that it was some bad connections on the protoboard. Once it was soldered onto a veroboard it was working perfectly. Once both was working I made some simple functions to output 400 pulses at different frequencies which was to check that it did one revolution(I'm running at half step). This seemed to work, but still need to test more once I have the robot assembled which will put more load on the wheels.

I did however find a new problem where when using a mbed for the pulse signal the gonal amplitude was heavly reduced when the L297 was powered on, this caused the high pulse to be so low that the L297 did not requgnise it as an high pulse(. The driver circuit should control the current in the coils to a safe level, the drive voltage can be very high, limited only by the semiconductors in the driver and the insulation breakdown rating of the motor.

Motor nameplate voltages are rated at DC, you wont get much performance out of a motor at that voltage. Stepper motors are a terrible choice for a battery powered project, they consume the same power even when stationary, producing zero mechanical output. One trick is to include a switch that drops the coil current down while the motor is not turning, this can save significant power.