Arduino UNO to Leadshine DM422 Stepper Drive

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.

Please help!

In the time that you spent looking, I’m sure you noticed that one site linked to another. Too bad you didn’t provide any links.

I’m sure you saw a schematic or two. Too bad you didn’t provide a schematic.

I’m sure you saw some code. Too bad you didn’t provide any code.

And yet, you want us to use our crystal balls to tell you what the problem is. Too bad mine are brass.

@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.

The devil is in the detail.

...R
Stepper Motor Basics
Simple Stepper Code

Z table:

Driver:
http://www.lightobject.com/Leadshine-mini-2-Phase-DM422-22A-1-axis-Stepping-Motor-Driver-P1024.aspx

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

http://www.leadshine.com/productdetail.aspx?type=products&category=stepper-products&producttype=stepper-drives&series=DM&model=DM422

As for code it was just something simple like

void setup(){
pinMode(2, OUTPUT);  //dir
pinMode(3, OUTPUT); //step pin (pul)
pinMode(4, OUTPUT); //ENA
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
}

void loop(){
digitalWrite(3, HIGH);
delayMicroseconds(200);
digitalWrite(3, LOW);
delayMicroseconds(200);

}

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.

The devil is in the detail.

...R
Stepper Motor Basics
Simple Stepper Code

I already said what kind of supply it was, 12V 2.5A, i am not sure on the brand because it's not in front of me but i got it from radio shack.

The wire assignments are from the description of the z table from the product listing on the light object website.

If the step pin is 3, what is the point of banging on pin 8 in loop()?

PaulS:
If the step pin is 3, what is the point of banging on pin 8 in loop()?

Sorry that was a mistake, i fixed it in the code.

I think your wiring is correct.

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.

...R

Robin2:
I think your wiring is correct.

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.

...R

Thanks for the info the data sheet for the stepper is here:
http://www.leadshine.com/UploadFile/Down/42HSxxd.pdf

I will try your code when i get home, thanks!

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

I suggest you use the wiring diagram c.

...R

Robin2:
Assuming you have the HS03 motor as in that datasheet in Reply #8 then this wiring is WRONG
I suggest you use the wiring diagram c.

...R

So if i am reading the diagram correctly that would be:
Yellow = A+
Orange = A-
Red = B+
Brown = B-

I will try it.

jardane:
So if i am reading the diagram correctly that would be:
Yellow = A+
Orange = A-
Red = B+
Brown = B-

I will try it.

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

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.

…R