RS485 Communication With Spindle VFD

Hi all,

I have a spindle VFD that is capable of using RS485 to start, stop, and control the speed of the spindle motor. Variable Frequency Drive : STEPPERONLINE CNC VFD 3.7KW 5HP ...

I have a RS485 to TTL converter and have no trouble wiring it up to the VFD, but I can't find the commands to get the VFD to do what I want (start, stop, adjust speed)

I imagine the commands would look something like this:

Serial.write(START); //start spindle motor
Serial.write(11453) // set spindle motor speed
Serial.write(STOP); //stop the spindle motor

But I can't seem to find anything official.

Is anyone able to help me?

Thanks, Zeb

ZebH:
… I can’t find the commands to get the VFD to do what I want (start, stop, adjust speed)

But I can’t seem to find anything official.

a quick internet search returned this datasheet:

Section 6.10 of the datasheet appears to have the command you are looking for.

hope that helps…

V70-3.7S2.pdf (1.19 MB)

Hi sherzaad,

Thanks for your help!

I don't understand what these commands mean and how I would translate them into code.

Would you be able to explain it to me?

Thanks very much, Zeb

The datasheet indicates that the VFD speaks the MODBUS protocol. It also indicates that the VFD supports MODBUS-RTU or MODBUS-ASCII depending on the configuration settings.

F163 sets the VFD device address on MODBUS.
F164 sets the baud rate
F165 sets whether it's None, Even or Odd parity and whether its MODBUS-RTU or MODBUS-ASCII

I'm guessing that you can alter these values using the front panel on the VFD.

However, the datasheet suggest that the factory default configuration is for V70 communication protocol (F169), rather than MODBUS.

You should be able to configure the VFD using F163, F164, F165 & F169 for MODBUS. I would suggest you went with MODBUS-ASCII as the communications are easier to see when monitoring the serial lines.

There are some examples of messages on page 71 of the datasheet.

Hi markd833,

Thanks for your help, that's really good. I'll use MODBUS-ASCII communication.

I have looked at page 71 of the datasheet but I still don't quite understand what the command is to start, stop, adjust speed.

Would it be possible for you to give me an example command?

Thanks very much, Zeb

My knowledge of motors and how to use a VFD is practically zero! I did Google "vfd modbus communication" and straight away got some YouTube videos on how to get started. Maybe they will help you with getting the motor running.

I have come across this code:

/*

   ModBus RTU control VFD

   Address               : 01H  (is the address of the VFD)
   Function              : 06H  (write function code)
   Starting data address : 20H
                         : 00H  (2000H  is the address of control command)
   Data(2Byte)           : 00H
                         : 01H  (0001H is forward command)
   CRC CHK Low           : 43H
   CRC CHK High          : CAH   (43CAH (is 16bits CRC check code)

*/

#include <SoftwareSerial.h>

#define SSerialRX        10  //Serial Receive pin
#define SSerialTX        11  //Serial Transmit pin

// From manual vfd Forward command = 01H 06H 2000H 0001H 43CAH

// From manual vfd Stop command = 01H 06H 2000H 0003H C20BH

byte request1[] = {0x01, 0x06, 0x20, 0x00, 0x00, 0x01, 0x43, 0xCA};

byte request2[] = {0x01, 0x06, 0x20, 0x00, 0x00, 0x03, 0x20, 0xCA};

SoftwareSerial RS485Serial(SSerialRX, SSerialTX); // RX, TX

void setup()
{
  // Start the built-in serial port, probably to Serial Monitor
  Serial.begin(9600);
  Serial.println("SerialRemote");  // Can be ignored

  RS485Serial.begin(9600);
}

void loop()
{
  RS485Serial.write(request1, sizeof(request1));
  delay(2000);
  RS485Serial.write(request2, sizeof(request2));
  delay(10000);
}

This should start and stop the spindle, but my question is how do I adjust the speed?

Thanks, Zeb

I think your best bet would be to find somebody with experience in VFD terminology as the datasheet for the device seems to have rather a lot of parameters relating to motors.

You may be lucky and find that VFD controllers all generally have the same MODBUS register layout. In which case you may find a PC program that can control the VFD to make it do what you want. If you get that far, then maybe you can observe the RS485 messages going between the PC and the VFD to figure out which ones you might need to control it from an Arduino.