Endless climb, loiter, 4.6.0 dev, webots

Greetings! I’m not sure if this is related to Webots, the firmware, or my parameters, but after reaching a certain altitude (more than 200 meters), the drone cannot stop climbing. In loiter mode, I am sending rc_channels_override_send to the drone with different thrust values. We see that DSAlt is correct, the drone should start descending, but the altitude keeps increasing. Also, the power output to the motors does not change.



log: 00000030.zip - Google Drive

It seems that the problem occurs not only when the drone is ascending, but also during descent. At low thrust (thrust = 1700), upon reaching a certain altitude (probably > 50 meters, the operating range of the rangefinder), the drone receives a thrust of 1100 but continues to ascend for about a minute before it starts descending. When it begins to descend, even with a thrust of 1500, it continues to descend for about a minute. In other words, the drone responds very slowly to changes in DSAlt. At high ascent speeds, this delay can be 5-10 minutes.

Your RNGFND1_MAX_CM is 5000. I don’t think CTUN.DSAlt will have effect above that value. CTUN.DAlt is equal to CTUN.Alt.

You are probably right, the rangefinder is somehow related to the problem. I’m not sure how to proceed in this situation. I tried changing EK3_SRC1_POSZ from 2 to 1 and back, but I didn’t notice any difference.

How exactly are you controlling the drone? I don’t see any mention of flight modes in the log. If this all works through Webots then I’d look for the issue there.

I am running an Ardupilot/MAVProxy server, Webots connects to this server, and I connect from an external Python editor to the Ardupilot server using pymavlink. I don’t know why the flight mode is not saved in the log, but when I send the command through MAVLink I receive confirmation that the flight mode is set to loiter.

I rechecked the flight mode during flight, it’s loiter. Even when I set the loiter thrust to 1000, the drone stops climbing very slowly, as if it has significant inertia.

Thank you for your willingness to help!

Nevermind, Loiter is shown, it was just cut off.

Look at these graphs:

It does react to your RCIN.C3 changes, although I don’t understand why CTUN.ThO goes back to 0.18 immediately. But it does affect the climb rate. Really makes no sense to me.

Maybe try setting MOT_THST_HOVER,0.18, just to see what happens.

Actually, can you upload your TLOG file as well?

Attached are the log and telemetry log. In this flight, you can see both a slow stop in altitude gain and slow braking during descent. Towards the end, I disconnect from the controller, so the drone stops receiving any messages and starts to fall. In this flight, I set MOT_THST_HOVER to 0.18, as you suggested. I also experimented with RNGFND1_MAX_CM = 50000, but it seems the lidar doesn’t work beyond 5000 anyway. Thanks again for your willingness to help! I don’t know how to approach the problem.

Fixed by adding these params:
EK3_RNG_USE_HGT 70
TERRAIN_ENABLE 0