Arduino with Automation Direct STP-DRV-4850

I spent a few hours tonight figuring this out so I wanted to share in case it may be able to help anyone else.

If you want to drive a automation direct advanced stepper drive with arduino you can do it through the SCL commands. For this example I used the code from below almost as is, just change the baud to 9600.

Then, instead of using the Sure Motion Pro SCL terminal you can send commands from the arduino serial monitor terminal. This is assuming your driver is already programmed correctly. Once you get this established its easy then to put those control commands in your Arduino to control a stepper motor without the need for high speed pulsing. Note the monitoring terminal needs to be in "Carriage Return" to be able to read the responses from the drive. This uses a TTL to RS-232 converter which was all of $1.09 on ebay (including free shipping, if you can believe that).

Originally I was learning how to control the stepper motor with a Click PLC but it struggled to receive responses to queries because of the time it takes to switch from TX to RX and lack of serial buffering ability. In particular I wanted to be able to query the "IP" or instantaneous position to make a sort of control loop but since click couldn't do it, I sold it and was planning on getting a BRX PLC. However in the interim I decided to get an Arduino and I'm happy I did. Micro controller programming was my absolute favorite in college and 15 years later the enjoyment is still there.

BTW, if you're going through the SCL manual, below is a list of the key commands you'll need. Others may have a niche use but these seem like the key ones.

IP - instantaneous position : position in steps relative to zero point
SP0 - sets the current position as zero counts, or home position
VE - sets /reads motor velocity
AC - set / reads motor acceleration rate
DE - set / reads motor deceleration rate
DI - used to set target steps to move relative to SP0 position
FP - feed position, executes the amount of steps set in DI. DI0 + FP will return to SP0
FL - when sent with a number of steps, moves those steps. Or, moves steps set by DI
JS - jog speed
CJ - commence jog. Jog start direction can be set with DI (i.e. DI-1 + CJ)
SJ - stop jog
CS - change speed / direction while jogging (if moving forward CS-1 will reverse motion)
ST - stop
SA - save drive settings

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.

What model Arduino controller and what model automation direct advanced stepper.
Can you post a link to the stepper controller so we know what you are talking about?

Thanks.. Tom... :slight_smile:

Sure, no problem. Controller is an Arduino UNO.

The stepper drive model is here. I chose it because it can take serial commands so less wires and richer data availability.

https://www.automationdirect.com/adc/shopping/catalog/motion_control/stepper_systems/stepper_drives/stp-drv-4850

Actually I put this post up because I saw another post through search that was about 2 years old. They were asking the guy why he didn't want to use the serial functions of the drive.

Hi,
OPs pic,


Thanks.. Tom.. :slight_smile: