mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-18 09:29:03 +08:00
Merge pull request #635 from odriverobotics/endstop_fixes
Fix synchronization-related endstop bugs
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
# Unreleased Features
|
||||
Please add a note of your changes below this heading if you make a Pull Request.
|
||||
|
||||
* CANSimple messages which previously required the rtr bit to be set will now also respond if DLC = 0
|
||||
* Ensure endstops update before being checked for errors, to prevent [#625](https://github.com/odriverobotics/ODrive/issues/625)
|
||||
* Reset trajectory_done_ during homing to ensure a new trajectory is actually computed [#634](https://github.com/odriverobotics/ODrive/issues/634)
|
||||
* Use `input_xxx` as a DC offset in tuning mode
|
||||
|
||||
# Releases
|
||||
## [0.5.4] - 2021-10-12
|
||||
|
||||
|
||||
@@ -421,6 +421,10 @@ bool Axis::run_homing() {
|
||||
controller_.pos_setpoint_ = pos_estimate_local.value();
|
||||
controller_.vel_setpoint_ = 0.0f;
|
||||
controller_.input_pos_updated();
|
||||
|
||||
// Synchronization issue. Ensure trajectory_done is false prior to the while loop, so that
|
||||
// the controller has time to run move_to_pos() on the next update()
|
||||
controller_.trajectory_done_ = false;
|
||||
|
||||
while ((requested_state_ == AXIS_STATE_UNDEFINED) && motor_.is_armed_ && !(done = controller_.trajectory_done_)) {
|
||||
osDelay(1);
|
||||
|
||||
@@ -400,6 +400,13 @@ void ODrive::control_loop_cb(uint32_t timestamp) {
|
||||
odrv.oscilloscope_.update();
|
||||
}
|
||||
|
||||
for (auto& axis : axes) {
|
||||
MEASURE_TIME(axis.task_times_.endstop_update) {
|
||||
axis.min_endstop_.update();
|
||||
axis.max_endstop_.update();
|
||||
}
|
||||
}
|
||||
|
||||
MEASURE_TIME(task_times_.control_loop_checks) {
|
||||
for (auto& axis: axes) {
|
||||
// look for errors at axis level and also all subcomponents
|
||||
@@ -432,11 +439,6 @@ void ODrive::control_loop_cb(uint32_t timestamp) {
|
||||
MEASURE_TIME(axis.task_times_.sensorless_estimator_update)
|
||||
axis.sensorless_estimator_.update();
|
||||
|
||||
MEASURE_TIME(axis.task_times_.endstop_update) {
|
||||
axis.min_endstop_.update();
|
||||
axis.max_endstop_.update();
|
||||
}
|
||||
|
||||
MEASURE_TIME(axis.task_times_.controller_update)
|
||||
axis.controller_.update(); // uses position and velocity from encoder
|
||||
|
||||
|
||||
Reference in New Issue
Block a user