4
\$\begingroup\$

Using this sheet to an Arduino Uno I am trying to drive a Bipolar Stepper Motor. I have dragged out all the connections 6 times and retried now, but still the stepper will only do a strange vibration when its connected and I upload the schema. I have checked the pairing of the connections with a multimeter, so I know that that's not the problem, but somewhere in my connection I must have messed something up. If it can help I have uploaded some screenshots of my setup in the bottom of the post. I am not asking to thoroughly observe them to find my mistake, just for if you want to take a quick look to check if any obvious errors.

Stepper motor datasheet Stepper motor specs

Any tips on common mistakes when connecting steppers with this kind of driver to Arduino also helpful. Or any other newbie mistakes.

Schema uploading to Arduino I have copied from this page: http://www.tigoe.com/pcomp/code/circuits/motors/stepper-motors/

I have also tried just using the standard Stepper.h library from Arduino.cc and changed the values using two pins. Same result, just random vibrations from the stepper.

Scheme: enter image description here

Before connecting jumper cables: enter image description here

Connecting NPN transistors: enter image description here

All connections done: (here I have connected the jack which is going to battery just to the power source of the 5v in the Arduino, I've tried with a 12v power source, which gives same result) enter image description here

Don't know if its helpful, but I can provide more images.

\$\endgroup\$
  • 1
    \$\begingroup\$ Can you scope the waveforms of the L293 to confirm the sequence is correct? (you don't need the motor plugged in for this) Also, is your power supply capable of sourcing enough current to start/run the motor? (according to the spec it needs 12V @350mA or more) How fast are you stepping? (try it more slowly to see whether this helps) \$\endgroup\$ – Oli Glaser Jun 27 '13 at 18:42
  • \$\begingroup\$ @OliGlaser Thanks for the comment. I have tried connecting a 12v power source. The shank barely moves a tiny bit back and forth, the same but less powerful without power source. Not experience enough to understand what scoping the waveforms mean, can you clearify that? Now stepping at 1 step with 500 ms delay, so its very slow. \$\endgroup\$ – bogen Jun 27 '13 at 18:49
  • 1
    \$\begingroup\$ Sorry - do you have an oscilloscope? By "scoping" I meant looking at the waveforms on one. \$\endgroup\$ – Oli Glaser Jun 27 '13 at 18:54
  • 1
    \$\begingroup\$ OK. For the NPN, the collector goes to the 10k resistor and +V, but the pin number depends on which NPN you are using, they can have different pinouts (info in the datasheets) - what part number? You need a 12V supply, capable of supplying at least 350mA (0.35A) \$\endgroup\$ – Oli Glaser Jun 27 '13 at 19:00
  • 1
    \$\begingroup\$ No problem, glad it's working :-) \$\endgroup\$ – Oli Glaser Jun 27 '13 at 19:11
6
\$\begingroup\$

I have many years experience with stepper motor drive circuits and there's nothing basically wrong with the schematic you have provided. It matches the requirements of the datasheet. The fact that the motor buzzes also indicates that you have power to the driver, have logic signals connected to the driver and the driver connected to the motor.

To fault find this circuit you'll need a multimeter, a couple of small LEDs and a couple of resistors (330R to 680R range).

First, check the power supplies:

  1. Check that all the Gnd connections are connected together - your Arduino Gnd, the driver +5V supply Gnd and the motor +12V supply Gnd. If not, then nothing is going to behave as you expect.

  2. With everything connected and powered up, use the multimeter to check that you have 4.5V to 5.5V between pin 16 and Gnd, and 10V to 15V between pin 8 and Gnd. If not, you need to correct this first.

Connect each LED in series with one of the resistors. Then connect one LED-resistor combination between +5V and pin 7, and the other between +5V and pin 10. (You can check the LED is the right way round by connecting your 5V supply and connecting the LED-resistor between +5V and Gnd). Your NPN transistor inverters will turn on these LEDs at the same time they pull the inverted driver pins low so you can see precisely what's going on with your drive signals.

Now, alter your Arduino code to run at a slow stepping rate, something like 1 step per second will be perfect, and observe the LEDs. If your code is correct, and the Arduino correctly wired to the circuit, you should observe the following:

  1. Each LED should flash on and off every 2 seconds, (4 steps for each LED to complete its cycle). If either LED is not flashing, check the LEDs are correctly connected and the Arduino is correctly connected to the circuit.

  2. Each LED should be on for half the time, 2 steps on and two steps off. If this is not the case, check your Arduino code.

  3. Only one LED should change state each step. If both change together, either both on at the same time, or one on and the other off at the same time, then the motor has no direction information and won't rotate. It will alternately move from the detent position to an energised position, (less than half a step) and back again. If this is the case, go back and look at your Arduino code, you have a software problem not a circuit problem.

  4. If the LEDs are flashing in 4-state cycles, per the above, then the drive signals are correct. Your focus must now shift to the driver-motor link.

  5. Disconnect the motor connections to pins 3 and 6 and measure the resistance of the motor winding with a multimeter. It should be a value between 25 and 50 ohms. If not, you don't have the motor you think you do, or if the resistance is very high (or open circuit), then despite your checking the motor is not wired correctly. In this case, disconnect the other two wires and find a pair which do measure the correct resistance between them and connect thise to pins 3 and 6, and the other two to 10 and 15.

  6. If the motor wires to pins 3 and 6 have the correct resistance, reconnect them and check the same thing with the wires between pins 10 and 15. If one pair is correct, but the other is not, then you have a faulty motor and it will not rotate under control.

If all the above are okay, but the circuit still doesn't work, then you've exhausted my imagination. Please let me know what you find and I'll do my best to help further.

Eventually, when it's all working, remove the LED-resistor combinations, they were only diagnostic aids. There are some small circuit improvements I'd make:

  1. Decrease the inverter output pullup resistors to something like 2k7, (as at the maximum specified input current, you could be dropping a volt there); and

  2. Add some good decoupling capacitors to the driver IC, (100nF ceramic between pins 16 and Gnd, and something upwards of 100uF at no less than 50V rating between pin 8 and Gnd.

These will keep things nice and tidy, and more resistant to interference and temperature changes, but not doing them is NOT your problem.

Last of all, don't run this circuit with any motor supply above 18V. The original silicon designs of this driver family were prone to failure if you even thought about the motor voltage going above its 36V max. And many people have come unstuck when driving inertial loads which cause the motors to regenerate energy into the motor supply, momentarily spiking the supply voltage and blowing up the driver. The maximum regenerated voltage is equal to the supply voltage, so keep that under 18V and you can't kill the driver by regenerating.

Best of luck!

\$\endgroup\$
  • 2
    \$\begingroup\$ If you read the comments, you would have known that the problem was solved and it had nothing to do with anything you said. \$\endgroup\$ – user3624 Jun 28 '13 at 18:41
  • \$\begingroup\$ @DavidKessner Zing! \$\endgroup\$ – Anindo Ghosh Jun 28 '13 at 19:02
  • 2
    \$\begingroup\$ Ah, I saw that @OliGlaser thought so, but the comments shown did not lead to that conclusion. I'm new to this site and didn't hit 'show more comments'. Basic newbie error, and the above will be useful if only to help someone off to sleep... \$\endgroup\$ – Billysugger Jun 28 '13 at 20:16
  • 1
    \$\begingroup\$ @Billysugger Really nice post! Thanks. Its good that it can stand as a future reference if others having common problems like mine. Probably a common question for people coming from newbie-arduino background. \$\endgroup\$ – bogen Jun 28 '13 at 22:09
  • 1
    \$\begingroup\$ Gosh @Hakonbogen, that was my first post here. Glad you found it worthwhile. Once you get steppers working, there's heaps you can do with them. \$\endgroup\$ – Billysugger Jun 28 '13 at 22:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.