MB3hel / AUVControlBoard

Vectored 6-DOF motion controller for AUVs.
https://mb3hel.github.io/AUVControlBoard/
2 stars 2 forks source link

[BUG] Speed sets on v1 may fail silently #20

Closed MB3hel closed 1 year ago

MB3hel commented 1 year ago

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 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: