usb485 to huanyang vfd

More
30 Jul 2019 05:55 #140939 by tjones
Hi All,

I have been following the tutorial in the link below to get my VFD talking with Linuxcnc. I am able to load into Linuxcnc and home the machine. The custom panel shows up but I am unable to get my spindle to actually turn on. I suspect it has something to do with the spindle vfd enable. When I check the monitor in linuxcnc it says false and I haven't been able to figure out how to enable it. As I am pretty green to messing around in .hal and the way linuxcnc is configured. Can linuxcnc open if the usb is plugged in and nothing is plugged into the vfd? That may send me down the path of checking all my continuity...

wapl.es/cnc/2015/12/04/huanyang-linuxcnc-2.7-speed-control.html

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

More
More
30 Jul 2019 11:52 - 30 Jul 2019 11:53 #140947 by Hakan
Replied by Hakan on topic usb485 to huanyang vfd
If you just want to check that it works you can enter a line after the loadusr of the hy_vfd component
setp vfd.enable 1
if you named it "vfd" in the loadusr line

A better way is finally to connect it to perhaps motion.enabled
There is a signal motion.spindle-on that starts the spindle, but I think it is better to have the communication already going. It doesn't hurt to have the ocmmunication going all the time as far as I can see.

If the vfd is not communicating properly, you will get tons of errors, like crc warnings or timeouts. You can't miss it.

A first test to check the comms is easily done outside linuxcnc (don't start it) with these lines
halcmd loadusr -Wn spindle-vfd hy_vfd -n spindle-vfd -t 1 -d /dev/ttyUSB0 -p none -r 38400 -s 1
halcmd setp spindle-vfd.enable 1
halcmd show pin

You should see a TRUE on the hycomm_ok pin, then all is good. Use the actual parameters for your setup in the loadusr line
Last edit: 30 Jul 2019 11:53 by Hakan.

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

More
10 Aug 2019 16:10 #141869 by tjones
Replied by tjones on topic usb485 to huanyang vfd
Ok so I found a few issues. using -g in the loadusr line is a big help.

When using the -Wn command you shouldn't use the -n command. I was getting a double name error. To this point I was able to boot into Axis. After I changed this line I was unable to boot into axis and I was able to look at the debug file. A couple of the next errors I was able to clear up by double checking all the parameters in the VFD.

When I run the first line, halcmd loadusr... line It says, "waiting for component 'spindle-vfd' to become ready.

Is there timeout command I can add? when I go to open linuxcCNC it never opens because it is waiting for the 'spindle-vfd-' component to become ready. Then I have to open linuxcnc again to show an error message and then I am stuck in the loop again.

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

More
11 Aug 2019 05:36 - 11 Aug 2019 09:36 #141893 by Hakan
Replied by Hakan on topic usb485 to huanyang vfd
Those lines are from my running 2.8 (2.9 now?) system, they should be ok.

When you get messages from the loadusr line then it is something with the usb connection, the usb device or something along those lines. Make sure you use the right usb device name in the /dev/ttyUSBx and that it has the proper file protection to allow you to open it. Maybe something from "dmesg" can give a hint?

First when you give the "setp spindle-vfd.enable 1" command the device will start/try to communicate with the vfd. Before that it isn't doing that.

Here is what happens when I unplug the twisted pair cable to the vfd, the usb dongle is connected to the computer. The comm errors come at the enable point. The sleep is there just to show there are no errors from the loadusr line.
Attachments:
Last edit: 11 Aug 2019 09:36 by Hakan.

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

More
11 Aug 2019 17:53 #141923 by tjones
Replied by tjones on topic usb485 to huanyang vfd
Ok so I unplugged and plugged the USB converter into multiple USB ports and got USB0 everytime. Screen shot below of running the, dmesg | -i usb, command. I am not exactly sure what I am looking for in the dmesg file other then it tells me what that usb device is. I tried a different cable connected to the VFD as well. I have attached the hal files as well.




File Attachment:

File Name: custom.hal
File Size:1 KB

File Attachment:

File Name: custom_postgui.hal
File Size:0 KB

File Attachment:

File Name: Paul_CNC.hal
File Size:10 KB
Attachments:

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

More
11 Aug 2019 18:52 - 11 Aug 2019 18:53 #141925 by Hakan
Replied by Hakan on topic usb485 to huanyang vfd
Put that "-n spindle-vfd" back and see if things don't change.
Last edit: 11 Aug 2019 18:53 by Hakan.

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

More
12 Aug 2019 06:00 #141949 by pl7i92
Replied by pl7i92 on topic usb485 to huanyang vfd
make shure you/USER are in the dialup group
sudo adduser $USER dialout

otherwise you wont be able to communicate and the vfd is not bekomming ready

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

More
12 Aug 2019 06:08 - 12 Aug 2019 06:10 #141950 by Hakan
Replied by Hakan on topic usb485 to huanyang vfd
He is past that. The device opens just fine.
Last edit: 12 Aug 2019 06:10 by Hakan.

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

More
13 Aug 2019 17:31 #142053 by tjones
Replied by tjones on topic usb485 to huanyang vfd
I finally got it working! Looking back I think I can figure out why it wasn't working.

First I didn't have PD164 on the VFD set correctly. But I didn't catch this till after I was getting the double naming error. I think part of the reason for the error is running the, halcmd loadusr, then trying to run linuxcnc while it was still searching (I was only able to see that message by using the '-g' debug message in the loadusr line). Deleting the, '-n spindle-vfd' got ride of the double naming error. (Still a little confused why I need both '-Wn and -n lines in there. In the desrciption of -Wn it waits for the connect and names the device as well as '-n' names the device. ) Then I figured out the PD164 was set wrong and when I added the '-n spindle-vfd' line back in I was up and running. Also not sure if this had anything to do with it or not but I changed the communication speed to 9600.

Thanks for all the help Hakan!

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

Time to create page: 0.234 seconds
Powered by Kunena Forum