Help! Loss of altitude and almost crash in auto

Hi,

I’m flying an IRIS+ and set up an auto mission. The aircraft was supposed to ascend to 120m, follow a path, then descend, circle an object, and ascend back to base. Instead it descended through several 120m AGL spline waypoints until it was lower than home altitude, just missing some trees. This point in the mission should have been 120m AGL:

Here’s the first part of the mission:

i.imgur.com/tRx7FqN.png

After the unexplained descent it rapidly ascends to hit waypoint 10, then descends as expected and continues on mission. The IRIS+ has the Tarot Brushless Gimbal kit attached.

Here’s the GPS and baro altitude charts. They seem to be in sync so it doesn’t seem to be an altitude issue. I’ve colored the unexplained descent in an orange rectangle:

i.imgur.com/RApOFBv.png

It doesn’t seem to be a vibration issue:

i.imgur.com/mBtynMZ.png

I checked and charted the EKF parameters using this page as a guide and didn’t find anything that looked anomalous to me: copter.ardupilot.com/wiki/common … -overview/

I’ve seen similar loss in altitude for no reason my last few flights. I thought it was a navigation bug at first, but now it seems to navigate below any altitude I set during the flight.

Log is attached and with my limited knowledge I haven’t found the problem. Any help is very much appreciated!

~Mark.

Couple of things. First you don’t need a region of interest between waypoints with version 3.2.
Second there must have been an east wind as the copter did not have enough power to fight the wind.
On the way back it was down wind and stayed at the correct altitude.
Good thing you were higher than your target as the copter should have hit the ground a couple of times based on the barometer.
At your lowest point you were still 40 feet above ground…

Mike

[quote=“iseries”]Couple of things. First you don’t need a region of interest between waypoints with version 3.2.
Second there must have been an east wind as the copter did not have enough power to fight the wind.
On the way back it was down wind and stayed at the correct altitude.
Good thing you were higher than your target as the copter should have hit the ground a couple of times based on the barometer.
At your lowest point you were still 40 feet above ground…

Mike[/quote]

Thanks Mike! Keep in mind I’m a newbie at this so don’t be too hard on me. I had set WPNAV_SPEED to be 2000cm/s which is the max horizontal speed between waypoints. I had assumed the copter would give priority to altitude, not maintaining horizontal speed, but it sounds like based on what you’re saying that’s not the case and that explains the drop in altitude right up until it got close to a waypoint where it was going to not have much horizontal movement which gave it an opportunity to climb. Does that sound right?

Since I set the speed that high I’ve been seeing unexplained drops in altitude so that would explain those I think.

Regarding the ROI’s. I’ve filed a bug regarding how they work in 3.2. It seems that if you set a ROI at start of mission and then set a different ROI later in the mission the first ROI overrides the second ROI a couple of waypoints after the second becomes active. Details in the report with logs and screenshots: github.com/diydrones/ardupilot/ … t-68571525

For this particular mission I didn’t actually set the same ROI multiple times between waypoints. I think (sorry I’ve deleted the flight plan) what I did was set one ROI and then I may or may not have set another later on. I’ve you’re seeing multiple ROI CMD’s in the log, I think that’s just the way arducopter gets ROI’s to persist between waypoints isn’t it? I didn’t set those.

I’ve set WPNAV_SPEED back to something sane. Let me know if that explains it100% or if there’s something else I should check. Thanks again!!!

Mark.

Ok, I see the ROI issue and didn’t know it handled it that way. Did extract your mission so I could load it back into Mission Planner just to see what was commanded.

I think in order to clear the waypoint it needs to be within 2 meters or whatever you set as reaching the waypoint. So since it was not high enough to clear that waypoint it slowed down and climbed to reach it.

It’s interesting to see that it does not treat the spline waypoints as waypoints. Not until it got to the other house did it decide it needed to climb.

Mike

Yes, it is. WPNAV_RADIUS was always set to 200cm for me. It would be interesting to hear one of the devs input on the strictness of WPNAV_RADIUS and altitude when it comes to spline waypoints. It seemed to completely disregard spline waypoint altitude until it hit a regular waypoint. So perhaps a workaround for now is to use spline’s sparingly and use regular waypoints as a sanity check periodically en-route.

~Mark.

I had a look at the spline waypoint advance code at:

github.com/diydrones/ardupilot/ … v.cpp#L894

and the regular waypoint code at:

github.com/diydrones/ardupilot/ … v.cpp#L448

This is the first look I’m having at the code and I’m not a CPP developer, but it seems clear in the regular waypoint code that Z leash length (vertical distance to destination waypoint) is taken into account.

But it’s not clear in advance_spline_target_along_track() that this is taken into account. Although I must admit I lost it about here: github.com/diydrones/ardupilot/ … v.cpp#L945