Go Down

Topic: Jerky movement with stepping motor and L293D (Read 3197 times) previous topic - next topic


Apr 24, 2011, 06:09 am Last Edit: Apr 24, 2011, 12:29 pm by Zoofy Reason: 1
I got this stepper from a printer http://www.mitsumi.co.jp/latest/Catalog/compo/motor/m42sp5_e.html. I hooked it up according to the H-bridge example on Tom Igoe's site with an L293D http://www.tigoe.net/pcomp/code/circuits/motors/stepper-motors. The motor moves, but in a jerky fashion, so something must be wrong. How do I debug this, where do I start?

I also have a question about the steps per revolution which I need to state in the code. Specs say the motor has 7.5deg per step, which would mean only 48 steps per revolution (360deg), which seems low. Am I reading this wrong? I think it is unrelated to the jerky movement because I have tried many values between 48 and 360, but it does not improve the movement, but I still would like to know.  

Thanks in advance for help.


Its a stepper motor, it moves in steps - I presume this is what you describe as 'jerky motion'?  The spec says its 7.5 degress per step, so it will be big steps.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


Looking at the links you supplied I see the motor has both a unipolar and bipolar version and that the examples on Tom Igoe's pages give solutions for both. Do you know which it is? Could be that you are using the wrong driving method. It also could be that you are seeing the effect of the large steps as MarkT pointed out. To get around that you could use microstepping but that would require an appropriate driver.
If you can supply more info perhaps we can help figure it out.


Even with an Adafruit motor shield I get the same (also uses a L293D). The L293D gets hot within seconds and the movement doesn't seem very reliable. To be clear, the jerky movement is within the longer stretch, so if I move 100 steps, it does that but seems to stop after each step causing the thing to rattle and vibrate. I have looked on Youtube but haven't seen any stepper move that way. Also, I actually have two of these from the same printer, but they both do this. It would be quite a coincidence if both are broken, so I really think something else must be wrong. 

Maybe hooked up incorrectly? I am using a 24V 500mA switching power supply http://www.sparkfun.com/products/8981. I have also tried lower power (0-9V 0-1A) but it either just vibrates or it does the same thing

Code (Adafruit library)

#include <AFMotor.h>

AF_Stepper motor(48, 2);

void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("Stepper test!");
  motor.setSpeed(10);  // 10 rpm   

void loop() {
  motor.step(100, FORWARD, MICROSTEP);
  motor.step(100, BACKWARD, MICROSTEP);


Update: Turns out one of the L293Ds in the motor shield had gone bad. In the circuit I built myself (without motor shield) I must have connected something wrong because I re-did the whole thing and now it works fine.


you must have connected the wires the wrong way - I know because I did the same thing and it behaves exactly as you described

I have tried many values between 48 and 360, but it does not improve the movement, but I still would like to know
that wouldn't improve anything... that value just tells the programme how many steps are needed for each revolution (useful for some commands)

Go Up