Modbus spindle control using the Sunfar E500 and PLCM-B1-G2 expansion board
You will need a frequency converter (hereinafter referred to as the FC) with support for Modbus RTU control, such as Sunfar E500, to control the spindle via Modbus via the PLCM-B1-G2 expansion board.
Modbus spindle control setting procedure:
- 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).
Example for Sunfar E500.
Function code | Value | Description |
---|---|---|
F0.00 | 2 | Frequency reference source - external data transfer |
F0.02 | 0002 | Trigger channel selection - serial data port |
F4.00 | 0114 | Data transfer settings - speed selection: 9600 bps, parity check, Modbus data transfer protocol |
2. Connect FC to the PLCM-B1-G2 expansion board via RS-485 interface.
3. Purchase the "MODBUS protocol support" option or activate a trial period for this option in the menu "Configuration" → "License Manager" → "Common".
4. Enable and configure Modbus in the menu "Configuration" → "Modbus Setup".
Create new Modbus-master. Number of COM port is PLCM. 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).
You need to add registers to control the FC and read statuses from FC. For example you need to configure registers named SpindleMode, SpindleRPM and SpindleStatus.
Рекомендуем использовать именно эти названия, так как в дальнейшем к регистрам будет обращение из фоновых операций по их именам.
5. Создать новую фоновую операцию (макрос) через окно управления макросами.
Основная задача фонового макроса - отслеживать текущее состояние и обороты шпинделя и отправлять значения в частотный преобразователь по Modbus.
Пример фонового макроса modbus_spindle.bm для управления шпинделем по ModBus размещен во вложении. Данный файл нужно добавить в список фоновых операций.
6. Включить фоновую операцию. Убедиться, что операция стартовала и работает нормально. Об этом будет свидетельствовать зеленый индикатор справа от названия операции.
Если все настроено правильно, то шпиндель теперь должен включаться и выключаться. При изменении оборотов шпинделя в PUMOTIX они, соответственно, должны изменяться и на ЧП.