Interlock with motion.motion-type?
To all, thank you so much for your help.
I have solved the issue with a logic based on motion-type + at-speed
driving motion.feed-hold.
Added an override pin linked to a gladevcp button allowing stopped
spindle when using a drag knife.
Here is my HAL component:
component spindle_security "Block non G0 motions when the spindle is not
running";
author "Frederic RIBLE";
pin in s32 motion_type;
pin in bit at_speed;
pin in bit override;
pin out bit feed_hold;
variable double old;
function _;
license "GPL"; // indicates GPL v2 or later
;;
FUNCTION(_) {
if (override) {
feed_hold = 0;
return;
}
switch (motion_type) {
case 0: //Idle (no motion)
case 1: //Traverse
case 4: //Tool change
case 5: //Probing
case 6: //Rotary axis indexing
feed_hold = 0;
break;
case 2: //Linear feed
case 3: //Arc feed
feed_hold = !at_speed;
break;
}
}
And associated HAL configuration:
loadrt spindle_security
addf spindle-security.0 servo-thread
net spindle-at-speed => spindle-security.0.at-speed
net feed-hold spindle-security.0.feed-hold => motion.feed-hold
net motion-type motion.motion-type => spindle-security.0.motion-type
net spindle-security-override spindle-security.0.override
Frederic
http://cnc.f1oat.org
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users