Stepper Driver Problem!

Hi Guys,

I am trying to control a stepper motor using arduino uno and a stepper driver (photo attached) from a old CNC machine. Everythings working fine but the problem is that the motor does not rotate at the maximum speed (100 rpm). It goes till a certain speed and than remains constant.

The stepper motor is 2.3V and 4.3 amps. Due to the high current I have to use the old stepper driver and I cannot replace the motor because I need high torque.

I need to know why the motor is not going to the full speed.? Do I need to replace the driver?

Any help is highly appreciated.

Note: When I tested this motor with Arduino Motor Shield R3, it used to run at high speed but I can not use the shield as it is not capable of supplying the required current.

Regards

#include <Stepper.h>

const int stepsPerRevolution = 200;  

Stepper myStepper(stepsPerRevolution, 12, 13);

int stepCount = 0; 
int buttonState = 0;
int buttonState_1 = 0;


const int buttonPin_1 = 4;   // ON/OFF Switch
const int buttonPin = 2;     // the number of the direction switch
const int ledPin_1 = 7;      // the number of the LED pin
const int ledPin_2 = 5; 
const int ledPin_3 = 6;
const int pwmA = 10;
const int pwmB = 11;
const int brakeA = 9;
const int brakeB = 8;
const int dirA = 12;
const int dirB = 13;

int potPin = 2;    // select the input pin for the potentiometer

int val = 0;   
int motorSpeed = 0;

void setup() {

pinMode(ledPin_1, OUTPUT);
pinMode(ledPin_2, OUTPUT);
pinMode(ledPin_3, OUTPUT);
pinMode(buttonPin, INPUT);
pinMode(buttonPin_1, INPUT);
pinMode(pwmA, OUTPUT);
pinMode(pwmB, OUTPUT);
pinMode(brakeA, OUTPUT);
pinMode(brakeB, OUTPUT);
digitalWrite(pwmA, HIGH);
digitalWrite(pwmB, HIGH);
digitalWrite(brakeA, LOW);
digitalWrite(brakeB, LOW);
Serial.begin(9600);
}

void loop() {
     digitalWrite (ledPin_1, LOW);
     digitalWrite (ledPin_2, LOW);
     digitalWrite (ledPin_3, LOW);
     buttonState_1 = digitalRead(buttonPin_1);
  if (buttonState_1 == HIGH)
  {  
    digitalWrite (ledPin_3, LOW);
    buttonState = digitalRead(buttonPin);
   if (buttonState == HIGH)
    {
     digitalWrite (ledPin_1, HIGH);
     digitalWrite (ledPin_2, LOW);
     digitalWrite (ledPin_3, LOW);
     val = analogRead(potPin);  
     motorSpeed = map(val, 0, 1023, 1, 100);
     myStepper.setSpeed(motorSpeed);
     myStepper.step(stepsPerRevolution / 100);
     Serial.print("CW  ");
     Serial.print(motorSpeed); 
     Serial.println("  RPM");
    }
   else
    {
     digitalWrite (ledPin_2, HIGH);
     digitalWrite (ledPin_1, LOW);
     digitalWrite (ledPin_3, LOW);
     val = analogRead(potPin);  
     motorSpeed = map(val, 0, 1023, 1, 100);
     myStepper.setSpeed(motorSpeed);
     myStepper.step(-stepsPerRevolution / 100);
     Serial.print("CCW  ");
     Serial.print(motorSpeed);
     Serial.println("  RPM");
    }
  }
  else
    {
      digitalWrite(ledPin_3, HIGH);
      digitalWrite(ledPin_1, LOW);
      digitalWrite(ledPin_2, LOW);
    }
}

Image from Original Post so we don’t have to download it. See Image Guide

5cfe6d8a08793ae973668d324987428d95025afa.jpg

d6fb02f85127fb03ba7bcd0d7ee6ddb3c9d6b81c.jpg

We need details of the stepper driver. Most specialized stepper drivers just require step and direction signals.

What power supply are you using for the motor (volts and amps)?

A photo of wiring is not useful. Make a pencil drawing showing all the connections and post a photo of the drawing.

…R
Stepper Motor Basics

Hi Robin,

Thanks for posting the photos.

I am using the same power supply that the old CNC used to use that is 50V. But the actual voltage reaching the motor is around 5V.

I have tried the code with a small stepper motor with arduino stepper shield and it runs absolutely fine.

Unfortunately I do not have the data sheet for the driver.

Regards,

If you don't have a datasheet perhaps there is useful info on the board itself - such as descriptions of the connections? Can you post a close-up photo so we can read stuff?

If you are not measuring the motor voltage with an oscilloscope the measurement is likely to be wrong.

...R

Use the AccelStepper library, you need to ramp up speed with a big stepper.

Hi Robin,

Here are the zoomed in pics, hoe it helps. By the way hat kind of information about the driver are you looking for.

Hi Mark,

Do I need to make changes in the sketch to use the AccelStepper library? If so, then what changes do I need to Make?

Regards,

20160312_094028_resized.jpg

20160312_094034_resized.jpg

staccato:
Hi Robin,

Thanks for posting the photos.

I am using the same power supply that the old CNC used to use that is 50V. But the actual voltage reaching the motor is around 5V.

That makes no sense at all. Do you actually mean that? Steppers are current driven using a chopper circuit.

I have tried the code with a small stepper motor with arduino stepper shield and it runs absolutely fine.

Unfortunately I do not have the data sheet for the driver.

Regards,

By the way for the AccelStepper library first look at the examples that come with it - that's what
they are for.

staccato:
Here are the zoomed in pics, hoe it helps. By the way hat kind of information about the driver are you looking for.

I was hoping for pics of the connectors on the board in the hope that there may be some writing beside them to describe their purpose. Maybe there is writing on the underside?

I don't see anything on those Pics that helps me to help you.

Also, there seem to be 2 boards in the Pics and you have not explained what they are.

...R