Here is a video of the stepper: Dropbox link to video
It is obviously skipping steps.
This is actually driving me a little nuts because I can't find the source.
The program is the arduino stepper example running on pins 4,5,6,7. It should be doing 200 steps CW then 200 CCW repeat forever at 60RPM. I've tried it at 1 RPM and it still seems to be skipping steps although it does turn.
I have even modified the stepper library to this simpler sequence:
1000
0010
0100
0001
Usually the library uses this sequence:
1010
1001
0101
0110
Has anyone fixed such skipping stepper before? I am powering the stepper using a 12V 5A power supply. I know the stepper works because I pulled it off a 3d printer that worked.
Why not use a specialized stepper motor driver board rather than an L298 H-Bridge? The driver board takes care of the pulse pattern. All the Arduino needs to do is provide step and direction signals.
Ganymede:
Here is a video of the stepper: Dropbox link to video
It is obviously skipping steps.
This is actually driving me a little nuts because I can't find the source.
The program is the arduino stepper example running on pins 4,5,6,7. It should be doing 200 steps CW then 200 CCW repeat forever at 60RPM. I've tried it at 1 RPM and it still seems to be skipping steps although it does turn.
I have even modified the stepper library to this simpler sequence:
1000
0010
0100
0001
Usually the library uses this sequence:
1010
1001
0101
0110
Has anyone fixed such skipping stepper before? I am powering the stepper using a 12V 5A power supply. I know the stepper works because I pulled it off a 3d printer that worked.
You should keep the library sequence. You need reverse polarity on each coil "mid way". You keep the first coil at 10 for the first two steps and then you reverse the polarity on that coil. Then you reverse the polarity for the second coil for step 2 and 3 in regards to step 1 and 4 for that coil. I'm not sure I explained very well but I hope you understand what I mean
I would use a Pololu DRV8825 with that motor - or even a driver with a higher current capacity.
I can't see how it would be wise to drive it with 12v through an L298 - there is a great risk of the motor overheating with too much current even if there is a significant voltage drop within the L298. It may also overload the L298.
The DRV8825 can be adjusted to set the maximum current which allows higher voltages to be used safely.
Have you tried half-stepping?
Have you added mechanical damping (just making it drive a tenstioned toothed
belt will usually help a bit).
Steppers have strong mechanical resonances if not full-stepped and this is
normally the limiting factor in their performance if not addressed somehow.
A bare motor with no load is about the worst case for resonance.
kamelryttarn:
You should keep the library sequence. You need reverse polarity on each coil "mid way". You keep the first coil at 10 for the first two steps and then you reverse the polarity on that coil. Then you reverse the polarity for the second coil for step 2 and 3 in regards to step 1 and 4 for that coil. I'm not sure I explained very well but I hope you understand what I mean
I tried the library sequence and it does the same thing (skips a lot of steps).
MarkT:
Have you tried half-stepping?
Have you added mechanical damping (just making it drive a tenstioned toothed
belt will usually help a bit).
Steppers have strong mechanical resonances if not full-stepped and this is
normally the limiting factor in their performance if not addressed somehow.
A bare motor with no load is about the worst case for resonance.
I have tried half stepping. The result is the motor vibrates then stops spinning. Vibration is not the only issue I am experiencing.
Robin2:
I would use a Pololu DRV8825 with that motor - or even a driver with a higher current capacity.
I can't see how it would be wise to drive it with 12v through an L298 - there is a great risk of the motor overheating with too much current even if there is a significant voltage drop within the L298. It may also overload the L298.
The DRV8825 can be adjusted to set the maximum current which allows higher voltages to be used safely.
How about an A4988? I could buy that from a local store.
Could the skipped steps be from overloading the L298?
Ganymede:
How about an A4988? I could buy that from a local store.
You could try it but my concern is that it would be working closer to its current (amps) limit. A heatsink would probably be needed. Of course you could probably get the motor to move with the current set lower - say 1.2 amps - to ease the burden for the A4988.
In your situation I'm pretty sure I would try the A4988.
I have a limited experience with the L298 and a bipolar stepper. If it "studders" or skip steps it could be a mismatched timing and driving voltage issue. Have you tried driving it with a lower voltage first just to see what happens? Have you experimented with different step speeds?
My experience is that the L298 can take quit a bit of abuse and current, but there is of course a limit. My first L298 turned out to be a fake driver. My problems went away when I got a genuine driver. First one was bought on ebay. Second from a local reseller.
kamelryttarn:
I have a limited experience with the L298 and a bipolar stepper. If it "studders" or skip steps it could be a mismatched timing and driving voltage issue. Have you tried driving it with a lower voltage first just to see what happens? Have you experimented with different step speeds?
My experience is that the L298 can take quit a bit of abuse and current, but there is of course a limit. My first L298 turned out to be a fake driver. My problems went away when I got a genuine driver. First one was bought on ebay. Second from a local reseller.
Oh dear. Mine is from ebay too. I had ordered it some time ago and forgot about it. I wonder if it's a fake.
Were there any markings that could be used to spot a fake?
Thanks Tom. I was actually just coming here to post that I've solved it and the problem was GROUND.
For some reason although the arduino and the L298 were powered from the same source there was a grounding problem between the arduino and the controller.
Before I saw your post I ran a wire from the GND pin on the arduino to the GND pin on the L298 and everything started magically working.
And I was getting very upset because I was removing the motor and checking the signals with my oscilloscope and everything seemed fine but in reality the oscilloscope was solving the ground issue.
So when I was taking out the oscilloscope and putting the motor back it wouldn't work. In reality everything was going back to the no ground bad state. >:(
I noticed it might be a ground problem this morning when I thought of checking the power supply with my oscilloscope while it was running. When I clipped the probe ground to the power supply everything started working perfectly.
Here's a simple rule for commisioning a new module/board/component.
check for shorted power to ground with a multimeter before ever powering up.
Power up without load, monitoring the current, check it isn't too high (power
down immediately if it is!)
Power up and check voltages on each power supply and ground in various
places (such as the power/ground pins of the controller chip). Check functionality
if appropriate.
power down, connect the load, repeat 2). and then check functionality with load.
Being methodical like this saves money and time in the long run.