Servers by jDrones

Automatic landing always abort itself after updating to ArduPlane 3.8beta


(Adolfo Cobo) #1

Hello to all,
I had to switch to ArduPlane 3.8beta5 after several crashes that seemed related to a bug resetting integrators of PIDs on mode changes with ArduPlane 3.7.1, and solved in new betas. Everything is fine now but I have noticed a weird behaviour: I am trying to configure a Bormatec Maja airplane for AUTO missions, and everything works fine but in the middle of an automatic landing, I see a message in Mission Planner "restarted landing sequence to waypoint #" and the plane resume the mission in the previous waypoing and tries to land again. It happen always (10 times, so far), regardless of the mission configuration. I am not using a range sensor for altitude correction at landing, but all are short (2 minutes) missions, and altitude drift is small. Sometimes the abort procedure works and the plane resume the mission, but sometimes it is too close to the ground and land anyway, but with the throttle at maximum trying to gain altitude. I all cases, landing sequence seems normal, with small glidding slopes, and detect the flare point at the correct altitude (3 meters). Abort is triggered before reaching the landing point.

I have read about the parameter LAND_ABORT_THR that abort the landing if throttle joystick is above 95%, but it is set to 0 by default.
I have no clue what could be the reason.
I have searched through the code of Arduplane and the trigger seems to be this one:

