* optimize for code size.
* consolidate error message handling.
* replace similar error messages with identical ones.
* shorten all strings where possible.
* made less verbose.
This was required for the CC3D OPBL build.
Main rule logic and MSP commands ported from baseflight.
Gimbal mixer updated to use rules. This allows us to remove more
conditional logic. Operation of gimbal servos is now different.
...and apply them after a soft reset (which also required an additional
write to flash), it is now such that features and settings are modified
and stored in flash as before.
After initialisation completes, the active features are latched and are
not to be modified until the next startup. This guarantees that all
saved modifications are persistent even when power is switched of
(without a reset in between).
When a soft reset is required, the active features and the currently
configured features are used to detect if the oneshot feature has
changed state, in which case motor PWM outputs are stopped and soft
reset is done after a 1.5 second delay.
During normal operation the active features will not change and all
changes to features ordered via MSP commands or the CLI are applied to
the configuration that gets saved to flash.
The required effect of modifying features without changing the actions
in the running mainloop is achieved. The user needs to be aware that
changes to features are not applied immidiatly.
Maximum value of 500 is now removing the limit (same as for
yaw_jump_prevention_limit)
Moving defines for PID controllers to headerfiles.
Some general code cleanup.
Documentation update
Pull request #802 has by default disabled yaw jump. That is fine on the
most of the configurations, but one of my multirotors had an angled
motor due to crash and this was causing weird behaviour.
It is also possible to configure very low values, which can even cause a
craft to not be able to stop after yaw and I am talking about the values
below 100 like 1.
Anyway this fix provides only valid configurable values what can't cause
any danger. Also default parameter is not unlimited anymore and is
configured to 200, which is a safe value to anybody who does the
upgrade.
cli.md is also edited
configurations
The hardcoded limit in the mixer and PID controllers 3-5 would be
removed
by default and will be configurable by CLI variables:
yaw_jump_prevention_limit, global setting (original fixed value was 100)
yaw_p_limit, per profile setting (fixed value was 300)
and simply run the motors at constant minthrottle. This allowed the chance
for the quad to lose control during flight if the throttle was set to minimum,
say, to drop from a high altitude to a lower one.
With this edit, the quad will still self-level at minimum throttle when armed,
allowing for safe decents from altitude. To prevent motors spinning when
arming/disarming, the yaw input is ignored if the throttle is at minimum and
we're using the sticks to arm/disarm.
Conflicts:
src/main/flight/mixer.c
and simply run the motors at constant minthrottle. This allowed the chance
for the quad to lose control during flight if the throttle was set to minimum,
say, to drop from a high altitude to a lower one.
With this edit, the quad will still self-level at minimum throttle when armed,
allowing for safe decents from altitude. To prevent motors spinning when
arming/disarming, the yaw input is ignored if the throttle is at minimum and
we're using the sticks to arm/disarm.
Conflicts:
src/main/flight/mixer.c
added cli command disable_pid_at_min_throttle
(same as previous)
# The first commit's message is:
Previously, at minimum throttle, the quad would do absolutely no self-leveling
and simply run the motors at constant minthrottle. This allowed the chance
for the quad to lose control during flight if the throttle was set to minimum,
say, to drop from a high altitude to a lower one.
With this edit, the quad will still self-level at minimum throttle when armed,
allowing for safe decents from altitude. To prevent motors spinning when
arming/disarming, the yaw input is ignored if the throttle is at minimum and
we're using the sticks to arm/disarm.
Conflicts:
src/main/flight/mixer.c
# This is the 2nd commit message:
added cli command disable_pid_at_min_throttle
doesn't use potentially unitialised data to update the motors. Pause
for 50ms before rebooting after updating disabling the motors to ensure
the timer hardware and ESCs havea chance to react.
This commit might help with #123