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.
Just a very minor correction to the gyro scaling factor. All gyro drivers were using the hardcoded value of 16.4 msb/dps which is actually a rounded value of the true factor of 16.384 msb/dps. This value actually comes from the `abs(INT16)` range divided by the full scale. So 32768 / 2000. To be fair the Invensense gyro datasheets list this 16.4 rounded value so they're the cause of the mistake. Other manufacturers correctly list the scale as `(1 << 15) / 2000`.
The actual variance is trivial (about 0.1%) and only accounts for 2dps error at full scale so the situation is not dire. iThis variance is the reason we only see +-1998dps maximum rate in logging for example. But since we're already using a float for the scaling factor there's no reason not to use the more accurate value.
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