Shop OBEX P1 Docs P2 Docs Learn Events
HELP! Stepper motor problems — Parallax Forums

HELP! Stepper motor problems

dev/nulldev/null Posts: 381
edited 2009-09-13 18:50 in BASIC Stamp
I seem to be out of luck trying to run stepper motors.

Today, I burnt up two darlingtons trying to get it to work, and I allready burnt a Stamp pin with another setup. The motor is a 1.3A (peak) bipolar stepper motor.

I use two H-Bridges, and apply voltage to the motor as follows. Pins 8-11 are connected to one H-Bridge, and pins 12-15 to the other.
Main:
  OUTC = %1001 ' Current A --> D
  OUTD = %0110 ' Current F --> G
  PAUSE 9

  OUTC = %0110 ' Current B --> C
  OUTD = %1001 ' Current E --> H
  PAUSE 9

  GOTO main




Could it be that I am applying current for too long to a coil (9ms)?

Each H-bridge is configured as follows (the circuit works with a DC motor):

Left coil:
dc5.jpg

Right coil:
dc6.jpg

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy

Comments

  • dandreaedandreae Posts: 1,375
    edited 2009-08-26 13:05
    Have you taken look at the StampWorks manual?· In experiment 27 it will show you how to connect a stepper motor to the BASIC Stamp.· Here is a link for the download of the StampWorks text:

    http://www.parallax.com/Store/Books/BASICStamp/tabid/168/CategoryID/42/List/0/Level/a/ProductID/144/Default.aspx?SortField=ProductName%2cProductName

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Parallax Tech Support·
  • dev/nulldev/null Posts: 381
    edited 2009-08-26 15:45
    I've read and tested that example (I recently blew up a 293D). What I need to know is:
    1) How to apply current to the coils? I know you need an AC signal, but excatly which signal in which sequence with respect to the coils? It's impossible to find any good literature on the Internet for this. So I am trying and blowing up my transistors.
    2) What happens if you apply current to the coils in opposite directions (towards each other)? Effectively stalling the motor, what is the implication?
    3) Since you are driving an inductive load, applying current over a long period of time will be like a short circuit. I don't see anybody mentioning this? Isn't the purpose of the coil to get charged, and it's the discharge that actually moves the motor?

    Thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • NWUpgradesNWUpgrades Posts: 292
    edited 2009-09-08 04:08
    I have been playing with stepper motors for quite some time and have found it best to use a stepper motor controller.· Although I habe burnt out a few power supplies, I have never ruined a motor. Most 4 wire controllers can also control 6 and 8 wire motors, and it is a matter of figuting out the coils using an ohm meter to get them going. You supply 5V to the controller and then seperate power for your motor, depending on what the motor requires. If you do a search on ebay, you can find one for about $25.00 on up.
  • W9GFOW9GFO Posts: 4,010
    edited 2009-09-08 04:59
    I've been using a 4 axis Xylotex driver on my milling machine for a few years now with no problems. They don't seem to sell the driver board by itself anymore, only the complete kit.

    Rich H

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Servo Boss, a 12 channel servo tester kit from Gadget Gangster.
  • PropabilityPropability Posts: 142
    edited 2009-09-08 18:31
    ·Since you are controlling all of the logic of the h bridge you are most likely having a case of "shoot through" . Most h bridge designs have logic to prevent this.
  • FearTurtlesFearTurtles Posts: 89
    edited 2009-09-08 19:33
    It seems to me you are only taking half of the steps needed for the motors you might try something like this.

    Main:
      OUTC = %1001 ' Current A --> D
      OUTD = %0110 ' Current F --> G
      PAUSE 9 
    
      OUTC = %0011 
      OUTD = %1100 
      PAUSE 9 
    
      OUTC = %0110 ' Current B --> C 
      OUTD = %1001 ' Current E --> H 
      PAUSE 9 
    
      OUTC = %1100 
      OUTD = %0011 
      PAUSE 9
     
    GOTO main
    
    








    Post Edited (FearTurtles) : 9/8/2009 7:41:40 PM GMT
  • B WolfB Wolf Posts: 4
    edited 2009-09-10 21:15
    TIP127 is only 60Vdc collector - emittor. Most likely having inductive kick-back from your motor blowing out the junction. The current rating is good for the TIP127 although....

    I see you have a 12V supply. Do you happen to know what supply voltage your motor needs? Even though it is 1.3A, say @ 5Vdc, then you're going to have more current with the 12V supply.
  • dev/nulldev/null Posts: 381
    edited 2009-09-10 23:32
    Thanks for replies!

    Actually, I had the 2N4400's configured the wrong way (emitter was collector) so no wonder things blew up. DUH!

    But now I get another confusing issue. If I put a 10K resistor across the motor pins I get a big spark, like there's a short circuit. The circuit shouldn't conduct anything to the motor wires unless I turn on the 2N4400's. What is that?

    The motor is rated at 24V. I am applying 21V.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • dev/nulldev/null Posts: 381
    edited 2009-09-10 23:37
    I thought the TIP's had clamping diodes inside them to prevent kick-backs?

    Also; The motor coils have 4.8 ohm resistance. The circuit in a steady-state situation would conduct over 4 amps! Isn't it crucial to have current flowing just until the coils get saturated? When they are, the will act like short circuits.... What am I missing here.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • B WolfB Wolf Posts: 4
    edited 2009-09-11 13:17
    You Sir are correct, foggy memory....there are clamping diodes. Stepper motors do pull some current and tend to run warm. You may need to use biasing (current limiting) resistors in series with the motors. Be sure that you have proper wattage resistors or you will let out the magic smoke that makes them work. Don't break the law....ohms law.

    The motors won't saturate but will get warm. Stepper motors run warmest when they are in a holding position. You may want to consider if you want them powered all of the time. If they have to hold something...then they do.
  • dev/nulldev/null Posts: 381
    edited 2009-09-11 15:54
    Thanks. I found a better implementation of an H-bridge, which removes the problem of short circuits (if your logic is erronous), and uses 4 pins instead of 8:
    hb.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • dev/nulldev/null Posts: 381
    edited 2009-09-11 19:40
    I've cleaned up the ciruit a little.

    When I apply 18V from a 1600 mAh pack I get a spark, and the motor gets very hot quickly. The TIP's are ok with heat. So I think I need current limiting reeistors on the coils. But at least the motor is running properly.

    (Use two of these to control a stepper):
    STEPPER.jpg

    Full step sequence:
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    p VAR Byte
    
    p=6
    
    DIRa=%1111
    OUTa=%0000
    
    GOTO Main2 
    
    ' Forward
    Main1:
    
      OUTa = %1010 : PAUSE p
      OUTa = %0110 : PAUSE p
      OUTa = %0101 : PAUSE p
      OUTa = %1001 : PAUSE p
    
      GOTO Main1
    
    ' Backward
    Main2:
    
      OUTa = %1001 : PAUSE p
      OUTa = %0101 : PAUSE p
      OUTa = %0110 : PAUSE p
      OUTa = %1010 : PAUSE p
    
      GOTO Main2
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • FearTurtlesFearTurtles Posts: 89
    edited 2009-09-12 13:13
    It still looks like you have the sequence wrong. I have always understood stepper either steps as I posted above or in a %1000 %1100 %0100 %0110 %0010 %0011 %0001 %1001 sequence. It looks to me like you sequence would be causing resistance to the rotation. Which would cause the motor to heat up more.
  • dev/nulldev/null Posts: 381
    edited 2009-09-12 16:40
    I think that your sequence is called "half steps", and that I am using "full steps". So that with your sequence you get a smoother rotation. I will try it on my motor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • dev/nulldev/null Posts: 381
    edited 2009-09-12 16:51
    I tried your sequence Turtles, and the spark and heat is still there, though the motor seems to run more moothly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • FearTurtlesFearTurtles Posts: 89
    edited 2009-09-13 02:34
    The 8 step sequence is half step and the 4 step sequence in my first post is full step. If the motor sparks and heats up then it might be on its way out. Glad to hear its running smoother. Did you use the 8 step or 4?
  • dev/nulldev/null Posts: 381
    edited 2009-09-13 08:15
    I used the 8 step sequence. But what about the wires coming out of the motor? They have to be connected to the right outputs of the H-bridge.
    Is the motor supposed to do a full turn with your sequence? At the moment, it turns about 45 degrees with either the 4 or 8 step sequence.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • FearTurtlesFearTurtles Posts: 89
    edited 2009-09-13 12:38
    Yes the wires have to be connected up in the right order. I think it is a trial and error to figure out the wire order but if the motor turns 45 degrees it should be looping through the cycle twice. So the cycle and wiring order should be good. If you spin the motor by hand does it move freely?
  • dev/nulldev/null Posts: 381
    edited 2009-09-13 15:06
    Yes it's moving freely. I think the spark that occurs is caused by the 330uF cap across the power lines? The park only happens when the cap is discharged, so when I connect power for a second time it's not there.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • dev/nulldev/null Posts: 381
    edited 2009-09-13 16:40
    When I try your 8-sequence now,the motor just jitters back and forth, no matter how I connect the coils...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • dev/nulldev/null Posts: 381
    edited 2009-09-13 16:42
    Let me correct that. If I keep PAUSE below 5, it runs, above that it jitters.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • FranklinFranklin Posts: 4,747
    edited 2009-09-13 18:50
    Sounds like you are not providing enough current to throw the rotor to the next coil unless you have it moving fast.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.