Skip to content
Merged
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
8 changes: 8 additions & 0 deletions FluidNC/src/Probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ void Probe::group(Configuration::HandlerBase& handler) {
handler.item("toolsetter_pin", _toolsetterPin);
handler.item("check_mode_start", _check_mode_start);
handler.item("hard_stop", _hard_stop);
handler.item("probe_hard_limit", _probe_hard_limit); // non probing motion protection
}
void protocol_do_probe(void* arg) {
Probe* p = config->_probe;
Expand All @@ -50,5 +51,12 @@ void protocol_do_probe(void* arg) {
} else {
protocol_do_motion_cancel();
}
} else if (p->tripped() && p->_probe_hard_limit) {
// trip if in homing, cycle or jog, but not probing
if ((sys.state == State::Cycle || sys.state == State::Jog || sys.state == State::Homing) &&
(gc_state.modal.motion != Motion::ProbeAway && gc_state.modal.motion != Motion::ProbeAwayNoError &&
gc_state.modal.motion != Motion::ProbeToward && gc_state.modal.motion != Motion::ProbeTowardNoError)) {
mc_critical(ExecAlarm::ProbeHardLimit);
}
}
}
1 change: 1 addition & 0 deletions FluidNC/src/Probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Probe : public Configuration::Configurable {

public:
bool _hard_stop = false;
bool _probe_hard_limit = false;
// Configurable
bool _check_mode_start = true;
// _check_mode_start configures the position after a probing cycle
Expand Down
1 change: 1 addition & 0 deletions FluidNC/src/Protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const std::map<ExecAlarm, const char*> AlarmNames = {
{ ExecAlarm::Init, "Init" },
{ ExecAlarm::ExpanderReset, "Expander Reset" },
{ ExecAlarm::GCodeError, "GCode Error" },
{ ExecAlarm::ProbeHardLimit, "Probe Hard Limit" },
};

const char* alarmString(ExecAlarm alarmNumber) {
Expand Down
1 change: 1 addition & 0 deletions FluidNC/src/Protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ enum class ExecAlarm : uint8_t {
Init = 15,
ExpanderReset = 16,
GCodeError = 17,
ProbeHardLimit = 18,
};

extern volatile ExecAlarm lastAlarm;
Expand Down