Describe the bug
If the TCCx_PWM24bitDutySet function returns false, the thruster_set function will not retry or do anything about this. In this case, the thruster speed set seems to succeed, but will not have necessarily.
Tested Versions
v1
Impacted Versions
v1
Expected behaviorthruster_set should handle this function returning false by retrying the speed set (maybe with a small delay).
Additional context
This could explain an issue happening AquaPack Java code for using control board missing some speed sets in RAW mode. The testing scenario this occurred in:
Java code running on Orange Pi 4 LTS
Java code runs motors one after the other at a fixed speed for a fixed time
Before each motor is run, a TINV command is sent without waiting for ACK before sending the RAW command
Control Board v1 unit in use running Release build firmware
The theory is that TINV (triggering an apply_saved_speed) followed by a RAW command already in the buffer may happen fast enough that the PWM set function returns false.
This is consistent with the observations that introducing debug messages into thruster_set (debug build) makes this issue no longer occur compared to a release build without any such messages.
The missing of thruster speed sets did not occur every time nor did it occur consistently when it did happen.
This would also explain why the interface scripts work (they do not TINV before RAW so there are not two back to back speed sets happening in the firmware).
TLDR: (theory)
Computer:
Computer writes TINV (ack not waited for)
Computer writes RAW (probably at the same time as TINV written due to buffering)
Control board handles TINV causing a speed set of the saved raw mode target
Control board handles RAW immediately (already in buffer)
This causes a second speed set too fast and the pwm set function returns false (not handled)
Control board acknowledges speed set with no error
Computer is informed that speeds were set, but some thrusters may not respond sometimes.
Describe the bug If the
TCCx_PWM24bitDutySet
function returns false, thethruster_set
function will not retry or do anything about this. In this case, the thruster speed set seems to succeed, but will not have necessarily.Tested Versions v1
Impacted Versions v1
Expected behavior
thruster_set
should handle this function returning false by retrying the speed set (maybe with a small delay).Additional context
This could explain an issue happening AquaPack Java code for using control board missing some speed sets in RAW mode. The testing scenario this occurred in:
The theory is that TINV (triggering an apply_saved_speed) followed by a RAW command already in the buffer may happen fast enough that the PWM set function returns false.
This is consistent with the observations that introducing debug messages into
thruster_set
(debug build) makes this issue no longer occur compared to a release build without any such messages.The missing of thruster speed sets did not occur every time nor did it occur consistently when it did happen.
This would also explain why the interface scripts work (they do not TINV before RAW so there are not two back to back speed sets happening in the firmware).
TLDR: (theory)
Computer: