Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Stepper Motor Controller only working on a particular power suppy?

  1. Jul 14, 2009 #1
    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!
     
  2. jcsd
  3. Jul 14, 2009 #2

    berkeman

    User Avatar

    Staff: Mentor

    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?
     
  4. Jul 14, 2009 #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.
     
  5. Jul 15, 2009 #4

    berkeman

    User Avatar

    Staff: Mentor

    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?
     
  6. Jul 15, 2009 #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: Jul 15, 2009
  7. Jul 15, 2009 #6

    vk6kro

    User Avatar
    Science Advisor

    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.
     
  8. Jul 15, 2009 #7
    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: Jul 15, 2009
  9. Jul 15, 2009 #8

    vk6kro

    User Avatar
    Science Advisor

    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.
     
  10. Jul 15, 2009 #9
    Yep, its 5.002V.
     
  11. Jul 15, 2009 #10

    vk6kro

    User Avatar
    Science Advisor

    So, it has nothing to do with the battery. It is something else you are doing.
     
  12. Jul 15, 2009 #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.
     
  13. Jul 15, 2009 #12

    vk6kro

    User Avatar
    Science Advisor

    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.
     
  14. Jul 15, 2009 #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?
     
  15. Jul 15, 2009 #14

    berkeman

    User Avatar

    Staff: Mentor

    Do you have any floating logic inputs? Any control inputs that you are not tying off?
     
  16. Jul 15, 2009 #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.
     
  17. Jul 15, 2009 #16

    vk6kro

    User Avatar
    Science Advisor

    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.
     
  18. Jul 15, 2009 #17
    Pins 13 and 14 are grounded.

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

    The application note states the following:

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

    http://us.st.com/stonline/books/pdf/docs/1734.pdf"
     
    Last edited by a moderator: Apr 24, 2017
  19. Jul 15, 2009 #18

    vk6kro

    User Avatar
    Science Advisor

    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?
     
  20. Jul 16, 2009 #19
  21. Jul 16, 2009 #20

    vk6kro

    User Avatar
    Science Advisor

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Stepper Motor Controller only working on a particular power suppy?
  1. Stepper Motor Control (Replies: 10)

Loading...