Creating Airframe Configurations for APX4
What is an Airframe File?
After setting up, configuring, and tuning a new vehicle, an airframe configuration file should be created to store the setup and tuning parameters. Using airframe configurations the tuning can then easily be applied to other vehicles of the same type, as all relevant parameters will be loaded from this file.
In APX4 the airframe configuration file does mainly two things:
Load pre-defined parameters: APX4 is configured by changing various parameters to tune the behaviour of the autopilot. Pre-defining parameters is convenient for setting up a large number of the same aircrafts
Configure the Control Allocation (Input/Output mixing): Control allocation handles the mapping of control inputs to motor and servo outputs. All parameters starting with
CA_
are related to Control Allocation and therefore affect the mixing.
Example of an Airframe File
The airframes supported by PX4 and Auterion PX4 can be found in PX4's official documentation.
In this example we want to create an airframe file for a Generic quadrotor x configuration. The PX4 Airframe Reference specifies that this airframe configuration has the ID 4001
. Inside the PX4 Github Repository, we can find the file corresponding to the Generic quadrotor x airframe.
This airframe configuration file is composed of two main parts. The first one loads the default parameters valid for a general multicopter frame:
The second one specifies all PX4 parameters that need to be different from the default ones. This examples shows the definition of the number of motors and the frame geometry. In a previous chapter (Actuators Setup) we have also seen how to change these parameters via the AMC UI by using the actuators tab.
We recommend that the motors' position specified by the CA_ROTORx_P
parameters are configured to match your vehicle geometry precisely.
Creating a custom Airframe Configuration File
The easiest way to create a custom airframe file is to start with an existing one.
You can either copy one from the PX4 Github Repository, or create a completely new .txt file named ID_customName (e.g. 1230010_custom) locally on your PC/Laptop.
For our example, we would start by modifying the header and keeping the multicopter defaults, since our custom drone is also a multicopter. Our Custom Config file should look as follows:
Now you need to gather the parameters we changed during the sensors and actuators Setup. To do that the easiest way is to access the MavlinkConsole present inside AMC.
Connect your Skynode via USB-C to your PC/Laptop and open AMC. Access the Advanced Mode. Click on the "Analyze" Tab present in the Left-hand sidebar menu and then choose MAVLink Console:
Type the following command inside the MAVLink Console:
And then type "Enter".
At this point you should be presented with the following output:
Now Select and copy the parameters inside your custom Airframe Configuration file, like this:
Now save this file locally on your PC/Laptop.
Getting your Airframe File onto Skynode
Remove the propellers before proceeding
The airframe file we just created can be bundled with AuterionOS for deployment on Skynodes.
First you have to install the Auterion OEM Tools: OEM Tools Installation
Save your airframe file as
aepx4-oem-tools-2.x.x/fmu/config/airframes/1230010_custom
Edit the file
rc.autostart
underaepx4-oem-tools-2.x.x/fmu/config
and add your custom airframe there:
Make sure that your Skynode is coonnected to your PC/Laptop via USB.
Package your configuration file by executing the following command from your OEM tools folder:
Reboot your vehicle.
ATTENTION: REMOVE THE PROPELLERS BEFORE PROCEEDING
Check if you motors and servos move correctly by repeating the procedure explained here.
From now on you can directly upload this configuration file to your vehicles by following the procedure explained above.
Last updated