Skip to content

Commit

Permalink
check ACIM for skipping index requirement too
Browse files Browse the repository at this point in the history
  • Loading branch information
madcowswe committed Jan 8, 2021
1 parent 8dfd26f commit 78cc902
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Firmware/MotorControl/encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ void Encoder::update_pll_gains() {

void Encoder::check_pre_calibrated() {
// TODO: restoring config from python backup is fragile here (ACIM motor type must be set first)
if (!is_ready_ && axis_->motor_.config_.motor_type != Motor::MOTOR_TYPE_ACIM)
config_.pre_calibrated = false;
if (mode_ == MODE_INCREMENTAL && !index_found_)
config_.pre_calibrated = false;
if (axis_->motor_.config_.motor_type != Motor::MOTOR_TYPE_ACIM) {
if (!is_ready_)
config_.pre_calibrated = false;
if (mode_ == MODE_INCREMENTAL && !index_found_)
config_.pre_calibrated = false;
}
}

// Function that sets the current encoder count to a desired 32-bit value.
Expand Down

0 comments on commit 78cc902

Please sign in to comment.