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.

Time to create page: 0.096 seconds
Powered by Kunena Forum