Here are some notes for achieving a good altitude hold:
- Protect the barometric sensor from light and air turbulence (a black plastic tube glued on the pcb with some foam inside or anything else).
- Ensure that your altitude reading is accurate enough for your needs. E.g. if you want altitude hold to hover 1M from the ground, you need much less than 1M noise in the altitude readings that are reported from the FC.
- Tune your multirotor with proper Acc calibration , radio and Acc trims
- Consider that you should activate baro only when a stable hover is reached
- Once you activate the baro mode DO NOT touch throttle any more.
- With baro mode enabled you should not notice any differences in behavior between Acro and Acc mode.
- When initially setting up your altitude hold PID values begin with P, I and D values at zero.
Altitude PID tuning
- Take notes, record which values cause desirable/undesirable effects, this will be useful in future!
- Set Altitude P, I and D to 0. This effectively means the PID controller makes zero adjustment...
- Slowly increase D from 0 in increments of 1-2 until you start to get a slow yo yo movement. (When I tried this step, I don't really get a yo-yo motion, with low D values the copter shoots up when alt hold is enabled, as it increases it holds with drift, then if increased further it drops to the ground)
- Reduce D a little until yo yo movement stops (or, if no yoyo motion, reduce D until the hover sounds smoother!).
- At this point the multicopter will start to hold altitude for a short time with drift
- Increase P slowly now in small increments (0.1-0.2), and you will find that the multicopter will begin to hold altitude better, until it starts the yo yo movement again,
- reduce P until yo yo movement goes away. The multicopter will now hold altitude with less drift.
- Increase I gradually to reduce the drift that occurs as the battery runs down and the throttle needed to keep the copter at hover changes.
- If copter moves with a sinusoidal motion from altitude point (point when you activate baro) decrease P value little by little, when you reach a good result increase D parameter.
- Fly around gently with altitude hold enabled to check the behaviour of the system. If the copter changes altitude while flying, monitor the altitude that is reported by the FC and ensure that it appears accurate. If the altitude reading is deviating from the actual altitude you need to protect the sensor better from air currents. If the changes in altitude are not caused by deviations from the sensor, increasing D gradually to improve the response to deviations, followed by increasing P gradually until the altitude hold performs well in motion too.