Skip to content

Barometer Temperature Drift Compensation ​

Board temperature climbs steadily once the controller is powered. On a tightly packed board the barometer sits next to the heat sources, so the pressure reading drifts along with the temperature: the altitude display creeps up or sinks even though nothing has moved. It shows worst in AltHold and Auto.

Barometer temperature compensation (TCAL) makes the controller learn the temperature-to-pressure relationship for itself, then corrects the reading against the current board temperature so that drift goes away.

▲ Board temperature rising from 38 °C to 76 °C: uncompensated altitude drifts out to +25 m, while the compensated trace stays on 0

NOTE

Requires Copter 3.6 or later.

Parameters ​

ParameterWhat it doesValues
TCAL_ENABLEDTemperature compensation switch0 off
1 use the learned values (no further learning)
2 learn new values and use them
TCAL_BARO_EXPLearned barometer correction exponentRead-only; non-zero once learning has finished
TCAL_TEMP_MINLowest board temperature seen while learningRead-only, in °C
TCAL_TEMP_MAXHighest board temperature seen while learningRead-only, in °C

Calibration steps ​

▲ The idea: cool the controller down first, then let it learn as it warms up

  1. Set TCAL_ENABLED to 2 (learn and use the result)
  2. Power off and let the controller cool for a few minutes
  3. Power on and leave it sitting for about 10 minutes
  4. It learns automatically as the board warms up
  5. When learning finishes, TCAL_BARO_EXP becomes non-zero
  6. Optional: set TCAL_ENABLED to 1 afterwards to use the learned values without learning again

TIP

Learning only happens while the controller is completely still — do not move it during those 10 minutes.