Got a working solution for detecting failed probes
This commit is contained in:
@@ -82,7 +82,7 @@ void seek_end() {
|
|||||||
if (!seek.active) return;
|
if (!seek.active) return;
|
||||||
|
|
||||||
if (!(SEEK_FOUND & seek.flags) && (SEEK_ERROR & seek.flags))
|
if (!(SEEK_FOUND & seek.flags) && (SEEK_ERROR & seek.flags))
|
||||||
estop_trigger(STAT_SEEK_NOT_FOUND);
|
STATUS_WARNING(STAT_SEEK_NOT_FOUND, "", 0);
|
||||||
|
|
||||||
if((seekMode == SW_STALL_0) || (seekMode == SW_STALL_1) || (seekMode ==SW_STALL_2) || (seekMode == SW_STALL_3))
|
if((seekMode == SW_STALL_0) || (seekMode == SW_STALL_1) || (seekMode ==SW_STALL_2) || (seekMode == SW_STALL_3))
|
||||||
disable_stall_microstep();
|
disable_stall_microstep();
|
||||||
|
|||||||
@@ -117,8 +117,10 @@ module.exports = new Vue({
|
|||||||
},
|
},
|
||||||
state: {
|
state: {
|
||||||
messages: [],
|
messages: [],
|
||||||
|
probing_active: false,
|
||||||
wait_for_probing_complete: false,
|
wait_for_probing_complete: false,
|
||||||
show_probe_complete_modal: false
|
show_probe_complete_modal: false,
|
||||||
|
show_probe_failed_modal: false
|
||||||
},
|
},
|
||||||
video_size: cookie.get('video-size', 'small'),
|
video_size: cookie.get('video-size', 'small'),
|
||||||
crosshair: cookie.get('crosshair', 'false') != 'false',
|
crosshair: cookie.get('crosshair', 'false') != 'false',
|
||||||
@@ -322,9 +324,6 @@ module.exports = new Vue({
|
|||||||
|
|
||||||
this.check_ip_address();
|
this.check_ip_address();
|
||||||
this.check_ssid();
|
this.check_ssid();
|
||||||
//.check_disk_space();
|
|
||||||
|
|
||||||
|
|
||||||
}.bind(this))
|
}.bind(this))
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -386,7 +385,12 @@ module.exports = new Vue({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ('log' in e.data) {
|
if ('log' in e.data) {
|
||||||
this.$broadcast('log', e.data.log);
|
if (this.state.probing_active && e.data.log.msg === "Switch not found") {
|
||||||
|
this.$broadcast('probing_failed');
|
||||||
|
} else {
|
||||||
|
this.$broadcast('log', JSON.stringify(e.data.log, null, 4));
|
||||||
|
}
|
||||||
|
|
||||||
delete e.data.log;
|
delete e.data.log;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -240,7 +240,18 @@ module.exports = {
|
|||||||
this.send('M70\nG91\nG0' + axis + value + '\nM72');
|
this.send('M70\nG91\nG0' + axis + value + '\nM72');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
probing_failed: function() {
|
||||||
|
Vue.set(this.state, "probing_active", false);
|
||||||
|
Vue.set(this.state, "wait_for_probing_complete", false);
|
||||||
|
Vue.set(this.state, "show_probe_complete_modal", false);
|
||||||
|
Vue.set(this.state, "goto_xy_zero_after_probe", false);
|
||||||
|
|
||||||
|
Vue.set(this.state, "show_probe_failed_modal", true);
|
||||||
|
},
|
||||||
|
|
||||||
probing_complete: function() {
|
probing_complete: function() {
|
||||||
|
Vue.set(this.state, "probing_active", false);
|
||||||
|
|
||||||
if (this.config.settings['probing-prompts']) {
|
if (this.config.settings['probing-prompts']) {
|
||||||
Vue.set(this.state, "show_probe_complete_modal", true);
|
Vue.set(this.state, "show_probe_complete_modal", true);
|
||||||
} else {
|
} else {
|
||||||
@@ -303,6 +314,10 @@ module.exports = {
|
|||||||
on_finish();
|
on_finish();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
hide_probe_failed_modal: function() {
|
||||||
|
Vue.set(this.state, "show_probe_failed_modal", false);
|
||||||
|
},
|
||||||
|
|
||||||
prep_and_show_tool_diameter_modal() {
|
prep_and_show_tool_diameter_modal() {
|
||||||
this.tool_diameter_for_prompt = (this.mach_units == 'METRIC')
|
this.tool_diameter_for_prompt = (this.mach_units == 'METRIC')
|
||||||
? this.tool_diameter
|
? this.tool_diameter
|
||||||
@@ -351,6 +366,7 @@ module.exports = {
|
|||||||
// Also, add zlift to compensate for the fact that we lift after probing Z
|
// Also, add zlift to compensate for the fact that we lift after probing Z
|
||||||
const plunge = Math.min(12.7, zoffset * 0.75) + zlift;
|
const plunge = Math.min(12.7, zoffset * 0.75) + zlift;
|
||||||
|
|
||||||
|
Vue.set(this.state, "probing_active", true);
|
||||||
Vue.set(this.state, "goto_xy_zero_after_probe", !zOnly);
|
Vue.set(this.state, "goto_xy_zero_after_probe", !zOnly);
|
||||||
|
|
||||||
if (zOnly) {
|
if (zOnly) {
|
||||||
|
|||||||
@@ -128,6 +128,18 @@ script#control-view-template(type="text/x-template")
|
|||||||
button.pure-button.button-success(@click=`$emit("finalize_probe")`)
|
button.pure-button.button-success(@click=`$emit("finalize_probe")`)
|
||||||
| Done
|
| Done
|
||||||
|
|
||||||
|
message(:show.sync=`state.show_probe_failed_modal`)
|
||||||
|
h3(slot="header") Probing failed!
|
||||||
|
|
||||||
|
div(slot="body")
|
||||||
|
.pure-form
|
||||||
|
p Could not find the probe block during probing!
|
||||||
|
p Make sure the bit is within 1" / 25.4mm of the probe block, and try again.
|
||||||
|
|
||||||
|
div(slot="footer")
|
||||||
|
button.pure-button.button-success(@click=`hide_probe_failed_modal()`)
|
||||||
|
| OK
|
||||||
|
|
||||||
table(style="table-layout: fixed; width: 100%;")
|
table(style="table-layout: fixed; width: 100%;")
|
||||||
tr(style="height: fit-content;")
|
tr(style="height: fit-content;")
|
||||||
td(style="white-space: nowrap; width: 410px;", rowspan="2")
|
td(style="white-space: nowrap; width: 410px;", rowspan="2")
|
||||||
|
|||||||
@@ -216,14 +216,16 @@ class Comm(object):
|
|||||||
self.log.warning('%s, data: %s', e, line)
|
self.log.warning('%s, data: %s', e, line)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if 'variables' in msg: self._update_vars(msg)
|
if 'variables' in msg:
|
||||||
elif 'msg' in msg: self._log_msg(msg)
|
self._update_vars(msg)
|
||||||
|
elif 'msg' in msg:
|
||||||
|
self._log_msg(msg)
|
||||||
|
self.ctrl.mach.process_log(msg)
|
||||||
elif 'firmware' in msg:
|
elif 'firmware' in msg:
|
||||||
self.log.info('AVR firmware rebooted')
|
self.log.info('AVR firmware rebooted')
|
||||||
self.connect()
|
self.connect()
|
||||||
|
else:
|
||||||
else: self._update_state(msg)
|
self._update_state(msg)
|
||||||
|
|
||||||
|
|
||||||
def estop(self):
|
def estop(self):
|
||||||
|
|||||||
@@ -132,6 +132,12 @@ class Mach(Comm):
|
|||||||
# if current == 'idle' or (cycle == 'jogging' and self._is_paused()):
|
# if current == 'idle' or (cycle == 'jogging' and self._is_paused()):
|
||||||
self._set_cycle(cycle)
|
self._set_cycle(cycle)
|
||||||
|
|
||||||
|
|
||||||
|
def process_log(self, log):
|
||||||
|
# Detect when a probe has failed, and reset the planner
|
||||||
|
if log['msg'] == 'Switch not found':
|
||||||
|
self.planner.reset(False)
|
||||||
|
|
||||||
|
|
||||||
def _update(self, update):
|
def _update(self, update):
|
||||||
# Detect motor faults
|
# Detect motor faults
|
||||||
@@ -145,7 +151,8 @@ class Mach(Comm):
|
|||||||
state = self._get_state()
|
state = self._get_state()
|
||||||
|
|
||||||
# Handle EStop
|
# Handle EStop
|
||||||
if state_changed and state == 'ESTOPPED': self.planner.reset(False)
|
if state_changed and state == 'ESTOPPED':
|
||||||
|
self.planner.reset(False)
|
||||||
|
|
||||||
# Exit cycle if state changed to READY
|
# Exit cycle if state changed to READY
|
||||||
if (state_changed and self._get_cycle() != 'idle' and
|
if (state_changed and self._get_cycle() != 'idle' and
|
||||||
@@ -161,7 +168,8 @@ class Mach(Comm):
|
|||||||
self.stopping = False
|
self.stopping = False
|
||||||
|
|
||||||
# Unpause sync
|
# Unpause sync
|
||||||
if state_changed and state != 'HOLDING': self.unpausing = False
|
if state_changed and state != 'HOLDING':
|
||||||
|
self.unpausing = False
|
||||||
|
|
||||||
# Entering HOLDING state
|
# Entering HOLDING state
|
||||||
if state_changed and state == 'HOLDING':
|
if state_changed and state == 'HOLDING':
|
||||||
|
|||||||
Reference in New Issue
Block a user