Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/emc/task/emctask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,11 @@ int emcTaskSetState(EMC_TASK_STATE state)
break;

case EMC_TASK_STATE::ESTOP_RESET:
// a machine that is on has no E-stop to reset; the abort below
// would only stop whatever it is doing
if (emcStatus->motion.traj.enabled && !emcStatus->io.aux.estop) {
break;
}
// reset the estop
emcAuxEstopOff();
emcCoolantFloodOff();//TODO: race here
Expand Down
3 changes: 3 additions & 0 deletions tests/abort/feed-rate/README
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ This test starts LinuxCNC, sets the feed rate (in G94 and G95), then
Aborts and verifies that the expected feed rate is active.

In 2.6.12 and 2.7.7 this test replicates Github Issue #180.

It then runs a move with the spindle and flood on, sends an E-stop reset,
and verifies that the move, the spindle and the flood keep going.
28 changes: 28 additions & 0 deletions tests/abort/feed-rate/test-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,33 @@ def wait_for_linuxcnc_startup(status, timeout=10.0):
print("feed rate:{}".format(s.settings[1]))
assert(math.fabs(s.settings[1] - feed_rate) < 0.0000001)


def wait_for(condition, timeout=10.0):
start_time = time.time()
while time.time() - start_time < timeout:
s.poll()
if condition():
return True
time.sleep(0.01)
return False


# An E-stop reset sent to a machine that is on leaves it alone, and does
# not run the abort that goes with leaving E-stop.
c.mdi('g20 g90 g94 m3 s1000 m8')
c.wait_complete()
c.mdi('g1 x3 f30')
assert wait_for(lambda: s.current_vel > 0), "the move did not start"
c.state(linuxcnc.STATE_ESTOP_RESET)
c.wait_complete()
s.poll()
x = s.position[0]
assert wait_for(lambda: s.position[0] > x + 0.1), "the reset stopped the move"
assert s.task_state == linuxcnc.STATE_ON, "the reset turned the machine off"
assert s.spindle[0]['enabled'], "the reset stopped the spindle"
assert s.flood, "the reset turned the flood off"
c.abort()
c.wait_complete()

sys.exit(0)

Loading