1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 01:05:27 +03:00

Changed float parameters to int16 in 'cli.c'.

Fixed buffer length used for 'ftoa'.

Got rid of magic numbers, replaced 'digitalIdlePercent' with 'digitalIdleValue'.
This commit is contained in:
Michael Keller 2017-03-30 12:12:20 +13:00
parent ce8c5fbd79
commit 9c29475ba4
16 changed files with 77 additions and 120 deletions

View file

@ -24,8 +24,8 @@
#define PID_CONTROLLER_BETAFLIGHT 1
#define PID_MIXER_SCALING 1000.0f
#define PID_SERVO_MIXER_SCALING 0.7f
#define PIDSUM_LIMIT 0.5f
#define PIDSUM_LIMIT_YAW 0.4f
#define PIDSUM_LIMIT 500
#define PIDSUM_LIMIT_YAW 400
// Scaling factors for Pids for better tunable range in configurator for betaflight pid controller. The scaling is based on legacy pid controller or previous float
#define PTERM_SCALE 0.032029f
@ -68,8 +68,8 @@ typedef struct pidProfile_s {
uint16_t dterm_notch_hz; // Biquad dterm notch hz
uint16_t dterm_notch_cutoff; // Biquad dterm notch low cutoff
uint8_t itermWindupPointPercent; // Experimental ITerm windup threshold, percent motor saturation
float pidSumLimit;
float pidSumLimitYaw;
uint16_t pidSumLimit;
uint16_t pidSumLimitYaw;
uint8_t dterm_average_count; // Configurable delta count for dterm
uint8_t vbatPidCompensation; // Scale PIDsum to battery voltage
uint8_t pidAtMinThrottle; // Disable/Enable pids on zero throttle. Normally even without airmode P and D would be active.
@ -78,11 +78,11 @@ typedef struct pidProfile_s {
// Betaflight PID controller parameters
uint16_t itermThrottleThreshold; // max allowed throttle delta before iterm accelerated in ms
float itermAcceleratorGain; // Iterm Accelerator Gain when itermThrottlethreshold is hit
uint16_t itermAcceleratorGain; // Iterm Accelerator Gain when itermThrottlethreshold is hit
uint8_t setpointRelaxRatio; // Setpoint weight relaxation effect
uint8_t dtermSetpointWeight; // Setpoint weight for Dterm (0= measurement, 1= full error, 1 > agressive derivative)
float yawRateAccelLimit; // yaw accel limiter for deg/sec/ms
float rateAccelLimit; // accel limiter roll/pitch deg/sec/ms
uint16_t yawRateAccelLimit; // yaw accel limiter for deg/sec/ms
uint16_t rateAccelLimit; // accel limiter roll/pitch deg/sec/ms
} pidProfile_t;
#if FLASH_SIZE <= 128