yalang yl620 VFD rs485/modbus communicaiton

More
6 years 5 months ago #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:

Attachment IMG_20200519_195950.jpg 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.
Attachments:

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

More
6 years 5 months ago - 6 years 5 months ago #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)
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
Last edit: 6 years 5 months ago by aekhv.

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

More
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 or Create an account to join the conversation.

More
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
Attachments:

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

More
6 years 5 months ago #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
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.

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

Time to create page: 0.149 seconds
Powered by Kunena Forum