Stepper Motor Control

I have a project that I would like to use a stepper motor to drive a pulley to a predetermined distance based on a series of buttons with each button representing a different (and programmable) number of steps. I am using a DM860A stepper driver and a NEMA 34 1232oz stepper motor.

I have poured though the forums and tried various setups I read about, but have had very limited success.

I have limited Arduino experience and am looking for paid help learning more about the platform by completing this project

How far along have you got? Can you wire up the stepper and driver and get it to step at all?

Wildbill

Thanks for the reply. I am working on an old target delivery system for the local PD training center. The original setup uses a 110 volt AC motor and a toggle switch to run a target up and down range. The system is 30 years old and the mechanical's are sound but the electrical side could sure use some help. The motor has been discontinued for about 5 years and any suitable emplacements are impossible to find without having a motor shop modify and existing motor to work. I have several target systems that use stepper motors for target positioning and would like to retrofit this old system with some more modern components. My goals are as follows:

I would like to use this project to learn more about the Arduino platform

Short term I would like to build a circuit/sketch that controls the motor forward and reverse possible adding a display to indicate distance. I plan on using this as a working prototype to test the suitability of the stepper motor in this application.

Long term I would like to control this with a touchscreen and a raspberry pi providing several popular presets for target distance

Again my goal is to learn as much as possible about the Arduino platform.

I watched several of the tutorial videos last night and have a much better understanding about the programming but I'm not ready to tackle this project on my own.

I do have a setup that currently works but is very slow and doesn't work well and the driver and motor get very hot when at rest.

Again thanks for any help you can provide

here is my setup

KenLove:
I do have a setup that currently works but is very slow and doesn't work well and the driver and motor get very hot when at rest.

What code are you running on the Arduino?

It works ok but is to slow

[code]
// 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

byte directionPin = 9;
byte stepPin = 8;

byte buttonCWpin = 10;
byte buttonCCWpin = 11;

boolean buttonCWpressed = false;
boolean buttonCCWpressed = false;

byte ledPin = 13;

unsigned long curMicros;
unsigned long prevStepMicros = 0;
unsigned long microsBetweenSteps = 700; // microseconds 

void setup() { 

  Serial.begin(9600);
  Serial.println("Starting Stepper Demo with micros()");

  pinMode(directionPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  
  pinMode(buttonCWpin, INPUT_PULLUP);
  pinMode(buttonCCWpin, INPUT_PULLUP);
  
}

void loop() { 
 
 curMicros = micros();
 readButtons();
 actOnButtons();
 
}

void readButtons() {
 
 buttonCCWpressed = false;
 buttonCWpressed = false;
 
 if (digitalRead(buttonCWpin) == LOW) {
 buttonCWpressed = true;
 }
 if (digitalRead(buttonCCWpin) == LOW) {
 buttonCCWpressed = true;
 }
}

void actOnButtons() {
 if (buttonCWpressed == true) {
 digitalWrite(directionPin, LOW);
 singleStep();
 }
 if (buttonCCWpressed == true) {
 digitalWrite(directionPin, HIGH);
 singleStep();
 }
}

void singleStep() {
 if (curMicros - prevStepMicros >= microsBetweenSteps) {
 prevStepMicros += microsBetweenSteps;
 digitalWrite(stepPin, HIGH);
 digitalWrite(stepPin, LOW);
 }
}

[/code]

Your stepper driver DM860A has 8 dip switches for settings. You can see on the driver Pulse/rev Table how to set the number of pulse per revolution using dip switches numbered from 5 to 8.

With the 5-8 setting that I see in your IMG_0230.jpg (sw5, sw6, sw7 = OFF, sw8 = ON), you must send 51200 pulses for 1 revolution. With the 700 microseconds interval between pulses assigned in your sketch, 1 revolution requires 700 * 51200 = 35,840,000 microsecond = 35.84 seconds: not very fast.

If you set sw5, sw6, sw7 and sw8 to ON, you will need only 400 pulse for 1 revolution. Using the same 700 microseconds interval between pulses in your sketch, the rotation speed will be 700 * 400 = 280,000 microseconds = 0.28 seconds for 1 revolution = 214 rpm.