Airframe/Template
From Paparazzi
Contents |
Airframe
Airframe file is where you describe what kind of firmware do you have, what external components are conected and do basic setup for that components. (like calibrations etc.) Basicly it is enough to have this much for file to work:
<!DOCTYPE airframe SYSTEM "../airframe.dtd"> <airframe name="lisa_m_testing"> <firmware name="lisa_m_test_progs"> <target name="test_led" board="lisa_m_1.0"/> </firmware> </airframe>
/!\ WARNING! Remember to set up correct path to airframe.dtd file (hilighted in bold) or otherwise file won't work.
In this case we defined airframe called "lisa_m_testing" which has only one firmware (there can be more that on firmware sections, see below) and it has only one target called "test_led". Building this will result our board (in this case it's lisa/m) to test work of led lights. For more details on commands and usage syntax see below.
Be advise, that if you want to bring out some settings to external file, it should also start with <airframe> and end with </airframe> tags.
To include external file to your airframe use: <include href="path relative to paparazzi home dir here" />
Example: <include href="conf/airframes/demo.xml" />
Firmware
Section that contains general systems and board type information. There is more than one firmware section allowed in config file.
Syntax:
<firmware name="fixedwing"> sections here, see below </firmware>
Target
This section describes execution target, ie. type of hardware that will run your firmware.
Syntax:
<target name="sim" board="pc" />
| Sim | PC | setup PC for flight process simulation |
| ap | <here should be your board> | configure autopilot for certain board type |
Subsystem
This section describes additional subsystems plugged into main autopilot.
Syntax: <subsystem name="ahrs" type="infrared" />
| radio_control | ppm | choose your receiver input profile |
| joystick | activate joystick (rc sticks) support???; | |
| telemetry | transparent | select type of telemetry applied |
| control | what is this?! | |
| ahrs | infrared | selects appropriate attitude and heading algoritm |
| gps | ublox | sets GPS receiver type and protocol |
Modules
Section that describes modules that need to be run.
Syntax:
<modules> <load name="infrared_adc.xml" /> </modules>
| infrared_adc | Needed for infrared ahrs to function |
complete list of the modules can be found here.
Servos
Here we give each channel on our board a particular handle to use it later in config.
/!\ Keep in mind, that values set in this section will be used as a handle in further configuration.
Syntax:
<servos> <servo name="MOTOR" no="0" min="1000" neutral="1000" max="2000" /> </servos>
| servo name ie. MOTOR ie. AILEVON_LEFT etc. | 0-(number of channels) | min_mid_max of servo | servo range and channel assignment setup |
Commands
This section defined state of FailSafe switch on each channel.
Syntax:
<commands> <axis name="THROTTLE" failsafe_value="0"> </commands>
| THROTTLE ROLL PITCH YAW | 0 or 1 | Set failsafe on channel (separate string required for each) |
rc_commands
Here we introduce our RC controller values and give them a system handle. In current example THROTTLE is a handle and @THROTTLE is a value that we get from our RC system.
Syntax:
<rc_commands> <set command="THROTTLE" value="@THROTTLE" /> </rc_commands>
command_laws
Here it is defined how do values from radio control are transmitted to servo mechanics.
Note that in first line of example we define a local variable that combines input on @ROLL channel and AILEVON_AILERON_RATE which is mixing rate. Be advise that AILEVON_AILERON_RATE variable should be defined to be used (see next in part that describes "section" tag).
Also notice, that alone tag starting with "let" is no good for us, to get full use out of it we need another section that will bind calculated value "$aileron" to particular servo output channel (AILEVON_RIGHT in our case). You can notice that there is also "$elevator" variable is present in calculation, but for shortness sake I'll say that it is calculated in the same way as "$aileron".
(i) Informational note: "let" tag creates alias for expression defined in "value", see let ... in operators usage in OCaml for better understanding.
Syntax:
<command_laws> <let var="aileron" value="@ROLL * AILEVON_AILERON_RATE" /> <set servo="MOTOR" value="@TRHOTTLE" /> <set servo="AILEVON_RIGHT" value="$ailevon + $elevator" /> </command_laws>
section
This universal part of config defines all kinds of constants.
Prefix attribute of section is optional and sometimes is omitted.
Syntax:
<section name="AUTO1" prefix="AUTO1_"> <define name="MAX_ROLL value="0.85"> </section>
| MIXER | Typically it contains mixing rate constants | |
| AUTO1 | AUTO1_ | Border values for stabilization to start working |
| AHRS | AHRS_ | Describes local magnetic field settings |
| BAT | Typically it contains minimal battery level value | |
| MISC | Contains different constants that doesn't fit other sections | |
| VERTICAL CONTROL | V_CTL_ | Vertical control values |
| HORIZONTAL CONTROL | H_CTL_ | Vertical control values |
| NAV | ??? Navigation settings | |
| FAILSAE | FAILSAE_ | Aircraft failsafe return settings |
| IMU | IMU_ | Innertial Measurment Unit calibrations |
| SIMU | ??? Additional IMU settings? | |

