Controlling a stepper motor using Arduino Modbus

Hi @Mj2iu3wrdj ,

Did you check your Modbus settings on both sides?

This is the most common issue. The Arduino (acting as the Modbus Master) and the Motor Controller (Modbus Slave) must agree on the communication parameters.

  • Baud Rate: Must be identical (e.g., 9600, 19200, etc.). Check your motor controller’s manual for its default or configured rate.
  • Data Format: Must be identical (e.g., 8 data bits, No parity, 1 stop bit $\to$ 8N1).
  • Slave ID: The Modbus request you send from the Arduino must target the correct Slave ID (address) of the motor controller (e.g., 1, 2, etc.).

Also, RS-485 buses require termination resistors (120 ohms) at both ends of the bus line (i.e., near the master/Arduino and near the slave/motor controller).