Tridge Please help.. 2.76 log attached, still RTL problems,

Tridge, or whomever,

I have attached a link to my log from today. ( this forum says Sorry, the board attachment quota has been reached. when I try to upload it)

dl.dropboxusercontent.com/u/925 … 32-58.tlog

2.76 in a Penguin airframe, about 5 lbs,

It still gives me major problems. very “unstable”, compared to 2.73.

RTL still a wild ride, Loiter is a figure eight, There is a short auto mission included. auto it was just hunting for the path, it did fly it, but seems to try too hard…
I know some of my PIDs are off or something, just not sure what to try next. I copied another Penguin who says his flies good with 2.76… so I need to change mine I guess.

Also, it was a calm day, and I was getting wind reports of 20 mph sometimes… Something to do with my APM I guess.
But… 2.73 was solid enough for me, wind was accurate, stablize worked rtl worked…

I just don’t want to be stuck at 2.73…
any help is appreciated. I can send video as well. the plane seems to just jump around, wings dip back and forth, etc…

flew again yesterday with same result. flies pretty good in FBWA, but Loiter and RTL it can’t seem to settle down and circle, it just hunts and does figure eights… does anyone out there have a tuning suggestion?

thanks

If anyone can look at this, I am still having crazy RTL and Loiter… it ran the auto mission pretty well and FBWA seems pretty good.

But RTL is off. first it seems to now only use the altitude it was in when it was switched to RTL instead of a set altitude…

But when it gets back it goes into some crazy gyrations and never settles into a circle…

Finally , if anyone is analyzing this log, my STAB mode is now so twitchy - responsive! How can a reduce stab down to be more “stable”… it seem like it was gonna flip in stable mode!

Thanks to anyone who can offer suggestions…

Hi, sorry for the slow reply!
I have started to look at the log and will post an analysis soon.
Cheers, Tridge

Hi Harfordhawk,
I’ve had a look at your log and found a couple of issues.
The first is that you have quite strong magnetic interference from your motor or wiring. Have a look at this graph of the total magnetic field and your throttle level:


as you can see there is a very strong correlation between the measured magnetic field and your throttle. Have you moved the wiring at all recently? Or moved the compass?
What you may not realise is that bad heading due to this sort of magnetic interference can strongly impact on the attitude (roll/pitch) estimate, which means it can impact on all stabilised flight modes.
It also greatly affects navigation. Have a look at this graph of the compass heading versus the GPS heading while you were in AUTO:

You also seem to have too high P gains for both roll and pitch. Let’s look at roll first:

See the oscillation? That means the P value is too high. Try using 1.5 instead of the current value of 2.3.
The same problem happens with pitch:

Regarding the figure-8 loiter:

that is a combination of two problems. The first is a real bug where APM can get stuck going around the loiter in the wrong direction, and as it tries to turn around it will do this sort of figure-8. Paul and I hope to fix this for the next release.
The second cause of the bad loiter (and why it went in the wrong direction in the first place) is the compass interference. If you can fix that and also fix the above tuning I think you’ll find it will fly a lot better.
I’d also suggest you use a bit bigger loiter radius.
Cheers, Tridge

Thanks so much for taking the time to review this.

