yalang yl620 VFD rs485/modbus communicaiton
- BryceJ
- Topic Author
- Offline
- New Member
- Posts: 7
- Thank you received: 1
I was able to get it in modbus mode with the manual:
vancura.biz/files/Documents/CNC/YL620-A%20Setup%20table.pdf
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.
Please Log in or Create an account to join the conversation.
- aekhv
- Offline
- Senior Member
- Posts: 49
- Thank you received: 18
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:
bit 1:0
- b01:stop
- b10:run
- 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
Please Log in or Create an account to join the conversation.
- BryceJ
- Topic Author
- Offline
- New Member
- Posts: 7
- Thank you received: 1
Please Log in or Create an account to join the conversation.
- BryceJ
- Topic Author
- Offline
- New Member
- Posts: 7
- Thank you received: 1
I did try and increase LoopDelay and ProtocolDelay but didn't have success yet.
Attached is the error log and ini
Please Log in or Create an account to join the conversation.
- aekhv
- Offline
- Senior Member
- Posts: 49
- Thank you received: 18
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.
Please Log in or Create an account to join the conversation.
- BryceJ
- Topic Author
- Offline
- New Member
- Posts: 7
- Thank you received: 1
smile.amazon.com/JBtek-Converter-Adapter...6a-b325-4be35d7258cc
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.
Please Log in or Create an account to join the conversation.
- aekhv
- Offline
- Senior Member
- Posts: 49
- Thank you received: 18
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
Please Log in or Create an account to join the conversation.
- rounyworks
- Offline
- New Member
- Posts: 2
- Thank you received: 0
Opening /dev/ttyUSB0 at 9600 bauds (N, 8, 1)
vfdmod: reading 'spindle.rpm-out' from address 8203 (0x200B)...
[01][03][20][0B][00][01][FE][08]
Waiting for a confirmation...
<01><83><03><01><31>
ERROR Illegal data value
vfdmod: setting command speed value to 500 (0x01F4)...
[01][06][20][01][01][F4][D3][DD]
Waiting for a confirmation...
<01><86><03><02><61>
ERROR Illegal data value
Attachments:
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23310
- Thank you received: 4858
Please Log in or Create an account to join the conversation.
- rounyworks
- Offline
- New Member
- Posts: 2
- Thank you received: 0
P00.01 = 3
P03.00 = 3
P03.01 = 1
P03.02 = 2
P07.08 = 5
Please Log in or Create an account to join the conversation.