Stepper Motor control with DM320T and Arduino Uno

I am having a problem getting the shaft of a NEMA 17 motor to rotate. I have attached a wiring diagram and the Arduino code. i am using an Arduino Uno with output controls on digital pins 6 and 7. I am interfacing the Uno to a DM320T Driver manufactured by OMC ( I am using a 12V power source for the driver. The motor is manufactured by Polulu and is described as unipolar/bipolar , 6 wire, 200 steps/rev, 1.2A/phase, 42x48 mm.
I set up the circuit using the DM320 User manual in bipolar mode (I think) with center taps of A and B windings disconnected. The attached diagram shows DIP settings and wiring. The manual suggests 1k resistors on the control lines between Uno pins and the Driver PUL and DIR terminals. I measured the voltages on the 1K resistors. Pin 7 (PUL) to ground was 5.0V. Pin 6 (DIR) to ground alternated (assume pulse waveform) 0.0/5.0V. On the Driver side of the 1k resistor this measured 3.0v/5.0v.
I have some electronics background but limited experience with stepper motors. I have successfully used a ULN2003 driver with a NEMA 11 motor and an UNO. I am wondering about a timing issue or wrong motor (200 steps/rev)

int x;

void setup() {
  pinMode(7,OUTPUT);    //Set Pin 7 as PUL
  pinMode (6,OUTPUT);   //Set Pin 6 as DIR  


void loop() {
  digitalWrite(6,HIGH);     //Set high level direction
  for (x=0; x<400;x++)        //Repeat 400 times a revolution when setting is 400 on driver
    digitalWrite(7,HIGH);    //Output high
    delayMicroseconds(500);   //Set rotate speed
    digitalWrite(7,LOW);      //Output low
    delayMicroseconds(500);    //Set rotate speed
  digitalWrite(6,LOW);        // Set high level direction



Thanks, Kirk Rensmeyer

.DM320T System Diagram

But you have the coil current at SW1=ON, SW2=ON, SW3=ON which is 0.3A.
SW1=OFF, SW2=OFF, SW3=ON would give 1A.

You have the microstepping set to x64 which is 128000 steps per revolution (SW4=OFF, SW5=ON, SW6=OFF). 400 steps will move the motor shaft 1.125° which may not be enough to see. I would suggest that you set the microstepping to more like x4 or x8 while getting the motor running. And step the motor more steps and put a flag on the shaft so that you can see it move.
See page 8 of the data sheet for switch settings.

Also, in the code, you are starting the motor at 1000 steps per second. You may want to slow it down to get it running. Increase the delay time to slow the motor.

Did you use a meter to Ohm out the windings to identify the right wires to connect to the driver.

Your schematic is barely readable. This may help with the schematic drawing.

Thanks. I will try your suggestions and get back to you.

Seasonal note: October is ideal for ground fungus-have a lot in my backyard!

Kirk Rensmeyer

Indeed - in fact you never want to run a stepper this big without ramping the speed, say using the AccelStepper library or similar as the inertia will cause miss-stepping if you try to jump the speed instantly. You can only get away with this with low speeds and tiny steppers.

Erm, that only applies in the northern temperate zone :slight_smile:

Further note: The code I listed was provided by the Driver Tech support people at OMC. A question: I noticed it does not include the Arduino stepper library, as far as I can tell. I'm going to adjust the For statement to 50 as in for (x=0; x<50; x++)

You don't need the resistors for 5V input.
delayMicroseconds(5000); //instead of 500

Thanks! I'll try that.