Quadcopter highly unstable with ANGLE_MAX set to 8000

I set ANGLE_MAX to 8000 (maximum angle of tilt changed from 45 degrees to 80 degrees) as a precursor to using a companion computer to pitch my drone to 80 degrees as part of a computer-controlled aerobatic manoeuvre I am attempting.

After setting the new value of ANGLE_MAX, I entered LOITER mode and flew the drone upwards. Shortly after nudging the right hand joystick to move the drone around in X-Y, the drone suddenly underwent massive tilting from side to side like a drunken monkey. Somehow it stablised and landed okay.

I previously tried sending velocity and position targets in SITL and things worked fine there, although admittedly this is not the same as manually flying in LOITER mode.

I do not have a video but I do have a log. It is the last flight in this log:

EDIT: correct log posted in my next post in this thread

Password is simply my username.

I have done an autotune on my drone but nothing beyond that, however I am shocked that my drone could behave so erratically with this change, given it seems very stable most of the time. I honestly thought I was in for a crash.

Thanks.

The ANGLE_MAX shouldn’t change any behaviour except when reaching that limit, so it is unlikely to be the cause of instability. You only reached 10 degrees maximum on that log, mostly 5 degrees.
I would say the issue is still tuning and this flight was worse than previous flights because the attitude control got affected more for some unknown reason. Maybe wind or temperature was different…

Don’t even worry about guided mode and missions until tuning is nailed down. Otherwise you’ll end up confusing tuning issues with flight mode behaviour and it will be more confusing than necessary.
You could set ANGLE_MAX back to 45 degrees for now, then later increase it when needed.

You key flight modes for testing will be Stabilise, AltHold and Loiter. Don’t worry about PosHold, it’s outdated and Loiter is much more configurable.

Pitch and Roll are behaving differently because of only running Autotune on Pitch. Each have their good and bad points.

Yaw is not quite out of control, but it is doing it’s own thing and cant keep with Desired Yaw, mainly because pitch and roll are getting busy.

Your Vcc (5v dc supply to the flight controller) is going dangerously low. Check what it really is with a digital multimeter. You might want to add an electrolytic cap across the regulated 5 volts (on the FC board) and another right on the battery input side of the power brick. Or just throw it away and get a better one. Left how it is, this will eventually cause a mid-air brown-out and crash. The cheap Pixhawk clones come with a power brick that is missing key parts and the main FC board is usually also missing important power management parts - all meant to ensure reliability, but excess to requirements when price is king.

Your battery voltage monitoring is OK but you might want to verify the accuracy. Current monitoring is definitely wrong though, it more closely matches the voltage reading in trend, which is backwards for current. Check wiring, which wires go to which pins. Shorted current and voltage monitor pins?? maybe that power brick is bad?? Unsure…

There seems to be plenty of “power” or thrust, you might want to lower MOT_SPIN_MIN,0.15 to about 0.12 so motors don’t hit that minimum (much) during normal use.

There are a lot of default values.
Definitely set more values by connecting to MissionPlanner, go to Setup, Mandatory Hardware, Initial Parameters
Put in you prop size and battery cells there, also select the other optional parameters check box (not the T-Motor Flame settings though) and accept everything it offers.
Apart from a bunch of filter settings, this will also set the Fence, meaning you cant arm until there’s a good 3D fix (which takes time, and that’s a good thing) but it will also set the correct battery voltage related settings and these babies:
BATT_FS_CRT_ACT,1
BATT_FS_LOW_ACT,2

Also set these before the next test flight, to even out the PIDs between pitch and roll and get some logging for the Harmonic Notch Filter configuration
ATC_ANG_RLL_P,6.5
ATC_ANG_PIT_P,6.5
ATC_RAT_RLL_P,0.12
ATC_RAT_RLL_I,0.12
ATC_RAT_RLL_D,0.0075
ATC_RAT_PIT_P,0.12
ATC_RAT_PIT_I,0.12
ATC_RAT_PIT_D,0.0075
INS_LOG_BAT_MASK,1

Also to help out the GPS module set this, it might also improve that wandering position in Loiter:
GPS_GNSS_MODE,65

Now let’s see the .bin log from the next flight :slight_smile:

