- Posts: 476
- Thank you received: 0
Prevent spindle start if a certain tool is selected?
5 years 10 months ago #192187
by alkabal
Replied by alkabal on topic Prevent spindle start if a certain tool is selected?
For my own the question is now : what is the best way to do this ? (mostly because i'm afraid about adding too much latency)
Write a .comp including the whole hal logic for multiple probe management + prevent spindle starting + managed activation/deactivation for both input etc.
Include this in probe screen V python code
Do this in a full hal logic
???
Edit : related topic : forum.linuxcnc.org/38-general-linuxcnc-q...robe-inputs?start=10
Write a .comp including the whole hal logic for multiple probe management + prevent spindle starting + managed activation/deactivation for both input etc.
Include this in probe screen V python code
Do this in a full hal logic
???
Edit : related topic : forum.linuxcnc.org/38-general-linuxcnc-q...robe-inputs?start=10
Please Log in to join the conversation.
- tommylight
-
- Offline
- Administrator
-
Less
More
- Posts: 22010
- Thank you received: 3
5 years 10 months ago #192189
by tommylight
Replied by tommylight on topic Prevent spindle start if a certain tool is selected?
I would use hal or comp.
Please Log in to join the conversation.
5 years 10 months ago #192190
by alkabal
Replied by alkabal on topic Prevent spindle start if a certain tool is selected?
Thanks, did you see how to add this inside that :
Code:
net touch-probe-not-in <= motion.digital-out-01
net touch-probe-not-in => not.combined-probe-on.in
net touch-setter-not-in <= motion.digital-out-02
net touch-setter-not-in => not.combined-setter-on.in
# If this one is 0 and spindle or orient try to start then halui.abort (but i think this need only toggled and need to be inhibited in a normal probe use)
net touch-probe <= [HMOT](CARD0).7i76.0.0.input-14-not
# or if this is more easy If this one is 1 and spindle or orient try to start then halui.abort (but i think this need only toggled and need to be inhibited in a normal probe use)
net touch-probe <= [HMOT](CARD0).7i76.0.0.input-14
net touch-probe => and2.combined-probe.in0
net touch-probe-on-psng <= not.combined-probe-on.out #motion.digital-out-01
net touch-probe-on-psng => and2.combined-probe.in1;
net touch-probe-and2-psng <= and2.combined-probe.out
net touch-probe-and2-psng => or2.combined-touch.in0
net touch-setter <= [HMOT](CARD0).7i76.0.0.input-15
net touch-setter => and2.combined-setter.in0
net touch-setter-on-psng <= not.combined-setter-on.out #motion.digital-out-02
net touch-setter-on-psng => and2.combined-setter.in1
net touch-setter-and2-psng <= and2.combined-setter.out
net touch-setter-and2-psng => or2.combined-touch.in1
net touch-probe-combined <= or2.combined-touch.out
net touch-probe-combined => motion.probe-input
Please Log in to join the conversation.
5 years 10 months ago #192198
by alkabal
Replied by alkabal on topic Prevent spindle start if a certain tool is selected?
At the end i have add something in my orient.comp and in my spinload.comp
and that seem to work fine :
in my hal
# Check 3D Touch Probe input, if probe is connected cancel lock spindle for safety
Ps : now i need to found another workaround for preventing spindle orient homing or remove this stuff, (the process turn max 360° and very slow so this can be ok to keep this)
and that seem to work fine :
Code:
mot_cancel_by_probe = 0;
if (probe_is_connected && spindle_ena_in) {
mot_cancel_by_probe = 1;
return;
}
in my hal
# Check 3D Touch Probe input, if probe is connected cancel lock spindle for safety
Code:
net touch-probe <= [HMOT](CARD0).7i76.0.0.input-14-not
net touch-probe => CONNECTED TO YOUR REGULAR OUTPUT OR2 or direct to motion.probe-input
net touch-probe-inv-lock <= [HMOT](CARD0).7i76.0.0.input-14 # More easy and usable in .comp using 1 for probe connected
net touch-probe-inv-lock => spinload.manager.probe-is-connected
net touch-probe-lock-spindle <= spinload.manager.mot-cancel-by-probe
net touch-probe-lock-spindle => halui.mdi-command-28 # for send message to user
net touch-probe-lock-spindle => halui.abort
Ps : now i need to found another workaround for preventing spindle orient homing or remove this stuff, (the process turn max 360° and very slow so this can be ok to keep this)
Please Log in to join the conversation.
5 years 10 months ago #192211
by cmorley
To do this as you want (properly) would require remapping the spindle M codes (which I don't think you can currently) and probably HAL code to catch the manual control of the spindle. So I think currently can't be done.
But how about - setting the inhibit pin and using HAL code detecting the spindle on pin - if both are true then post an error message and possibly set abort.
Chris
Replied by cmorley on topic Prevent spindle start if a certain tool is selected?
alkabal wrote:
tommylight wrote:
I do not think the clasicladder is the way of doing this, hal is better in my opinion.BodybyBostonCream wrote: i'm actually trying to use spindle.0.inhibit right now in classicladder and the spindle is still coming on even with it set to true. I'm using a sim, though, so i'm not sure if that makes a difference.
Spindle has another pin that should be possible to use
spindle-on
and
motion.spindle-on
Pulling that down should disable spindle.
Well i think this is a possible dangerous way to do this using only bypass for spindle-on because if you now remove the probe the spindle start directly
motion.spindle-on is imo not the best option, for me the best is use halui.abort : machine stay on and ready for next things vs machine is like closed. (and if you try to send message to user after motion.spindle-on altering to 0 this not possible.
To do this as you want (properly) would require remapping the spindle M codes (which I don't think you can currently) and probably HAL code to catch the manual control of the spindle. So I think currently can't be done.
But how about - setting the inhibit pin and using HAL code detecting the spindle on pin - if both are true then post an error message and possibly set abort.
Chris
Please Log in to join the conversation.
5 years 10 months ago #192217
by alkabal
Replied by alkabal on topic Prevent spindle start if a certain tool is selected?
Well this is similar to what i have done in my comp file
Detecting if spindle-on is call or orient and if probe is connected cancel the whole operation using halui.abort
Using halui.abort is perfect for stop without locking machine
But if you see a full hall way i'm full curious
For my own the proposed code to use in a comp file work like a charm (except preventing spindle orient auto homing but i removed this for now, i need to think about how to include this in my orientv2.comp)
Detecting if spindle-on is call or orient and if probe is connected cancel the whole operation using halui.abort
Using halui.abort is perfect for stop without locking machine
But if you see a full hall way i'm full curious
For my own the proposed code to use in a comp file work like a charm (except preventing spindle orient auto homing but i removed this for now, i need to think about how to include this in my orientv2.comp)
Please Log in to join the conversation.
2 years 4 months ago #303155
by RotarySMP
Replied by RotarySMP on topic Prevent spindle start if a certain tool is selected?
Not sure if this is thread necro, but what if using a Haimer 3D probe rather than an electric touch probe integrated into LCNC? I cant use a probe sensor pin as the inhibit, as it is a purely mechanical probe.
To restate the original question, is there a way to inhibit the spindle based on a certain tool number from the tool table? I will make my Haimer probe tool number one, and reference all other tools from it's offsets.
Cheers,
Mark
To restate the original question, is there a way to inhibit the spindle based on a certain tool number from the tool table? I will make my Haimer probe tool number one, and reference all other tools from it's offsets.
Cheers,
Mark
Please Log in to join the conversation.
2 years 4 months ago #303156
by MaHa
Replied by MaHa on topic Prevent spindle start if a certain tool is selected?
I have this in the usercommand.py. It is working fine
Code:
#!/usr/bin/env python
prob_in_spindle = 0
def user_live_update():
global prob_in_spindle
#PROBE = T999 / T998
if s.tool_in_spindle == 998 or s.tool_in_spindle == 999:
prob_in_spindle = 1
hal.set_p('spindle.0.inhibit','1')
else:
if prob_in_spindle == 1:
prob_in_spindle = 0
hal.set_p('spindle.0.inhibit','0')
Please Log in to join the conversation.
2 years 4 months ago #303160
by RotarySMP
Replied by RotarySMP on topic Prevent spindle start if a certain tool is selected?
Oh that is good. Thanks. Why do you have two different probes in your tool table? What are you using?
So I just save this as usercommand.py? Where do I call the function user_live_update(): do I need to add something in the Ini, or is that a standard already built into LCNC?
Cheers,
Mark
So I just save this as usercommand.py? Where do I call the function user_live_update(): do I need to add something in the Ini, or is that a standard already built into LCNC?
Cheers,
Mark
Please Log in to join the conversation.
2 years 4 months ago #303163
by MaHa
Replied by MaHa on topic Prevent spindle start if a certain tool is selected?
Just now i realized you are using gmoccapy, but i am using axis. There you can use axis.rc or usercommand.py file to do some modification.It needs an entry in ini file, DISPLAY section.
I don't know if gmoccapy has this option also, or how to do it there. Maybe just try, or someone else knows about that.
The manual doesn't tell much
linuxcnc.org/docs/2.9/html/gui/gmoccapy.html#_user_command_file
I don't know if gmoccapy has this option also, or how to do it there. Maybe just try, or someone else knows about that.
The manual doesn't tell much
linuxcnc.org/docs/2.9/html/gui/gmoccapy.html#_user_command_file
Please Log in to join the conversation.
Time to create page: 0.129 seconds
