Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to ignore endstops during startup #747

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions Firmware/MotorControl/axis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ bool Axis::do_checks(uint32_t timestamp) {
motor_.do_checks(timestamp);

// Check for endstop presses
if (min_endstop_.config_.enabled && min_endstop_.rose() && !(current_state_ == AXIS_STATE_HOMING)) {
if (min_endstop_.config_.enabled && min_endstop_.rose() && !(current_state_ == AXIS_STATE_HOMING) && !(min_endstop_.config_.ignore_during_startup && current_state_ == AXIS_STATE_UNDEFINED)) {
error_ |= ERROR_MIN_ENDSTOP_PRESSED;
} else if (max_endstop_.config_.enabled && max_endstop_.rose() && !(current_state_ == AXIS_STATE_HOMING)) {
} else if (max_endstop_.config_.enabled && max_endstop_.rose() && !(current_state_ == AXIS_STATE_HOMING) && !(max_endstop_.config_.ignore_during_startup && current_state_ == AXIS_STATE_UNDEFINED)) {
error_ |= ERROR_MAX_ENDSTOP_PRESSED;
}

Expand Down
1 change: 1 addition & 0 deletions Firmware/MotorControl/endstop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Endstop {
uint16_t gpio_num = 0;
bool enabled = false;
bool is_active_high = false;
bool ignore_during_startup = false;

// custom setters
Endstop* parent = nullptr;
Expand Down
1 change: 1 addition & 0 deletions Firmware/odrive-interface.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1409,6 +1409,7 @@ interfaces:
enabled: {type: bool, c_setter: set_enabled}
offset: {type: float32, unit: turns}
is_active_high: bool
ignore_during_startup: bool
debounce_ms: {type: uint32, c_setter: set_debounce_ms}

ODrive.MechanicalBrake:
Expand Down