we had a long discussion on IRC yesterday on this theme
the gist was that accretion of possibly surprising features with limited
applicability in motion is undesirable
the state machine and offset pin approach I proposed yesterday are such a case
of feature accretion
the way out was suggested by Andy, which opens the path to programmable
behavior at the UI level with minimal motion changes (pretty much as the code
stands).
the key observations (and I hadnt thought of this admittedly) are:
- it is possible to track the state of activity during jog-while paused in a UI
or custom program *)
- during pause now jog commands can be issued from a UI or that custom program
as well; that was not possible before
- meaning it is now possible to activate an optional, customizable UI function
on pause, and do any of the following:
1. record positions - initial pause positions, and any further jog locations
2. as alternative to a direct reentry move from a offset location, previous jog
locations can be selected as 'goto', or replayed in reverse order
doing this in say Python in the UI not only adds flexibility, it does not
burden motion complexity with extra states and moves. If one absolutely has to
do an automatic move on pause, that is possible in the same scheme, but motion
changes are not needed.
I would think that gives the best feature mix: keyboard jog can be done pretty
much now, whereas more complex setups like record/replay are possible without
involving fiddling with motion internals, just plain Python is enough. I would
actually think this also works with wheel jogs just the same once that is added.
- Michael
*) Python example and program output to track jog positions during pause (not
necessary to understand in detail - just to show it isnt all that complicated):
import time
import sys
import linuxcnc
s = linuxcnc.stat()
s.poll()
previous_state = s.pause_state
names = ("RUNNING", "PAUSING", "PAUSED", "PAUSED_IN_OFFSET", "JOGGING",
"JOG_ABORTING", "RETURNING", "PAUSING_FOR_STEP")
while True:
s.poll() # get current status values
# detect changes in s.pause_state
if s.pause_state != previous_state:
print names[previous_state], "->",names[s.pause_state]
if s.pause_state == linuxcnc.PAUSED:
print "stopped at initial pause position:", s.actual_position
if s.pause_state == linuxcnc.PAUSED_IN_OFFSET:
print "stopped at offset:", s.actual_position
previous_state = s.pause_state
time.sleep(0.2)
-------
Example run:
Running this in parallel with Axis produces this (# = my remarks):
# reaction to pause button
RUNNING -> PAUSED
# motion has stopped, program detects that and displays initial pause position:
stopped at initial pause position: (-3.8268308818897636, 0.019685039370078188,
-10.157954787401579, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
# incremental jog 0.1in on X axis via keyboard:
PAUSED -> JOGGING
# motion has stopped, we're not at initial pause position anymore:
JOGGING -> PAUSED_IN_OFFSET
stopped at offset: (-3.7268308818897635, 0.019685039370078369,
-10.157954787401579, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
# incremental jog 0.1in on Z axis via keyboard:
PAUSED_IN_OFFSET -> JOGGING
# jog stopped:
JOGGING -> PAUSED_IN_OFFSET
stopped at offset: (-3.7268308818898732, 0.019685039370109226,
-10.05795548036826, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
# resume hit - automatic return to initial pause position begins:
PAUSED_IN_OFFSET -> RETURNING
# arrived at initial pause position - program execution resumes:
RETURNING -> RUNNING
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users