- Posts: 8
- Thank you received: 0
yalang yl620 VFD rs485/modbus communicaiton
6 years 5 months ago #168339
by BryceJ
yalang yl620 VFD rs485/modbus communicaiton was created by BryceJ
Thought I was getting a huanyang VFD, but it turned out it be a yalang yl620 that uses a different command set apparently. Anyone talk to one of those over modbus from LinuxCNC? The modbus pins are the JST-XH connector right above the FWD/REV terminal blocks. RS485+ RS485- and Common are the pins in the order of the following picture:
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.
Attachment not found
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 to join the conversation.
6 years 5 months ago #168359
by aekhv
Replied by aekhv on topic yalang yl620 VFD rs485/modbus communicaiton
Hi,
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 bits of control register are:
bit 1:0
So control values should be:
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)
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)
Code:
[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 to join the conversation.
6 years 5 months ago #168465
by BryceJ
Replied by BryceJ on topic yalang yl620 VFD rs485/modbus communicaiton
Thanks a lot aekhv! I'll give it a try here soon. Was just looking at your github for the vfdmod and it looks pretty interesting!
Please Log in to join the conversation.
6 years 5 months ago #168468
by BryceJ
Replied by BryceJ on topic yalang yl620 VFD rs485/modbus communicaiton
I got a chance to try it out quickly tonight. Partial success. If I hit the stop button on the VFD then start linuxcnc. A few commands go through, but then it appears to start erroring out.
I did try and increase LoopDelay and ProtocolDelay but didn't have success yet.
Attached is the error log and ini
I did try and increase LoopDelay and ProtocolDelay but didn't have success yet.
Attached is the error log and ini
Please Log in to join the conversation.
6 years 5 months ago #168469
by aekhv
Replied by aekhv on topic yalang yl620 VFD rs485/modbus communicaiton
BryceJ,
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.
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 to join the conversation.
6 years 5 months ago #168822
by BryceJ
Replied by BryceJ on topic yalang yl620 VFD rs485/modbus communicaiton
Hey Aekhv, I was able to get communication going. Turns out the rs485 on that vfd is full of noise. Took out one of the cheap rs485 sticks:
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.
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 to join the conversation.
6 years 5 months ago #168841
by aekhv
Replied by aekhv on topic yalang yl620 VFD rs485/modbus communicaiton
An interesting info about YL620 and electrical noises:
forum.linuxcnc.org/24-hal-components/341...2hal?start=20#153160
I'm using this adapter (with other VFD, not a YL620), it works fine for me: aliexpress.ru/item/32811301007.html
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 to join the conversation.
- rounyworks
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
5 years 1 month ago #219281
by rounyworks
Replied by rounyworks on topic yalang yl620 VFD rs485/modbus communicaiton
please help me i'm problem wih this vfd
Attachment not found
Code:
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
Please Log in to join the conversation.
5 years 1 month ago #219381
by andypugh
Replied by andypugh on topic yalang yl620 VFD rs485/modbus communicaiton
Are you sure that 9600 / N / 8 / 1 is correct for the VFD?
Please Log in to join the conversation.
- rounyworks
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
5 years 1 month ago #219475
by rounyworks
Replied by rounyworks on topic yalang yl620 VFD rs485/modbus communicaiton
Yes this my VFD setting
P00.01 = 3
P03.00 = 3
P03.01 = 1
P03.02 = 2
P07.08 = 5
P00.01 = 3
P03.00 = 3
P03.01 = 1
P03.02 = 2
P07.08 = 5
Please Log in to join the conversation.
Time to create page: 0.310 seconds
