yalang yl620 VFD rs485/modbus communicaiton

More
20 May 2020 02:45 #168339 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.
Attachments:

Please Log in or Create an account to join the conversation.

More
20 May 2020 10:27 - 20 May 2020 10:53 #168359 by aekhv
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 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
bit 5:4
  • b01:forward direction
  • b10:reverse direction
bit 7:6
  • 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
Last edit: 20 May 2020 10:53 by aekhv.

Please Log in or Create an account to join the conversation.

More
21 May 2020 04:17 #168465 by BryceJ
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 or Create an account to join the conversation.

More
21 May 2020 05:12 #168468 by BryceJ
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
Attachments:

Please Log in or Create an account to join the conversation.

More
21 May 2020 05:38 #168469 by aekhv
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.

Please Log in or Create an account to join the conversation.

More
24 May 2020 19:36 #168822 by BryceJ
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.

Please Log in or Create an account to join the conversation.

More
25 May 2020 00:35 #168841 by aekhv
An interesting info about YL620 and electrical noises: forum.linuxcnc.org/24-hal-components/341...2hal?start=20#153160

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.

More
31 Aug 2021 20:00 - 31 Aug 2021 20:20 #219281 by rounyworks
please help me i'm problem wih this vfd

 
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:
Last edit: 31 Aug 2021 20:20 by rounyworks.

Please Log in or Create an account to join the conversation.

More
02 Sep 2021 00:25 #219381 by andypugh
Are you sure that 9600 / N / 8 / 1 is correct for the VFD?

Please Log in or Create an account to join the conversation.

More
03 Sep 2021 00:17 #219475 by rounyworks
Yes this my VFD setting
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.

Time to create page: 0.121 seconds
Powered by Kunena Forum