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 encoder index search #748

Open
wants to merge 6 commits 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
16 changes: 3 additions & 13 deletions .github/workflows/firmware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-latest]
board_version: [v3.6-56V]
debug: [true]

include:
- {os: ubuntu-latest, board_version: v3.2, debug: false}
- {os: ubuntu-latest, board_version: v3.3, debug: false}
- {os: ubuntu-latest, board_version: v3.4-24V, debug: false}
- {os: ubuntu-latest, board_version: v3.4-48V, debug: false}
- {os: ubuntu-latest, board_version: v3.5-24V, debug: false}
- {os: ubuntu-latest, board_version: v3.5-48V, debug: false}
- {os: ubuntu-latest, board_version: v3.6-24V, debug: false}
- {os: ubuntu-latest, board_version: v3.6-56V, debug: false}

debug: [false]

runs-on: ${{ matrix.os }}
outputs:
channel: ${{ steps.release-info.outputs.channel }}
Expand Down
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) && !(min_endstop_.config_.ignore_during_encoder_index_search && current_state_ == AXIS_STATE_ENCODER_INDEX_SEARCH)) {
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) && !(min_endstop_.config_.ignore_during_encoder_index_search && current_state_ == AXIS_STATE_ENCODER_INDEX_SEARCH)) {
error_ |= ERROR_MAX_ENDSTOP_PRESSED;
}

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

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

ODrive.MechanicalBrake:
Expand Down