Modbus spindle control using the Sunfar V350

Last modified by writer on 2022/10/14 18:55

You need next devises to control the spindle via Modbus:

  1. RS-485 adapter for connecting a frequency converter to a PC.
  2. Frequency converter (FC) with support for control via Modbus RTU.
  3. Expansion board for frequency converter: IOV-A102; IOV-D104; IOV-D105 (https://purelogic.ru/docs/elektronika/Plata_rasshireniya_dlya_SUNFAR_V350_V560_instruction_ru.pdf).

Modbus spindle control setting procedure

1. Set FC to the control mode using the Modbus RTU protocol (RS-485) and remember the COM port settings in FC (count of bits per second, data bits, parity and stop bits).

Function code

Value

Description

Enable spindle parameter control via ModBus

F0.0.02

1580

Password for access to change parameters. Entered through the operation panel.

F0.0.00 

0

Custom control profile.

F0.3.33

2

Control profile selection - via ModBus.

F0.2.25

17

Frequency reference using ModBus Field Set 2 register.

F3.0.00

18

Setting digital input №1 of the FC: setting the function Fu.0.17 (external equipment fault) - when the contact is closed to the inputs, the FC will smoothly stop.

ModBus connection settings

FA.0.00

1

Read only. It will display the currently selected control mode (ModBus).

FA0.01

03

Select the baud rate and packet format.
Least significant decimal place (baud rate kbit/s): 1 — 1200, 2 — 2400, 3 — 4800, 3 — 9600, 4 – 19200, 5 – 38400, 6 – 76800.
The next digit (number of stop bits and parity): 0 — 1N, 1 – 1E, 2 – 1O, 3 – 2N (N – none, e – Even, O – odd).
For example, 03 = no parity, one stop bit, 9600.

FA.0.02

1

Device address on the bus.

FA.0.03

10

Answer delay (ms).

FA.0.04

1000

Network failure detection time (ms). The frequency converter will stop the spindle and stop working after this time.

FA.0.05

0

Reaction to connection loss: 0 — spindle stop, 1 — continue executing the previous command.

Save settings

F0.0.08

2

 

2. Connect FC to the PC via the RS-485 adapter. You may need to install the driver for the RS-485 adapter for Windows.

3. Verify that the adapter in RS-485 was detected by the operating system. Use the Windows Device Manager for this.

image2019-11-5_17-13-40.png

4. Purchase the "MODBUS protocol support" option or activate a trial period for this option in the menu "Configuration" → "License Manager" → "Common".

5. Enable and configure Modbus in the menu "Configuration" → "Modbus Setup".

Create new Modbus-master. Number of COM port is RS-485 adapter number. The rest of the settings should be exactly the same as in the FC (in the screenshot, an example of a standard configuration of the COM port of Sunfar E500).

master.png

You need to add registers to control the FC and read statuses from FC. For example you need to configure registers named CtrlWord и FreqSet for Sunfar V350, also additional registers for diagnostics.

We recommend using exactly these names, since in the future, registers will be accessed from background operations by their names.

modbus.png

Success

Register numbers must be specified as decimal values.

Unknown macro: note. Click on this message for details.

6. Create new background operation (macro) through the macro manager.

The main task of the background macro is to monitor the current state and spindle speed and send the values to the frequency converter via Modbus.

An example of  background operation modbus_spindle_v350.bm for ModBus spindle control posted in attachment. This file must be added to background operations list.

Download background operation

Unknown macro: note. Click on this message for details.

7. Enable the background operation. Make sure that the operation has started and is working properly. This will be indicated by the green indicator to the right of the operation name.

2022-05-12 09_22_49-Управление макросами.png

The spindle should now turn on and off if everything is configured correctly. The spindle speed accordingly must also change at the FC when it changing in PUMOTIX.