L297/L298 Help. Please :)

Hello all, I am trying to build a stepper controller for a bipolar

2A/Phase stepper motor, but I am having some trouble.

My circuit is like the one on the data sheet

formatting link
with some changes. For one the RC pair on OSC (pin 16) on the L297 produces a frequency of about 14 KHz not 20 as the data sheet shows. (f = 1/ .69 RC). My resistors (RS1 RS2) are .47 ohm 5 watt resistors. I have Enable pin hard wired to +5v, CW/CCW pin hard wired to GND, Control pin wired to

+5V, pins 1,3,and 20 are not connected. The L298 is as shown. Vref is conected to a 1K pot where I can vary the resistance from 0 to 5V (keeping it below 3V as per the data sheet).

The problem is that I can't get the motor to do much. When the motor is still, it squeals unless I turn Vref way down to the point that the motor has almost no holding torque. When I try to make the motor spin (using the printer port on my PC and code i'm writing MSV .NET) it clearly detects the "pulses from my parallel port, but it seems to just jitter back and forth.

My first question is what is the control pin for? Should I have it high or low? Also, to drive the motor, should I use a square wave? That is, should the on time equal the off time? Also, why is my motor changing directions? Any other advice would help alot, and thanks. Lucas

Reply to
lmcgill
Loading thread data ...

The chip will quickly turn the coils on and off to limit current when the voltage on the sense resistors shows that the stepper is drawing too much current. It turns it on and off at the chopper frequency (14 KHz for you). But there are two ways it can do it. This is what the control line selects. It either pulses the inhibit lines (when the control signal is low), or it will pulse the drive lines (when the control signal is high as you have it).

When it pulses the drive lines, it does it setting both sides of the coil to high, instead of both to low.

I don't know if it makes any difference which way the control is set. If you are driving the L298N I think either should work from the way I read the spec sheet. If you are using some other circuit for driving the stepper, then you might want to do it one way vs the other.

Not needed. But a square wave with a 50/50 duty cycle is fine. It's an edge triggered signal which means the stepper should advance to the next position on the rising edge of the signal. It's only important that you hold it low for at least .5 us before letting it rise again.

I would suggest you create a debounced switch to drive the clock input so you can manually step it (or maybe drive with your PC, but make it on do only one step). Does the stepper advance correctly when you do this? Does the CW/CCW control make it correctly step one way or the other?

If not, measure the voltage across each coil and the outputs of the chip and see if everything is as it should be.

Also, you did not mention how you have the half/full input set. That took me some time to understand. If you use the full step mode (input low), it will produce one of two different output sequences depending on what part of the sequence the chip was in when you selected the full step mode. In half step mode, it does the same thing always. I would suggest just connecting the pin to +5 for half step mode until you figure out what's going on.

What it is doing in full step mode, is just using the half step sequence, and skipping every other step. So depending where you start, it will either only use the half steps (where both coils are energized at the same time), or it will only use the full steps, where only one coil is energized at a time.

If you try to make the motor step too fast, it will just vibrate instead of spinning. Cold that be your problem?

Also, are you sure you are using a bipolar stepper (4 wires (not 5 or 6))? Do you have the wires connected correctly? If you invert a coil, it makes no difference, because it just makes it spin the other direction. But if you swap wires so that one coil is connected to A D and the other to B C, it won't spin correctly but it will buzz. Just take the stepper out of the circuit and measure the resistance of the wire pairs to make sure you know which wires go to a coil.

Reply to
Curt Welch

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.