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!



