EnergyControl

From PaparazziUAV
Jump to navigation Jump to search

Some more info [Doxygen]

Total Energy (speed + height) control for fixed wing vehicles. An airspeed sensor is mandatory!


implementation of guidance energy


File: conf/airframes/myplane.xml
    <section name="VERTICAL CONTROL" prefix="V_CTL_">

    <define name="GLIDE_RATIO" value="8."/>
    <define name="POWER_CTL_BAT_NOMINAL" value="11.1" unit="volt"/>
    <define name="MAX_ACCELERATION" value="0.5"/>
    <define name="THROTTLE_SLEW_LIMITER" value="1." unit="s"/>

    <define name="ALTITUDE_PGAIN" value="0.13"/>
    <define name="ALTITUDE_MAX_CLIMB" value="2."/> <!--default 2-->

    <define name="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" value="0.3"/>
    <define name="AUTO_THROTTLE_NOMINAL_CRUISE_PITCH" value="0."/> <!-- default 0 -->

    <define name="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT" value="0.1" unit="%/(m/s)"/>
    <define name="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN" value="0.15"/>

    <define name="AIRSPEED_PGAIN" value="0.6"/>

    <define name="AUTO_THROTTLE_OF_AIRSPEED_PGAIN" value="0.069"/>
    <define name="AUTO_THROTTLE_OF_AIRSPEED_IGAIN" value="0.01"/>

    <define name="AUTO_PITCH_OF_AIRSPEED_PGAIN" value="0.01"/>
    <define name="AUTO_PITCH_OF_AIRSPEED_IGAIN" value="0.003"/>
    <define name="AUTO_PITCH_OF_AIRSPEED_DGAIN" value="0.03"/>

    <define name="ENERGY_TOT_PGAIN" value="0.3"/>
    <define name="ENERGY_TOT_IGAIN" value="0.05"/>
    <define name="ENERGY_DIFF_PGAIN" value="0.4"/>
    <define name="ENERGY_DIFF_IGAIN" value="0.01"/>

    <define name="AUTO_GROUNDSPEED_SETPOINT" value="6.0" unit="m/s"/>
    <define name="AUTO_GROUNDSPEED_PGAIN" value="0.75"/>
    <define name="AUTO_GROUNDSPEED_IGAIN" value="0.25"/>

  </section>


schematics for guidance energy. They represent only the main part for a better over view. Not included are any kind of safety functions.

Energy Control loop



Very Quick I'm feeling Lucky Tuning Manual

Start with:

outerloop:

  • alt-pgain about 0.1
  • speed-pgain about 0.2

innerloop:

  • airspeed sp -> make sure it is OK
  • cruise_throttle -> your preferred initial cruise throttle: 0.6 ? (this is overruled/adapted by the tot_en_i-gain)
  • cruise pitch -> zero or your preferred initial cruise pitch (this is overruled/adapted by the dis_en_i-gain)
  • P_en_tot -> 20% of slider
  • I_en_tot -> 20% of slider
  • P_en_dis -> 20% of slider
  • I_en_dis -> 20% of slider

More Step By Step

To allow nice step by step tuning with less risk, I recommend to start with the integrators set to zero.

If you do not thrust your airspeed or IMU you might even start with all en_tot en en_dis gains set to zero but with the throttle_incr gain set to about 0.1 and the pitch_of_vz set to also about 0.1 to turn it into a traditional old-style fixedwing outerloop (without airspeed).

A next possible step is to add a very small bit of I_th_air. This will slowly adapt the cruise throttle to get the correct average airspeed.

...

incomplete ...