About
We often end up wanting to reset the parameters in PX4 via QGC, for example when upgrading to new version with breaking changes, or just wanting to re-start on the whole setup again.
However, I have repeatedly noticed that the current “parameter reset” is a bit too crude, and results in undesired behaviors such as wiping out the sensor calibration data, rc calibration, as well as board mounting and orientation data.
So in this post I will break down ways to have a back-up for those parameters, so that you don’t have to re-calibrate over and over again (thanks to @Jakob_Strebel’s comment, which inspired this post)
Current Mechanism in QGC for parameter reset
In QGC Parameters tab, we currently have the following options related to resetting the parameters:
- Reset all to firmware’s defaults
- Reset to vehicle’s configuration defaults
- Load from file
- Save to file
- Clear all RC to Param
So what to all of these mean? I will explain each briefly below.
Reset to Firmware’s defaults
This button sends the “MAV_CMD_PREFLIGHT_STORAGE” MAVLink message with the PARAM_RESET_CONFIG_DEFAULT telling PX4 to:
Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics.
This effectively resets “all” the parameters to their default value (the values are documented in Parameter Reference | PX4 User Guide (main)). And your airframe selection (which vehicle type you are using, etc) will effectively all be lost, and PX4 will return to a state that you would have if you flashed a flight controller with PX4 the first time.
Reset to vehicle’s configuration defaults
This sets the SYS_AUTOCONFIG parameter to non-zero value, which is documented to do:
Set to 1 to reset parameters on next system startup (setting defaults). Platform-specific values are used if available. RC* parameters are preserved.
The implementation can be found in the startup script (rcS) here:
This effectively resets “all but specified (airframe selection, RC calibration, Sensor calibration, etc)” parameters, which is most of the times what we want to do.
Conclusion
So funny enough, I realized during writing that the “Reset to vehicle’s configuration defaults” is the reset button people should be using, to keep the calibration values, so there’s no need to do anything fancy like parameter backup it seems.
If you want to keep your calibration values, but reset everything else, press “Reset to vehicle’s configuration defaults” in Parameters>Tools of QGC
Other
Note, there’s an ongoing discussion on how to “prevent” people from accidentally resetting all the parameters (even I after using PX4 for 2 years didn’t know what “Reset to vehicle’s configuration defaults” really meant, so it must be very confusing for most users!) by providing a ‘lock’ on those calibration parameters.