Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Positive control gains #127

Merged
merged 32 commits into from Feb 14, 2012

Conversation

Projects
None yet
2 participants
Owner

flixr commented Feb 2, 2012

Since there were no more comments on issue #85, I decided to just propose this for merging for the 4.0_beta branch (preparation for the next release).

I think this would be a good idea:

All control gains are defined with a positive sign, in the airframe file, in the settings, etc
At initialization of the control gain variables, the absolute value of the define in the airframe file is taken. This ensures that people with old airframe files don't suddenly see the opposite behaviour. It will just continue to work.
If no-one can come up with any drawbacks, I will merge it soon-ish.

flixr added some commits Nov 29, 2011

@flixr flixr start defining all control gains with positive values: changed H_CTL_…
…COURSE_PGAIN to positive
225111d
@flixr flixr changed NAV_GROUND_SPEED_PGAIN to positive f5c23d8
@flixr flixr changed h_ctl_pitch_pgain to positive c3f0bb8
@flixr flixr changed h_ctl_pitch_dgain to positive
already had postive definition for stabilization_adaptive, but negative for stabilization_attitude
d4d9747
@flixr flixr changed h_ctl_roll_attitude_gain to positive 5e59fc1
@flixr flixr changed h_ctl_roll_rate_gain to positive a107375
@flixr flixr changed v_ctl_altitude_pgain to positive 00ac61c
@flixr flixr changed v_ctl_auto_throttle_pgain to positive a844968
@flixr flixr changed v_ctl_auto_throttle_igain to positive
already had positive definition for guidance_v (standard control),
but negative for guidance_v_n (control new)
8b3adde
@flixr flixr changed v_ctl_auto_throttle_dgain to positive
already had positive definition for guidance_v (standard control),
but negative for guidance_v_n (control new)
72940e1
@flixr flixr actually use V_CTL_AUTO_THROTTLE_DGAIN if it's defined in the airfram…
…e file
f2af350
@flixr flixr changed v_ctl_auto_pitch_pgain to positive 336340f
@flixr flixr changed v_ctl_auto_pitch_igain to positive
already had positive definition for guidance_v (standard control),
but negative for guidance_v_n (control new)
192f726
@flixr flixr changed v_ctl_auto_pitch_dgain to positive (only used in guidance_v_n) 47b661a
@flixr flixr changed the signs of the error signals (now setpoint - estimate) for …
…better readability and consistency
989953a
@flixr flixr forgot to change H_CTL_ROLL_RATE_GAIN for adaptive settings file 556bbec
@flixr flixr change h_ctl_roll_igain to positive (only stabilization_adaptive) e08ca58
@flixr flixr changed h_ctl_pitch_igain to positive (only stabilization_adaptive) 190e868
@flixr flixr changed h_ctl_roll_Kffa and h_ctl_roll_Kffd to positive (only stabili…
…zation_adaptive)
a193dc9
@flixr flixr stablilization_adaptive changed the signs of the roll error signals (…
…now setpoint - estimate) for better readability and consistency
3af3554
@flixr flixr changed h_ctl_pitch_Kffa and h_ctl_pitch_Kffd to positive (only stabi…
…lization_adaptive and not actually used anywhere atm)
8cc7802
@flixr flixr get rid of an unused var warning for last_err 397ae5c
@flixr flixr fix h_ctl_course_pgain in nav and use with positive sign in stabiliza…
…tion_adaptive
6aeb2f1
@flixr flixr changed the sign of the ground speed error signal (now setpoint - est…
…imate) for better readability and consistency
16f2034
@flixr flixr changed stabilization_rate gains to positive 070eb4c
@flixr flixr changed rotorcraft stabilization_attitude_euler gains to positive 3167c8f
@flixr flixr changed rotorcraft stabilization_attitude_quat gains to positive c8aa382
@flixr flixr changed rotorcraft guidance_h gains to positive b789890
@flixr flixr changed rotorcraft guidance_v gains to positive dd4f6b0
@flixr flixr Merge branch 'dev' into positive_control_gains
Conflicts:
	conf/airframes/ENAC/fixed-wing/funjet2.xml
	conf/airframes/ENAC/fixed-wing/funjet2_nc.xml
	conf/airframes/ENAC/fixed-wing/funjet2_new.xml
	conf/airframes/ENAC/fixed-wing/funjet3.xml
	conf/airframes/ENAC/fixed-wing/merlin.xml
	conf/airframes/ENAC/fixed-wing/minimag1.xml
	conf/airframes/ENAC/fixed-wing/obsolete/drops.xml
	conf/airframes/ENAC/fixed-wing/overview.xml
	conf/airframes/ENAC/fixed-wing/soarzi.xml
	conf/airframes/ENAC/fixed-wing/weasel.xml
	conf/airframes/LAAS/mmlaas_N1.xml
	conf/airframes/LAAS/mmlaas_N2.xml
	conf/airframes/LAAS/mmlaas_N3.xml
	conf/airframes/Poine/funjet42.xml
	conf/airframes/Poine/swift_1.xml
	conf/airframes/TU_Delft/MicrojetBR.xml
	conf/airframes/delta_wing_minimal_example.xml
	conf/airframes/easystar_ets_example.xml
	conf/airframes/easystar_example.xml
	conf/airframes/example_twog_analogimu.xml
	conf/airframes/funjet_cam_example.xml
	conf/airframes/funjet_example.xml
	conf/airframes/mm/extra/press_t.xml
	conf/airframes/mm/extra/probe_t.xml
	conf/airframes/mm/extra/turbine_trigger.xml
	conf/airframes/mm/fixed-wing/drops.xml
	conf/airframes/mm/fixed-wing/funjet43.xml
	conf/airframes/mm/fixed-wing/funjetdca.xml
	conf/airframes/mm/fixed-wing/funjetdcb.xml
	conf/airframes/mm/fixed-wing/funjetdcc.xml
	conf/airframes/mm/fixed-wing/funjeteth1.xml
	conf/airframes/mm/fixed-wing/funjeteth2.xml
	conf/airframes/mm/fixed-wing/funjetfmi1.xml
	conf/airframes/mm/fixed-wing/funjetfmi2.xml
	conf/airframes/mm/fixed-wing/funjetfmi3.xml
	conf/airframes/mm/fixed-wing/funjetgfi1.xml
	conf/airframes/mm/fixed-wing/funjetgfi3.xml
	conf/airframes/mm/fixed-wing/funjetgfi4.xml
	conf/airframes/mm/fixed-wing/funjetgfi5.xml
	conf/airframes/mm/fixed-wing/funjetgfi6.xml
	conf/airframes/mm/fixed-wing/funjetgfi7.xml
	conf/airframes/mm/fixed-wing/funjetgfi8.xml
	conf/airframes/mm/fixed-wing/funjetgfi9.xml
	conf/airframes/mm/fixed-wing/funjetlisa.xml
	conf/airframes/mm/fixed-wing/funjetlisam.xml
	conf/airframes/mm/fixed-wing/funjetmm.xml
	conf/airframes/mm/fixed-wing/funjetmm2.xml
	conf/airframes/mm/fixed-wing/fw_ins_arduimu.xml
	conf/airframes/mm/fixed-wing/merlin.xml
	conf/airframes/mm/fixed-wing/miniwing.xml
	conf/airframes/mm/fixed-wing/slowfast.xml
	conf/airframes/mm/fixed-wing/slowfast2.xml
	conf/airframes/mm/fixed-wing/twinstarmm.xml
	conf/airframes/mm/hangar/black_one.xml
	conf/airframes/mm/hangar/glass_one1.xml
	conf/airframes/mm/hangar/glass_one2.xml
	conf/airframes/mm/hangar/glass_one3.xml
	conf/airframes/mm/hangar/lila.xml
	conf/airframes/mm/hangar/mac06a.xml
	conf/airframes/mm/hangar/red_one.xml
	conf/airframes/obsolete/easystar2.xml
	conf/airframes/obsolete/kalscott_easystar.xml
	conf/airframes/obsolete/microjet5_tp_auto.xml
	conf/airframes/obsolete/microjet6.xml
	conf/airframes/obsolete/microjetII.xml
	conf/airframes/obsolete/minimag1.xml
	conf/airframes/obsolete/minimag_fs.xml
	conf/airframes/obsolete/mmlaas_N1_carto_cam.xml
	conf/airframes/obsolete/storm1.xml
	conf/airframes/obsolete/tiny2.xml
	conf/airframes/obsolete/xxx1.xml
	conf/airframes/test_hb.xml
	conf/airframes/twinstar_example.xml
	conf/airframes/usb_test.xml
	conf/settings/tuning_ctl_adaptive.xml
	sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c