3 Likes

Thank you so much for your detailed post. I will spend tonight/tomorrow looking at it.

In the immediate term, I realise I posted the wrong log. I’m sorry to have done this… last time I checked Arducopter created one log per “battery power up” but it now seems to split the log files up more readily which is why I posted the wrong log.

Please see the correct log below; password is my username.

https://www.dropbox.com/s/ebikvh5pxsi9uud/log.bin.zip?dl=0

You can see the crazy behaviour with pitch to 150 degrees(!). I am certain it is no coincidence that I had just set ANGLE_MAX to 80 degrees. The flights before and after with ANGLE_MAX set to 45 degrees did not exhibit that behaviour.

I think the same holds true for this log file.
In the first one there’s no RC Input except throttle and yet there’s still plenty of oscillations and movement.
In this log file there is a full stick deflection (not just a little nudge) and since the 45 degree limit is not in place the aircraft easily tilts beyond 50 degrees then has trouble recovering stability.

Get the tuning right and the rest will fall into place.
There’s no reason (so far) that you cant get Desired attitudes and Actual attitudes perfectly overlaid, and that’s how it should be before you start radical manoeuvres or going out in strong winds, like this quad. There were strong winds this day:

EDIT:
and this is a larger quad capable of lifting a few kilograms, you can clearly see the effect of the 45 degree limit - there’s no side effects or oscillations, it just wont tilt over more. Notice the tuning is equally “locked-in” as the smaller quad in the previous graph.

1 Like

Honestly, the winds were pretty light. I would say about 10-15 miles per hour at ground level. Maybe a bit higher higher up. Edit: sorry, I see you were just giving an example of a quad flying in strong winds.

I think it’s pretty disturbing to see 150 degrees of pitch in a quadcopter! That’s basically upside down.

I have already learned one lesson which is I need to download the latest log as soon as I see a problem to avoid confusion between logs.

Anyway, I’ll get tuning and see if that helps. Thanks again.

Okay, I’ve read this now and the Arducopter manual tuning web pages. Do you just suggest I use the Mission Planner wizard to set these values and see how it goes? (Had no idea there was this initial tuning values tool in MP.)

Should I do Autotune as well? BTW, I did Autotune a year ago on this quad but without changing and default values as you suggested.

Basically, do I just need to fly the drone around in STABILISE mode to get some data which I can post back here?

Edit1: one more thing. Is current monitoring mandatory for tuning and flying? I ask because I have another bigger drone that I need to tune after this one and it has a faulty current pin. :frowning:

Edit2:I don’t think I am at risk of brownout as the minimum voltage is 4.1v.

Sorry for all the questions. I’m aiming for a Wednesday flight if the weather is okay.

The minimum voltage to run the flight controller is 4.1v BUT you wont be able to plug in anything else since the GPS (for example) needs 5 volts. And I wouldn’t be trusting it either, not until there is a safe margin.

Current monitoring is not mandatory but it is useful. Accurate voltage monitoring is extremely important.

Follow the instructions you quoted then take off in Stabilise, if everything seems OK change to AltHold, hover for a while and do some gentle movements (pitch/roll/yaw).
Let’s see that log, and maybe adjust some settings.

If everything is going to plan you can test Loiter and then run Autotune on pitch and roll axis, or all three axis if you battery will support that. I would hold off until we check the next log though.

1 Like

Hi there, I had some delays due to replacing the UBEC with a more expensive/reliable one and wind and rain. I have set the min motor speed and arm speed to lower values than before as I determined using motor test.

I present 2 logs which compose some flying I did today with all the Mission Planner tuning params set, as per the “Initial Parameter Set” tab.

Password is my username. There is also a video of the flight:

and landing:

The part of the landing seen in the video is done under RTL mode with no user joystick input; the battery went low quicker than I expected probably as Mission Planner is very conservative regarding battery safety.

In the flight, I spend the first half in STABILIZE and the second half in ALTHOLD roughly speaking (though I switch around a bit later in the flight).

The wind speed was 5mph or less. The drone randomly twitched in different directions thoughout flying though I expect the logs show this. It was definitely harder to control than with the original params.

