From 875a2bfe01329d5b0110edeb4c73cdbfd02dd5ff Mon Sep 17 00:00:00 2001 From: Luca Jost <47953330+l-jost@users.noreply.github.com> Date: Tue, 2 Apr 2024 20:48:32 +1300 Subject: [PATCH 1/3] Add pre-release flag --- flight_computer/platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 0603a8175361c6d40a8b6dc2217e5f805bcb7a50 Mon Sep 17 00:00:00 2001 From: Luca Jost <47953330+l-jost@users.noreply.github.com> Date: Tue, 2 Apr 2024 20:51:07 +1300 Subject: [PATCH 2/3] Extend servo operating range --- flight_computer/src/drivers/servo.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flight_computer/src/drivers/servo.cpp b/flight_computer/src/drivers/servo.cpp index cadbb5d7..25320b16 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.025 * depth); m_pwm_channel.SetDutyCycleTicks(output); } From 973ca15b2367a24f484c74fc6a7d0d21d8ba081c Mon Sep 17 00:00:00 2001 From: Luca Jost <47953330+l-jost@users.noreply.github.com> Date: Tue, 2 Apr 2024 20:51:07 +1300 Subject: [PATCH 3/3] Extend servo operating range --- flight_computer/src/drivers/servo.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); }