The helicopter jumped up and fell down in loiter mode during the take-off phase under version 4.3.6

@bnsgeyer @Leonardthall
Today, I flew version 4.3.6 on the helicopter.

The first flight took off in steady mode and then flew. The whole performance was perfect.This is the flight log.The helicopter is flying normally in stabilize mode

However, the second time I tried to take off in loiter mode, while the helicopter was still on the ground, the pilot did not push the height stick, the helicopter suddenly jumped from the ground about 2.5 meters above the ground, and then fell heavily.This is the flight log.https://we.tl/t-Cm5MHiZBra

Although the vibration of the helicopter is larger than that of the multi-rotor wing, from the first flight, the vibration will not affect the normal flight at all.I wonder if there is something wrong with my parameter setting?At least in my opinion, when the helicopter is still on the ground and the height stick of the remote control is still at its lowest position, the helicopter should not take off from the ground and the total distance should not be involved in altitude control.

As can be seen from the flight log, when the helicopter does not decide “not landed”, the integral term of altitude control fluctuates dramatically and participates in altitude control substantially, resulting in the helicopter’s collective pitch reaching a very large value, even the maximum, when the fixed speed is not completed, thus making the helicopter jump up.

At present, the acceleration term is introduced into the judgment condition of whether the helicopter is on the ground, but in fact, the acceleration seems to be easily affected by vibration.In many cases, such as transient resonance, uneven ground will cause the vibration to increase.Whether the acceleration term in this algorithm can be removed.Finally, when the helicopter is on the ground, the integral term of altitude control and attitude control is 0.

@Leonardthall
Is it possible to remove the “_accel_desired.z” limit from init_z_controller ()?

_accel_desired.z = constrain_float(get_z_accel_cmss(), -_accel_max_z_cmss, _accel_max_z_cmss);

void AC_PosControl::init_z_controller()
{
_pos_target.z = _inav.get_position_z_up_cm();

const float curr_vel_z = _inav.get_velocity_z_up_cms();
_vel_desired.z = curr_vel_z;
// with zero position error _vel_target = _vel_desired
_vel_target.z = curr_vel_z;

// Reset I term of velocity PID
_pid_vel_z.reset_filter();
_pid_vel_z.set_integrator(0.0f);

**_accel_desired.z = constrain_float(get_z_accel_cmss(), -_accel_max_z_cmss, _accel_max_z_cmss);**
// with zero position error _accel_target = _accel_desired
_accel_target.z = _accel_desired.z;
_pid_accel_z.reset_filter();

// initialise vertical offsets
_pos_offset_target_z = 0.0;
_pos_offset_z = 0.0;
_vel_offset_z = 0.0;
_accel_offset_z = 0.0;

// Set accel PID I term based on the current throttle
// Remove the expected P term due to _accel_desired.z being constrained to _accel_max_z_cmss
// Remove the expected FF term due to non-zero _accel_target.z
_pid_accel_z.set_integrator((_attitude_control.get_throttle_in() - _motors.get_throttle_hover()) * 1000.0f
    - _pid_accel_z.kP() * (_accel_target.z - get_z_accel_cmss())
    - _pid_accel_z.ff() * _accel_target.z);

// initialise ekf z reset handler
init_ekf_z_reset();

// initialise z_controller time out
_last_update_z_us = AP::ins().get_last_update_usec();

}