4 wires but 2 pins stepper motor

Hi, am using the DM420A driver for my stepper motor. I have the power supply and stepper motor hooked up correctly. Now the power options from the driver to arduino are as follows:
PUL: connected this to pin 8 in arduino - uno
DIR: connected this to pin 9 in arduino
+5V: connected this to 5v pin in arduino
ENBL: no connection

Now i tried to run the example code for "onerevolution" under stepper, the example uses 4 pins (pins 8 to 11) but i only have 2 pins available coming from my driver to arduino which are the PUL and DIR, whats the equivalent code! I tried changing the line to Stepper myStepper(stepsPerRevolution, 8, 9); that doest work. Any help is appreciated.

Cant find the data sheet, didnt come with it either. This might help:
http://www.leadshine.com/UploadFile/Down/DMShm_P.pdf

nice_servo:
"you can google for image".

If you are too lazy to post the image here and also a link to the motor and motor driver datasheets then I am even lazier.

...R
Simple Image Guide

Stepper Motor Basics
Simple Stepper Code

can anyone help! I tried the above links but this isnt easy for me to solve.

"PUL" may be another name for "step".

"DIR" may be another name for "direction".

Use the AccelStepper library as it works better with step and direction.

You have edited your Original Post so that my Reply #1 does not make sense. That sort of change is no appreciated.

An because you have modified your Original Post I can't help with your image - I can't remember what it was.

Those stepper drivers have a lot of info printed on the driver case. Post a photo of what is printed on your driver.

...R

removed because you didnt like it, didnt want others to get rubbed the wrong way with it, wouldnt do that to someone who's teaching me. Here is the driver:

nice_servo:
Here is the driver:

I already gave you a link to the instructions for displaying images. Why do I have to do it for you?

...R

OK. Now we have some info about the driver.

Next thing we need is a diagram showing how you have everything connected. A photo of a simple pencil drawing will be fine.

...R

Here is the drawing:

The power supply ground must go to the Arduino.

The 5V terminal on the stepper driver may be an input, not an output. So the Arduino needs power.

Without reading the datasheet, I don't know if "enable" needs to be connected to anything.

MorganS:
The power supply ground must go to the Arduino.

I don't think so. It is common for the motor power and the logic power to be optically isolated.

The 5V terminal on the stepper driver may be an input, not an output. So the Arduino needs power.

I think it is almost certainly an input, but I presume the OP has just omitted the Arduino's power supply from the diagram.

Without reading the datasheet, I don't know if "enable" needs to be connected to anything.

Agreed. But it can only have one of 2 states so it is easy for the OP to test.

...R

I'm imagining 3 states for "enable" GND, +5V and floating.

OK, if it's optically isolated and +5V is an input then the Arduino doesn't need ground. It still needs power though.

i have the arduino connected to pc via usb. so do i connect enable to arduino's ground? is dir and PUL fine going into pins 8 and 9?

I just found and attached some kinda data sheet from the manufacturer's site for this driver. Does this help?

stepper-motor-driver-dm542a(1).pdf (267 KB)

Yes, sounds good so far.

I found the manufacturer's site: stepper motor driver-DM420A - China Changzhou Longs Motor It's not very clear - the lists of terminals talk about terminals that don't exist on the box. But the way you have it looks correct. Leave "enable" unconnected and it should work.

Ok, i tried it with different example codes and also tried "Simple Stepper Code". It doesnt move.

Did you try the AccelStepper library? Use the "ConstantSpeed" or "Bounce" examples. Replace the line below...

AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5

with...

AccelStepper stepper(AccelStepper::DRIVER, 9, 8);

Replaced line, still nothing. I see green light on driver and power supply which means everything is wired correct. But still no movement.

In the datasheet, under troubles:

....................
Motor doesn't run, but maintains holding torque (which in my case is true, its stiff wont turn if i tried with my hand but does run)
Reasons: without input pulse signal (whatever that means)
Measures: adjust PMW & signal level
......................

does that mean i need to move wires around?

Looks like the +5V terminal in the signal group is the common "return" wire, connect to Arduino 5V pin, STEP and DIR will be LOW true.

nice_servo:
Ok, i tried it with different example codes and also tried "Simple Stepper Code". It doesnt move.

If that means the code from my link then stick with that until you get it working. If it won't work with that simple code it won't work with anything more complex. Just make sure there is a long interval between steps - at least 250 millisecs - so the motor is moving very slowly.

I presume you have made sure that the step and direction pins in the code match your physical connections.

Are you sure you have identified which pairs of motor wires belong to the different coils in the motor?

Be VERY CAREFUL never to disconnect the wires between the motor and the stepper driver while the driver is powered up. The driver will be instantly destroyed,

Have you set the current limit correctly to match your motor?

What micro-stepping setting have you set? For testing I recommend full steps.

...R