Using arduino nano to command an automationdirect STP-DRV-4850

Hi everyone, first time poster. I've read through the forums and I think I've set up everything correctly, however the motor doesn't move. I have an automation direct STP-DRV-4850 stepper driver with USB to RS232 adapter cable and I can command the motor using the automation direct software (suremotionpro) from my laptop and everything works fine.

The problem is the suremotionpro setup only sends one command at a time, and I need to loop commands to move the motor back and forth for my project. To do that I purchased an Arduino nano, and later after reading through the forums here a UART to RS232 translation board (Artekit AK-3232 and AK-3232L | Artekit Labs Tutorials). I've done a bit of troubleshooting both with the setup and the IDE code. If I put a scope on the output pins of the translation board (input to the driver) I get 13V square wave, so some serial command is making it to the input of the driver, but nothing moves. I've removed the looping of commands from the code so that I can send one command at a time, as the suremotionpro software does, and it still doesn't move.

I'm out of troubleshooting ideas, my only guess is that there is some sort of enable command secretly being sent by the suremotionpro software that isn't mentioned in the documentation, but that doesn't seem realistic.

Here is a pic of the setup, 24V supply goes to the driver, 5V supply to the translation board, black wire is the nano Tx, this is showing the scope output for looped commands:

Here is the IDE code I've used to test single command sending:

#include <SoftwareSerial.h>

const byte txPin = 1;
const byte rxPin = 0;
String command; 

SoftwareSerial mySerial (rxPin,txPin);

void setup() {
  // put your setup code here, to run once:
  // Define pin modes for TX and RX
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  Serial.begin(9600);
  mySerial.begin(9600);
  Serial.println("Type Command (GO)");
  }

void loop() {
  // put your main code here, to run repeatedly:
    if (Serial.available()) {
    command = Serial.readStringUntil('\n');
    command.trim();
    if (command.equals("GO")) {
        mySerial.write("FL10000\n");
        Serial.write("FL10000");
    }
   
    else {
      Serial.println("bad command");
    }
    Serial.print("Command: ");
    Serial.println(command);
  }
}

Any troubleshooting ideas for either the code or the setup would be greatly appreciated.

Thanks!

Time for an annotated schematic - about two days ago.

Hi here is a schematic sketch of the set up with the pins labeled. The driver and motor work fine so I didn't sketch out the pin details there, it's just per the manual. 'DB9' is where the scope image was taken. Thanks

It might be an issue with the enable signal or timing. Some drivers need an enable pin triggered before they move. Check the datasheet for your driver and ensure all grounds (Arduino, translation board, and driver) are connected. Also, try adding a small delay (50-100ms) between commands to see if that helps.

The RS232 to laptop command cable that came with it only had Rx. Tx, and GND pins, here is the cable used that bypasses the nano set up:

Nothing like a seperate enable pin to the driver

You can use the Step and Dir inputs to do that but I can't seem to find a technical manual for the 4850 model.

Heres the command library for the stepper driver. Its uses SCL for serial commanding, if you look at the code I posted "FL10000" is the forward step command for10000 steps.
scl_manual.pdf

Don't use SCL
Connect the Step and Dir inputs to your arduino and use them to control the motor.
You can use the accelstepper library if you want.

You mean not use the STP-DRV-4850 and drive the motor directly from the Arduino? The STP-DRV-4850 provides alot of options for signal control and supports fairly beefy motors. I'm only using 1.2A per phase now but I bought this so that I can scale up later so trying to find path forwards that keeps the STP-DRV-4850 in the set-up

No, still use the driver.
I found this manual, see page 3-7
What they call an indexer is your Arduino.
StepperDriver-SureStep-manual.pdf (2.3 MB)

Don't use the serial interface

Ah I see. An alternate approach, interesting. I suppose I could configure the drive through the laptop, then use a script to send step and dir commands, so should do the same thing I'm trying to do.

Before I abandon my current approach..... it also should have worked the way I set it up correct?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.