Creating Airframe Configurations for APX4
Last updated
Last updated
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.
The airframes supported by PX4 and Auterion PX4 can be found in .
In this example we want to create an airframe file for a Generic quadrotor x configuration. The specifies that this airframe configuration has the ID 4001
. Inside the PX4 Github Repository, we can find the .
This airframe configuration file is composed of two main parts. The first one loads the default parameters valid for a general multicopter frame:
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.
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.
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
under aepx4-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
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 () we have also seen how to change these parameters via the AMC UI by using the actuators tab.
You can either copy one from the , or create a completely new .txt file named ID_customName (e.g. 1230010_custom) locally on your PC/Laptop.
Connect your Skynode via USB-C to your PC/Laptop and open AMC. Access the . Click on the "Analyze" Tab present in the Left-hand sidebar menu and then choose MAVLink Console:
Wait for your Skynode to boot and connect to . Change the parameter SYS_AUTOSTART = 1230010
and SYS_AUTOCONFIG = reset parameters to airframe defaults.
Check if you motors and servos move correctly by repeating the procedure explained .
From now on you can directly upload this configuration file to your vehicles by following the procedure explained .