Automation direct STP-DRV-4850 step motor driver with 4 wire stepper motor

I have a SureStep (STP-MTR-23055) stepper motor with an automation direct step motor driver (STP-DRV-4850).

Datasheet for driver: http://www.automationdirect.com/adc/Shopping/Catalog/Motion_Control/Stepper_Systems/Stepper_Drives_-z-_Power/STP-DRV-4850

I have an Arduino Uno along with an external power supply.

I am attempting to control the motor so that when I run the code it will simply go forward and backward. I have been attempting to do this for the past week with no luck. I have read through many different forms and I have not been able to get the motor running at all. I know that the driver comes with software to program but I am unable to write script.

Can somebody please assist me in wiring and programming the Arduino, motor, and driver? Nothing I have done so far is working. I am able to run a simple DC motor on the Arduino, but I cannot get this motor/driver to function. Any help is appreciated.

Thank you.

In what way are you trying to communicate with the 4850 driver?

I have a few of these from a project and they are nice in that they have many ways to function.

In my case I used a BS2 (basic stamp) to control 3 of them using serial commands.

There is a serial cable and software that allows sending and receiving commands from a PC.

That allowed some fine tuning of the speeds and acceleration.

When I tried to send the same commands from the stamp nothing worked.

I ended up using the stamp to listen to the data being sent over from the PC to the 4850.

Once I saw what was being sent it was then possible to have the stamp control it.

That driver seems to take normal step and direction inputs. For example step+ should be connected to an I/O pin and step- connected to Arduino GND.

This Simple Stepper Code should be good for testing.

Post a link to the datasheet for your motor.

...R Stepper Motor Basics

I am attempting to simply make the motor go forward and backward so that I can power a linear slide. I would like to make this a continuous loop which is why I was unable to use the PC software, as that software only allows for one command at a time rather than writing script.

Robin 2:

Here is a link the the motor data sheet: http://www.automationdirect.com/adc/Shopping/Catalog/Motion_Control/Stepper_Systems/Stepper_Motors_-z-_Cables/STP-MTR-23055

Again, here is the link the the drive: http://www.automationdirect.com/adc/Shopping/Catalog/Motion_Control/Stepper_Systems/Stepper_Drives_-z-_Power/STP-DRV-4850

Would it be possible to get some sort of wiring diagram? I am new to arduino and I have not yet fully mastered the art. I was able to order a starter kit about a month back but I haven't yet mastered it.

IIRC there are wiring diagrams in the driver datasheet. If there is something you don't understand tell me what it is and what page of the datasheet it is on.

For a simple wiring diagram look at the Pololu 4988 page. The general principle is the same.

...R

I have the motor connected to A+, A-, B+, and B-. I have the external power supply connected to V+ and V-. The problem that I am having is connecting the driver to the Arduino. I have GND, AIN, +5V, OUT-, OUT+, EN-, EIR-, EN-, EN+, DIR-, DIR+, STEP-, and STEP+ left to use on the driver. I am unsure how to wire the driver to the Arduino. Again, I have looked at both data sheets and read through forms for the past week an I haven’t been able to get the motor to run at all. Any help is appreciated.

dan12146: I have the motor connected to A+, A-, B+, and B-. I have the external power supply connected to V+ and V-. The problem that I am having is connecting the driver to the Arduino. I have GND, AIN, +5V, OUT-, OUT+, EN-, EIR-, EN-, EN+, DIR-, DIR+, STEP-, and STEP+ left to use on the driver. I am unsure how to wire the driver to the Arduino. Again, I have looked at both data sheets and read through forms for the past week an I haven't been able to get the motor to run at all. Any help is appreciated.

What page of the datasheet is all that stuff on? Then I can have a look at it.

...R

Had to go back and refresh what I did in dealing with this driver.

First of all follow the instructions on how to hook this up from the website.

All you really need is the power supply hooked up and the correct wires of the stepper connected and of course the rs232 cable to allow the sure step software to communicate with it.

You will need to configure the drive to the power supply and the stepper thru the sure step software.

In the software you will be able to also set other features like the inputs and outputs.

