# Two Stepper Motor Interfacing

Can we interface two stepper Motors simultaneously ?
I am Currently Using one Unipolar Stepper Motor 28 BJY-48 at pins 8,9,10,11 and one Bipolar Stepper Motor at pins 4,5,6,7 .
This is my Code :
#include <Stepper.h>

const int stepsPerRevolution1 = 64;
const int stepsPerRevolution2 = 400;

Stepper Stepper1(stepsPerRevolution1, 4,5,6,7);
Stepper Stepper2(stepsPerRevolution2, 8,9,10,11);

void setup() {

Stepper1.setSpeed(60);
Stepper2.setSpeed(60);

}

void loop() {
for(int i=0; i<=400; i++)
{
digitalWrite(13,LOW);
Stepper2.step(200);
delay(1000);
int j=1;
while(j)
{
Stepper1.step(2048);
j=0;
}
delay(2000);
}

}

What stepper motor driver are you using with the bipolar motor?

If you want two motors to move at the same time it will be easier with the
AccelStepper library

If you use the standard stepper library you will need to make each motor move one step at a time and manage the step timing yourself.

...R

I am using L298N Stepper Motor Driver for the Bipolar Motor. And my main objective is to rotate one motor for a certain value, then the second motor for a certain value But Simultaneously. Say Motor1 - 90degree and Motor2 - 180degree value But they should Rotate Simulataneously. ThankYOu for your Reply.

Do the motors start and stop at the same time? What I mean is that if one motor is to go 90° and the second 180°, does the second run at half the speed of motor one so that they stop at the same time?

chintan_r:
I am using L298N Stepper Motor Driver for the Bipolar Motor. And my main objective is to rotate one motor for a certain value, then the second motor for a certain value But Simultaneously. Say Motor1 - 90degree and Motor2 - 180degree value But they should Rotate Simulataneously. ThankYOu for your Reply.

Have you tried the suggestions in Reply #1

chintan_r:
I am using L298N Stepper Motor Driver for the Bipolar Motor. And my main objective is to rotate one motor for a certain value, then the second motor for a certain value But Simultaneously. Say Motor1 - 90degree and Motor2 - 180degree value But they should Rotate Simulataneously. ThankYOu for your Reply.

These days most bipolar stepper motors are low impedance and need a suitable driver, not an H-bridge like
the L298. What exactly is the bipolar motor?

MarkT:
These days most bipolar stepper motors are low impedance and need a suitable driver, not an H-bridge like
the L298.

MarkT I've seen this said before in this and other forums. In its day, the L298 suited the stepper motors motors of the day. Along with its companion L297 it was a common way to drive the steppers of the day. ("It's day" being what, 30+ years back?)

So question @MarkT: what are the quantitative characteristics which define the threshold at which a stepper is a candidate for driving with an L298?

(eg, what's "low impedance" in the stepper world?)

Why would anyone use an L298 for any stepper motor if s/he had the option of using a specialized stepper motor driver?

Indeed why would anyone use an L298 for driving any motor in view of the many better alternatives?

...R

Robin2:
Why would anyone use an L298 for any stepper motor

Indeed why would anyone use an L298 for driving any motor

I'm not arguing: just wondering why (since the L298 was designed as a stepper and dc motor driver in its day, note italics) what the quantified electrical criteria are that makes (or rather made) "this" stepper a candidate for a 298 and "that" one not.

neiklot:
since the L298 was designed as a stepper and dc motor driver in its day,

I reckon it was designed as a DC motor driver and some clever marketing guy decided to add on the bit about using it for a stepper motor

...R

Robin2:
clever marketing guy

Is there such a thing?

neiklot:
Is there such a thing?

by “clever” I meant “smart ass”

…R

Robin2:
by "clever" I meant "smart ass"

In which case, you just needed to say "marketing guy"

neiklot:
the quantified electrical criteria are that makes (or rather made) "this" stepper a candidate for a 298 and "that" one not.

is the motor's rated current times the coil resistance, aka the "supposed" input voltage.
If you have 1A 12ohm motor you "could" use an H-bridge with a 12V power supply.
It's not smart nor efficient but the motor will rotate. I don't have a specific voltage value but i guess that every motor that doesn't "require" at least 7-8V should be avoided.

If you have 1A 1ohm motor what can you use with an H-bridge? 1V power supply? Nothing that's reasonable, since there are proper stepper drivers that directly manage the CURRENT flowing in the coils (which is the proper stepper motor control technique). For the same price of an L298 you'll have current control, microstepping, energy efficiency, higher RPM, basically only two pin to control the motor, wide input voltage requirement, quieter motor...

neiklot:
MarkT I've seen this said before in this and other forums. In its day, the L298 suited the stepper motors motors of the day. Along with its companion L297 it was a common way to drive the steppers of the day. ("It's day" being what, 30+ years back?)

So question @MarkT: what are the quantitative characteristics which define the threshold at which a stepper is a candidate for driving with an L298?

(eg, what's "low impedance" in the stepper world?)

Low impedance motors are typically 0.5 to 3 ohms. They use constant-current drive and can do 1000's of RPM
with suitable drivers and high voltage power supplies (24 to 80V is typical). The winding inductance is
a few mH.

Old fashioned slow steppers are 30 to 50 ohms for 12V use, typically 200 or so RPM before torque drops
to unusable levels due to the high inductance of the windings compared to available voltage.

You could get the same performance from a high impedance motor, but you'd need constant current drive from
supplies in the 100's to 1000's of volts range, which the winding insulation would not likely survive.

There are some motors inbetween these extremes, which can be used either way (voltage drive
or current drive), but they are rarer.