[Home]Jog-While-Paused

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

Showing revision 1

Jog-while-pause changes to motion

what it is

An enhancement to the motion pause handling to:

 axes, not joints)
continue the auto run
 replay it for return (could be done in HAL or Python)

the intent is to provide a stopgap solution to the 'pause, jog away, clean swarf, continue' issue to provide the basis for other scenarios

what it doesnt provide:

daughter's kinect etc. All it does is provide the HAL hooks to provide these features, but it doesnt do so by itself. This is experimental, and needs some shakeout. Until then, some HAL plumbing is needed, it isnt yet clear to me how jogging in coordinated mode fits in the overall picture.

and forcing the issue would have some serious side effects.

jog-while-paused is not visible - it all looks like a loooong pause. This modification assures that at resume happens at the point where where 'pause' was hit.

  the current 'pause' capabilities. 

How to try it out

Pull http://git.mah.priv.at/gitweb/emc2-dev.git/shortlog/refs/heads/jog-while-paused-preview1 and build

 cd configs/sim/axis 
 linuxcnc jog-while-pause9.ini

execute, hit pause somewhere press 'pause-offset-enable' change some offset press 'pause-offset-enable' again press 'step' to return to pause point press 'pause' again to continue

Integration notes

I assume here you want to build a jog-while-paused support component, for instance for an MPG. I use 'IPP' to mean the 'inital pause position', which is the pose where the pause request was honored and state changed from running to paused.

Status pins:

request was honored. pins would result in a move not violating machine

Control pins:

Pause, Resume and Step:

next chance (EMC_TASK_PLAN_PAUSE NML message). causes transition to the running state (EMC_TASK_PLAN_RESUME NML message). paused in the initial pause position. If not in the initial pause position, it triggers a return move. (EMC_TASK_PLAN_STEP NML message).

HAL flows:

move starts, state changes to 4 (jogging) progress stops immediately. motion.in-position becomes true. pause-offset-* will be honored by a corresponding linear move immediately. halui.program.resume, halui.program.step

Python notes:

for recording/replaying jog history: to determine the current pause point, use the linuxcnc module and query linuxcnc.stat.position when state is 1 or 2. Some example supporting code can be found in configs/sim/axis/gladevcp-jwp.py .

Changes in behaviour:

The DRO values for velocity, and distance-to-go are set to zero during a pause, and thereafter reflect velocity and DTG of the jog moves. On resume the velocity and DTG values of the initial paused move are restored.

Programming notes

The basic approach is to employ an alternate motion queue - on pause, motion control is switched to the alternate queue, and arbitrary moves can be executed. Switchback to the primary motion queue happens on 'resume'; if the current pose doesnt match where execution was paused, a linear move to the pause point is executed. Then primary motion queue execution continues as before.

WRT pause, the externally significant change is that 'paused' isnt just an emcmotStatus flag anymore, but the state of the pause FSM (see enum pause_state in mot_priv.h). Any state other than 'not paused' is nonzero which is compatible with current task assumptions.

The semantics of 'step' are now such that if paused on the inital pause position, a return move to the initial pause position is executed. That seemed the most logical step to me.

While this implementation relies on the current pause behavior, the underlying mechanism could be used to for more advanced backout strategies, like retracting during a threading move.


LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions | View current revision
Edited April 30, 2012 12:54 am by MichaelHaberler (diff)
Search:
Published under a Creative Commons License