-
Notifications
You must be signed in to change notification settings - Fork 10
Autopilot Tuning, Firmware
Freyja can be used with several different autopilot boards, as long as the vehicle flies stable, and the autopilot has an interface that accepts [roll, pitch, yaw(rate), thrust]
commands. Freyja has been tested with Ascending Technologies autopilots (Hummingbird, Firefly), and with Pixhawk boards running ArduCopter flight stack.
The following instructions are written for ArduCopter; adapt these to your specific vehicle/autopilot. Ensure that the vehicle flies well following the next steps.
-
Install correct firmware.
-
Freyja typically works with a customized ArduPilot firmware. The source files are maintained here. See the
README-nimbus
file to get the pre-built binaries for common boards. Install this custom firmware. It removes no features from the official firmware, but adds a custom flight mode: "Computer"COMP_CTRL
. Configure your RC to switch in and out of this mode. If MP/QGC doesn't show this as a drop-down option, search for the correspondingFLT_MODE_N
parameter, and set it to the number 25. This is the enumeration for this custom mode.When updating the firmware, the parameters are retained as such - so if the vehicle flew well before, it should fly well after.
-
New versions of ArduPilot (4.1+) now be directly used without customisation. The suitable mode now is
Guided_NoGPS
. For this to work, you must also setThrustAsThrust
field within the parameterG2_OPTIONS
. -
Other autopilot stacks can also work if they provide an interface for Freyja's output. For example, PX4's
OFFBOARD
mode should work almost similar (although untested), especially if usingmavros
.
-
-
Change flight response (careful!).
Freyja requires the vehicle response to commands to be very "crisp". If the vehicle response to pilot roll/pitch commands is too soft (or damped), the implicit "no-lag" assumption made by classical formulations is violated. Tune the vehicle to be very responsive to user stick commands. Then, in MP/QGC, search for a parameter calledatc_input_tc
and set it to between [0.06 .. 0.1] (0.1 is the safer end). Note that some input filtering is desirable to attenuate high-frequency command responses. Changing this to less than 0.05 can make the vehicle very difficult to fly. -
Adjust communication rates.
Pipe Freyja's commands preferably to the Telem2 port (also known asserial2
). If using a wireless telemetry radio (or Xbee), edit the following two sets of params:-
serial
: change baudrate. Usually 57600 is a good compromise. -
sr2
: change all publish rates to zeros, except forEXTRA3
(battery info, system state) which can be set to 1Hz.
These steps are essential !! Free up the radio channel for Freyja's transmission of control signals.
Wired connections should use higher baudrate (can go more than 115200).
-
-
Suppress unused
mavros
plugins.
The defaultmavros
plugins enabled/disabled by Freyja are usually ok. Please check thepluginlists.yaml
file to add more whitelisted plugins. Note that some plugins attempt to use communication channel, so don't spawn them needlessly.
- Ensure battery failsafes are in place. For 3-cell LiPo, low battery is usually at 10.6V; for 4-cell, set it to 13.9V.
- Make sure to calibrate your compass and accelerometers. Consider using vibration-damping mounts for the autopilot board.
- If your vehicle refuses to arm, verify that you don't have unnecessary (unsatisfiable) arming checks enabled.
- Additionally, some older boards might have an
EK3_GPS
check enabled; disable that if indoors.
- Additionally, some older boards might have an
- Check that the firmware uses
EK3_*
parameters (and notEK2_*
).
Sip coffee, raise an issue on GitHub! :)
(c) aj, Nimbus Lab, 2020