Stepper to open door, issue with speed and pausing-stops briefly then runs again

Please help!!! :disappointed_relieved: :disappointed_relieved: :disappointed_relieved:
I am trying to open a door using a stepper + belt system. My hardware is uno + adafruit motorshield V2+ Stepper motor (ZJchao 57oz-in 1Nm Nema 17 Stepper Motor 1.3A 40mm for CNC Router or Mill). The motor is supplied 12V from an ATX power supply

You can see the setup at Stepper motor arduino - YouTube

My issue is that

  1. the stepper motor moves in a jerky manner as seen in the video.
  2. I set the speed at 200 rpm but clearly the motor is much slower. Is this because the adafruit motor shield cannot support the required current? or maybe because the ATX supply is not suitable to drive a stepper?

The solutions I see are
A) Buy a 12V DC 6A switched supply and replace the ATX. I read in forums ATX need to be current balanced on the 5V too, that is why u see a DC motor attached to the 5V in the video.
B) But a Pololu DRV8825 High Current Stepper Motor Driver. But can I still use the same ATX 12V supply or I need to buy a higher voltage power supply to reap the benefits of the Pololu?

base_station_limitSwitch.ino (8.26 KB)

I can't figure out how your code is supposed to work. Can you provide a description ?

Your video suggests to me that some (or all) of the delay()s is interfering with the stepper movement.

In general you should not use the delay() function as the Arduino can do nothing during a delay(). Use millis() to manage timing as illustrated in several things at a time.

...R
Stepper Motor Basics

That stepper is completely unsuitable for driving from a motor shield, it is a low impedance stepper that
needs current control, not voltage control.

Hi Robin, thanks for your advice. Basically I am checking if button 1 or button 2 is LOW and executing a FOR loop to move the motor. I am using the 200ms delay to prevent faulty starts when the arduino powers up first time but from your post on state machines I can see better ways of doing that.

But as far as the stepper motor motion is concerned the delay shouldnt affect it because each FOR loop runs the motor 6700 as in the below code. ( I can confirm that the stepper motion still has the same problem even if I remove the 200ms delay)

if (button2State == LOW)
{
ledoff();
for(int i=0; i<6700; i++)
{
myMotor->step(1, FORWARD, DOUBLE); //FORWARD is closing of base station
}
myMotor->release();
}

Robin2:
Your video suggests to me that some (or all) of the delay()s is interfering with the stepper movement.

Hi MarkT, would using a Pololu DRV8825 high current driver help? But I am still limited to using the 12V ATX power supply.
Alternatively should I get a different stepper motor? any suggestions? Thanks

MarkT:
That stepper is completely unsuitable for driving from a motor shield, it is a low impedance stepper that
needs current control, not voltage control.

I am thinking I should go ahead with the Pololu DRV8825 High Current Stepper Motor Driver. But can someone tell me if I can still use the same ATX 12V supply and get better performance than the adafruit motor shield???

Please help!!!!

Are the glitches in your video occurring during the iteration of the 6700 steps of your FOR loop ?

Is the motor->step() a blocking function ? In other words will it wait until the motor takes its step?
If not I suspect the 6700 iterations are happening much faster than the motor can move ?

I think the 12v supply will work better with the DRV8825 than with the motor shield and the DRV8825 will make the programming much easier.

...R

pranesh_arduino:
Hi MarkT, would using a Pololu DRV8825 high current driver help? But I am still limited to using the 12V ATX power supply.
Alternatively should I get a different stepper motor? any suggestions? Thanks

Yes, you can use 12V supply, yes the DRV8825 module is a reasonable choice for 1.3A motor.

Powering the motor from 12V via a motor shield will have fried the motor shield and/or motor
if the power supply could source enough current, at 12V you have perhaps 10A available to
burn out the motor. A chopper driver like the DRV8825 will hold the winding current at or
below 1.3A whatever the supply voltage. You need to adjust the current setting on the DRV8825 module
(there is a little preset-pot to adjust).

BTW a lot of people seem to buy a stepper motor and then find out about driving it - this
is no doubt because a lot of dual motor shields claim to be able to drive a stepper (they
can, but only a high impedance stepper, and only slowly). Low impedance bipolar
steppers always need constant current drive, and will go much faster...

If you don't need the speed (happy with 200 rpm max) a unipolar high impedance motor
can be driven from an ULN2803 - this is the cheapest option if you can find suitable motor.

If you need speed or microstepping, low impedance bipolar motor and chopper drive is
the way to go. No single-chip driver can cope with more than about 1.5A without generating
lots of heat, note, NEMA23 and larger steppers need a discrete MOSFET chopper circuit/driver
which is a lot more expensive.

Thanks Mark and Robin, I will post the results after using the DVR8825.

Well it was the ATX supply alright, I switched to a proper DC supply and the stepper worked just fine. The ATX is probably not supplying enough current leading to the jerky motion.

pranesh_arduino:
Well it was the ATX supply alright, I switched to a proper DC supply and the stepper worked just fine. The ATX is probably not supplying enough current leading to the jerky motion.

I have a vague recollection of reading somewhere that those power supplies need a minimum load to maintain their regulation. Maybe add a small bulb (not an LED) to act as a load ?

...R