Board index FlightGear Development Aircraft Autopilot and route manager

F-86F Sabre Rocks Side to Side between waypoints on autopilo

Designing a stable autopilot is one of the hardest things. Need help?

Re: F-86F Sabre Rocks Side to Side between waypoints on auto

Postby Turnit » Wed Dec 28, 2016 4:28 pm

With the Kp at 0.125 it is still rocking side to side... I may of not hooked up the autopilot correctly though, as there was no path in the systems area of the -set file for the generic autopilot. Would there be a conflict between having the <autopilot> code under systems where I have the path set, and the <autopilot> code I posted earlier?
Air Comet Chile Virtual - http://aircc.gq/
Mac125: http://mac125.ga/
Turnit
 
Posts: 518
Joined: Sun Aug 24, 2014 9:21 pm
Location: Washington State, USA
Callsign: Turnit
Version: 2017.2.1
OS: Windows 8.1

Re: F-86F Sabre Rocks Side to Side between waypoints on auto

Postby Octal450 » Wed Dec 28, 2016 5:01 pm

Make sure Inside <sim> and </sim> you have this:
<systems>
<autopilot>
<path>Aircraft/folder_name/Systems/autopilot.xml</path>
</autopilot>
</systems>
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm

Re: F-86F Sabre Rocks Side to Side between waypoints on auto

Postby Johan G » Wed Dec 28, 2016 5:05 pm

Edit: it0uchpods beat me to it. :)

Turnit wrote in Wed Dec 28, 2016 4:28 pm:I may of not hooked up the autopilot correctly though, as there was no path in the -set file for the generic autopilot.

Ah. To make the aircraft use your autopilot you have to declare it in the -set file, which somehow do not seem to be mentioned at all when I skim through the article I recommended. :?

I just added that to the article.

Edit: Word order.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5523
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: F-86F Sabre Rocks Side to Side between waypoints on auto

Postby Octal450 » Wed Dec 28, 2016 5:56 pm

:D

@Johan G
I found the max-rate-of-change to work well, as when the PIDs engage, they sometimes move oddly for half a second or so, and then stable out. The max-rate-of-change gets rid of that, as the PID corrects itself, before the actual surface moves incorrectly. ;)
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm

Re: F-86F Sabre Rocks Side to Side between waypoints on auto

Postby Thorsten » Wed Dec 28, 2016 6:06 pm

Actually that's what the derivative term is for - in essence it's a dynamical rate of change limiter if used correctly.

The size of the proportional gain should be adjusted to the correction that's needed (i.e. you shouldn't necessarily reduce it) - then you should adjust the derivative term to get rid of oscillations (i.e. turn a harmonic oscillator into a damped harmonic oscillator). And then carefully apply the integral term to soak up any remaining errors, using both trigger and derivative term to avoid it causing new oscillations.

If you use an external rate limiter and have an integral term in the game, chances are you might get integrator windup - and that's far worse than oscillations.
Thorsten
 
Posts: 11045
Joined: Mon Nov 02, 2009 8:33 am

Re: F-86F Sabre Rocks Side to Side between waypoints on auto

Postby Johan G » Wed Dec 28, 2016 6:21 pm

About integrator windup (and getting slightly off topic): This PID noob (i.e. me) once experimented with a VTOL craft and had one PID loop for pitch and one for roll. If I left it on the ground while looking in the configuration files and then gently applied enough throttle for one of three legs to barely leave ground it would instantly flip over due to the integrator having accumulated a huge response to a tiny error, probably from leaning slightly from the crosswind. I simply removed Ki after too much of that.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5523
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: F-86F Sabre Rocks Side to Side between waypoints on auto

Postby Turnit » Wed Dec 28, 2016 6:30 pm

it0uchpods wrote in Wed Dec 28, 2016 5:01 pm:Make sure Inside <sim> and </sim> you have this:
<systems>
<autopilot>
<path>Aircraft/folder_name/Systems/autopilot.xml</path>
</autopilot>
</systems>

I have added that under the <system> tag. It still rocks side to side, so I must still need to tweak it.
Air Comet Chile Virtual - http://aircc.gq/
Mac125: http://mac125.ga/
Turnit
 
Posts: 518
Joined: Sun Aug 24, 2014 9:21 pm
Location: Washington State, USA
Callsign: Turnit
Version: 2017.2.1
OS: Windows 8.1

Re: F-86F Sabre Rocks Side to Side between waypoints on auto

Postby Thorsten » Wed Dec 28, 2016 6:43 pm

If I left it on the ground while looking in the configuration files and then gently applied enough throttle for one of three legs to barely leave ground it would instantly flip over due to the integrator having accumulated a huge response to a tiny error


Heh - I once failed to switch off the AP channel for abort guidance when not used (and just never merged the output in). As a result, the integrator of the abort guidance acquired all the errors from a normal profile *not* being an abort, so when it engaged, it basically always tried to kill you...

