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.
This airframe configuration file is composed of two main parts. \
The first one loads the default parameters valid for a general multicopter frame:
. ${R}etc/init.d/rc.mc_defaults
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.
{% hint style="info" %}
We recommend that the motors' position specified by the CA_ROTORx_P parameters are configured to match your vehicle geometry precisely.
{% endhint %}
Creating a custom Airframe Configuration File
{% hint style="info" %}
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.
{% endhint %}
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:
{% code title="1230010_custom.txt" %}
```
!/bin/sh
@name Custom Quadcopter
@type X500 Quadrotor
@class Copter
@maintainer YourName
. ${R}etc/init.d/rc.mc_defaults
```
{% endcode %}
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:
param show-for-airframe
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:
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:
{% code title="rc.autostart" %}
bash
if param compare SYS_AUTOSTART 1230010
then
sh /fs/microsd/ext_autostart/airframes/1230010_custom
fi
{% endcode %}
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:
```bash
In the Auterion OEM Tools directory:
make fmu-update configurationDir=fmu/config
``
7. Wait for your Skynode to boot and connect to [Auterion Mission Control](https://app.gitbook.com/s/7S1QElc9VpiBzRbPAWCp/auterion-mission-control/auterion-mission-control). Change the parameterSYS_AUTOSTART = 1230010andSYS_AUTOCONFIG = reset parameters to airframe defaults.`
8. Reboot your vehicle.
9. 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.
Comments
0 comments
Please sign in to leave a comment.