I’d be super grateful to hear your thoughts on what I should be up to next. Thanks again.

The tune on this craft is terrible and the motor outputs are oscillating wildly. Why are you using EKF2?

For reference this is what you want to look at in the logs:




The Initial Parameter Setup in MP is just that, Initial. Real tuning starts from that.

1 Like

I first installed Arducopter 2 years ago and have updated it regularly to the latest version. I have been using default settings (mostly). What should I be using instead of EKF2?

Thanks for the log images… I am grateful for all/any help I can get.

@xfacta I wondered if you had a take on all this? Cheers again.

EKF3 is default now.

1 Like

I did a flight with EKF3. The first flight was just STABLIZE. The second flight was STABILIZE for takeoff, followed shortly by ALTHOLD.

These are the logs (password is my username):
https://www.dropbox.com/s/k1q903kxtjc9dy9/stab_alt.zip?dl=0

You can see the yaw is okay, but DesRoll/Roll shows lots of noise. In practical terms, the drone was jerking around a bit, like a hyperactive child.

How would I reduce this behaviour? The documentation only talks of problems with oscillation which I do not appear to have.

BTW, I also did a test with MOT_HOVER_LEARN set to 2. This gave me a MOT_THST_HOVER value of 0.125 which is too small to set PSC_ACCZ_P to. Please see image below:

I’m not sure what to do here.

Finally, I also enabled IMU logging but I’ll save this for a later post once I’ve been able to discuss the first 2 issues hopefully with some kind forum member. Thanks.

And the answer is…

  1. It does not matter if MOT_THST_HOVER is less than 0.2 when setting PSC_ACCZ_P. I did not experience problems setting it like this.
  2. There was absolutely nothing wrong with the tune. The problem was IMU noise and the specific variable causing me all the trouble was INS_GYRO_FILTER. The Mission Planner tuning initial parameter wizard set it very unhelpfully to 46Hz which meant the noise peak at… you guessed it… 46Hz got absorbed by the flight controller and made the drone twitch all over the place.

Moral of the story: always tune your dynamic notch filter before applying Mission Planner tuning wizard Initial Params. This is in total constrast to the Arducopter wiki which says use the wizard first!!!

That must be an odd situation with vibrations and resonance of your aircraft. The normal advice is usually the correct way of doing things. It would definitely be acceptable to lower the gyro value if experiencing issues, of course.
I’m glad you got a solution, always good to hear about more non-retail aircraft in the air.

Edit:
The PSC_ACCZ params are fine at defaults, usually best using the formulas, but also OK to go with whatever works. Smaller overpowered quads generally need PSC_ACCZ values well outside the normal range.

For the Gyro and related filter settings if the calculated values give less than ideal results, go with a some basic ranges like 40/20 , 30/15 or 20/10 , working your way lower until there’s stability.

Here are the IMU noise graphs before and after dynamic notch filtering which explains why the Mission Planner initial parameters caused so much trouble for me:

Before:


After:

What do you mean 40/20? Centre at 40 and width of 20?

I think the wiki is deficient on the note of IMU noise. Using Initial Params wizard is dangerous and contradicts the safe 20Hz IMU filter provided by the Arducopter defaults.

I meant for the INS_GYRO_FILTER/ATC_RAT_xxx_FLTx values
Many times I’ve had the “Initial Parameters” values work better than the defaults. There’s always going to be an exception to every rule though :slight_smile:

I’ll bear that in mind. BTW the Pixhawk is on vibration isolation mounts and I thought I had done a good job of prop balancing but apparently not since that noise peak is getting through to the IMU.

The only thing playing on my mind now is whether the 46Hz was a throttle-dependent oscillation or a static oscillation.

i.e. if it is just the frame resonating then perhaps I should have used a static filter? Maybe I need to get some IMU noise logs while ascending/descending repeatedly to check that the peak shifts from 46Hz?

Hello Dave.

Would you be able to share some sample graphs of a correctly tuned frame by any chance?

BR.

1 Like

Normally yes but I have been working remotely for a few months and don’t have access to any of my RC craft. I looked for some of my previous post on the forum here where I posted logs but the links are to Dropbox folders that I have since deleted.

Cool. No worries. Perhaps later.