PID tuning for large frame

Hello
I have problem with tuning my plane, it is quite large (wingspan 3.7m). The biggest problem (Maybe I’m wrong ) is that my plane is very stable - it levels in air by itself (in manual) .
I was trying to tune the PID’s for quite long time now with no effects - plane cant fly simple box pattern, it snakes on track and it loose stability in corners ( falls ) etc.
Also I’m using flight gear and APM in hill mode to practice, the “rascal” is very similar to my plane.
Did anyone tried AMP on large stable plane ? Can I get some tips for tuning ?

Thanks

Hi Killer,
Sorry no one has responded to your question yet. Can you post a copy of your parameters? Perhaps a tlog or a log file if you have can?

I have a 2.4m Super Sky Surfer that had similar issues in the beginning. I think you will find that your P,I,D, terms are just way too low (for now just focus on the P term). For me my P term for both Pitch and Roll are up near 2.0, a long way from the stock P terms! Yours may need to be even higher than that. Your NAVL1_PERIOD is probably too high as well (though what we really need is a tlog to be able to tell). You’re probably also going to want a large value for waypoint radius when planning missions, for me this is around 120’ (36-37m), for you it will probably be a bit larger.

Have you followed the tuning guides carefully http://plane.ardupilot.com/wiki/roll-pitch-controller-tuning/, http://plane.ardupilot.com/wiki/tecs-total-energy-control-system-for-speed-height-tuning-guide/,and http://plane.ardupilot.com/wiki/navigation-tuning/? It really helps if you have someone to either fly the plane or adjust the parameters for you via a telemetry link. What I did to fine tune the parameters, once I got to a point where the plane could navigate reasonably, was to define a simple mission that would fly a box loop over and over again; then I would pull up the tuning window in the Mission Planner and plot ROLL and NAV_ROLL and watch the plots as the plane flew. I would then adjust the parameters based on what I saw and repeat until I obtained the response I was looking for. Once this was complete I would repeat the process for PITCH and NAV_PITCH. Pretty soon I had it navigating well and could focus on fine tuning other parameters. Sometimes its a back and forth process where one parameter can affect the behavior of another so you go back and tune it some more.

Anyway post you parameters and a tlog if you can and we’ll get things sorted out!

Regards,
Nathaniel ~KD2DEY

[quote=“Nathaniel Caner”]Hi Killer,
Sorry no one has responded to your question yet. Can you post a copy of your parameters? Perhaps a tlog or a log file if you have can?

I have a 2.4m Super Sky Surfer that had similar issues in the beginning. I think you will find that your P,I,D, terms are just way too low (for now just focus on the P term). For me my P term for both Pitch and Roll are up near 2.0, a long way from the stock P terms! Yours may need to be even higher than that. Your NAVL1_PERIOD is probably too high as well (though what we really need is a tlog to be able to tell). You’re probably also going to want a large value for waypoint radius when planning missions, for me this is around 120’ (36-37m), for you it will probably be a bit larger.

Have you followed the tuning guides carefully http://plane.ardupilot.com/wiki/roll-pitch-controller-tuning/, http://plane.ardupilot.com/wiki/tecs-total-energy-control-system-for-speed-height-tuning-guide/,and http://plane.ardupilot.com/wiki/navigation-tuning/? It really helps if you have someone to either fly the plane or adjust the parameters for you via a telemetry link. What I did to fine tune the parameters, once I got to a point where the plane could navigate reasonably, was to define a simple mission that would fly a box loop over and over again; then I would pull up the tuning window in the Mission Planner and plot ROLL and NAV_ROLL and watch the plots as the plane flew. I would then adjust the parameters based on what I saw and repeat until I obtained the response I was looking for. Once this was complete I would repeat the process for PITCH and NAV_PITCH. Pretty soon I had it navigating well and could focus on fine tuning other parameters. Sometimes its a back and forth process where one parameter can affect the behavior of another so you go back and tune it some more.

Anyway post you parameters and a tlog if you can and we’ll get things sorted out!

Regards,
Nathaniel ~KD2DEY[/quote]

Hello, thanks for your post :slight_smile:
I’m trying to tune the pids for about 4-5 months now. Yes I used the tuning guides, they are helpfull but still not enough :slight_smile: (or maybe I’m doing something wrong) The biggest improvement was the differential ailerons - the plane is now capable to operate on auto mode (it don’t fall down easily in corners) but it snakes A LOT when following straight path.
I’ll attach the logs today

