diff --git a/flight_computer/platformio.ini b/flight_computer/platformio.ini index 17442e8f..e6a6ebbe 100644 --- a/flight_computer/platformio.ini +++ b/flight_computer/platformio.ini @@ -39,7 +39,7 @@ check_src_filters = build_unflags=-fno-rtti build_flags = - -D FIRMWARE_VERSION='"3.0.2"' + -D FIRMWARE_VERSION='"3.0.2-pre"' -D ARM_MATH_CM4 -D ARM_MATH_MATRIX_CHECK -D ARM_MATH_ROUNDING diff --git a/flight_computer/src/drivers/servo.cpp b/flight_computer/src/drivers/servo.cpp index cadbb5d7..a258d9f5 100644 --- a/flight_computer/src/drivers/servo.cpp +++ b/flight_computer/src/drivers/servo.cpp @@ -14,9 +14,9 @@ void Servo::SetPosition(uint16_t ticks) { // Get the output depth const auto depth = static_cast(m_pwm_channel.GetPwmDepth()); - // Servos operate between 4% and 11% duty cycle -> 7% usage of the pwm depth - const float32_t single_tick = (depth * 0.07F) / 1000.0F; - const auto output = static_cast(single_tick * static_cast(ticks) + 0.04F * depth); + // Servos operate between 2.5% and 12.5% duty cycle -> 10% usage of the pwm depth + const float32_t single_tick = (depth * 0.1F) / 1000.0F; + const auto output = static_cast(single_tick * static_cast(ticks) + 0.025F * depth); m_pwm_channel.SetDutyCycleTicks(output); }