Alt hold expo #1119

Merged
merged 6 commits into from Mar 8, 2014

2 participants

@peabody124

KipK was asking for more aggressive control in altitude hold mode. This PR does two changes towards that goal:

  1. The stick input is not treated with an exponential when outside the dead band (which is still hardcoded at the inner 10% like previously).
  2. Behaves like axis lock mode in terms of transitioning from a position to rate controller when you are requesting much change.

This also has another implicit change. When using this there is no longer the song and dance to enter vario mode as there was previously. It seemed like not many people liked that. If you do not want to have a vario mode then climb rate can be set to zero and it will never enter that mode. Do we want to make that the default?

This has been test flown on Sparky and works quite well.

peabody124 added some commits Feb 24, 2014
@peabody124 peabody124 AltitudeHold: allow exponential altitude control
This makes the throttle signal be processed through an
exponential to allow rapid altitude changes but also
sensitivity in the middle range.
02c678d
@peabody124 peabody124 AltitudeHold: make vario mode use full state control
In vario mode the desired state is now the current location
with the requested velocity, instead of moving the setpoint.
This behavior is essentially the same as axis lock. For big
stick inputs it enters a rate control and small values it
holds the last position.
3670c06
@peabody124 peabody124 AltHold: remove anti windup
This is in testing.
b10515a
@peabody124 peabody124 Sparky: use faster baro rate 72707ce
@solidgoldbomb solidgoldbomb commented on an outdated diff Mar 6, 2014
shared/uavobjectdefinition/altitudeholdsettings.xml
@@ -5,6 +5,8 @@
<field name="VelocityKp" units="throttle/m" type="float" elements="1" defaultvalue="0.3"/>
<field name="VelocityKi" units="throttle/m/s" type="float" elements="1" defaultvalue="0.3"/>
<field name="AttitudeComp" units="" type="enum" elements="1" options="FALSE,TRUE" defaultvalue="TRUE"/>
+ <field name="MaxRate" units="m/s" type="uint8" elements="1" defaultvalue="4"/>
+ <field name="Expo" units="" type="uint8" elements="1" defaultvalue="40"/>
@solidgoldbomb
solidgoldbomb added a line comment Mar 6, 2014

Field lines are tab-indented. Access/Telemetrygcs are space-indented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@solidgoldbomb solidgoldbomb commented on an outdated diff Mar 6, 2014
flight/Modules/ManualControl/transmitter_control.c
altitudeHoldDesired.Roll = cmd->Roll * stabSettings.RollMax;
altitudeHoldDesired.Pitch = cmd->Pitch * stabSettings.PitchMax;
altitudeHoldDesired.Yaw = cmd->Yaw * stabSettings.ManualRate[STABILIZATIONSETTINGS_MANUALRATE_YAW];
- float currentDown;
- PositionActualDownGet(&currentDown);
+ uint8_t altitude_hold_expo, altitude_hold_maxrate;
+ float current_down;
+ PositionActualDownGet(&current_down);
+ AltitudeHoldSettingsMaxRateGet(&altitude_hold_maxrate);
+ AltitudeHoldSettingsExpoGet(&altitude_hold_expo);
@solidgoldbomb
solidgoldbomb added a line comment Mar 6, 2014

No need to load these settings (MaxRate + Expo) outside of the "else" clause below. Also move related local variables into the scope of the "else".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@peabody124

Got some testing in with this https://vimeo.com/88439963 and it flies nicely

If there are no more issues, I'll merge this.

@peabody124

@solidgoldbomb did you finish your review, btw?

@guilhermito

Looks good!

@guilhermito guilhermito merged commit 0deba13 into TauLabs:next Mar 8, 2014
@peabody124 peabody124 deleted the peabody124:alt_hold_expo branch Mar 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment