|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
What the automatic servo test reads and what it hands out: the supply's readings, the INA3221's windows and the encoder's readings it is fed, what it wants done, and the items of its outbox. A caller that feeds a run or carries its files to the card, and steps none, includes this alone, as servo_screen.h does; the engine is servo_test.h. More...
#include <stdbool.h>#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | servo_test_reading_t |
| One reading of the supply, as SUPPLY has it (supply_state_t). More... | |
| struct | servo_test_win_t |
| One 50ms window of INA3221 CH1, as the window ring carries it (sense_link_win_t). More... | |
| struct | servo_test_enc_sample_t |
| A kept reading. More... | |
| struct | servo_test_enc_t |
| One reading of the output encoder, as the SENSE page has it. More... | |
| struct | servo_test_do_t |
| What the run wants done, from servo_test_step(). More... | |
| struct | servo_test_in_t |
| What the caller knows each step. More... | |
Macros | |
| #define | SERVO_TEST_ENC_HIST 16u |
| Readings of the encoder kept for matching with the supply's rows. | |
| #define | SERVO_TEST_LINE_MAX 224u |
| The longest line a log row or a report line takes, terminator included: the CSV's header with the encoder's columns is 219 characters. | |
Enumerations | |
| enum | servo_test_out_t { SERVO_TEST_OUT_NONE = 0 , SERVO_TEST_OUT_OPEN , SERVO_TEST_OUT_CSV , SERVO_TEST_OUT_TXT , SERVO_TEST_OUT_END , SERVO_TEST_OUT_OPEN_TXT } |
Functions | |
| float | servo_test_enc_deg (uint16_t raw, uint16_t centre) |
raw from centre on the circle, degrees, -180 to just under 180: 360 / 4096 a count. The difference of any two counts the shortest way round. | |
| float | servo_test_enc_wrap (float deg) |
deg on the circle: -180 to just under 180. | |
What the automatic servo test reads and what it hands out: the supply's readings, the INA3221's windows and the encoder's readings it is fed, what it wants done, and the items of its outbox. A caller that feeds a run or carries its files to the card, and steps none, includes this alone, as servo_screen.h does; the engine is servo_test.h.
SPDX-License-Identifier: MIT
| #define SERVO_TEST_ENC_HIST 16u |
Readings of the encoder kept for matching with the supply's rows.
The panel has one about every 40ms, so 16 span 640ms: more than SERVO_TEST_ENC_STALE_MS.
| enum servo_test_out_t |
| float servo_test_enc_deg | ( | uint16_t | raw, |
| uint16_t | centre ) |
raw from centre on the circle, degrees, -180 to just under 180: 360 / 4096 a count. The difference of any two counts the shortest way round.
| raw | Encoder count, 0 to 4095. |
| centre | Centre count, 0 to 4095. |
| float servo_test_enc_wrap | ( | float | deg | ) |
deg on the circle: -180 to just under 180.
| deg | Angle, degrees. |