Stepper Motor Controller only working on a particular power suppy?

In summary, the individual is working on a circuit using the stepper motor controller L297 on a breadboard, with 4 LEDs to check logic levels. They are using a 9V battery connected to a 5V regulator to power the circuit, but it only works with a specific battery and not with a new one or a wall-wart. They have also soldered the circuit but the problem persists. The individual is seeking advice on how to solve the power problem and has mentioned grounding Sense inputs and connecting Vref to Vs, but the controller pin is not connected. They are also unsure if they need to add a capacitor in parallel with the regulator.
  • #1
saad87
85
0
I'm making a circuit around the stepper motor controller L297 on a breadboard, and I've got it working so far. I haven't connected it to the H-bridge and so obviously not to the motor either. But I'm checking the logic levels using 4 LEDs connected to the outputs and they corrospond with the L297's data-sheet.

Here's the really quirky bit, I'm running the circuit using a 9V battery wired to a 5V Regulato which feeds the L297. This circuit is only working off this particular battery. I've got another, fresh, battery that does nothing. The IC remains in its initial stage and no matter how many pulses are applied, refuses to change its state.

I've also wired a cheap wall-wart and I get the same problem.

I've just spent hours and hours on this thing and I'm pretty frustrated because it just doesn't make any sense.

I know its impossible for anyone here to analyze the circuit, but any tips/advice on how to solve the power problem would be MUCH appreciated!
 
Engineering news on Phys.org
  • #2
saad87 said:
I'm making a circuit around the stepper motor controller L297 on a breadboard, and I've got it working so far. I haven't connected it to the H-bridge and so obviously not to the motor either. But I'm checking the logic levels using 4 LEDs connected to the outputs and they corrospond with the L297's data-sheet.

Here's the really quirky bit, I'm running the circuit using a 9V battery wired to a 5V Regulato which feeds the L297. This circuit is only working off this particular battery. I've got another, fresh, battery that does nothing. The IC remains in its initial stage and no matter how many pulses are applied, refuses to change its state.

I've also wired a cheap wall-wart and I get the same problem.

I've just spent hours and hours on this thing and I'm pretty frustrated because it just doesn't make any sense.

I know its impossible for anyone here to analyze the circuit, but any tips/advice on how to solve the power problem would be MUCH appreciated!

You're going to need more than a 9V battery to run a stepper motor. Do you have an oscilloscope that you can use to trace the circuit operation?
 
  • #3
Yes, I know I need more than 9V to run the motor. I'm just using it for testing purposes right now, with the micro-controller.

Unfortunately, I do not have an oscilloscope.
 
  • #4
saad87 said:
Yes, I know I need more than 9V to run the motor. I'm just using it for testing purposes right now, with the micro-controller.

Unfortunately, I do not have an oscilloscope.

You do not need more than 9V -- that's not what I said.

Quiz Question -- if you don't have a 'scope, how can you use your DVM to debug this problem?
 
  • #5
Yes, I'm sorry, its not the voltage. Its the current. Very new with this stuff so I don't really know what I'm doing.

Do I measure the voltage at different points? If so what points? My meter can also measure the frequency.

EDIT: I've also soldered the circuit now, incase I was messing up the wires or something before. Unfortunately, the problem persists.

EDIT 2: It seems if I leave the other battery connected for a while and come back to it, the circuit works. So it seems to be a voltage related problem. I know the battery that works all the time wasn't new. It still doesn't make any sense though.

Any advice?
 
Last edited:
  • #6
From the data sheet, it looks like the stepper motor controller L297 has to have 5 volts on pin 12. So if you are putting 9 volts there, it probably won't work and may damage the chip.

This is possibly why your old 9 volt battery works but a new one doesn't.

If the chip is OK, you may be able to get it working properly by getting a 5 volt regulator and supplying a genuine 5 volts to pin 12. A typical 5 volt regulator is a LM7805.

The 297 does not appear to drive a motor directly either. It needs another driver chip to do that.

I suggest you get the data sheet and read it carefully. This is a complex chip and the voltages and settings need to be correct.
 
  • #7
vk6kro said:
From the data sheet, it looks like the stepper motor controller L297 has to have 5 volts on pin 12. So if you are putting 9 volts there, it probably won't work and may damage the chip.

This is possibly why your old 9 volt battery works but a new one doesn't.

If the chip is OK, you may be able to get it working properly by getting a 5 volt regulator and supplying a genuine 5 volts to pin 12. A typical 5 volt regulator is a LM7805.

The 297 does not appear to drive a motor directly either. It needs another driver chip to do that.

I suggest you get the data sheet and read it carefully. This is a complex chip and the voltages and settings need to be correct.

Mate, if you had read my post you would have seen I said I am using a 5V regulator. Infact, I am using 7805.

I know about the driver, I have it. I haven't hooked it up yet because I'm taking it step by step.

I got a brand new battery just now and same problem, the IC just doesn't change state with the clock applied. Its frozen in its initial state i.e 0101.

For what its worth, I have grounded the Sense inputs (as per the application note), I have connected Vref to Vs - as I don't intend to use the chopper feature. Controller pin is not connected anywhere.

Its just baffling that it works on its beloved battery, but not on any other supply! 9V or otherwise!

EDIT: One more thing, I haven't added a capacitor in parallel with the Regulator. I've seen it done often on power supply, but since I've connected a DC source anyway, I assumed it was unnecessary. Do you suppose this is the culprit?
 
Last edited:
  • #8
Have you measured 5 volts on pin 12 of the chip?
If that is there, it shouldn't matter what power source you are using.
 
  • #9
Yep, its 5.002V.
 
  • #10
So, it has nothing to do with the battery. It is something else you are doing.
 
  • #11
The circuit itself does not change at all, I've soldered it. I switch the batteries, it works.

If I leave it alone for 30 mins, it'll start working on the battery it doesn't like.
 
  • #12
If you measure the 5 volts on pin 12 under the different conditions, you might see when it isn't there, the chip doesn't work, and when it is there, the chip does work.

The battery voltage will drop if you run it for a while and the regulator could cut off if it gets too hot. These are two things that could be happening.

If you can relate the voltage on pin 12 to the chip working or not working, it should be easy from there. All that chip cares about is getting 5 volts on pin 12. If that comes from a wall wart, it will be cheaper in the long run, but the wall wart has to be free of hum ripple.

There should be a capacitor from pin 12 to ground. 0.1 uF would be a good choice. But that isn't likely to cause this sort of go-no_go behaviour.
 
  • #13
Okay, I did some measurements. The regulator is outputting about 5.02V on a fresh battery. The circuit does not work with this battery.

If I connect the old battery, it gives out about 4.85V, sometimes 4.93V (the battery's voltage is around 7.72V). It works on this battery.

If I leave the circuit on with the fresh battery, after a while it starts working again. The regulator is still giving out 5.02V with this battery.

The 7805 has a heatsink attached to it and does not get hot, at all.

Bizarre?
 
  • #14
Do you have any floating logic inputs? Any control inputs that you are not tying off?
 
  • #15
I had the Controller pin floating. I tied it low and it had no effect.

One more thing, if I use the wallwart, and I manually apply a pulse (that is I take the Clock pin to high and low myself using a wire), the LEDs I've attached to the outputs of the IC flicker.
 
  • #16
It seems that the current sense pins 13 and 14 should be grounded or the chip will think the motor is drawing too much current.

Also, it seems the reset pin, pin 20 should be held high by connecting a resistor to pin 12 from pin 20. About 4.7 K would be OK.

Also, pin 15 should be given about 2.5 volts by putting 2 resistors in series across the power supply and connecting pin 15 to the middle of them.
 
  • #17
vk6kro said:
It seems that the current sense pins 13 and 14 should be grounded or the chip will think the motor is drawing too much current.

Pins 13 and 14 are grounded.

Also, it seems the reset pin, pin 20 should be held high by connecting a resistor to pin 12 from pin 20. About 4.7 K would be OK.

I tied pin 20 directly, without any resistor. Would a resistor make a difference? If so, how?

Also, pin 15 should be given about 2.5 volts by putting 2 resistors in series across the power supply and connecting pin 15 to the middle of them.

The application note states the following:

In all applications where the choppers are not used it is important to remember that the sense inputs must be
grounded and VREF connected either to VS or any potential between VS and ground.

I connected VREF (pin 15) to Vs, directly.

http://us.st.com/stonline/books/pdf/docs/1734.pdf"
 
Last edited by a moderator:
  • #18
I tied pin 20 directly, without any resistor. Would a resistor make a difference? If so, how?

The resistor would let you do a reset by grounding the pin. If it is connected directly, you can't short out the power supply to do a reset




It looks like the batteries are not the problem and you have something else wrongly set up.
So, you will need to work through the pins to find out how each one of them should be treated.

How are you applying pulses to the chip?
 
  • #19
Here's a badly drawn schematic of how I've wired the L297:

motorcontroller.jpg


The 555 is wired like this:

LM555Astable.GIF


From http://home.cogeco.ca/~rpaisley4/LM555.html#2
 
  • #20
I looked back at the measurements you did earlier.
The time it worked was when the regulator stopped working and you got less than 5 volts on the chip.

Normal 555s (ie not the CMOS ones) give less than 5 volts p-p square wave output with a 5 volt supply. Sometimes, I have seen it as low as 3.5 volts.

This is a bit of a guess, but maybe the output is not enough to drive the L297 if it is getting the full 5 volts, but enough to drive it if it is getting less voltage.

You could try putting a Silicon diode in series with the L297 after the regulator, but not in series with the 555 so the 555 gets more voltage than the L297.

Alternatively, a CMOS 555 will give the proper 5 volts out if it is getting 5 volts supply itself.

Or, you could run the 555 off 6 volts.
 
  • #21
I'll try your suggestion!

However, even if I disconnect the CLK from the 555 and apply it 'manually' i.e by taking the pin high and then back low, it doesn't work. It does work with the other battery.

But I'll try your suggestion and report back.

thanks a lot for your help so far.
 
  • #22
Powered the 555 chip directly off the battery. Had no effect on the operation of the circuit. It works on the one battery and not on the other one. The freq. and duty cycle of the clock is the same on both batteries.

The capacitor and resistor values on my circuit are different than the ones on the data-sheet. Do those matter? They just define the chopper rate. The datasheet specifies the resistor should be higher than 10K (if i remember correctly). Mine is 14K or so.

It is possible that the chip is damaged? Its probably unlikely since it does work under certain conditions.

Also, should I connect the floating pins somewhere? The datasheet doesn't specify if I don't intend to use the chopper feature.
 
Last edited:
  • #23
Maybe get some more data.
Floating pins are deadly but in case they are outputs, you shouldn't just ground them. Put 10 K resistors or similar from each unknown floating pin to ground.

If you have a silicon diode, try putting it between the regulator and the L297 chip's pin 12.
It seemed to work better when the supply was low. This will drop 0.6 volts and give you a 4.4 volt supply, purely as a test.

However, maybe it is time to assume the chip is OK and wire it up to drive a motor. At least you will have proper circuits for doing this.
The chip is probably OK if it works sometimes, so it is probably just the test setup that is wrong.
 
  • #24
It sounds to me like the chip is pulling spikes of current periodically, which drops the supply voltage and scrambles the chip. the reason i suspect this is that a cold 9V battery and a wall wart don't work, but anohter 9V does work--that sure sounds like there are current spikes that some supplies can handle and others can't (and after the one 9V gets hotter it can handle it because a hotter battery has a bit lower internal resistance). Solution: put both an electrolytic cap and a .01uF cap between 9V (before the regulator) and ground. Watch the polarity on the electrolytic of course( I know you probably know this but thought I'd say it just in case). That should handle the current spikes, if there are any.
 
  • #25
Wow, fleem, it worked! I added two capacitors and its working on all batteries (I tried 4) and the wall-wart.

You absolutely rule!

One more question though!

The stepper motor I have is rated 12V with a impedance of 2 ohm per winding. I'm guessing its a bi-polar motor because its got 4 wires coming out of it.

My question is, do I feed this motor 12V? If so, its going to pull 6A, isn't it? Thats a lot and I don't know how the L298 driver is going to handle that since its rated at 2A or so.

Can I feed it less than 12V? If not, what do I do? Get a different motor?

I'm making this circuit to make a barn door tracker, for astrophotography, so its going to be out in the field. The best source that I can get is probably a 12V battery from the car.

Any advice?
 

1. Why is my stepper motor controller only working on a particular power supply?

There could be several reasons why your stepper motor controller is only working on a particular power supply. One possibility is that the voltage or current output of the power supply is not suitable for the stepper motor controller. Another possibility is that there may be a compatibility issue between the power supply and the controller. It's also possible that there is a malfunction or defect in either the power supply or the controller.

2. Can I use a different power supply for my stepper motor controller?

It is possible to use a different power supply for your stepper motor controller, but it is important to make sure that the voltage and current output of the new power supply are suitable for the controller. Using an incompatible power supply can cause damage to the controller and potentially the motor.

3. How do I determine the appropriate power supply for my stepper motor controller?

The appropriate power supply for your stepper motor controller will depend on the specifications of the controller and the motor. It is important to check the voltage and current requirements of both and choose a power supply that can provide enough power to drive the motor without exceeding the maximum rating of the controller.

4. Can a faulty power supply cause my stepper motor controller to malfunction?

Yes, a faulty power supply can cause your stepper motor controller to malfunction. If the power supply is not providing the correct voltage or current, it can lead to erratic motor movement or no movement at all. It is important to check the power supply and replace it if necessary to ensure proper functioning of the controller.

5. What should I do if my stepper motor controller is only working on a particular power supply?

If your stepper motor controller is only working on a particular power supply, the first step is to check the compatibility of the power supply with the controller. If they are compatible, then it is possible that the power supply is faulty and needs to be replaced. If the power supply is compatible and functioning correctly, then there may be an issue with the controller itself and it may need to be repaired or replaced.

Similar threads

  • Electrical Engineering
Replies
4
Views
2K
  • Electrical Engineering
Replies
4
Views
2K
  • Electrical Engineering
2
Replies
58
Views
6K
  • Electrical Engineering
Replies
14
Views
3K
Replies
11
Views
3K
Replies
19
Views
2K
  • Electrical Engineering
Replies
1
Views
1K
  • Electrical Engineering
Replies
15
Views
2K
  • Electrical Engineering
4
Replies
136
Views
15K
  • Electrical Engineering
Replies
10
Views
794
Back
Top