rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
telemetry_sim.c File Reference

The modelled pack, motor and propeller, see telemetry_sim.h. More...

#include "telemetry_sim.h"
#include <math.h>
#include <string.h>

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.

Detailed Description

The modelled pack, motor and propeller, see telemetry_sim.h.

SPDX-License-Identifier: MIT

Function Documentation

◆ telemetry_sim_init()

void telemetry_sim_init ( telemetry_sim_t * s,
const telemetry_sim_cfg_t * cfg )

Sets up the model from its configuration.

Parameters
sThe model to set up.
cfgThe configuration, or NULL for the default.

◆ telemetry_sim_step()

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.

Parameters
sThe model.
throttle_pctThe throttle, in percent.
dt_sThe time step, in s.
outReceives the readings.