Skip to content

Commit

Permalink
Updated changelog, made phase check beta current filtering not depend…
Browse files Browse the repository at this point in the history
… on control loop rate
  • Loading branch information
PAJohnson committed Dec 10, 2020
1 parent d4a03f4 commit 95d5df6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Unreleased Features
Please add a note of your changes below this heading if you make a Pull Request.
### Added
* Added phase balance check to motor calibration and MOTOR_ERROR_UNBALANCED_PHASES to error enums
* Added polarity and phase offset calibration for hall effect encoders
* [Mechanical brake support](docs/mechanical-brakes.md)
* Added periodic sending of encoder position on CAN
Expand Down
4 changes: 2 additions & 2 deletions Firmware/MotorControl/motor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct ResistanceMeasurementControlLaw : AlphaBetaFrameController {
if (Ialpha_beta.has_value()) {
actual_current_ = Ialpha_beta->first;
test_voltage_ += (kI * current_meas_period) * (target_current_ - actual_current_);
I_beta_ += kIBetaFilt * (Ialpha_beta->second - I_beta_);
I_beta_ += (kIBetaFilt * current_meas_period) * (Ialpha_beta->second - I_beta_);
} else {
actual_current_ = 0.0f;
test_voltage_ = 0.0f;
Expand Down Expand Up @@ -69,7 +69,7 @@ struct ResistanceMeasurementControlLaw : AlphaBetaFrameController {
}

const float kI = 1.0f; // [(V/s)/A]
const float kIBetaFilt = 0.01f;
const float kIBetaFilt = 80.0f;
float max_voltage_ = 0.0f;
float actual_current_ = 0.0f;
float target_current_ = 0.0f;
Expand Down

0 comments on commit 95d5df6

Please sign in to comment.