troubles with my stepper motors...

Discussion in 'The Projects Forum' started by kutalinelucas, Aug 22, 2011.

  1. kutalinelucas

    Thread Starter Active Member

    Nov 20, 2007
    98
    0
    Hey guys, I'm a little stuck trying to get a stepper motor to turn and was wondering of somebody could shed a bit of light on what may be going wrong...Just to close the net a little, I'll try to explain whats happening...

    I have a c++ app communicating through a PIC18F, which controls a parallax propeller microprocessor with 4 DC motors (which is fine) and also communicates with five bs2 (basic stamp 2) processors through a 2 way data bus...which again is all fine.

    Each stamp controls one stepper motor through a L293D h-bridge driver, and sends the required pulses and direction determined by the info sent down the bus.

    Through development i've been using LED's to ensure the correct data is sent out of the driver which appears to work as expected, but now I've tried to replace said LED's with the steppers; when a instruction is sent (even a single pulse) the motor kind of clunks and shorts the circuit.

    If you imagine each of the 5 drivers, connected to the five stamps has 4 led's connected to each, and each motor is controlled by a slider bar in the c++ app (the bigger the change in slider value, the longer the sequence). So if I send a sequence of pulses when the LED's are attached, each stamp operates independantly and simultainiously. Once I send a sequence to a stamp with the motor connected, all LED's go out.

    The circuit doesn't stay shorted, it will except subsequent instructions, but again short once I try to communicate with the motored one!

    I'm using a 20mm hybrid motor (http://www.motioncontrolproducts.com/pdfs/fl20-28.pdf) bought from a surplus net site, so i'm not too sure its totally cosure and I don't have any other motors to try out.
    I've paired the wires by measureing the resistance between wires, and i've tried all other wiring possibilities to no avail


    The other complication is that I'm using a 12v dc wall adapter to power my breadboard with a series of regulators providing the voltage levels required (3.3v; 5v; 8v; 12v + 5vusb) but i've had no difficulty running 4 12v dc motor simultainiously or any other power issues. I was thinking it could be a current issue, but I've disconnected pretty much everything, and I'm not sure that would short the circuit, just not move the motor...also there is a 100nf cap between both Vss and Vdd on each processor as well as each side of the regulator

    I've just done a quick schematic of the pic -> stepper...I'd really appriciate some advice...if posting my code, a sketch or anything else may help i'll be right on it.

    Sorry the post is so long, but I'd like to help as much as possible, and any advice or suggestions would be greatly appriciated

    Cheers guys

    Martyn
     
  2. DFR123

    New Member

    Aug 22, 2011
    4
    1
    Sounds like a similar problem I had with an external HDD adapter. It was also powered from an external source (wall adapter) and it worked fine without a HDD plugged in. When I plugged in a HDD and the motor started spinning the power supply voltage dropped until the everything stopped (undrvoltage protection).
    Try to use a more powerful power adapter or just for testing purposes power the circuit from a battery.
     
  3. kutalinelucas

    Thread Starter Active Member

    Nov 20, 2007
    98
    0
    Hey guys, I was wondering if I could ask some advice from those who know about this kind of thing...I'm a little stuck trying to get a stepper motor to turn and was wondering of somebody could shed a bit of light on what may be going wrong...Just to close the net a little, I'll try to explain whats happening...

    I have a c++ app communicating through a PIC18F, which controls a propeller processor with 4 DC motors (which is fine) and also controls five bs2 (basic stamp 2) processors through a 2 way 4-bit data bus...which again is all fine.

    Each stamp controls one stepper motor through a L293D h-bridge driver, and sends the required pulses and direction determined by the info sent down the bus.

    Through development i've been using LED's to ensure the correct data is sent out of the driver, but now I've tried to replace said LED's with the steppers; when a instruction is sent (even a single pulse) the motor kind of clunks and shorts the circuit. If you imagine each of the 5 drivers, connected to the five stamps has 4 led's connected to each, and each motor is controlled by a slider bar in the c++ app. So if I send a sequence of pulses when the LED's are attached, each stamp operates independantly and simultainiously. Once I send a sequence to a stamp with the motor connected, all LED's controlled by the other stamps (but on the same power rail) turn off. The pic which is powered by vusb but with a common ground is unaffected.

    The circuit doesn't stay shorted but just seems to reset all of the stamps. It will except subsequent instructions, but again short once I try to communicate with the motored one!

    I'm using a 20mm hybrid motor (http://www.motioncontrolproducts.com/pdfs/fl20-28.pdf) bought from a surplus net site, so i'm not too sure about that.

    The other complication is that I'm using a 12v dc wall adapter to power my breadboard with a series of regulators providing the voltage levels required (3.3v; 5v; 8v; 12v + 5vusb) but i've had no difficulty running 4 12v dc motor simultainiously or any other power issues. I was thinking it could be a current issue, but I've disconnected pretty much everything, and I'm not sure that would short the circuit, just not move the motor.

    There is a 100nf both sides of the voltage regulator, one each side of the pic, but currently only if the stamps has caps across its power terminals the attached motor as I've ran out).

    I've attached a schematic of the pic -> stepper...if theres anything else I can do to help like an ares layout, sketches or posting code please let me know as I'd really appriciate some advice

    Sorry the post is so long, but I'd like to help as much as possible.

    Cheers guys

    ps...tried to post this 10 minutes ago and I'm not sure whats happened to it...so if this is a repeat I appologise


    (http://forum.allaboutcircuits.com/showthread.php?p=392301#post392301)_
     
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You said you're powering it via USB, yet your stepper motors are rated 600mA.
    USB can only supply 500mA. You are overloading your USB supply.

    Also, stepper motors have lots of inductance. If the stepper motors are using the same rail as the stamps, it's no wonder that they're going stupid. The stepper will put huge transient spikes on the power rail.

    You'd need an awful lot of capacitance to keep the transients under control.
     
  5. BurninBri

    New Member

    Aug 16, 2011
    27
    3
    How many amps does the 12V power supply give you?

    Which model stepper are you using? The first two require 3.9V and have a rate current of 0.6A, while all the rest require 4.32V and have a rate current of 0.8A. Note that you had mentioned in your post "12V DC motors" and you mentioned having either 3.3V or 5V regulators. But what voltage are you trying to run these 3.9V or 4.32V steppers from?

    Note that the L293D can drive up to 0.6A (1.2A peak). I personally think this may be okay, but perhaps others here on this forum would want to comment if it should be fine for the 0.8A steppers above. However, it looks like the minimum voltage it uses is 4.5V and your motor may require 3.9V or 4.32V. Someone else can also comment on that?!

    The amperage there is not really insignificant, so can you also include the schematics of your voltage regulators as well? Hopefully, you can get some more support with this information.
     
  6. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    Verifiy the main power supply (12V) with an oscilloscope at the moment when you activate the motor. I suspect the power supply can't provide the necessary peak current.

    If you're unsure or don't have an oscilloscope, power the basic stamp with a different power supply to find out if that's the problem.
     
  7. kutalinelucas

    Thread Starter Active Member

    Nov 20, 2007
    98
    0
    Dc circuits really are above my head at the moment...I'm more of a programmer but I really am trying, so for this project i've devoted pretty much all my time getting the processors going, and I've left the circuit as an after-thought unfortunatly. The 5v from the usb is only powering the PIC, which has a shared earth with the rest of the circuit. At the moment, I have a 12v dc converter and three voltage regulators droping the voltage to...
    1). 3.3v to power the parallax propeller
    2). 5v to power 7 L293d drivers
    3). 9v powering 5 x basic stamps
    4). 12v powering 4 x DC motors

    I've only just noticed that the wall adapter can only supply 300mA...So that can't be good, but as I said I've just stuck the circuit together to enable me to code the processors, and I've been putting off the circuitry as I know I'm out of my depth.

    So far, the propeller is happy driving the motors, and the stamps can pulse the LED's in sequence but all this will be in vein if I can't get the motors to turn.

    Could I just power another rail with a seperate DC adapter solely for the steppers and connect to a common ground?

    Burninbri, the drivers have a seperate motor voltage and Vdd, so thats not really a problem. Each regulator has a 100 nF cap between the vin/gnd and vout/ground...
     
  8. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    Yes that should be possible. It would still be helpful if you post a schematic. ;)
     
  9. kutalinelucas

    Thread Starter Active Member

    Nov 20, 2007
    98
    0
    So, would it be a good idea to have a seperate supply to power the steppers, or the stamps (considering five should be running consecuitively)...and would it be ok to have two wall supplies with a common earth powering the same circuit?
     
  10. kutalinelucas

    Thread Starter Active Member

    Nov 20, 2007
    98
    0
    fantasic, It's pretty late here but i'll get another adapter in the morning, and let you guys know how I get on...

    Thanks for the advice
     
  11. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    No it's better to have separate (or properly decoupled) power supplies for power circuits/logic circuits.
     
  12. kutalinelucas

    Thread Starter Active Member

    Nov 20, 2007
    98
    0
    ahhhhhh, well this is when I come out of my depth. Could you give me some hints on how to go about this? I'm guessing the supplies can't be completly seperate as the driver and stamp should be grounded together...would it just be a series of capasitors between the ground rails? I'll search for tutorials in the morning but is there any chance you could just get me started?
     
  13. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    Since you need an additional power supply anyway, it would be good to use one for the logic part, and one for the power part. The motor will then draw it's current only from the power supply it is supposed to.

    The grounds will be connected, yes, that's why you should connect the grounds in a way to avoid that the motor current flows through the same wire/trace that is part of the logic circuitry...
    However, I don't think this will be a problem in your case. Just try to power these two circuit parts with different power supplies and see if it changes anything. Then we can look further into the details.
     
  14. kutalinelucas

    Thread Starter Active Member

    Nov 20, 2007
    98
    0
    fantastic I'll give it a go in the morning...thanks again
     
  15. kutalinelucas

    Thread Starter Active Member

    Nov 20, 2007
    98
    0
    Hey guys, I tried the above and theres deffinatly an improvement...the processors no longer short and the stepper energizes, retains holding torque but the shaft doesn't rotate, but it feels like it should. If for example I sent the instruction to turn three steps, the motor just gives three subtle clicks but no rotation, then holds its position. It could be the motors...I don't mind ordering more but does anybody know what else it may be?

    One more thing, the wall adapter i've just added supplies 1.2A...how much of a problem would this be? I believe the L293D outputs max 600mA which is the motors rated max current
     
  16. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    No problem at all, you can always use a more powerful power supply. The current rating is related to the current that the power supply CAN provide.


    As for the motors... did you measure if the correct voltage arrives at the motor?
     
    kutalinelucas likes this.
  17. kutalinelucas

    Thread Starter Active Member

    Nov 20, 2007
    98
    0
    ahhhh sorted! when I was playing about last night I must have reversed two of the motor outputs...Thankyou so much for the advice
     
  18. kutalinelucas

    Thread Starter Active Member

    Nov 20, 2007
    98
    0
    Hey guys, I was wondering if I could ask some advice from those who know about this kind of thing...I'm a little stuck trying to get multiple stepper motors to turn and was wondering of somebody could shed a bit of light on what may be going wrong...Just to close the net a little, I'll try to explain whats happening...

    I have a c++ app communicating through a PIC18F, which controls a propeller processor with 4 DC motors (which is fine) and also controls five bs2 (basic stamp 2) processors through a 2 way 4-bit data bus...which again is all fine.

    Each stamp controls one stepper motor through a L293D h-bridge driver, and sends the required pulses and direction determined by the info sent down the bus.

    Through development i've been using LED's to ensure the correct step sequence is sent out of the driver, and each works fine independently and simultainiously, but now i'm trying to get the same result with the motors.

    So at the moment, I have 3 steppers connected to 3 drivers, and LED's connected to the other 2 drivers.

    The LED's are no problem as they draw little current, I can run each of the two motors through the app, but heres the problem...i can't switch between motors without shorting the circuit. So say I play about with motor one and then bring it to a halt (and holding torque remains), if I try to control motor two, the circuit shorts on the first instruction (led's go out and there is no holding torque with motor one). motor 2 works again after the short

    The motors run off a 4.6v power rail which is independant from the drivers/stamps etc...

    I'm using a 20mm hybrid motor (http://www.motioncontrolproducts.com/pdfs/fl20-28.pdf) bought from a surplus net site

    The other complication is that I'm using a 12v dc wall adapter to power my breadboard with a series of regulators providing the logic voltage levels required (3.3v; 5v; 9v; + 5vusb) for the processors, and a seperate 6v 1A wall adapter for the stepper power rail (going into pin 8 of the L293D)...and...I have no decoupling caps on the circuit as I'm not even sure where they'd go

    There is a 100nf both sides of all voltage regulators, one each side of the pic and propeller.

    I'm guessing, which has been suggested to me last week that the stepper has high inductance during that first step which can short the circuit, but as its on a seperate supply rail so I don't know why it would short the stamps, and to be honest I'm not sure of how to go about fixing it...I have a pile of 100nf and 10uf caps if that will help!

    ...if theres anything else I can do to help like an ares layout, sketches or posting code please let me know as I'd really appriciate some advice



    Cheers guys
     
  19. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
  20. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    Datasheet says the motor is rated at 0.6A. If you power two motors that's more than the power adapter (1A) can provide. Voltage will drop.
     
Loading...