I have a Leadshine DM422 stepper motor driver controller purchased from lightobject.com for a Z table adjustable laser bed for a K40 laser cutter engraver. The bed uses a single 42HS03 2A 2 phase 4 wire stepper motor and the DM422 is listed on the website as one that works with this motor. I am powering the controller with a 12v 2.5A power supply.
I am trying to control the stepper controller using an arduino uno and i think i have it wired correctly but no commands i send to the controller seem to do anything.
Here is how i currently have it wired:
A+ = Red stepper motor wire
A- = Yellow stepper motor wire
B+ = Orange stepper motor wire
B- = Brown stepper motor wire
VCC = connected to power supply
GND = Connected to ground on power supply and uno
OPTO = Connected to 5V
DIR = Connected to Pin 3
PUL = Connected to Pin 2
ENA = Connected to Pin 4 and set High
Is this wiring correct? what arduino code should i use to test it?
Is my power supply enough or do i need a better one?
I have been looking for answers on this for weeks and still have nothing to show for it.
@jardane, you need to post a link to the datasheet for your stepper driver.
Also. post a link to the datasheet for your stepper motor and tell us what stepper motor power supply you have (volts and amps).
Unless you have the specifications very clearly set out the colours of the wires are not a reliable indication of which pairs with which. Check the resistances with your multimeter be make certain you know which pairs belong to each coil.
I don't have a schematic to share because i don't know how everything is wired, i am just using what i know of arduino and what i have guessed from the data sheet of the DM422 i got from
Robin2: @jardane, you need to post a link to the datasheet for your stepper driver.
Also. post a link to the datasheet for your stepper motor and tell us what stepper motor power supply you have (volts and amps).
Unless you have the specifications very clearly set out the colours of the wires are not a reliable indication of which pairs with which. Check the resistances with your multimeter be make certain you know which pairs belong to each coil.
You can use this Simple Stepper Code to test it. However you should be aware that your driver expects the Arduino to pull the pulse pin LOW to create a step whereas my code pulls it HIGH. Just swap the HIGH and LOW in my demo. It will probably work even if you don't change it.
I missed your earlier reference to the power supply. I don't think you have posted a link to the stepper motor datasheet. If (as is likely) it requires 2 amps at a nominal 3v or so (6 watts per coil) then your 12v x 2.5amp (30 watt) power supply should be sufficient. A large capacitor across the power supply might be a good idea.
You can use this Simple Stepper Code to test it. However you should be aware that your driver expects the Arduino to pull the pulse pin LOW to create a step whereas my code pulls it HIGH. Just swap the HIGH and LOW in my demo. It will probably work even if you don't change it.
I missed your earlier reference to the power supply. I don't think you have posted a link to the stepper motor datasheet. If (as is likely) it requires 2 amps at a nominal 3v or so (6 watts per coil) then your 12v x 2.5amp (30 watt) power supply should be sufficient. A large capacitor across the power supply might be a good idea.
Assuming you have the HS03 motor as in that datasheet in Reply #8 then this wiring is WRONG
Here is how i currently have it wired:
A+ = Red stepper motor wire
A- = Yellow stepper motor wire
B+ = Orange stepper motor wire
B- = Brown stepper motor wire
Robin2:
You are not reading it correctly so don't try it.
This is what I see in Diagram C
Yellow and Black to A+
Green and Orange to A-
Red and White to B+
Blue and Brown to B-
...R
My stepper motor has no white or black just Red, Brown, Yellow and Orange in that order. I hooked it up in the order you said not including the white and black and its at least moving but not in a smooth way, it jitters back and forth.
here is the code i am running.
// testing a stepper motor with a Pololu A4988 driver board or equivalent
// this version uses millis() to manage timing rather than delay()
// and the movement is determined by a pair of momentary push switches
// press one and it turns CW, press the other and it turns CCW
//Yellow is A+ Orange is A- Red is B+ Brown is B-
byte directionPin = 9;
byte stepPin = 8;
byte buttonCWpin = 10;
byte buttonCCWpin = 11;
boolean buttonCWpressed = false;
boolean buttonCCWpressed = false;
byte ledPin = 13;
unsigned long curMillis;
unsigned long prevStepMillis = 0;
unsigned long millisBetweenSteps = 25; // milliseconds
void setup() {
Serial.begin(9600);
Serial.println("Starting Stepper Demo with millis()");
pinMode(directionPin, OUTPUT);
pinMode(stepPin, OUTPUT);
pinMode(ledPin, OUTPUT);
pinMode(buttonCWpin, INPUT);
pinMode(buttonCCWpin, INPUT);
}
void loop() {
curMillis = millis();
readButtons();
actOnButtons();
}
void readButtons() {
buttonCCWpressed = false;
buttonCWpressed = false;
if (digitalRead(buttonCWpin) == HIGH) {
buttonCWpressed = true;
}
if (digitalRead(buttonCCWpin) == HIGH) {
buttonCCWpressed = true;
}
}
void actOnButtons() {
if (buttonCWpressed == true) {
digitalWrite(directionPin, LOW);
singleStep();
}
if (buttonCCWpressed == true) {
digitalWrite(directionPin, HIGH);
singleStep();
}
}
void singleStep() {
if (curMillis - prevStepMillis >= millisBetweenSteps) {
prevStepMillis += millisBetweenSteps;
digitalWrite(stepPin, LOW);
digitalWrite(stepPin, HIGH);
}
}
Am i missing something? If this code worked it would turn one way when one button is pushed and the other way when the other is pushed. Its like its switching directions back and forth when the button is pressed.
jardane:
My stepper motor has no white or black just Red, Brown, Yellow and Orange in that order.
So that must mean that it is NOT the 42HS03 that you mentioned in your Original Post.
And you need to fall back on what I said in Reply #2
Unless you have the specifications very clearly set out the colours of the wires are not a reliable indication of which pairs with which. Check the resistances with your multimeter be make certain you know which pairs belong to each coil.