|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
A pack, a motor and a propeller, modelled, so every screen runs without a measurement front end. More...
#include "bench_state.h"Go to the source code of this file.
Data Structures | |
| struct | telemetry_sim_cfg_t |
| The configuration of the telemetry model: pack, motor and propeller. More... | |
| struct | telemetry_sim_t |
| The state of the telemetry model. More... | |
Macros | |
| #define | TELEMETRY_SIM_DEFAULT() |
Functions | |
| void | telemetry_sim_init (telemetry_sim_t *s, const telemetry_sim_cfg_t *cfg) |
| Sets up the model from its configuration. | |
| void | telemetry_sim_step (telemetry_sim_t *s, float throttle_pct, float dt_s, bench_state_t *out) |
Advance by dt_s at throttle_pct and fill out. | |
A pack, a motor and a propeller, modelled, so every screen runs without a measurement front end.
It runs on the panel, and only while no IOmcu answers: an IOmcu that is answering reports what it measures and leaves the rest empty, so a modelled number and a measured one never appear on the same screen.
Every value it produces carries LINK_BN_SIMULATED, and the router draws SIMULATION across the screen while that bit is set: a modelled number must not read as a measured one.
The model is crude: the bus sags under load, current grows faster than throttle (exponent 2.5), and rpm (revolutions per minute) follows the sagging bus rather than the stick.
SPDX-License-Identifier: MIT
| #define TELEMETRY_SIM_DEFAULT | ( | ) |
| void telemetry_sim_init | ( | telemetry_sim_t * | s, |
| const telemetry_sim_cfg_t * | cfg ) |
Sets up the model from its configuration.
| s | The model to set up. |
| cfg | The configuration, or NULL for the default. |
| void telemetry_sim_step | ( | telemetry_sim_t * | s, |
| float | throttle_pct, | ||
| float | dt_s, | ||
| bench_state_t * | out ) |
Advance by dt_s at throttle_pct and fill out.
Peaks are accumulated into out as the IOmcu accumulates them for the BENCH page, so the screen sees the same behaviour from both sources.
| s | The model. |
| throttle_pct | The throttle, in percent. |
| dt_s | The time step, in s. |
| out | Receives the readings. |