Yalang yl620 VFD rs485/modbus communication VFDmod or ClassicLadder

23 Nov 2021 02:57 #227359 by mBender
Hi Forum,

I am working on the integration of the Yalang YL 620 VFD with RS485 Modbus and LinuxCNC.
I created 2 github repositories and will continue to work on those as time allows.


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

24 Nov 2021 02:47 #227469 by mBender
I think I'm done so far. I would suggest the integration with classic ladder. I think it's more versatile and allows you to use other modbus devices at the same time.

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

26 Aug 2023 08:16 - 26 Aug 2023 08:23 #278999 by handsomebeast
hey i followed your tutorial and managed to get the vfd running with an rs485 usb adapter in axis gui with classicladder, by using the spindle buttons or f11 f12 but the spindle pyvcp panel doesnt show that the rs485 is connected or the spindle at speed indicator and the guage doesnt move when i start the spindle, im glad i got it working with your help from github repo file but the problems i ran into were, in the readme it says to add this at the end of the ini file

loadrt classicladder_rt numS32out=100
addf classicladder.0.refresh servo-thread
loadusr classicladder --modmaster vfd.clp
net spindle-on classicladder.0.in-00 spindle.0.on
net spindle-brake classicladder.0.in-01 spindle.0.brake
net spindle-forward classicladder.0.in-02 spindle.0.forward
net spindle-reverse classicladder.0.in-03 spindle.0.reverse
net spindle-cmd-rpm <= spindle.0.speed-out
net spindle-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-cmd-rps <= spindle.0.speed-out-rps
net spindle-cmd-rps-abs <= spindle.0.speed-out-rps-abs classicladder.0.floatin-00

but it should be the end of the hal file without the "POSTGUI_HALFILE = vfd.hal" at the end, if you try running linuxcnc with it left in you get an error message, also to get the pyvcp to show in linuxcnc you have to put "PYVCP = vfd.xml" in the "DISPLAY" section of the ini file or it wont appear, does the " POSTGUI_HALFILE = vfd.hal" need to go somewhere else? and i used a waveshare usb to rs485 adapter that was showing up in my /dev/folder as ttyACM0, not ttyUSB* and in the config tab in classicladder there was to ttyACM0 option to select, so i edited the vfd.clp file and changed this line
"MODBUS_MASTER_SERIAL_PORT=/dev/ttyACM0" and when i went into the config it was set to /dev/ttyACM0
i dont know why im getting no feedback from the pyvcp panel, sorry for the rant and thanks for taking the time to post the github repo and tutorial up as without it id had just given up,
Last edit: 26 Aug 2023 08:23 by handsomebeast. Reason: spelling mistakes

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

03 Dec 2023 02:58 #287061 by mBender
Marc, thanks, I corrected the errors in the Readme of the classic ladder. If the vfd.hal file is not loaded correct, the output on the GUI will not work. I think that was your problem. It seems like you figured it out, at least if I look at the manual wiki.printnc.info/en/electronics/vfd/yl620a-rs485 which I believe is written by you as well.

FYI, I am not sure how LinuxCNC comes standard. You say in the manual above:

in the [HAL] section add “POSTGUI_HALFILE = vfd.hal” at the bottom

In my installation In the .ini file It calls this file
POSTGUI_HALFILE = postgui_call_list.hal
in this file i load the vfd.hal. I believe this might be a bit more to the LinuxCNC standard. Maybe the pros can talk about the cleaner way of doing this.


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

03 Dec 2023 03:00 #287062 by mBender
You mentioned that this adapter works good for you. Can you clarify which version you have/recommend?

FT232RL or CH343G


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

03 Dec 2023 04:39 #287066 by handsomebeast
Hey bender. I have thoroughly tested both adapters. I have both. In the tutorial I put in links and pictures of both and how I configured them. Only 8n1 19200 settings worked. And the ft232rl needs to be switched to 5v not 3v as 3v causes errors. As for the postguihal file. I only use 2.8.4 prompt RT kernel. Not tested any other version of kernel or linuxcnc. I think it loads hal components in order. Which is why my method worked on my version and kernel. Your method probably works on older or newer versions but I've not tested it.

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

03 Dec 2023 12:30 #287090 by mBender
I guess then I get the FT232rl version. Interesting that only the 8n1 19200 work for you. I tried all different settings and it worked for me, currently I run a higher speed since every now and then I can submit a package to the VFD, found out with higher speed I get a package faster through.

LinuxCNC loads the POSTGUI_HALFILE like it says Post GUI. Means, it starts the GUI first then it loads the Hal file. This is necessary because otherwise you would load a hal file and the Pins from the GUI would not be there. Your setup should work with other versions too.

The difference in your set up is that:
Your version:
POSTGUI_HALFILE loads directly the vfd.hal

in my set up:
POSTGUI_HALFILE loads the postgui_call_list.hal
postgui_call_list.hal loads the vfd.hal

I am not sure why there is a postgui_call_list.hal file. I am sure I did not create that, I guess it comes with the LinuxCNC Standard and probably the reason is it supports more then 1 hal file.

I am not sure if you can have multiple POSTGUI_HALFILES loaded directly from the machine hal.

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

Time to create page: 0.088 seconds
Powered by Kunena Forum