Page 1 of 1

Preventing Motion after Feedhold Released

Posted: Mon Mar 04, 2019 5:34 am
by MattBlight
G'day Tom (or whomever cares to pitch in),

I'm trying to make my AutoToolChange Routine a bit more robust, and I've added some code that allows for a situation where you want to abort/pause a toolchange mid process. One of the issues which I would like to resolve is that if you hit feedhold part way through an approach move, it stops the motion as desired, and aborts the toolchange, however, if you then release feedhold it completes the move that was held (doesn't continue the rest of the toolchange, just that section of motion).

Is there any way to make it so that the code that aborts the toolchange script also aborts the motion - without having to "STOP" the machine and re-init & home etc.

Do I have to add a move to the the point at which it's at or something to cancel the currently stored destination?

Re: Preventing Motion after Feedhold Released

Posted: Mon Mar 04, 2019 4:57 pm
by TomKerekes
Hi MattBlight,

You can command the axis to stop with a Jog to 0 speed to clear any remaining motion waiting to be resumed. ie:
Jog(x, 0.0);

Alternately the feedhold can be cleared discarding any motion any of the axes are waiting to be resumed:
ClearStopImmediately(); // Clear Stop Condition without resuming

HTH

Re: Preventing Motion after Feedhold Released

Posted: Tue Mar 05, 2019 4:02 am
by MattBlight
Hi Tom,

Thanks for that.

My method for checking whether the machine is in a stopped state is checking "if (CS0_StoppingState != 0)". However, this morning a limit switch tripped, causing the machine to stop, but the toolchange script continued resulting in the tool being ejected from the spindle onto the deck. Is there another flag to check for the machine being stopped for some reason? Should the limit switch trip have caused the CS0_StoppingState to be not 0?

Cheers,

Matt

Re: Preventing Motion after Feedhold Released

Posted: Tue Mar 05, 2019 4:59 pm
by TomKerekes
Hi Matt,

You would have to tell us how you have your Limit Switch Options configured.

But you probably also want to check if any axis is disabled:

if (!ch0->Enable || !ch1->Enable || !ch2->Enable) ...