rs485 huanyang speed control

More
10 years 4 months ago #75830 by sw3Dp
rs485 huanyang speed control was created by sw3Dp
I'm trying to follow a method laid out in
by Marco Reps.

Using the custom Hal coding: loadusr -Wn vfd hy_vfd -n vfd -d /dev/ttyUSB0 -p none -r 9600, just generates errors as it can't load /dev/ttyUSB0 or any usb#. Can someone explain in basic terms what this line is doing and what it might look like on my machine, do I need hardware support for the r485? (using linuxcnc 2.7)

Anyone get a hal mod to work for rs485 spindle speed control?

... also is there code i can 'cut and paste' for a z touch plate routine?

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

More
10 years 4 months ago #75831 by andypugh
Replied by andypugh on topic rs485 huanyang speed control

sw3Dp wrote: Using the custom Hal coding: loadusr -Wn vfd hy_vfd -n vfd -d /dev/ttyUSB0 -p none -r 9600, just generates errors as it can't load /dev/ttyUSB0 or any usb#. Can someone explain in basic terms what this line is doing and what it might look like on my machine, do I need hardware support for the r485?


Yes, you need some sort of hardware support for RS485. What exactly do you have the VFD plugged in to?

The way that I worked out what my USB-to-RS485 dongle was was to open a terminal and type
Code:
ls /dev/tty*
Then I plugged in the USB dongle, repeated the command, and compared the two lists to see what the new device was.

In my case it was ttyUSB0

If your VFD is not connected to a USB-485 converter then the correct device will be different, but it will need to be one of the devices in /dev/

The meaning of the command is described in the hy_vfd manual page
linuxcnc.org/docs/2.7/html/man/man1/hy_vfd.1.html

The syntax of the loadusr command is here:
linuxcnc.org/docs/2.7/html/man/man1/halcmd.1.html

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

More
10 years 4 months ago #75835 by sw3Dp
Replied by sw3Dp on topic rs485 huanyang speed control
No eBay APP ID and/or Cert ID defined in Kunena configurationvfd 2.2kw and 2.2kw 24000 spindle motor, gecko g540, usb to r485 out to rs+ rs- on vfd. Used spindle talker2/windows and though the com port occasionally connected I get the error that "vfd is not responding". Not quiet there on understanding linux, usb port., does usb-rs485() needs additional drivers? I am finding more topics scattered in forum but rarely understand as there is an infinite variations of linuxcnc config possibilities. Could be the vfd settings?? it's configured with standard settings. Like tons of asian usb devices they almost make good connection sometimes but flexing the connection from the weight of the wires doesn't help.

... I have read all the hal and linux guides but little of it makes it to understanding so apologies if 'I can't get there from here.'

settings:
PD001=2
PD002=2
PD003=400
PD004=400
PD005=400
PD011=0
PD044=3
PD045=3
PD046=4
PD072=400
PD143=2
PD144=3000
PD163=1
PD164=1
PD165=3


what I would give to get pre-configured stable full house linuxcnc/linux image to start.

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

More
10 years 4 months ago #75838 by andypugh
Replied by andypugh on topic rs485 huanyang speed control
No eBay APP ID and/or Cert ID defined in Kunena configuration

sw3Dp wrote: does usb-rs485() needs additional drivers?


Not as far as I could tell. I used an identical thing and it just worked.

I got a bit elaborate, but only for aesthetic reasons:
forum.linuxcnc.org/forum/18-computer/306...485-connection#72351

The big question is do you see the dongle in /dev/ ?

For me it all "just worked". I plugged in the dongle, a new device appeared in /dev/ and I used that in the loadusr command and there was my VFD.

You do need to configure the VFD as defined in the hy_vfd manpage.

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

More
10 years 4 months ago - 10 years 4 months ago #75846 by sw3Dp
Replied by sw3Dp on topic rs485 huanyang speed control
yes, see the dongle /dev/ ttyUSB0

None of this makes sense fresh stepconf, my vfd settings match the hy_vfd listed settings with the exception of baud rate PD164=1 for 9600 as written in the custom hal, however I changed PD164=2 and it made no dif. Windows can see the dongle, /dev/ sees it but all linuxcnc gives me is the[strike] "cannot open com port errno 22."[/strike] Could it be the vfd failure to communicate or is this a dongle failure (ordered a couple to test). Shouldn't the custom hal load even if the vfd isn't powered?. Nothing more disheartening that hearing "all just worked" so something isn't working here, not the wiring just two connections, not settings, not code(loadusr -Wn vfd hy_vfd -n vfd -d /dev/ttyUSB0 -p none -r 9600)?, all I'm left with is fault with vfd or dongle I'm praying that it's the $4 dongle as this alternative is a nightmare.
Last edit: 10 years 4 months ago by sw3Dp.

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

More
10 years 4 months ago - 10 years 4 months ago #75848 by andypugh
Replied by andypugh on topic rs485 huanyang speed control
I am using a rather simpler "loadusr" line. Your version is trying to give the component and the pins different names. Mine is
Code:
loadusr -W hy_vfd -d /dev/ttyUSB0

Does your ttyUSB0 disappear when you unplug the dongle?

I am a bit puzzled by the error message you are getting, unless you have paraphrased it? The error message here is different:
github.com/LinuxCNC/linuxcnc/blob/master...g-vfd/hy_comm.c#L695

It might be worth turning on debug mode. In fact it is probably worth doing some testing in a terminal window to take everything else out of the system. Using the -g flag will give more info about what is going on.

Open a terminal window and type:
Code:
halrun loadusr -W -g hy_vfd -d /dev/ttyUSB0
If you don't get an error at this point, then things are looking good, and you can try
Code:
show pin setp hy_vfd.enable 1 setp hy_vfd.speed-command 600 setp hy_vfd.spindle-forward 1 setp hy_vfd.spindle-on 1
to see if comms starts to happen and the motor turns
Last edit: 10 years 4 months ago by andypugh.
The following user(s) said Thank You: jbar

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

Time to create page: 5.864 seconds
Powered by Kunena Forum