Integrators are cool to fly 'like on rails' - but windup protection has to be done in capital letters...
Thorsten
 
Posts: 11045
Joined: Mon Nov 02, 2009 8:33 am

Re: F-86F Sabre Rocks Side to Side between waypoints on auto

Postby Octal450 » Wed Dec 28, 2016 8:02 pm

^^^ haha
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm

Re: F-86F Sabre Rocks Side to Side between waypoints on auto

Postby Turnit » Sat Dec 31, 2016 12:45 am

The editing of the kp and ti doesnt seem to be doing much. I've been editing it over the past few days and it still rocks side to side.
Air Comet Chile Virtual - http://aircc.gq/
Mac125: http://mac125.ga/
Turnit
 
Posts: 518
Joined: Sun Aug 24, 2014 9:21 pm
Location: Washington State, USA
Callsign: Turnit
Version: 2017.2.1
OS: Windows 8.1

Re: F-86F Sabre Rocks Side to Side between waypoints on auto

Postby Octal450 » Sat Dec 31, 2016 4:12 am

Try this:
Set the KP to 0.
This should cause NOTHING to happen at all when that PID is enabled.
If that happens, then you just need to tune more.
If the AP still controls the plane, you didn't put in the custom AP properly.

J
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm

Re: F-86F Sabre Rocks Side to Side between waypoints on auto

Postby Thorsten » Sat Dec 31, 2016 7:20 am

There's a bit of sound advice - always check whether the file you are editing is actually used *before* trying to tune anything. Otherwise, lots of time wasted... (been there often enough).
Thorsten
 
Posts: 11045
Joined: Mon Nov 02, 2009 8:33 am

Re: F-86F Sabre Rocks Side to Side between waypoints on auto

Postby sanhozay » Sat Dec 31, 2016 9:51 am

If you open up the property browser, you can verify the path to the active autopilot configuration file at "sim/systems/autopilot/path". This should be something like "Systems/autopilot.xml" or "Aircraft/F-86/Systems/autopilot.xml", rather than "Aircraft/Generic/generic-autopilot.xml", which is the generic one in fgdata.

It's probably also worth adding that you can reload an autopilot configuration after editing using the "Debug - Reload Autopilot" menu. You don't need to restart Flightgear. Keep an eye on the console output in case you mess up your tags and the edited file fails to load.
sanhozay
 
Posts: 1207
Joined: Thu Dec 26, 2013 11:57 am
Location: EGNM
Callsign: G-SHOZ
Version: Git
OS: Ubuntu 16.04

Re: F-86F Sabre Rocks Side to Side between waypoints on auto

Postby Octal450 » Sat Dec 31, 2016 2:16 pm

@Thorsten
I didn't mean you should solve this type of problem with a rate-of-change. That would never work properly. Once the PID is stable, I add one so the surface doesn't make unrealistic sharp, changes rapidly. It also gives the PID a tiny amount of time for error. But I don't use a very slow one. Then the surface would always lag behind the command, by a lot.
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm

Re: F-86F Sabre Rocks Side to Side between waypoints on auto

Postby Turnit » Sat Dec 31, 2016 5:33 pm

The autopilot worked when I test flew it. Here is the code I put in to hook up the autopilot:
Code: Select all
<systems>
   <electrical>
    <path>Aircraft/Generic/generic-electrical.xml</path>
   </electrical>
   <autopilot>
    <path>Aircraft/F-86/Systems/autopilot.xml</path>
   </autopilot>
</systems>


I believe that is correct, but the <autopilot> tag is used again in the -set file later and says this:
Code: Select all
<autopilot>
   <config>
     <min-climb-speed-kt type="float">70.0</min-climb-speed-kt>
     <best-climb-speed-kt type="float">75.0</best-climb-speed-kt>
     <target-climb-rate-fpm type="float">500.0</target-climb-rate-fpm>
     <target-descent-rate-fpm type="float">1000.0</target-descent-rate-fpm>
     <elevator-adj-factor type="float">4000.0</elevator-adj-factor>
     <integral-contribution type="float">0.01</integral-contribution>
     <zero-pitch-throttle type="float">0.45</zero-pitch-throttle>
     <zero-pitch-trim-full-throttle type="float">0.14</zero-pitch-trim-full-throttle>
   </config>
 </autopilot>


I have reduced the kp down to .11, after it starting around .5.
Air Comet Chile Virtual - http://aircc.gq/
Mac125: http://mac125.ga/
Turnit
 
Posts: 518
Joined: Sun Aug 24, 2014 9:21 pm
Location: Washington State, USA
Callsign: Turnit
Version: 2017.2.1
OS: Windows 8.1

PreviousNext

Return to Autopilot and route manager

Who is online

Users browsing this forum: No registered users and 1 guest