The function that checks for each motor having valid telemetry broke with the implementation of bitbang. Effectively the motor count was zero and this caused the logic to fall through with a false-positive. The check relied on a local motor count that was set when the PWM dshot was initialized. When bitbang is active this initialization no longer runs and the motor count was defaulting to zero. This was missed in the bitbang implementation.
Fixed to get the motor count from a common source initialized by both timer and bitbang dshot.
Also changed the logic to prevent a false-positive fallthrough if the motor count is zero (shouldn't happen).
The addition of previous checks of bidirectional DSHOT being enabled were not sufficient. Additionally RPM filter must also be active (harmonics > 0) for dynamic idle to determine the minimum motor RPM and function correctly.
Fixes a problem with dynamic idle not checking for bidirectional DSHOT being enabled. So the code would run but have no RPM data available leading to elevated motor idle.
Fixes a problem with dynamic idle not resetting accumulated static variables that continue to be used when dynamic idle is switched off via a PID profile change. Depending on the state of the variables this could cause excessive motor idle speed. In some cases enough to cause the quad to spontaneously take off on arming or be unable to descend in flight.
Fixes a problem with dynamic idle inappropriately modifying the static `motorOutputLow` that is set based on the chosen motor protocol. Downstream code that relies on this value to determine the acutal motor output range was adversely affected.
Motor and DSHOT refactoring broke blocking DSHOT commands as the check for commands being enabled was not taking into account that "blocking" type commands need to operate only when the motors are not enabled.
Fixes the CLI `dshotprog` command.
Most people who have tested IllusionFPV's expo on the dynamic D lowpass filter have found it to improve propwash without adverse effects.
It achieves this reducing D lowpass delay more quickly on throttling up.
This allows us to retain, at idle, the strong lowpass filtering we currently have, but quickly reduce lowpass delay and improve propwash by mid throttle.
A value of 5-7 is OK I'm proposing 5 as a conservative start.
I know this is a new feature but it is really good . It would be great if it could be made active by default, if possible, in 4.2.
Since tickerCharacters is a char pointer rather than a char array the
result is: sizeof(8) / sizeof(1).
However, desired
result is: sizeof(5) / sizeof(1).
See also following example:
const char *tickerCharacters = "|/-\\";
const char _tickerCharacters[] = "|/-\\";
int main(void)
{
printf("%zu\n", (sizeof(tickerCharacters) / sizeof(char)));
printf("%zu\n", (sizeof(_tickerCharacters) / sizeof(char)));
return 0;
}
> gcc test.c -o test && ./test
8
5
Now with the motor protocol defaulting to DISABLED we can reimplement this.
Remove dependence on gyro type and base on MCU type.
The previous logic was based on expecting an 8K sampling gyro and would set an inappropriate loop time for other gyro types.
Change the logic to be based on the capabilities of the MCU which is more appropriate. We set the pid_process_denom default to the maximum recommended value for a given MCU.
The `pid_process_denom` will be defaulted as follows (assuming a 8khz gyro) based on MCU type:
MCU `pid_process_denom`
F1: 8 (1khz)
F3: 4 (2khz)
F411: 2 (4khz)
Others: 1 (8khz)
Of course the final PID loop rate will be based on the native sample rate of the gyro.