ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
Loading...
Searching...
No Matches
batt_state_t Struct Reference

published state More...

#include <battery.h>

Data Fields

uint8_t present
 a battery is connected

 
uint8_t cells
 0 = not known

 
uint8_t level
 PV2_BATT_OK / LOW / CRITICAL / EMERGENCY

 
uint8_t pct
 0…100

 
float vbat
 V, pack, filtered (τ 0.1 s)

 
float current
 A, filtered (τ 0.05 s); 0 without a sensor

 
float used_mah
 since power-on

 
float cell_v
 V, sagged, filtered (τ 0.5 s): failsafes, CHECKS.
 
float cell_rest_v
 V, sag compensated: state of charge

 
float r_cell
 Ω per cell, estimate

 
float soc
 0…1

 
float remain_s
 s of flight left, < 0 = n/a

 
float vbat_raw
 V, last sample, unfiltered (calibration)

 

Detailed Description

published state

Definition at line 51 of file battery.h.

Field Documentation

◆ present

uint8_t batt_state_t::present

a battery is connected

Definition at line 52 of file battery.h.

Referenced by batt_step(), and lost_battery().

◆ cells

uint8_t batt_state_t::cells

0 = not known

Definition at line 53 of file battery.h.

Referenced by batt_step(), lost_battery(), r_estimate(), and send_caps().

◆ level

uint8_t batt_state_t::level

PV2_BATT_OK / LOW / CRITICAL / EMERGENCY

Definition at line 54 of file battery.h.

Referenced by batt_step(), cal_from_v1(), and lost_battery().

◆ pct

uint8_t batt_state_t::pct

0…100

Definition at line 55 of file battery.h.

Referenced by batt_step(), and lost_battery().

◆ vbat

float batt_state_t::vbat

V, pack, filtered (τ 0.1 s)

Definition at line 56 of file battery.h.

Referenced by batt_step(), and cal_batt().

◆ current

float batt_state_t::current

A, filtered (τ 0.05 s); 0 without a sensor

Definition at line 57 of file battery.h.

Referenced by batt_step().

◆ used_mah

float batt_state_t::used_mah

since power-on

Definition at line 58 of file battery.h.

Referenced by batt_step().

◆ cell_v

float batt_state_t::cell_v

V, sagged, filtered (τ 0.5 s): failsafes, CHECKS.

Definition at line 59 of file battery.h.

Referenced by batt_step(), and lost_battery().

◆ cell_rest_v

float batt_state_t::cell_rest_v

V, sag compensated: state of charge

Definition at line 60 of file battery.h.

Referenced by batt_step(), and lost_battery().

◆ r_cell

float batt_state_t::r_cell

Ω per cell, estimate

Definition at line 61 of file battery.h.

Referenced by batt_init(), batt_step(), and r_estimate().

◆ soc

float batt_state_t::soc

0…1

Definition at line 62 of file battery.h.

Referenced by batt_step(), and lost_battery().

◆ remain_s

float batt_state_t::remain_s

s of flight left, < 0 = n/a

Definition at line 63 of file battery.h.

Referenced by batt_init(), batt_step(), and lost_battery().

◆ vbat_raw

float batt_state_t::vbat_raw

V, last sample, unfiltered (calibration)

Definition at line 64 of file battery.h.

Referenced by batt_step().


The documentation for this struct was generated from the following file: