PM2_Lib
Dependencies: LSM9DS1 RangeFinder FastPWM
Diff: SpeedController.cpp
- Revision:
- 9:583dbd17e0ba
- Parent:
- 6:41dd03654c44
- Child:
- 10:fe74e8909d3f
--- a/SpeedController.cpp Mon Apr 19 15:54:15 2021 +0000 +++ b/SpeedController.cpp Tue Aug 31 15:38:44 2021 +0000 @@ -4,8 +4,8 @@ const float SpeedController::TS = 0.001f; // period of 1 ms const float SpeedController::LOWPASS_FILTER_FREQUENCY = 100.0f; // given in [rad/s] -const float SpeedController::MIN_DUTY_CYCLE = 0.0f; // minimum duty-cycle -const float SpeedController::MAX_DUTY_CYCLE = 1.0f; // maximum duty-cycle +const float SpeedController::MIN_DUTY_CYCLE = 0.02f; // minimum duty-cycle +const float SpeedController::MAX_DUTY_CYCLE = 0.98f; // maximum duty-cycle SpeedController::SpeedController(float counts_per_turn, float kn, float max_voltage, FastPWM& pwm, EncoderCounter& encoderCounter) : pwm(pwm), encoderCounter(encoderCounter), thread(osPriorityHigh, 4096) {