ChibiOS - Aggressive switch to LAND mode is back!

Unfortunately, I’ve just found out that the Copter stops far too aggressive when flying in Loiter mode and switch into Land mode. This has already been fixed in version 3.6.7 under NuttX. Was this forgotten when switching to chibiOS?

@rmackay9 - Please look at this picture or the log file to confirm. This is very dangerous for a big autonomous flying drone. PLEASE, it would be nice if this works properly again in the next version.
Thank you in advance!

00000015.BIN (763.5 KB)

Please note, this is a big drone with 24" Props and an angle_max of 3000. As you can see, the stopping is too extreme. I fly with Pixhawk 4 and 3.6.9 ChibiOS. Recently I flew version 3.6.7 under nuttX, here the behavior did not occur, or rather was fixed.

PID tunining and everthing else is fine.

@Fabian,

I strongly suspect that this is not a ChibiOS vs NuttX difference but instead a tuning or environmental issue. ChibiOS allows ArduPilot to run faster and more regularly than NuttX but there should be no difference in features or behaviour. I’m pretty sure that if back-to-back tests are done with Copter-3.6.x on NuttX and ChibiOS it will perform the same.

Just looking at the Roll vs DesRoll we can see that the actual roll is deviating from the desired roll fairly regularly. I suspect there is some kind of tuning issue although I see that some good things have been done for a copter of this size including reducing the ATC_ACCEL_P_MAX and ATC_ACCEL_R_MAX (perhaps done using AutoTune).

My guess is that ATC_RAT_RLL_P/I should be raised by at least 10%. P rates also look to be underperforming so perhaps the same should be done for ATC_RAT_PIT_P/I.

Could you try reducing some of the LOIT_ parameter values and see if this helps?

  • reduce LOIT_ACC_MAX from 500 to 400
  • reduce LOIT_BRK_ACCEL from 250 to 200
  • reduce LOIT_BRK_JERK from 500 to 400

A few perhaps unrelated things I’ve noticed in the logs:

  • MOT_BAT_VOLT_MAX is lower (at 18) than MOT_BAT_VOLT_MIN (which is 24)
  • MOT_SPIN_MIN is set very high at 0.3. This reduces the available range for the ESCs. I’d reduce this back to the default and if there are issues with the ESC range then perhaps the ESCs need to be calibrated or MOT_PWM_MIN, MOT_PWM_MAX can be used to set the output range that matches the ESCs
  • the RC input doesn’t seem to have been calibrated. RCx_MIN = 1100, RCx_MAX = 1900 although I’m surprised this is not triggering a pre-arm check
  • there’s a motor imbalance between CW and CCW motors. It’s perhaps borderline OK.

One thing that looks odd is the MOT_

1 Like

Thanks for the quick and detailed answer, I appreciate that. I have repeated the test again and have the parameters adjusted to your information (except ATC_ACCEL_P), you can check it in the log file:

00000022.BIN (806.7 KB)

I have not noticed any real positive changes. Maybe I have to adjust the pids settings even more aggressive, but I’m rather careful. In addition, it apparently already flies very well. But I’m grateful for every tip!

I can remember the version 3.6.6 back well. I was very happy when the Verison 3.6.7 came out and the Copter finally did not make a “stop” anymore when it switched to Land or Auto mode. A difference like day and night. Sure, I could reduce the LOIT_ACC_MAX or even ATC_ACCEL_P even further, but eventually the flight stability or wind resistance will be lost. What do you think?

We fly with Li-ion batteries 6S 30600mAh, therefore the voltage scaling of the batteries would not be wrong. Can you recommend the features with the MOT_BAT_VOLT_MIN? What happens in the background? Is only the P value increased when the battery drops?

I have the spin_min set to 0.3, which is equals with ~1350ms. Below this value, the engine takes too long to restart. Of course it does not stop, but you can see it in flight at very low rpm’s, as the Proppeller turns black, then the copter almost falls out of the air or needs a little longer to stabilize. This also happens when the wind packs under the Proppeller and slightly raises the Copter. You often have that when landing in front of a house roof.

The remote control actually has exactly 1100 to 1900 on all channels. I have to manually set + -1 so that the prearm error has disappeared.

Thank you very much for your effort.

Could you try reverting to 3.6.7 to confirm the issue is resolved? These should be available from the MP’s, “Pick Previous Firmware” link on the bottom right of the Install Firmware screen. Alternatively stable-3.6.x firmwares are available directly from firmware.ardupilot.org although you’ll need to know which firmware is right for your board. For most Pixhawk-compatible boards “fmuv3” (for ChibiOS) or “PX4/ArduCopter-v3” (for NuttX)

1 Like

I testet with version 3.6.7 and 3.6.8 useing chibiOS and pixhawk 4. There was no difference regarding the stop behaviour - still aggressive. Thats why I assume its due to the chibiOS. With our other copters using the pix32 from holybro and 3.6.7 (nuttX) there is no stop! It just descends and stops very smoothly. No peak at all in the logs. I am prettty sure, this kind of stop can not be solved just by changing some parameters. But I am open to conviction that i am wrong :wink:

@Fabian, OK, could you please try reverting to 3.6.7 under NuttX on this exact copter?

1 Like

I have not installed the old Pixhawk on this copter because it would be too much effort to change all the connectors and power module there now. By the way, I was wrong, switching to landing mode was slightly different with version 3.5.7. Presumably before the new Loiter mode. So this actually has nothing to do with the chibiOS. I’m sorry for the confusion!

Nevertheless, the Copter reacts too aggressively when switching and this has nothing to do with wrong parameter values. I’m absolutely sure every big copter will have this behavior that when you fly relatively fast and then switch to landing mode, you feel like you’re about 5 years older … With a smaller copter this is not so strong noticeable because of the much higher rpm and regulation, but with larger ones in every case.

Since I have to finish the copter now, I’ll have to live with it first and put in my groundstation a query that you can only switch to landing mode when the airspeed is <= 5 and roll and pitch is in the middle position. It only becomes dangerous if errors occur in flight and the flight controller changes into landing mode at full speed. If you then add wind and an almost empty battery, such an extreme stop can cause a crash.

Maybe in the future you could slowdown the copter first and then begin with the descent. But you certainly know that better than me.

I will now try to increase the PID settings even further and reduce the ATC_ACCEL_P_MAX values on the other side. Maybe I can counteract the aggressive stopping at least a little. I hope the copter can still keep up with the wind then. Thank you for your help!