@Killer,
The ArduRover User Group is now using a rover version of the aircraft L1 code. I have found that if the NAV_PERIOD value is too small, the vehicle will snake from side to side from waypoint to waypoint. I have found that the rovers do well with NAV_PERIODs of around 8 which is way smaller than a plane should use, but I am sure that using a NAV_PERIOD that is much smaller than the default value may be causing the snaking when following the track from waypoint to waypoint.
Regards,
TCIII Developer

I followed Nathaniel’s advice on my Super Sky Surfer and found the advice to be of great help. My SSS now flies great in nearly all respects with one minor issue. When pointed 180 degs away from Launch, then engaging RTL, it turns quite violently back toward RTL instead of making a bit larger smoother turn. It almost looks as though it’s going to stall but manages to continue. Anything less than 180 degs, say 90 or so and it is very impressive on the Return to Launch. Otherwise, everything Nathaniel has advised worked flawless. I hope yours works out as well.

I’m really impressed with the work the devs are putting out and look forward to trying out the new 2.75 FW.

@Jezmo-Send me a PM so we can exchange information. I would like to hear your thoughts and perhaps trade parameter files.

Hi,
I fly a couple of 3m wingspan planes. If you post a tlog of a flight then I may be able to suggest some tuning changes.
Cheers, Tridge

Hello
I’m going to the field today so I’ll post fresh logs
Thanks

Lucky you! It’s 31°F here (-1C) with light winds and wintry conditions. :cry: Have fun, I look forward to seeing your log and reading Tridge’s analysis! I’m sure I will benefit from it as well!! :smiley:

Thanks Tridge!

Hi
Weather was OK today ( some wind and clouds)
here are the logs from flight dropbox.com/s/ywn24gyqjzbxt7z/logs.zip . There are logs from MP and from APM.

Last time we decided to wipe all settings to default and tune them once again - we tuned the PID’s with APM tutorials. Today we tried to tune TECS (motor) and AS/ALT pitch PID.
First part of log is FBWB tuning the TECS(motor) PID to follow the airspeed, next was the AS pitch pid there was no time to tune the ALT pitch pid properly.
Last part of log is AUTO mode with 2 way-points (straight line ) - plane has problems with turning, snakes on patch and doesn’t hold alt (PIDS are not tuned ).

The most important change between new and old settings is IMAX on basic pitch and roll settings - they are bigger and the P is smaller.

We tuned the AS pitch PID by disabling the ALT pitch pid on tecs_weight (or similar parameter I don’t remember the name)

Also can you tell me why HUD shows sometimes “bad compass health” message ? i2c errors count in status shows 0, any other toughs ?

I haven’t looked at your logs yet, but the “bad compass health” will be caused by an inconsistency between compass and GPS. If the two are different by more than 45 degrees, ground speed is above 3m/s and the wind estimate is below 80% of the ground speed then it will stop using the compass and use GPS for heading. That is to prevent bad magnetic interference from stopping effective navigation.
For 2.75 I changed this code so it will only declare the compass unhealthy if the condition persists for more than 2 seconds.
Cheers, Tridge

[quote=“tridge”]I haven’t looked at your logs yet, but the “bad compass health” will be caused by an inconsistency between compass and GPS. If the two are different by more than 45 degrees, ground speed is above 3m/s and the wind estimate is below 80% of the ground speed then it will stop using the compass and use GPS for heading. That is to prevent bad magnetic interference from stopping effective navigation.
For 2.75 I changed this code so it will only declare the compass unhealthy if the condition persists for more than 2 seconds.
Cheers, Tridge[/quote]

Thanks for answer ! Is 2.75 available as beta? can I use it to tune PID or this is bad idea ?

2.75 was released a few days ago
See the 2.75 forum topic.
Cheers, Tridge

[quote=“tridge”]2.75 was released a few days ago
See the 2.75 forum topic.
Cheers, Tridge[/quote]

Here are my logs from yesterday with new firmware 2.75
dropbox.com/s/ti09yp7z7vprvbj/logi.zip
No tuning was made only new firmware tests. Please have a look.

What happen to other PID’s (as pitch pid, alt pitch pid, motor pids) ? are they still used and buried somewhere or they are no longer used by any controller ?
Is there any graph of APM controller ?

