yalang yl620 VFD rs485/modbus communicaiton
I was able to get it in modbus mode with the manual:
And read some registers with pymodbus that looked right (read out some 4000 which is the 400.0hz I had it setup for) although it didn't seem too reliable, had to hit stop on the VDF to get it to take new commands. Could be asking for some registers didn't make it happy...
I asked the vendor for the modbus register doc, but they only had a chinese version. In this shared folder: drive.google.com/drive/folders/1Iao2n7WG...5ykyBUxC?usp=sharing
I don't know if I will get around to trying to write a driver or now yet... might just huanyang and move this one over to another piece of equipment. But I though I could at least leave the documents here if someone else wants to attempt it.
As I know Huanyang uses modified MODBUS protocol with non-standard function codes. According to datasheets your VFD looks like standard MODBUS RTU compatible.
With power of Google translator I see:
- Control register address is 0x2000
- Command frequency register is 0x2001
- Output frequency register is 0x200B
Control bits of control register are:
- b01:forward direction
- b10:reverse direction
- b01: reset one (is it fault reset???)
- b10: reset all (is it fault reset too???)
So control values should be:
- b000001 = 0x01 (stop)
- b010010 = 0x12 (run forward)
- b100010 = 0x22 (run reverse)
You can try vfdmod from that topic: forum.linuxcnc.org/24-hal-components/387...trol-over-modbus-rtu
Configuration file for your VFD is below (edit Common and RS485 groups according your settings)
[Common] MaxSpeedRPM=24000 MinSpeedRPM=3000 AtSpeedThreshold=0.05 [RS485] SlaveAddress=1 SerialDevice=/dev/rs485 BaudRate=19200 DataBits=8 Parity=N StopBits=1 [Control] Address=0x2000 RunForwardValue=0x0012 RunReverseValue=0x0022 StopValue=0x0001 [SpindleRpmIn] Address=0x2001 Multiplier=1 Divider=6 [SpindleRpmOut] Address=0x200B Multiplier=10 Divider=1
I did try and increase LoopDelay and ProtocolDelay but didn't have success yet.
Attached is the error log and ini
Try to decrease communication speed to 9600 baud, this may help.
As I see from log file communication starts normally, then errors are going, and then two last transactions (before LinuxCNC was closed) are fine again. What USB-to-RS485 converter do you use? I heard low-low-cost chinese adapters can cause errors. Something based on FT232RL chip should be good enough.
Even pulled off a ground to connect to a shielded cable to a ground on the VFD, and that didn't help
Another USB to rs232 to rs485 adapter I had seems to work better, but gets disconnected when the VFD starts up. Looks like to talk to one of these VFDs an isolated rs485 adapter is required.
BTW if you consider this VFD, dont!
If you have massive noise problems, you've been warned.
Schaffner FN2060-16-06 mains filter will help a lot (my DAB! radio works now) and ferrite bead(donut shaped ring) on rs485 line will stop your screen from going wonky.
I'm using this adapter (with other VFD, not a YL620), it works fine for me: aliexpress.ru/item/32811301007.html
Opening /dev/ttyUSB0 at 9600 bauds (N, 8, 1) vfdmod: reading 'spindle.rpm-out' from address 8203 (0x200B)... [0B][FE] Waiting for a confirmation... <01><83><03><01><31> ERROR Illegal data value vfdmod: setting command speed value to 500 (0x01F4)... [F4][D3][DD] Waiting for a confirmation... <01><86><03><02><61> ERROR Illegal data value