Look into the SCL feature of the drive. That is how I used a BS2 to drive it by simply sending it commands and not fiddle farting with trying to provide all the necessary timing pulses.

Here is the scl manual.

scl_manual.zip (848 KB)

Visit ---> http://www.automationdirect.com/adc/Shopping/Catalog/Motion_Control/Stepper_Systems/Stepper_Drives_-z-_Power/STP-DRV-4850

click the "Specifications" PDF

The wiring diagram on the first page to the right is the one that I followed to wire the power supply and the motor to the driver. I do not know how to connect to the Arduino

@dan12146, do yourself (and me) a favour and download and study the manual

Don't try to get something complex to work with part of the instructions

...R

I have read and downloaded the manual a while back. I was able to control the motor using the drive and the computer software, but I am unable to do anything other than give a single command as the computer software only allows for one command at a time rather than writing script. I would like to be able to use the Arduino to write a script and have the motor oscillate back and forth to allow a linear slide constant back and forth motion. I have the motor connected to the drive and the power supply connected as well. What I need to do is figure out how to wire the motor drive to the Arduino and write the code. I know that I need to use the STEP+, STEP-, DIR+, and DIR- to create bidirectional motion and I do not believe that I need the EN+ and EN- terminals as I do not think I need to use the enable function, but I could be wrong.

I am having trouble because I do not know how to wire this motor drive to the Aruduino and I do not know what code to use. I have tried many different wiring schematics and different codes but noting has helped.

I would like to be able to use the Arduino to write a script and have the motor oscillate back and forth to allow a linear slide constant back and forth motion.

Well that is what I did with just a simple BS2 so an arduino could do it with it's eyes closed.

but I am unable to do anything other than give a single command as the computer software only allows for one command at a time rather than writing script.

There is a buffer so more than one command can be sent. You cannot store a program but all that needs to be done is simply resend the commands each time.

Why on earth when you have a quite capable driver (I bet you never looked at the scl manual) do you want to use it as a brain dead stepper driver? Kind of like getting a ferrari to do parking lot sweeping.

I'll leave this to others.

dan12146: I am having trouble because I do not know how to wire this motor drive to the Aruduino

The reason I asked you to download the manual was so that you could read through it and find the page that describes connections to a micro-processor. Then you can tell me the page number and I can read the page and try to help you.

...R

Robin2: The reason I asked you to download the manual was so that you could read through it and find the page that describes connections to a micro-processor. Then you can tell me the page number and I can read the page and try to help you.

...R

The problem is that there is not real detailed page that shows how to wire to a micro-processor. I would say that the best pages in the manual to look at would be 2-7 through 2-9.

Thanks. I can see that page.

Now, what is it about that page that you need help with?

Maybe the best thing would be for you to make a pencil diagram showing how you think everything should be connected and then post a photo of the drawing.

As I said in Reply #2, I think all that is needed is to connect Step+ to an Arduino I/O pin and Step- to Arduino GND and the same for the DIR connections.

...R

I have attached a wiring diagram. The code I tried to use was the one that you had sent earlier in the thread:

This wiring or code is not working for me. I know I must be doing something wrong, I just do not know what. Any help would be appreciated.

Full page photo.pdf (426 KB)

You have a breadboard in that drawing. Please re-draw the circuit without any breadboard so we can understand it properly.

Also, please post the picture a a JPG file so we don't have to download it to view it. See Image Guide

And please post the code that you are trying copied from your Arduino IDE rather than from my link - just in case there is an important difference.

...R

Below is the code and I redrew the wiring diagram.

// 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;

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);
}
void loop() {
curMillis = millis();
readButtons();
actOnButtons();
}
void singleStep() {
if (curMillis - prevStepMillis >= millisBetweenSteps) {
prevStepMillis += millisBetweenSteps;
digitalWrite(stepPin, HIGH);
digitalWrite(stepPin, LOW);
}
}

Image from Reply #18 - I already gave you the Image Guide so I would not have to do this.

107cd7cdc6cbe9800e48815da2ec31187da5734b.jpg

…R