I was lost for a moment, when I realized you were analyzing the first log I posted from back on Dec 2, instead of the most recent. I am sorry . I assumed you would analyze the most recent I posted. since the log you just looked at, I have changed things, installed external compass ( which I think gets rid of all that interference, and I changed the loiter radius. I will have to look at the gains you reference, but I may have changed them as well.

Anyway, if you have time, could you peek at the most recent log? I too, was hoping that the mag interference was a huge part of the problem, but it wasn’t.

And to be honest, I had this kind of interference for quiet sometime before 2.74 and up, and the plane flew quiet well.

thank you

Thank’s guys Im going to review this things if it my problem too :slight_smile:

I found your analysis so helpful.
A couple quick questions.

  1. What would be considered an acceptable range for mag field?
  2. You graphed RAW_IMU, ATTITUDE. What is the equivelant in MP tlog? RAW_IMU, xmag perhaps?
  3. How can I see which mode I was in when graphing the tlog?
  4. What is considered acceptable vibrations for Plane?

Thank you.

[quote=“harfordhawk”]Thanks so much for taking the time to review this.
I was lost for a moment, when I realized you were analyzing the first log I posted from back on Dec 2, instead of the most recent.
[/quote]
ahh, sorry, I did this as I was rushing to pack for Christmas holidays. I’m now relaxing after Christmas dinner so I have a bit more time.

the compass interference is still quite bad. If it didn’t affect 2.74, can you post a 2.74 log with the same setup so I can directly compare?

Here are the graphs for your 21st December log.
First the magnetic field versus the throttle:


as you can see your magnetic field is still strongly correlated with your throttle.
If we look at the actual magnetic heading then we can see the exact impact it is having:

as you can see there are times when the compass is causing an error of more than 50 degrees in heading. If you can’t fix it you would be better off just disabling the compass by setting COMPASS_USE=0 (don’t do that if you do auto hand launches though).
It is less compass interference than your last log, but it is still bad enough to cause a lot of problems.
Let’s look at the roll controller tuning:

I still think your P gain is too high. I’d suggest the following changes:
RLL2SRV_P -> 1.5
RLL2SRV_D -> 0.05
keep RLL2SRV_I at 0.1
Now let’s look at pitch:

you can see a lot of oscillation there! The poor plane is twitching up and down like crazy. I’d suggest dropping PTCH2SRV_P down to 1.2, and dropping PTCH2SRV_D to 0.05. The I value of 0.1 is probably fine.

that is what you have it set to do :slight_smile:
You have ALT_HOLD_RTL set to -1, which means “use the current altitude”. See the documentation here: http://plane.ardupilot.com/wiki/arduplane-parameters/#RTL_altitude_ArduPlaneALT_HOLD_RTL
Cheers, Tridge
PS: Happy Christmas!

If the problem is just in STABILIZE mode then you should either use “dual rates” on your transmitter or just reduce the surface control throws either by physically changing the control horn setup or just by reducing the “rate” in the transmitter. I suspect you have far too much throw on your ailerons and elevator. A common mistake people make is to think that they need to be able to move the ailerons and elevator all the way up and down, when with many (most?) planes it will fly a lot better with a much smaller throw range. On some of my planes I fly with the “rates” set to 20%, so I only have 20% throw. That is still plenty to do nice loops and rolls on my AcroWot.
It is very aircraft dependent though. A good plane will tend to have a manual that recommends the amount of throw in terms of centimeters of deflection of the surfaces (at the trailing edge). If your manual doesn’t have that then just try using half of what you have now. If you can easily control the plane in MANUAL then you probably have too much throw.
If you do change the rates in your transmitter then make sure you re-do the RC calibration.
Cheers, Tridge

[quote=“iskess”]I found your analysis so helpful.
A couple quick questions.

  1. What would be considered an acceptable range for mag field?

  2. You graphed RAW_IMU, ATTITUDE. What is the equivelant in MP tlog? RAW_IMU, xmag perhaps?

  3. How can I see which mode I was in when graphing the tlog?

  4. What is considered acceptable vibrations for Plane?
    [/quote]

  5. I usually try to get the magnetic variance below 20%, but it actually depends on what axis it is on. Comparing GPS heading and compass heading in low wind is a great way to test.

  6. I’m not sure that MP can graph magnetic heading from RAW_IMU. I plan on making mavgraph easier to use on windows soon to make this sort of analysis easier for windows users.

  7. I usualy use mavextract to pull out the modes into separate logs. I’m not sure how to do that with MP (I don’t use MP)

  8. plane is not very sensitive to vibration, unlike copter. I haven’t seen a plane badly affected by vibration for more than a year. I’ve tried to maximise vibration in my planes to see if I can cause a problem and no matter how hard I try to make it vibrate badly it still flies well.

Cheers, Tridge

[quote=“tridge”][quote=“harfordhawk”]Thanks so much for taking the time to review this.
I was lost for a moment, when I realized you were analyzing the first log I posted from back on Dec 2, instead of the most recent.
[/quote]
ahh, sorry, I did this as I was rushing to pack for Christmas holidays. I’m now relaxing after Christmas dinner so I have a bit more time.

the compass interference is still quite bad. If it didn’t affect 2.74, can you post a 2.74 log with the same setup so I can directly compare?

Here are the graphs for your 21st December log.
First the magnetic field versus the throttle:


as you can see your magnetic field is still strongly correlated with your throttle.
If we look at the actual magnetic heading then we can see the exact impact it is having:

as you can see there are times when the compass is causing an error of more than 50 degrees in heading. If you can’t fix it you would be better off just disabling the compass by setting COMPASS_USE=0 (don’t do that if you do auto hand launches though).
It is less compass interference than your last log, but it is still bad enough to cause a lot of problems.

[quote] [color=#BF00BF]Harfordhawk reply[/color]: I have just recently installed an external mag and located it out on the tail boom, about 11 inches from motor and no electrical fields out there. It is sitting about 3 inches from the GPS antenna. I don’t know why this has so much interference… I was flying this same plane with internal mag for 6 months with firmware pre-2.73 and I didn’t have problems, ( I don’t know if I had inference, just no problems that I was aware of) Now in that config, there was ESC wires running almost on top of apm case, as well as many other electrical wires and a 5000 mah battery sitting within an inch…

So, I am perplexed by the mag deal.[/quote]
Let’s look at the roll controller tuning:


I still think your P gain is too high. I’d suggest the following changes:
RLL2SRV_P -> 1.5
RLL2SRV_D -> 0.05
keep RLL2SRV_I at 0.1
Now let’s look at pitch:

you can see a lot of oscillation there! The poor plane is twitching up and down like crazy. I’d suggest dropping PTCH2SRV_P down to 1.2, and dropping PTCH2SRV_D to 0.05. The I value of 0.1 is probably fine.

that is what you have it set to do :slight_smile:[quote] [color=#BF00BF]harfordfordhawk reply[/color] : yes I see that now… it must have set it when the 2.76 firmware goes in, 'cause I didn’t knowingly set it that way… no problem…[/quote]
You have ALT_HOLD_RTL set to -1, which means “use the current altitude”. See the documentation here: http://plane.ardupilot.com/wiki/arduplane-parameters/#RTL_altitude_ArduPlaneALT_HOLD_RTL
Cheers, Tridge
PS: Happy Christmas![/quote]

[color=#BF00BF] Merry Christmas to you and thanks, I will report back…[/color]