// see if we have reached abort altitude
if (adjusted_relative_altitude_cm_fn() > auto_state_takeoff_altitude_rel_cm) {
next_WP_loc = current_loc;
mission.stop();
if (restart_landing_sequence()) {
mission.resume();
}

That seems related to an “abort altitude” (I cannot trace where those two values are set, though). In the last flight (see telemetry log attached) flare was detected at 3.3m and abort was triggered at about 1m just around the moment the plane touch the ground.

Please find attached the telemetry logs and parameters.2017-06-27 21-09-46_aborlanding_con_MIN_GND=0.tlog (1.3 MB)
Maja parameters 24jun2017.param (14.2 KB)

Any help will be appreciated.
Thank you and regards,
Adolfo.


Dev Call Jul 3, 2017 2300 UTC
Dev Call Jul 3, 2017 2300 UTC
(Adolfo Cobo) #2

Hello again,
I have done more flights and still no clue what could be the problem, I am posting more data just in case anyone could help with this issue.
Arduplane version is 3.8beta5 and plane is a Bormatec Maja. The behaviour is always the same: in the automatic landing, it enters the landing stage, with a calculated slope of about 5deg, then it enters flare at the correct altitude of 3 meters, then, just around the moment is going to touch ground or just touched the ground, increase the throttle at 100% and then a landing abort message is shown.

This is a graph of the last landing from the dataflash log:


right after the flare, the throttle increases at an altitude of 2 meters , but the plane touch the ground anyway. I switched to FbwA mode to cut throttle.
In a previous landing, the behaviour is the same:

In another previous landing, the throttle is put at maximum just in the flare stage:

According to the Ardupilot wiki:

“The “flare” is the final stage of the landing when the autopilot cuts the throttle and raises the pitch, …”

At first, I though the that the problem was an unwanted abort of landing, but according to these logs, it seems that the problem is the increase of throttle in the flare, while the land is aborted when I switch out the AUTO mode trying to land land the plane.

Any help will be very much appreciated, I am running out of ideas :slight_smile:
Thank you,
Adolfo.

dataflash log: https://www.dropbox.com/s/e6338d3ofvu4jgm/00000013.BIN?dl=0


(MagicRuB) #3

Sounds very serious. I wrote the auto abort code, I’ll take a look. Thanks for reporting it and for posting a log!


(Adolfo Cobo) #4

Thank you very much for looking into it.
Today I did two more flights, logs are attached. Two identical short auto missions. the first one ended in a perfect landing, and the throttle did not engage (the first time the landing finished with no throttle in the last 15+ missions)
The second mission, just some minutes later, followed the same path and landed in the same spot, but once the plane touched the ground, the throttle increased.

HOWEVER, I noticed something weird. When I was about to launch the plane by hand, the throttle went 100%. This was unexpected, as I had the throttle joystick at minimum. I always have TKOFF_THR_MINSPD to 0 so I usually put the throttle at maximum by myself and launch the plane. I understand (according to the wiki) that those TKOFF_THR_* parameters just suprress the throttle, so the autopilot shouldn’t put any throttle if the joystick was at minimum.

So, I hand launched the plane anyway, WITH THE THROTTLE JOYSTICK AT MINIMUM during all the mission.

I am starting to develop a theory: the reason that the throttle was not increased during flare in the first mission was that the throttle joystick was at minium. In the second mission, it was at 50%, and the throttle increase up to about 50% after touchdown.

So, I think that this problem is not related to the landing code, but to the throttle firing when it shouldn’t.
Any help will be appreciated.
Thanks in advance,
Adolfo.

2017-07-04 21-00-56.tlog (1.4 MB)
Maja parameters 24jun2017.param (14.2 KB)
dataflash log: https://www.dropbox.com/s/qh72spa06l3aelb/00000014.BIN?dl=0


(MagicRuB) #5

I’ve looked at your log, here are my thoughts:

1 First waypoint is not always TAKEOFF, sometimes it’s WAYPOINT.
- TKOFF_THR_* params are only used during a takeoff
- While executing a WAYPOINT mission item in AUTO mode, throttle is handled by the autopilot so it will think it’s stalled and give full throttle (or trigger a crash if CRASH_DETECT=1 which it’s not). Use TAKEOFF to handle normal takeoff safety measures for throttle

2 Mission
- flight was generally low altitude
- DO_LAND_SART altitude is 66m? Altitude is ignored for this cmd.

  1. Landing
    • glide slope is shallow, 5.5deg. Is a steeper slope possible? If so, better to start the glide slope from higher up
    • LAND waypoint alt is 2m. Why?
    • WAYPOINT -> LAND alt transition is only 13m delta. It’s hard for the autopilot to stabilize in that short window. Your altitude is bumpy at the start and on the way down because of this.
  • RNGFND_LANDING=1 while RNGFND_TYPE=0 so Rangefinder is disababled but you’ve configured landing algorithm to expect it. It logs a height of zero because of this

  • THR_MIN = 3?

  • TECS_LAND_ARSPD = 8, but ARSPD_FBW_MIN=10 with STALL_PREVENTION=1. This means you’re commanding it to stall during a land but other constraints are saving you. You are confusing the autopilot.

  • suggestions: ALWAYS have first mission as TAKEOFF

  • suggestions: have land approach be longer altitude drop

  • suggestions: LAND alt=0m unless you really know what you’re doing

  • suggestions: set TECS_LAND_ARSPD to be a valid value. Confirm ARSPD_FBW_MIN is correct for the given airframe

  • Throttle was non-zero (~50%) during landing, but LAND_ABORT_THR=0 so abort via throttle is disabled

  • Abort seems to have happened via MAVLink command, I can’t say for sure without the tlog but that is the only case that would not show GCS text messages in the log, which there are none. Please provide a tlog if you have one to confirm.


(Adolfo Cobo) #6

Hello MagicRuB,
Thank you very much for your response, I greatly appreciate your help and all the suggestions.
It seems I messed up with some of the parameters, in my defense I would say that I was trying to avoid previous crashes that, at the end, seem to be related with the integrator reset bug in previous versions.

1 First waypoint is not always TAKEOFF, sometimes it’s WAYPOINT.

All the missions I’ve uploaded start with a TAKEOFF (15 meters, 15deg), today, I have re-load all of files and checked that, and they always start with TAKEOFF. Would it be possible that it is changed somehow upon upload to pixhawk? I have done three more flights today with the same auto missions, takeoff was always the first item.

While executing a WAYPOINT mission item in AUTO mode, throttle is handled by the autopilot so it will think it’s stalled and give full throttle (or trigger a crash if CRASH_DETECT=1 which it’s not). Use TAKEOFF to handle normal takeoff safety measures for throttle

I have TKOFF_THR_MINACC=5 and TKOFF_THR_MINSPD=0. I have verified that the full throttle starts only when I shake or move forward quickly the plane while in the first waypoint of AUTO mode, so I suppose it is in the takeoff stage and everything is normal (I just thought that throttle joystick needs to be at maximum after reading the sentence: “the autopilot starts in “throttle suppressed” mode”).

flight was generally low altitude

yes, I just wanted to do short missions to check landing.

DO_LAND_SART altitude is 66m? Altitude is ignored for this cmd.

I knew altitude was ignored, so I entered a random number. I inserted this DO_LAND_START command because i wanted the landing abort not to go back to the previous waypoint, but to a particular one so the last waypoints before landing were aligned.

glide slope is shallow, 5.5deg. Is a steeper slope possible? If so, better to start the glide slope from higher up

I have done two landings today with 10deg

LAND waypoint alt is 2m. Why?

I have done only this one flight with LAND altitude set to 2meters, just to check if the problem was related to baro drift. Intended landing point is actually about 2 meters above home due to the ground slope, so I wanted to be more precise about real ground location.

WAYPOINT -> LAND alt transition is only 13m delta. It’s hard for the autopilot to stabilize in that short window. Your altitude is bumpy at the start and on the way down because of this.

Changed to 30 meters.

RNGFND_LANDING=1 while RNGFND_TYPE=0 so Rangefinder is disababled but you’ve configured landing algorithm to expect it. It logs a height of zero because of this

My fault. Sonar was lost in the last crash and forgot to disable. Changed!

THR_MIN = 3?

No idea :frowning: changed to 0 now.

TECS_LAND_ARSPD = 8, but ARSPD_FBW_MIN=10 with STALL_PREVENTION=1. This means you’re commanding it to stall during a land but other constraints are saving you. You are confusing the autopilot.

That’s a good point. TECS_LAND_ARSP was set to 8 because first landings with Arduplane 3.8b5 were at too much (IMO) speed. I thought that the reason was that that I had set MIN_GNDSPD_CM to 10 m/s to assure a minimum ground speed in the case of some head wind, and this constrain was being applied also during landing. So I set MIN_GNDSPD_CM to 0 and set TECS_LAND_ARSP to 8 to force a reasonable landing speed. I had asked to Bormatec about the stall speed and they told me that 8 m/s is a minimum but safe airspeed, above stall. Just in case, I have set TECS_LAND_ARSPD to -1.

So, I have done all the suggested changes to parameters and have done two flights today, the same short missions in the same place.
In the first flight, I left the throttle joystick at about 50% during all the mission, the plane landed very well, but the throttle was risen to 50% right at the start of flare, as can be seen in the log:

For the second flight, I left throttle at 30% and motor engaged with this value at the start of flare:

After several seconds, without doing anything, the throttle cut itself.

What I can confirm is that the message “restarted landing sequence” that was the origin of my concern and the title of this post, is actually happening when I change mode after or during landing, not a condition generated by the autopilot.

And, above all, landing is now fine for me, I just have to remember to lower the throttle to 0 before landing.

Thankyou again for your time and all the suggestions.
Regards!
Adolfo.




(MagicRuB) #7

When in AUTO, feel free to leave your throttle at zero the whole time. Also, the default for TKOFF_THR_MINACC is higher than 5 for safety reasons. Watch out with a value of 5, you can trigger the throttle very easily.

In general, you have many many params changed. I suggest:

  • saving them to file
  • perform factory reset
  • load them all back in and understand every single one that is different than the default (many of them will be your calibrations which will be lost in the factory reset so make sure to load them over from the saved file

(Iam) #8

I’ve seen this before in MP. I write a mission with a T/O command, then read it back from the Pixhawk and the T/O command has vanished. It happens intermittently and infrequently.


(ranqingfa) #9

@Adolfo_Cobo Have you tried to mount a rangefinder?


(Adolfo Cobo) #10

Hello Firefly,
I had a rangefinder but was lost in a previous crash that I think was related with the “integrator reset bug” in Arduplane when changing modes. The crash was on a grass field and was so violent that we need several hours to find the motor, and the rangefinder is sitll there :frowning:
however, I think that the problem is not related to that, because I have done a lot of very short test missions and altitude values were good enough without using the rangefinder.
The problem is that once the flare stage is reached, the autopilot stops controlling the throttle and uses the amount of the transmitter joystick at that moment. I don’t know if this a bug or a feature, during the AUTO mission, it controls the throttle perfectly, but the start of the flare is somehow like an “end of auto mission” signal and it decides to give back the throttle control to the transmitter. The solution is quite straigthforward: to leave the trhottle at minimum.

Thankyou and regards!
Adolfo.