How to use the spindle-cmd-rpm signal?
15 Nov 2017 14:36 #101832
by nicokid
How to use the spindle-cmd-rpm signal? was created by nicokid
Hi,
I'm playing with spindle speed and I would like to create a manual speed control in pyvcp and gladevcp.
Unfortunately if bypassing the spindle-cmd-rpm signal then the manual command from gladevcp works but mdi command stops working (eg M3 S20000).
That's what I did:
In my-mill.hal
net my-spindlespeed-mux => mux2.0.sel
net spindle-cmd-rpm => mux2.0.in1
net spindlespeed <= mux2.0.out => pwmgen.0.value
What I removed:
net spindle-cmd-rpm => pwmgen.0.value
In postgui.hal
net gvcp-spindlespeed <= gladevcp.scale_spindle_speed => mux2.0.in0
mux2.0.sel is always false and therefore spindle-cmd-rpm that is linked to in1 never works. I do not know how to set mux2.0.sel when I'm in mdi mode.
Any help?
Thanks, Nicola.
I'm playing with spindle speed and I would like to create a manual speed control in pyvcp and gladevcp.
Unfortunately if bypassing the spindle-cmd-rpm signal then the manual command from gladevcp works but mdi command stops working (eg M3 S20000).
That's what I did:
In my-mill.hal
net my-spindlespeed-mux => mux2.0.sel
net spindle-cmd-rpm => mux2.0.in1
net spindlespeed <= mux2.0.out => pwmgen.0.value
What I removed:
net spindle-cmd-rpm => pwmgen.0.value
In postgui.hal
net gvcp-spindlespeed <= gladevcp.scale_spindle_speed => mux2.0.in0
mux2.0.sel is always false and therefore spindle-cmd-rpm that is linked to in1 never works. I do not know how to set mux2.0.sel when I'm in mdi mode.
Any help?
Thanks, Nicola.
Please Log in or Create an account to join the conversation.
16 Nov 2017 04:55 #101876
by cmorley
Replied by cmorley on topic How to use the spindle-cmd-rpm signal?
you could use HALUI to select on MDI:
halui.mode.is-mdi
will be true on MDi.
But If your using gladevcp you could use a button to invoke an MDI command to start the spindle:
linuxcnc.org/docs/2.7/html/gui/gladevcp....mand_on_button_press
or use a button to invoke a python script to start the spindle:
linuxcnc.org/docs/2.7/html/gui/gladevcp....gladevcp:programming
It's more to learn in the beginning but really opens up what you can do.
Chris M
halui.mode.is-mdi
will be true on MDi.
But If your using gladevcp you could use a button to invoke an MDI command to start the spindle:
linuxcnc.org/docs/2.7/html/gui/gladevcp....mand_on_button_press
or use a button to invoke a python script to start the spindle:
linuxcnc.org/docs/2.7/html/gui/gladevcp....gladevcp:programming
It's more to learn in the beginning but really opens up what you can do.
Chris M
Please Log in or Create an account to join the conversation.
17 Nov 2017 09:16 #101920
by nicokid
Replied by nicokid on topic How to use the spindle-cmd-rpm signal?
Hello Chris, thanks for your reply.
net net my-spindlespeed-mux <= halui.mode.is-mdi => mux2.%d.sel
net spindle-cmd-rpm => mux2.0.in1
net spindlespeed <= mux2.0.out => pwmgen.0.value
This is fine if you do not load a file. But if I load a file, my slider (for set rpm speed) continues to have precedence over the M3 S20000 command. This is not fine.
I played a bit with python + gladevcp but I still have no great advantages over mdi_commands.
Thanks,
Nicola.
Great, this works:you could use HALUI to select on MDI:
halui.mode.is-mdi
will be true on MDi.
net net my-spindlespeed-mux <= halui.mode.is-mdi => mux2.%d.sel
net spindle-cmd-rpm => mux2.0.in1
net spindlespeed <= mux2.0.out => pwmgen.0.value
This is fine if you do not load a file. But if I load a file, my slider (for set rpm speed) continues to have precedence over the M3 S20000 command. This is not fine.
This is interesting but you always have to press a button not just move the slider. It is not very user friendly.But If your using gladevcp you could use a button to invoke an MDI command to start the spindle:
linuxcnc.org/docs/2.7/html/gui/gladevcp....mand_on_button_press
or use a button to invoke a python script to start the spindle:
linuxcnc.org/docs/2.7/html/gui/gladevcp....gladevcp:programming
It's more to learn in the beginning but really opens up what you can do.
Chris M
I played a bit with python + gladevcp but I still have no great advantages over mdi_commands.
Thanks,
Nicola.
Please Log in or Create an account to join the conversation.
17 Nov 2017 12:18 #101925
by cmorley
Replied by cmorley on topic How to use the spindle-cmd-rpm signal?
If you load a file linuxcnc switches to auto mode but AXIS may switch back to MDI - use the status program to see what mode is currently running. Then you can try to cobble together some logic to work around the problem.
You can use the slider to invoke a python script too.
With python code you can do almost anything - this is how Gmoccapy and Gscreen interact with linuxcnc.
They are essentially just a non-standardly loaded gladevcp panel.
You can use the slider to invoke a python script too.
With python code you can do almost anything - this is how Gmoccapy and Gscreen interact with linuxcnc.
They are essentially just a non-standardly loaded gladevcp panel.
Please Log in or Create an account to join the conversation.
20 Nov 2017 09:51 - 20 Nov 2017 09:52 #102052
by nicokid
I joined things together and it seems that the system works.
In my-mill.hal:
setp lut5.0.function 0x1
net my-spindlespeed-is-mdi <= halui.mode.is-mdi => lut5.0.in-0
net my-spindlespeed-is-auto <= halui.mode.is-auto => lut5.0.in-1
net my-spindlespeed-lut <= lut5.0.out => mux2.0.sel
net spindle-cmd-rpm => mux2.0.in0
net spindlespeed <= mux2.0.out => pwmgen.0.value
In postgui.hal:
net gvcp-spindlespeed <= gladevcp.scale_spindle_speed => mux2.0.in1
Thank you.
Nicola.
Replied by nicokid on topic How to use the spindle-cmd-rpm signal?
Another interesting pin...If you load a file linuxcnc switches to auto mode but AXIS may switch back to MDI - use the status program to see what mode is currently running. Then you can try to cobble together some logic to work around the problem.
I joined things together and it seems that the system works.
In my-mill.hal:
setp lut5.0.function 0x1
net my-spindlespeed-is-mdi <= halui.mode.is-mdi => lut5.0.in-0
net my-spindlespeed-is-auto <= halui.mode.is-auto => lut5.0.in-1
net my-spindlespeed-lut <= lut5.0.out => mux2.0.sel
net spindle-cmd-rpm => mux2.0.in0
net spindlespeed <= mux2.0.out => pwmgen.0.value
In postgui.hal:
net gvcp-spindlespeed <= gladevcp.scale_spindle_speed => mux2.0.in1
I like python. What worries me is having to handle hal pin both in hal files and in python scripts. Anyway, I'm sure I will try to play.You can use the slider to invoke a python script too.
With python code you can do almost anything - this is how Gmoccapy and Gscreen interact with linuxcnc.
They are essentially just a non-standardly loaded gladevcp panel.
Thank you.
Nicola.
Last edit: 20 Nov 2017 09:52 by nicokid.
Please Log in or Create an account to join the conversation.
24 Nov 2017 17:31 #102298
by andypugh
Replied by andypugh on topic How to use the spindle-cmd-rpm signal?
I have a better idea
Use motion.spindle-on to control the mux.
Use motion.spindle-on to control the mux.
Please Log in or Create an account to join the conversation.
11 Dec 2017 23:35 #102954
by nicokid
Replied by nicokid on topic How to use the spindle-cmd-rpm signal?
I'm not sure it's better:
If I use motion.spindle-on to control the mux (mux2.0.sel) I will always have the slider running also when I'm in auto mode.
if I understand what you mean...
Nicola.
If I use motion.spindle-on to control the mux (mux2.0.sel) I will always have the slider running also when I'm in auto mode.
if I understand what you mean...
Nicola.
Please Log in or Create an account to join the conversation.
Time to create page: 0.068 seconds