Prevent spindle start if a certain tool is selected?

More
16 Dec 2020 20:42 - 16 Dec 2020 20:44 #192187 by alkabal
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
Last edit: 16 Dec 2020 20:44 by alkabal.

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

More
16 Dec 2020 20:46 #192189 by tommylight
I would use hal or comp.

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

More
16 Dec 2020 20:54 - 16 Dec 2020 21:18 #192190 by alkabal
Thanks, did you see how to add this inside that :
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
Last edit: 16 Dec 2020 21:18 by alkabal.

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

More
16 Dec 2020 21:45 - 17 Dec 2020 02:44 #192198 by alkabal
At the end i have add something in my orient.comp and in my spinload.comp

and that seem to work fine :
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
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)
Last edit: 17 Dec 2020 02:44 by alkabal.

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

More
16 Dec 2020 23:49 #192211 by cmorley

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.

I do not think the clasicladder is the way of doing this, hal is better in my opinion.
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
The following user(s) said Thank You: tommylight, alkabal

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

More
17 Dec 2020 02:42 #192217 by alkabal
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)

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

More
17 Jun 2024 08:19 #303155 by RotarySMP
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

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

More
17 Jun 2024 08:34 - 17 Jun 2024 09:57 #303156 by MaHa
I have this in the usercommand.py. It is working fine


#!/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')
Last edit: 17 Jun 2024 09:57 by MaHa.
The following user(s) said Thank You: RotarySMP, Unlogic

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

More
17 Jun 2024 08:52 - 17 Jun 2024 09:33 #303160 by RotarySMP
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
Last edit: 17 Jun 2024 09:33 by RotarySMP.

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

More
17 Jun 2024 09:59 #303163 by MaHa
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
 

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

Time to create page: 0.168 seconds
Powered by Kunena Forum