Offboard mode, quadcopter unexpected behaviour to velocity setpoint

Hi there,
I am trying to take off a quadcopter with velocity setpoints, to takeoff from ground fast I give high setpoint as 1.5 m/s, after some point I decrease the velocity setpoint. As you can see on the image from the log, when my velocity setpoint is changed from -1.5 m/s to -0.5 m/s, drone’s actual velocity goes to positive which means drone losing altittude, why this happens ?

I can play with the setpoints to takeoff the drone as I wanted but I want to learn Why drone acts like this which ,ı hope , will give me some useful insights

thanks in advance

Ho @Halil , could you share the full log please?

Here is my full log,
https://review.px4.io/plot_app?log=3ed2bb5d-7c17-472e-8fb9-e3c9ec17fbc2
thanks for your interest

Hi @Halil , from the logs I say that you have a tuning problem with the vertical velocity PID controller combined with poor initial hovering thrust initialization:

On takeoff, with 1.5m/s of setpoint vertical velocity, the computed setpoint thrust is 0.4, which is enough while the ground effect is active but it is not even enough for hovering once you are 1m off the ground. Once you reach 1m the required thrust is 0.52 more or less. Your parameters says you have 0.25 (MPC_THR_HOVER). This value is used to initialize the hovering thrust estimator, which converges to the right value when you reach a minimum altitude.

That is why you can see the vertical velocity decrease even before the the vertical velocity setpoint is reduced (time 01:11:01).
When you reduce the velocity setpoint to 0.5m/s the thrust is further reduced, leading to greater decrease of vertical velocity.

I suggest you to adjust the initial hovering thrust (MPC_THR_HOVER) and tune the PID controllers