How to ask Ardupilot to take height into account when moving to waypoints?

Hello,

I compile Ardupilot 4.5 (plane, board SITL) and start simulation in MAVProxy. My mission has a number of waypoints which have significant difference in altitude. I try to climb at say 300 meters and then descend to 200 meters then climb back at 300 meters, horizontal distance between waypoints is around the difference in height. Basically I try to make it fly like a wood pigeon in a spring.
In order to do this I increased pitch and sink limits in parameters to make it climb or descend quicker. Now the problem is the plane does not reach waypoints by specified height. I can see messages like “Waypoint N was reached, 10 meters” in console, however the vertical distance to it was not achieved. It looks like Ardupilot does not take into account an altitude when reporting that way point was reached.

Do I need to make changes in code or can I configure it ?

Thanks,

Vlad

ArduPlane does not take altitude into account when determining whether the aircraft has reached a waypoint. If you need to reach the desired altitude, there is a way to execute the mission command NAV_LOITER_TO_ALT, but that is a spiral flight, so it may not be the flight you want.

To achieve the flight you want, you need to set maximum pitch angle to 45 degrees or more.

ArduPlane tries to maintain a constant airspeed (TRIM_ARSPD_CM) while flying in Auto mode. In order to maintain a constant airspeed at a pitch angle of 45 degrees, a considerable amount of thrust margin is required. If the speed cannot be maintained constant during the climb, the FC will reduce the pitch and the aircraft will not reach the target altitude.

I think you should first check whether your aircraft has sufficient climb performance to achieve the flight you desire.

2 Likes

Thank you for replying.

Can you also explain how can I increase speed of my plane in SITL simulator ?
Max speed I can get is around 31 m/s, at this speed console shows Thr = 100.
Can I increase the speed to say 60 m/s ? I have increased TRIM_ARSPD_CM to 6000,
TRIM_THROTTLE = 70, ARSPD_FBW_MIN = 10, ARSPD_FBW_MAX = 100, THR_MIN/MAX 0/100
Is it SITL limiting the speed or do I set wrong param values ?

The performance of the aircraft depends on the simulator settings, not on the ArduPilot settings. What simulator are you using? For example, in this video, when Shockwave APM is selected for the aircraft, the speed of the aircraft exceeds 60 m/s.

I use regular SITL, MAVProxy in Linux.

I assume you are using sim_vehicle.py.
If you specify “plane-jet” as frame type, the maximum speed of 102 m/s is applied. The vehicle is heavy (22 kg), so I am not sure if it has good climbing performance.

sim_vehicle.py -v ArduPlane -f plane-jet