* * Put PID variables into the structure
* Precalculate DTerm gyro filter outside the axis loop
* Removed unused variables PIDweight[3], airmodeWasActivated
* If zero throttle or gyro overflow, we can just set values and exit, this saves checks and jumps in axis loop
* Compute PIDSUM after the axis loop, this saves branching inside the loop because of Yaw has no D term
* * Incorporated review changes from DieHertz and fujin
* * Incorporated another review requests from DieHertz
- PidSum renamed to Sum
- pidData[3] redone to pidData[XYZ_AXIS_COUNT]
Previously only vbat_scale was exposed. Adds vbat_divider and vbat_multiplier parameters.
Note that all of these parameters only apply to the first voltage sensor (VOLTAGE_SENSOR_ADC_VBAT). There is the capability to have multiple sensors and those will not have their parameters exposed. Currently there are no target definitions that use multiple sensors.
Without this a target that didn't specifically specify brushed motors would initialize to Oneshot125 on a firmware reset and this signal is sufficient to act a as a PWM source for brushed motors making them spin on power up.
With the proliferation of some targets (REVO, OMNIBUS, etc.) there are now many brushed variants that are at risk.
Adds new throttle_limit_type and throttle_limit_percent parameters that allow the pilot to limit the maximum commanded throttle seen by the flight controller by either scaling or clipping the maximum throttle. The default is 100 representing no limiting. So as an example, if a pilot was to set throttle_limit_type = SCALE and throttle_limit_percent = 80 the throttle input would scale from 0 to 80% based on full stick deflection from the radio.
This capability replaces the method of limiting throttle in the radio which some pilots are using to manage throttle on tight courses or reduce overall battery consumption when the extra power isn't needed.
There is no effect on the maximum throttle seen by the motors so the mixer still has full authority.
Previous logic changes were causing the RX task to run every loop for PWM rx leading to 100% CPU load. Reverted PWM processing to be based on a time interval rather than whether new data is available. With PWM we can't differentiate when new data is available as it's a continuous stream.
Previously the flag was only set during arming so after crash flip mode was used the flag would stay active until the next arming. This caused the "CRASH FLIP" warning message to erroneously display on the OSD when disarmed.