Problem connecting hy_vfd via RS485
- strahlensauger
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 195
- Thank you received: 65
23 Mar 2020 19:58 #161263
by strahlensauger
Problem connecting hy_vfd via RS485 was created by strahlensauger
I am setting up a cnc mill and connected it to Linuxcnc. I found solutions to all my Problems here in the forum,
but now I'm stuck.
Yesterday I tried to connect my vfd to an RS485USB Dongle and I could start the spindle with these commands
sudo chown 666 /dev/ttyUSB0
halrun
loadusr -Wn hy_vfd hy_vfd -n hy_vfd -d /dev/ttyUSB0 -p none -r 19200 -s 1
show pin
setp hy_vfd.enable 1
setp hy_vfd.speed-command 12000
setp hy_vfd.spindle-forward 1
setp hy_vfd.spindle-on 1
I put in some commands in my hal file to start the spindle, but it didn't want to do a single turn.
I thought that I didn't have enough rights and copied the config files to the root account and
started the spindle via the above halrun commands with root rights and it worked, but linuxnc didn't start with a
"Refusing to run as root without fallback UID specified". So I logged back into my user account trying to
start the spindle again via halrun, but now it even starts there, giving back a:
open: Permission denied
ERROR Can't open the device /dev/ttyUSB0 (errno 13)
hy_vfd: ERROR: couldn't open serial device
<stdin>:3: waitpid failed hy_vfd hy_vfd
<stdin>:3: hy_vfd exited without becoming ready
halcmd: Note: Using POSIX realtime
a su does turn the spindle.
Linuxcnc doesn't start anymore, the serial /dev/ttyUSB0 could not be opened.
I would really appreciate it if somebody could give me a hint.
Thanks
but now I'm stuck.
Yesterday I tried to connect my vfd to an RS485USB Dongle and I could start the spindle with these commands
sudo chown 666 /dev/ttyUSB0
halrun
loadusr -Wn hy_vfd hy_vfd -n hy_vfd -d /dev/ttyUSB0 -p none -r 19200 -s 1
show pin
setp hy_vfd.enable 1
setp hy_vfd.speed-command 12000
setp hy_vfd.spindle-forward 1
setp hy_vfd.spindle-on 1
I put in some commands in my hal file to start the spindle, but it didn't want to do a single turn.
I thought that I didn't have enough rights and copied the config files to the root account and
started the spindle via the above halrun commands with root rights and it worked, but linuxnc didn't start with a
"Refusing to run as root without fallback UID specified". So I logged back into my user account trying to
start the spindle again via halrun, but now it even starts there, giving back a:
open: Permission denied
ERROR Can't open the device /dev/ttyUSB0 (errno 13)
hy_vfd: ERROR: couldn't open serial device
<stdin>:3: waitpid failed hy_vfd hy_vfd
<stdin>:3: hy_vfd exited without becoming ready
halcmd: Note: Using POSIX realtime
a su does turn the spindle.
Linuxcnc doesn't start anymore, the serial /dev/ttyUSB0 could not be opened.
I would really appreciate it if somebody could give me a hint.
Thanks
Attachment not found
Attachment not found
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19213
- Thank you received: 6438
23 Mar 2020 20:03 #161264
by tommylight
Replied by tommylight on topic Problem connecting hy_vfd via RS485
Not sure, but search for arduino usb permission denied, there is a line that add the user to the dialout group.
Please Log in or Create an account to join the conversation.
- strahlensauger
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 195
- Thank you received: 65
23 Mar 2020 20:19 #161270
by strahlensauger
Replied by strahlensauger on topic Problem connecting hy_vfd via RS485
That was quick and it worked as the halrun is concerned, thanks a lot.
Still the problem that the spindle doesn't turn in the linuxcnc Gui.
Still the problem that the spindle doesn't turn in the linuxcnc Gui.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19213
- Thank you received: 6438
23 Mar 2020 20:26 #161272
by tommylight
Replied by tommylight on topic Problem connecting hy_vfd via RS485
Oh good, that was just a stab in the dark, from the time i built something with an arduino.
The following user(s) said Thank You: strahlensauger
Please Log in or Create an account to join the conversation.
23 Mar 2020 20:27 - 23 Mar 2020 20:28 #161273
by MovT
Replied by MovT on topic Problem connecting hy_vfd via RS485
Do you have made a udev rule for the USB device? Can halp but must not.
Last edit: 23 Mar 2020 20:28 by MovT.
The following user(s) said Thank You: strahlensauger
Please Log in or Create an account to join the conversation.
- strahlensauger
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 195
- Thank you received: 65
23 Mar 2020 23:14 #161297
by strahlensauger
Replied by strahlensauger on topic Problem connecting hy_vfd via RS485
It seems the dialout group was the Problem. Now I can start at least the spindle.
It still doesn't react to M3 or M5, but I think I have to configure that in the hal file.
It still doesn't react to M3 or M5, but I think I have to configure that in the hal file.
Please Log in or Create an account to join the conversation.
- strahlensauger
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 195
- Thank you received: 65
26 Mar 2020 20:23 #161612
by strahlensauger
Replied by strahlensauger on topic Problem connecting hy_vfd via RS485
Now the spindle is working almost as I wish.
There is still one thing I didn't find out.
The speed goes from 11520 reverse to 11520 forward.
Is there a possibility to go to 24000? I think the Huanyang spindle can
do that.
The manual is quite technical for a non-engineer...
There is still one thing I didn't find out.
The speed goes from 11520 reverse to 11520 forward.
Is there a possibility to go to 24000? I think the Huanyang spindle can
do that.
The manual is quite technical for a non-engineer...
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19213
- Thank you received: 6438
26 Mar 2020 22:26 #161620
by tommylight
Replied by tommylight on topic Problem connecting hy_vfd via RS485
Attach hal and ini files.
Please Log in or Create an account to join the conversation.
- strahlensauger
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 195
- Thank you received: 65
26 Mar 2020 22:53 #161625
by strahlensauger
Replied by strahlensauger on topic Problem connecting hy_vfd via RS485
Here they are
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19213
- Thank you received: 6438
26 Mar 2020 23:02 #161627
by tommylight
Replied by tommylight on topic Problem connecting hy_vfd via RS485
I could not notice anything wrong regarding spindle, you could just replace the 5000 values with 24000 so you get better scaling, but it looks like that is not being used here.
Please Log in or Create an account to join the conversation.
Time to create page: 0.089 seconds