Preventing Motion after Feedhold Released

Moderators: TomKerekes, dynomotion

Post Reply
MattBlight
Posts: 6
Joined: Mon Jan 07, 2019 12:05 pm

Preventing Motion after Feedhold Released

Post by MattBlight » Mon Mar 04, 2019 5:34 am

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?

User avatar
TomKerekes
Posts: 2677
Joined: Mon Dec 04, 2017 1:49 am

Re: Preventing Motion after Feedhold Released

Post by TomKerekes » Mon Mar 04, 2019 4:57 pm

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
Regards,

Tom Kerekes
Dynomotion, Inc.

MattBlight
Posts: 6
Joined: Mon Jan 07, 2019 12:05 pm

Re: Preventing Motion after Feedhold Released

Post by MattBlight » Tue Mar 05, 2019 4:02 am

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

User avatar
TomKerekes
Posts: 2677
Joined: Mon Dec 04, 2017 1:49 am

Re: Preventing Motion after Feedhold Released

Post by TomKerekes » Tue Mar 05, 2019 4:59 pm

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) ...
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply