huanyang vfd & linuxcnc 2.7

More
05 Feb 2016 20:40 #69666 by daninaustin
Thanks for this! There were a couple of errors on you directions for my version (loaduser rather than loadusr and some of the pins were incorrect), but this helped me tremendously. I can finally get my Spindle under control! Now i just have to figure out the servo's and encoders.

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

More
14 Feb 2016 00:00 #70089 by vre
Replied by vre on topic huanyang vfd & linuxcnc 2.7
I have linuxcnc 2.7.4 and installed hy_vfd from here github.com/bebro/linuxcnc-huanyang-vfd/tree/linuxcnc.
How can install hy_vfd version included with linuxcnc and not from external repository?

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

More
14 Feb 2016 03:02 - 14 Feb 2016 03:17 #70093 by cncnoob1979
vre,

Its already part of linuxcnc distribution. As a matter of fact I used your glade.panel for the VFD and your questions helped me install my system.

There are a few changes from the source code version vs the included version in linuxcnc, namely some pin names were change/removed (September 2015~)

Ill attach a copy of my configuration files so you can see them. When you created your hy_vfd from source did you then place it into you /bin directory?

Ill edit this post in a bit so I can post them from my machine.

EDIT: These should get you where you want to be. Im still in the process of finalizing my settings so there are some items commented out. But the VFD works well via MODBUS, well at least their version of it. Also with PD 165 I had to use 4 and even parity to connect. You can read it in my custom hal file.

Do take note that some pins were renamed and or removed in the distributed linuxcnc version of hy_vfd.


File Attachment:

File Name: bridgeport-2.hal
File Size:11 KB


File Attachment:

File Name: custom.hal
File Size:1 KB


File Attachment:

File Name: bridgeport-2.ini
File Size:4 KB


File Attachment:

File Name: huanyang.glade
File Size:17 KB


File Attachment:

File Name: custom_postgui.hal
File Size:2 KB
Last edit: 14 Feb 2016 03:17 by cncnoob1979.

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

More
14 Feb 2016 03:15 - 14 Feb 2016 03:15 #70095 by vre
Replied by vre on topic huanyang vfd & linuxcnc 2.7
solved!
I found the pins changed and updated my hal config & gladevcp panel.
here are the pins changed & removed
linuxcnc.org/docs/html/getting-started/u...c.html#_huanyang_vfd
thanks.
Last edit: 14 Feb 2016 03:15 by vre.

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

More
14 Apr 2021 23:26 #205950 by adr0
Replied by adr0 on topic huanyang vfd & linuxcnc 2.7
Hello all,
This is my first post. I feel a bit overwhelmed because this is not my field and i understand 15% of what i read.
I'm mechanical engineer and i have built my own 3 axis gantry from scratch. I thought CNCing it would be an easy task but i have lost half o my hair in the process.
Im sorry to sound that dumb, but there are tens of threads about problems connecting the huanyang vfd via rs485 and neither i understand nor none of them solves my problem.
I have a huanyang vfd 2.2kw, connected to my comp via a usb to rs485 dongle. I have tested it in windows using "spindle talker 2" working perfectly. In the "spindle talker 2" config it shows the parameters I set in the vfd panel "baud rate 9600" "data bits 8 parity none stop bits one" ModBus ID 1".
Back in Linux, I have installed Linuxcnc 2.7.14 in my harddrive. I have tried several tutorials/forum threads (marco reps, andypugh's explanations in tens of threads, James Waples website, etc) but i can't get it to work.
I open a terminal and type:
halrun
(if i type simply "loadusr hy_vfd" nothing happens
loadusr hy_vfd -d /dev/ttyUSB0 -p none -r 9600-s 1
show pins (and it shows every input and output)
setp hy_vfd.enable 1
After this last command it timeouts constantly.
(sorry I dont remember exactly what it says, my workshop is 30 mins away from my home and i don't have internet in my linux machine)
Im sorry to repeat again the same problem but i tryed everything i could before bothering anyone in the forum.
Thanks in advance

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

More
15 Apr 2021 12:22 #205997 by andypugh

I open a terminal and type:
halrun
(if i type simply "loadusr hy_vfd" nothing happens
loadusr hy_vfd -d /dev/ttyUSB0 -p none -r 9600-s 1
show pins (and it shows every input and output)
setp hy_vfd.enable 1
After this last command it timeouts constantly.


Is there any indication that it is working other than the timeouts? It might be that you just have to ignore them (they are not visible when the driver loads in the background as part of a LinuxCNC config)

Are you part of the linux "dialout" group? Type "groups" at the (normal Linux) command line to find out
linuxcnc.org/docs/2.8/html/man/man1/hy_vfd.1.html

Is the USB-Serial device definitely appearing as /dev/ttyUSB0? Try plugging and unplugging and using "ls /dev/tty*"

Do the VFD and the hy_vfd component agree on baud rate, parity, etc? I have a vague memory that my VFD ignored the parity setting, and I ended up setting hy_vfd to suit.

I use:
loadusr -Wn spindle-vfd hy_vfd -S 24000 -F 400 -n spindle-vfd -t 1 -d /dev/ttyUSB0 -p none -r 19200 -s 1 -g

Note that I am using 19200 baud, and both the VFD and the component need to be configured to the same.
The line above has some extra elements so that the hal pins are all called "spindle-vfd...." and so that the HAL file waits for the component to load.


(sorry I dont remember exactly what it says, my workshop is 30 mins away from my home and i don't have internet in my linux machine)

It might be worth bringing the VFD home to play with in comfort. It will fault-out without a motor, I imagine, but getting that fault back to HAL would be a start.

Is it definitely a "nornal" HY VFD and not the "GT" version, which uses a different HAL component (hy_gt_vfd)

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

More
15 Apr 2021 17:44 - 16 Apr 2021 20:56 #206027 by adr0
Replied by adr0 on topic huanyang vfd & linuxcnc 2.7
Thanks for replying!
I'm testing it right now.
I don't know what group i am part of (attach a pic "groups" showing what it sais"
Definitely my device is shown like ttyUSB0 (attach pic "tty devices")
I changed the vfd parameters to match your command line.
Pd164 changed to 2 (19200b/s)
Pd165 kept on 3 ( 8bit - none parity - 1stop)
My hy vfd is a "normal one" not gt.
I still get the same results when typing "setp vfd-spindle.enable 1" (attach pic "comm time out")


I think it's unable to read any parameter from the vfd. The only parameters that doesnt show "0" are "max-freq" and "rated-motor-rev" which were set manually.

I also attach a pic of the windows "spindle talker 2" config page before changing it to 19200 bauds.
Thanks so much for your help.
Last edit: 16 Apr 2021 20:56 by adr0.

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

More
16 Apr 2021 23:06 #206144 by adr0
Replied by adr0 on topic huanyang vfd & linuxcnc 2.7
I have been testing again today. I don't know whether im doing something wrong or my usb dongle is not compatible with my machine desktop.
I have tried successfully established communications with the vfd using "spindle talker 2" on windows on my laptop, cables connected + with + & - with -.
On linuxCNC is what is making me lose my will to live.
I successfully load the hy_vfd driver, but once i try to enable the communications with the vfd i get different results depending on the way i connect the cables between the usb dongle and the vfd.
Connecting the cables + with + & - with - :
read_setup: reading setup parameters: 

query_length = 6 
hycomm query = [01][02][03] [05] [9C][40][00] [BF] 
query_ret = 8 
response_length_computed = 8 
waiting for message (8 bytes)... 
WAIT DATA(): сomms time out 

ERROR Communication tine out (-12) 
read_setup: FAILED 
error reading setup from VFD, retrying

Connecting the cables + with - & - with + (opposite):
read_setup: reading setup parameters: 

query_length = 6
hуcomm querу = [01][02][03] [05][9C][40] [00] [BF] 
query_ret = 8 
response_length_computed = 8 
waiting for message (8 bytes)... 
read 6 byes: 0x0f 0x12 0x15 0х07 0x1f 0x01 
message was incomplete, length still to read = [02] 
WAIT DATА(): сomms time out 

ERROR Communication time out (-12) 
гead_setuр: FAILED 
error reading setup fгоm VFD, retrying

Weirdly, when i connect the cables in the opposite way, i receive some data back from the vfd?
I really don't know how to interpret this. I have triple checked that my settings in the vfd match with the command line i use to load the hy_vfd driver.
Does anyone know whats going on? Should i go with a rs232 to rs485 converter using the serial port instead?
Thanks in advance everyone!

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

More
16 Apr 2021 23:26 #206148 by andypugh
It's hard to guess what the problem is. It doesn't help that HY use their own quirky version of modbus.
Also, the net is full of fake HY drives, so all bets are off with those.

I use www.amazon.co.uk/gp/product/B082KKG55T and it works for me.

What is your other hardware? is +/- 10V control an option?

Dies the Windows Spindle Talker actually run the motor?
The following user(s) said Thank You: adr0

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

More
17 Apr 2021 00:10 #206151 by adr0
Replied by adr0 on topic huanyang vfd & linuxcnc 2.7
andy thanks for ur help.
I wouldn't know how to use other driver on linux, so using another driver was was ruled out beforehand :blush:
My first option was to use a "NVUM" motion controller with mach 3 on windows. It worked fine untill i tried to connect the vfd through the 0-10v input. It stopped working. I bought a second one on amazon, and when I started comanding the spindle, it stopped working too.
So now I am using a DB25-1205 breakout board i got with the motors kit i bought long ago and give linuxcnc a try.
I guess there is a way to "step-up" the 5v pwm signal from the breakout board to 10v, but i would be losing some features like the current load and the rpm feedback, and I'm afraid of "burning" my breakout board, the same way as the "nvum" boards stopped working once i connected the 0-10v
I will try with the amazon converter you are using.
I am "using" the average USB pen with green terminals.

And yes, the windows Spindle Talker runs the motor flawlessly.
I will post whatever progress i make.
Big thanks!

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

Time to create page: 0.180 seconds
Powered by Kunena Forum