motor output scale
commitd63ba914c606e3361da9d2742a3c2aafdacf71b2
authorctzsnooze <chris.thompson@sydney.edu.au>
Sat, 7 Mar 2020 13:16:02 +0000 (8 00:16 +1100)
committermikeller <github@ike.ch>
Sun, 22 Mar 2020 04:15:08 +0000 (22 17:15 +1300)
tree7dbcc950986364c46ab465582c6dcb387eb473ce
parent9c3d4603b739e4f301ea422ab43472fff2ce6da7
motor output scale

First draft

Change method to percentage compensation

fast sag filter with fast battery updates

Renaming, moving factors to init where possible

Names changed, display update frequency reverted to 50hz as it was

50Hz ESC Voltage sampling, battery sag lowpass for PID compensation.

increment PG_PID_PROFILE, element added to end of batteryConfig_t

all HZ_TO_INTERVALs set back to 200 to match battery task frequency of 200hz.

Add a flag to control vbat comp

Flag vbat_sag_comp_enabled allows battery compensation to be enabled or
disabled from the CLI. When disabled the battery voltage task is run at
50Hz and the battery compensation code is not run. When enabled the
voltage task is run at 200Hz and the compensation code runs. Constants
for the fast and slow rates are added to tasks.h. The default value for
vbat_sag_compensation is changed to 100 as we no longer need to use it
to disable the feature.

Fixed variable task frequency setting.

Added config validation to disable sag compensation unless ADC is used as the voltage data source.

Added conditionals, fixed naming.

Fixed build.
12 files changed:
src/main/cli/settings.c
src/main/config/config.c
src/main/fc/tasks.c
src/main/flight/mixer.c
src/main/flight/pid.c
src/main/flight/pid.h
src/main/msp/msp.c
src/main/sensors/battery.c
src/main/sensors/battery.h
src/main/sensors/voltage.c
src/main/sensors/voltage.h
src/main/target/common_pre.h