dd15598
@flixr flixr Merge branch 'positive_control_gains' into rotorcraft_positive_contro…
…l_gains

Conflicts:
	sw/airborne/math/pprz_algebra.h
ea47766

@flixr flixr referenced this pull request Feb 2, 2012

Closed

Positive control gains #126

Forcing the gains to be positive is probably needed for some time as we can't update custom airframes.
If possible, I would like to remove the ABS() after some time (it's more by principle, I don't like programs that change signs without telling).

Owner

flixr commented Feb 8, 2012

In the absence of some "sanity check" for the airframe file that will yell at you for wrong/stupid/incompatible/deprecated/out_of_bounds/whatever values it seems to me that using ABS() is the only solution. But as you said we can probably get rid of them again later... maybe someone will even write an uber-airframefile-config-and-check-wizard...

Owner

flixr commented Feb 14, 2012

Ok, as discussed with @gautierhattenberger and @poine we will remove the ABS() again and users will have to make sure that they have only positive control gains in their airframe files.

@flixr flixr added a commit that referenced this pull request Feb 14, 2012

@flixr flixr Merge pull request #127 from paparazzi/positive_control_gains
Positive control gains
f7e2ea9

@flixr flixr merged commit f7e2ea9 into 4.0_beta Feb 14, 2012

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