Help understanding Spindle controls
- Craig E
- Offline
- Senior Member
Less
More
- Posts: 75
- Thank you received: 2
17 May 2024 21:22 #300868
by Craig E
Help understanding Spindle controls was created by Craig E
If I am using Modbus to control my VFD what of the following Hal commands do I need and what can I delete?
Also am I missing anything?
#*******************
# SPINDLE
#*******************
setp pid.s.Pgain [SPINDLE_0]P
setp pid.s.Igain [SPINDLE_0]I
setp pid.s.Dgain [SPINDLE_0]D
setp pid.s.bias [SPINDLE_0]BIAS
setp pid.s.FF0 [SPINDLE_0]FF0
setp pid.s.FF1 [SPINDLE_0]FF1
setp pid.s.FF2 [SPINDLE_0]FF2
setp pid.s.deadband [SPINDLE_0]DEADBAND
setp pid.s.maxoutput [SPINDLE_0]MAX_OUTPUT
setp pid.s.error-previous-target true
net spindle-index-enable => pid.s.index-enable
net spindle-enable => pid.s.enable
net spindle-vel-cmd-rpm => pid.s.command
net spindle-vel-fb-rpm => pid.s.feedback
net spindle-output <= pid.s.output
# ---setup spindle control signals---
net spindle-vel-cmd-rps <= spindle.0.speed-out-rps
net spindle-vel-cmd-rps-abs <= spindle.0.speed-out-rps-abs
net spindle-vel-cmd-rpm <= spindle.0.speed-out
net spindle-vel-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-on <= spindle.0.on
net spindle-cw <= spindle.0.forward
net spindle-ccw <= spindle.0.reverse
net spindle-brake <= spindle.0.brake
net spindle-revs => spindle.0.revs
net spindle-at-speed => spindle.0.at-speed
net spindle-vel-fb-rps => spindle.0.speed-in
net spindle-index-enable <=> spindle.0.index-enable
# ---Setup spindle at speed signals---
sets spindle-at-speed true
Also am I missing anything?
#*******************
# SPINDLE
#*******************
setp pid.s.Pgain [SPINDLE_0]P
setp pid.s.Igain [SPINDLE_0]I
setp pid.s.Dgain [SPINDLE_0]D
setp pid.s.bias [SPINDLE_0]BIAS
setp pid.s.FF0 [SPINDLE_0]FF0
setp pid.s.FF1 [SPINDLE_0]FF1
setp pid.s.FF2 [SPINDLE_0]FF2
setp pid.s.deadband [SPINDLE_0]DEADBAND
setp pid.s.maxoutput [SPINDLE_0]MAX_OUTPUT
setp pid.s.error-previous-target true
net spindle-index-enable => pid.s.index-enable
net spindle-enable => pid.s.enable
net spindle-vel-cmd-rpm => pid.s.command
net spindle-vel-fb-rpm => pid.s.feedback
net spindle-output <= pid.s.output
# ---setup spindle control signals---
net spindle-vel-cmd-rps <= spindle.0.speed-out-rps
net spindle-vel-cmd-rps-abs <= spindle.0.speed-out-rps-abs
net spindle-vel-cmd-rpm <= spindle.0.speed-out
net spindle-vel-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-on <= spindle.0.on
net spindle-cw <= spindle.0.forward
net spindle-ccw <= spindle.0.reverse
net spindle-brake <= spindle.0.brake
net spindle-revs => spindle.0.revs
net spindle-at-speed => spindle.0.at-speed
net spindle-vel-fb-rps => spindle.0.speed-in
net spindle-index-enable <=> spindle.0.index-enable
# ---Setup spindle at speed signals---
sets spindle-at-speed true
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19437
- Thank you received: 6508
17 May 2024 21:28 #300870
by tommylight
Replied by tommylight on topic Help understanding Spindle controls
Pretty much all of those are needed, although it might work with probably half of those removed, but i would not remove anything.
The last line for setting the spindle at speed true might be changed (not deleted) only if you have encoder feedback to LinuxCNC for the spindle so LinuxCNC knows when the spindle reached the speed and sets it true.
The last line for setting the spindle at speed true might be changed (not deleted) only if you have encoder feedback to LinuxCNC for the spindle so LinuxCNC knows when the spindle reached the speed and sets it true.
Please Log in or Create an account to join the conversation.
- Craig E
- Offline
- Senior Member
Less
More
- Posts: 75
- Thank you received: 2
18 May 2024 19:48 #300932
by Craig E
Replied by Craig E on topic Help understanding Spindle controls
@tommylight Is there a way to determine if my version of LinuxCNC has the hy_gt_vfd component installed or how can I reinstall it?
I have tried everything that I can think of, and it errors out on "loadusr -W hy_gt_vfd -t 1 -d /dev/ttyUSB0 -p none -r 19200" line in me custom.hal file. If I use vfdmod it will communicate fine with my VFD but I can't get it to control it. I am pretty sure I have all the addresses correct and the VFD responds to me clicking the CW or CCW buttons The fan kicks on but no spindle movement. and no communication errors so I know my usb to RS485 is working.
am thinking if I could just get the hy_gt_vfd component to load I may be able to get this thing running again.
Of if there is no way to update the hy_gt_vfd component is there any way to send commands to the VFD to see if I can command the spindle on?
Here is my custom.hal commands.
loadusr -W hy_gt_vfd -t 1 -d /dev/ttyUSB0 -p none -r 19200
setp hy_gt_vfd.spindle-on 1
net spindle-vel-cmd-rpm => hy_gt_vfd.speed-cmd
net on spindle.0.on => hy_gt_vfd.spindle-on
net spindle-speed-fb => hy_gt_vfd.speed-fb
net spindle-at-speed <= hy_gt_vfd.at-speed
I have tried everything that I can think of, and it errors out on "loadusr -W hy_gt_vfd -t 1 -d /dev/ttyUSB0 -p none -r 19200" line in me custom.hal file. If I use vfdmod it will communicate fine with my VFD but I can't get it to control it. I am pretty sure I have all the addresses correct and the VFD responds to me clicking the CW or CCW buttons The fan kicks on but no spindle movement. and no communication errors so I know my usb to RS485 is working.
am thinking if I could just get the hy_gt_vfd component to load I may be able to get this thing running again.
Of if there is no way to update the hy_gt_vfd component is there any way to send commands to the VFD to see if I can command the spindle on?
Here is my custom.hal commands.
loadusr -W hy_gt_vfd -t 1 -d /dev/ttyUSB0 -p none -r 19200
setp hy_gt_vfd.spindle-on 1
net spindle-vel-cmd-rpm => hy_gt_vfd.speed-cmd
net on spindle.0.on => hy_gt_vfd.spindle-on
net spindle-speed-fb => hy_gt_vfd.speed-fb
net spindle-at-speed <= hy_gt_vfd.at-speed
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23160
- Thank you received: 4857
18 May 2024 20:43 #300938
by andypugh
Replied by andypugh on topic Help understanding Spindle controls
What is the exact error? Start Linuxcnc from the command line (with the command "linuxcnc" ) if you can't tell.
I suspect that the problem is more likely with /dev/tty/USB0 than with the hy_gt_vfd
If "man hy_gt_vfd" works to show the component docs, then it is installed.
ls /dev/tty* will show you what your modbus dongle is reporting as.
I suspect that the problem is more likely with /dev/tty/USB0 than with the hy_gt_vfd
If "man hy_gt_vfd" works to show the component docs, then it is installed.
ls /dev/tty* will show you what your modbus dongle is reporting as.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19437
- Thank you received: 6508
19 May 2024 00:02 #300945
by tommylight
Replied by tommylight on topic Help understanding Spindle controls
Also, is the VFD comms set fro 19200 baud, usually those are set at 9600.
Please Log in or Create an account to join the conversation.
- Craig E
- Offline
- Senior Member
Less
More
- Posts: 75
- Thank you received: 2
19 May 2024 21:50 #300975
by Craig E
Replied by Craig E on topic Help understanding Spindle controls
Thanks for the information on "man hy_gt_vfd" I was able to confirm that it is installed and found the real error message. It wanted more information. I had to add the max speed, max and min frequency and then it ran.
I am sure there is probably a better way to have done this, but This is what I did to make it work. in case anyone else get stuck here.
loadusr -W hy_gt_vfd -t 1 -d /dev/ttyUSB0 -p none -r 19200 -S 18000 -F 300 -f 5
The bad news was the results were the same as I had with vfdmod so both my VFD's are bad. What is a good brand that I can get a 240v 60hz 4KW in the US that is supported by LinuxCNC over modbus? The Haunyang rep said my voltage was higher than they expected but it is with in their specification of 220V +/- 15% I have had 2 Hy_GT that have not worked.
I am sure there is probably a better way to have done this, but This is what I did to make it work. in case anyone else get stuck here.
loadusr -W hy_gt_vfd -t 1 -d /dev/ttyUSB0 -p none -r 19200 -S 18000 -F 300 -f 5
The bad news was the results were the same as I had with vfdmod so both my VFD's are bad. What is a good brand that I can get a 240v 60hz 4KW in the US that is supported by LinuxCNC over modbus? The Haunyang rep said my voltage was higher than they expected but it is with in their specification of 220V +/- 15% I have had 2 Hy_GT that have not worked.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19437
- Thank you received: 6508
19 May 2024 23:32 #300979
by tommylight
Replied by tommylight on topic Help understanding Spindle controls
Why not use the analog control?
What controller board are you using?
Does it have spindle output and spindle encoder input?
What controller board are you using?
Does it have spindle output and spindle encoder input?
Please Log in or Create an account to join the conversation.
Time to create page: 0.078 seconds