These DC stepper motors do not have to run simultaneously either. Is this possible, and if so how would you go about doing this?
Any help is greatly appreciated!
Do you know that a stepping motor draws its maximum current when it is stationary?
With an external power supply and some sort of driver then yes it is perfectly possible to run as many stepping motors as you have pins for.
Yes, I am planning to use a 12V external power-source. I've been looking into using drivers to get the amount of PWM pins that will be needed per stepper motor down to only 2 pins also, But the Arduino Mega only has 14 PWM pins. Does this mean that the I am limited to only 7 stepper motors using this board?
Please post data sheets or other documentation of those motors.
PWM pins are not necessary for stepper motors. Their drivers take a digital pulse per step and the direction a digital level. PWM pins can be used to control the speed of a DC brushed motor, not a stepper.
Robin2's stepper motor basics tutorial.
Each stepper driver of the step/dir type takes 2 or 3 (optional enable) GPIO pins. If you are using motors like the 28BYJ with ULN2003 drivers, they take 4 pins, each.
This is data sheet to the current stepper motor I'm looking at: Pololu - Stepper Motor: Bipolar, 200 Steps/Rev, 35×28mm, 10V, 0.5 A/Phase
and this is the associated driver:
With this driver motor combo, I would be able to hook up 10 stepper motors to the Arduino? (I'm sorry a colleague of mine had me under the impression I needed PWM pins to control steppers and I'm new to this kind of project.
Also, do you think that this many steppers would drain a 12VDC Lithium Ion battery very quickly?
Yes.
At 0.5 Amp per phase that means the motor itself will take 1A, so ten motors give you a 10A drain. You need to know the amp/hour rating of the battery to find out how many hours it will run, but I suspect it will be less that one.
A typical car lead acid battery has a capacity of about 50 amp hours so it would run for approximately five hours using one of those.
Will that motor provide adequate torque for your use?
The A4988 is a good choice to drive that stepper. Be sure to set the coil current limit on the driver by following the instructions on the Pololu page for that driver.
To a Mega, yes. Each A4988 will need a pin for step and one for direction (dir). If you will want to disable the output stage of a stepper to save power you will need to wire another pin to the enable on the driver. A stepper with its driver disabled will not hold position against outside force.
Without knowing the capacity specification of the battery, I cannot answer that. The capacity spec. will be in mAH (milliamp Hours or AH (Amp Hours). Divide the capacity by the average current drawn to calculate how long the battery will last. For 10 steppers and any kind of run time you will need a pretty hefty battery.
Stepper motors are not efficient. They, unlike a DC brushed motor, draw current even when stopped (unless the driver is disabled, see above) so they are not the best choice for battery powered devices. If you need positioning and better efficiency, DC geared motors with an integral encoders may be a better choice.
I would say it can. Control of the PWM's frequency would be required, and the duty cycle would be fixed at ~50%.
I guess you could argue that signal does not qualify as a PWM signal, it's simply a square wave, because the pulse widths are identical, not modulated/varied to carry some information. Is that what you meant? It's a subtle distinction to make for a beginner and deserves to be explained, I think.
I said that PWM pins are not required for steppers.
What I meant is that one does not control the speed of a stepper with PWM. Unless you continually change the PWM frequency to change the speed.
Yes, from a beginners point of view, an Arduino PWM pin can be used to control a stepper, because it's frequency can be changed. The pin is not truly being used as a PWM pin because the pulse widths are not being varied to control the motor speed, its the frequency that does that. The analogWrite() function sets only the pulse width/duty cycle of the signal, not it's frequency, so that can't be used. But the tone() function could prehaps be used.
There are probably other limitations that mean you might not want to use Arduino PWM pins. They are controlled by the chip's internal timers. A timer often controls 2 PWM pins and the duty cycle of each pin can be independently controlled, but they would have the same frequency. So the number of motors that could be controlled this way would be fewer than the number of PWM pins. One motor per internal timer, at best. Also I think that on most AVR chips like Mega & Uno, if the chip runs at 16MHz, the lowest frequency that can be output is 31~32Hz. For motor control you really want the frequency to go down to zero.
@will_t33 Apologies, this is all a little academic really!
The same question was asked before. Is it for school ?
Here is a simulation with 10 stepper motors using the AccelStepper library and A4988 drivers : TenSteppers.ino - Wokwi Arduino and ESP32 Simulator
Yes it is for a design project I've been assigned. This simulation is extremely helpful also. Thank you!
Due to the current draw of using 10 Stepper motors. I believe I could get away with using servos, which would extend the battery lifetime correct? I would just have to get it to still work as desired with limitation of 360 degree rotation right?
Servos are more efficient than steppers to use with battery power.
Most hobby servos are 180 degrees, at best.
Servos that are advertised as 360 degree servos are often really continuous servos which are not servos at all. The continuous servo has its position feedback element disabled which makes it a gear motor with the speed and direction controlled with servo signal. Since they have no positional feedback they cannot be used for positioning.
If you need more than 180 degrees, geared DC motors with encoders would work. The encoder allows positional feedback so the motor can be used for positioning. Pololu sells gear motors with encoders.
180 degrees is the least amount I can make work, do you know of any servos on the market that that can move both directions a 180 degrees consistently. I'm looking for DC servos between 5v-12v range.
Thank you for all the help!!
That is what a servo motor does, the angle can be set anywhere between 0° and 180°. That is consistent, the angle is the same every time.
Almost every servo motor works with 5V, they are often 4.8 to 7.2V.
The very small hobby servo motor can already need a peak current of 0.5A. Try to find the servo the can do the job, but not stronger.
It can be tempting to buy a "extra strong" and "high torque" servo motor, but those could require a peak current of many amps.
You don't need a driver board for the servo motors. The Arduino can make the signals for the servo motor: ServoOverdone.ino - Wokwi Arduino and ESP32 Simulator
Thank you! I'm going to look into this and see where it takes me.
I'll keep y'all updated in the weeks to come.
I appreciate everything, this has been such a great help!
A 10volt stepper, an A4988, and a 12volt supply is a bad combination.
A chopper-driver needs significant higher supply voltage than stepper voltage.
Might as well use an L293D H-bridge for this poor combination.
Get a low impedance (~4volt) stepper, or use a 24volt supply.
Leo..
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.