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 5: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?
Harbor Air Virutal - Launching 11/28/2019
Turnit
 
Posts: 518
Joined: Sun Aug 24, 2014 10: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 6:01 pm

Make sure Inside <sim> and </sim> you have this:
<systems>
<autopilot>
<path>Aircraft/folder_name/Systems/autopilot.xml</path>
</autopilot>
</systems>
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

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

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

Edit: it0uchpods beat me to it. :)

Turnit wrote in Wed Dec 28, 2016 5: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)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

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

Postby Octal450 » Wed Dec 28, 2016 6: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. ;)
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

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

Postby Thorsten » Wed Dec 28, 2016 7: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: 12490
Joined: Mon Nov 02, 2009 9:33 am

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

Postby Johan G » Wed Dec 28, 2016 7: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)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

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

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

it0uchpods wrote in Wed Dec 28, 2016 6: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.
Harbor Air Virutal - Launching 11/28/2019
Turnit
 
Posts: 518
Joined: Sun Aug 24, 2014 10: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 7: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: 12490
Joined: Mon Nov 02, 2009 9:33 am

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

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

^^^ haha
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

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

Postby Turnit » Sat Dec 31, 2016 1: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.
Harbor Air Virutal - Launching 11/28/2019
Turnit
 
Posts: 518
Joined: Sun Aug 24, 2014 10: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 5: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
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

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

Postby Thorsten » Sat Dec 31, 2016 8: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: 12490
Joined: Mon Nov 02, 2009 9:33 am

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

Postby sanhozay » Sat Dec 31, 2016 10: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 12:57 pm
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 3: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.
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

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

Postby Turnit » Sat Dec 31, 2016 6: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.
Harbor Air Virutal - Launching 11/28/2019
Turnit
 
Posts: 518
Joined: Sun Aug 24, 2014 10: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 0 guests