Hi Killer,
When you post logs it is helpful to also describe what you saw as the pilot. That allows me to concentrate on issues you saw. Doing a full from-scratch analysis of a set of logs can take a long time, but it can be much quicker if you describe what issues I should be looking for.
Cheers, Tridge

[quote=“tridge”]Hi Killer,
When you post logs it is helpful to also describe what you saw as the pilot. That allows me to concentrate on issues you saw. Doing a full from-scratch analysis of a set of logs can take a long time, but it can be much quicker if you describe what issues I should be looking for.
Cheers, Tridge[/quote]

Hello
Thanks for your help.
We did another flights today you can find logs ( telemetry and flash ) here :
dropbox.com/s/imw3cfu8h7c7s … h_logs.zip
dropbox.com/s/8dbqzac4fh1yi … 013_MP.zip
dropbox.com/s/wlml8fb90m8ub … ings.param

We uploaded default settings and we tune the
-Pitch PID
-Roll PID
-Yaw PID
-TECS
step after step as in tutorial. It went OK - all regulators work smooth and quick - flying in FBW-A is kind of similar to manual (plus stabilization etc )

Also in FBW-B mode plane oscillates on height and air speed this also can be seen on telemetry logs

We found that we have problem with GPS module - it loses track (MTK 3329) - I checked the connections uploaded new firmware(10hz NMEA) etc and I’ll test it tomorrow .
The falling GPS caused (for example) some crazy turns in RTL ending with fall (this can be seen in telemetry logs) When GPS was disabled RTL and circle works fine.

Also please note that we have to use [color=#FF4000]NEGATIVE [/color] kff rudder mix value ( -0.5 ) positive values cause tail to wag (as in tutorial ) it seams strange ?

I’ll post fresh logs tomorrow (I hope the GPS will work OK)

[quote=“tridge”]Hi Killer,
When you post logs it is helpful to also describe what you saw as the pilot. That allows me to concentrate on issues you saw. Doing a full from-scratch analysis of a set of logs can take a long time, but it can be much quicker if you describe what issues I should be looking for.
Cheers, Tridge[/quote]

Helo again :slight_smile:
Here are yesterdays logs:
dropbox.com/s/8rsrl8su0c6pb … 0_logs.zip
We have big problems with gps or heading direction, i don’t know is that gps module fault or problems with magnetometer this is visible in logs hdg. One I know it’s not a gps connection problem - i rerouted fresh cables and even soldered the gps/APM plugs.
What happens
-GPS looses position - this shows as straight lines on telemetry (maybe only telemetry problems?)
-Gps sat no. drops from 12 to 6-4 when plane is pitched/rolled extremely.
-Bad compass health shows on HUD
Those errors are not time correlated.

Problems with heading leads to odd plane behavior - when everything is OK plane get back on patch ,levels, keep alt/speed without a problem, when error(s) begin it snakes on patch, pumps on alt/speed etc.

Please take look on logs and help me diagnose what is wrong witch GPS or APM hardware so I can order new parts

All problems solved! I changed the GPS to ublox neo 6m. Plane is fully operational ! :smiley:

Old GPS was strange - hdop value was under 1 (like 0.95) so extra fine BUT sometimes it spiked to 13-16 ! and then all problems occurred. I’don’t know what type of failure it is software or hardware maybe in the futore I’ll investigate that

You said you changed to: ublox neo 6m
It that GPS below you are using?
Is simple plug’n play?

My actual GPS on arduplane is MTK and I was suggested to upgrade to uBlox.
I am thinking to buy this one below.

hobbyking.com/hobbyking/stor … odule.html

[quote=“criro1999”]You said you changed to: ublox neo 6m
It that GPS below you are using?
Is simple plug’n play?

My actual GPS on arduplane is MTK and I was suggested to upgrade to uBlox.
I am thinking to buy this one below.

hobbyking.com/hobbyking/stor … odule.html[/quote]

I was using this module GPS-GMS-U1LP it is mtk3329 chip. The performance was great (10hz hdop 0.9) compared to ublox 6m (5hz, hdop 1.5 ) I dont know is there a problem wit thouse chips or my just bad luck :slight_smile:

now I have such module
ebay.pl/itm/Ublox-NEO-6M-GPS … 19e324c4ea
It was only available gps module in my country :open_mouth:

Do you have any problems with Plane ?