Board index FlightGear Development Aircraft

P-51D stall and spin: make it milder at takeoff and landing  Topic is solved

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

Re: P-51D stall and spin: make it milder at takeoff and land

Postby dany93 » Mon May 23, 2016 9:13 pm

FG 2016.3.0, Revision adeb0241ae24

Sorry not being more positive, but not solved. Maybe slightly improved.

Tests: LSGG runway 23 (same as previously).

1- Wind 0 kt 150°, then Autostart:
1st test: tossed, jostled, then sticked on the nose. FG no longer responds to aircraft commands.
2nd test: totally crashed, red screen.

2- Engine at idle, Wind 3 kt to and from 50° <---> 230° (3kt nose <---> tail, several times)
Between a bit tossed, small jump, jump to the side, with the sim still working....
....and strong toss, projection, total crash.
A bit better than previously (fgfs does not crash every time) but still something more or less violent.

3- Everything stopped, wind 3 kt 50° (tailwind) ==> J = -0.42
Autostart ==> J = -0.042 (brake parking ON)
Brake parking OFF, slow rolling ==> J increases from -0.042 to J = 0.36, small jolt, no crash: would be almost good (twice).

I can also get it at KSFO:
- either by autostarting the engine with strictly 0 kt wind (0 kt Alt 0 and 500 ft in "Weather config"),
- or slow-rolling 360°-turns with 150° 3 kt wind.
Between jolts (bumps) and FG crash, but not as violent in average, and not as reproducible.

Thank you, and sorry not being able to help more.

[EDIT, Addon]
Can it be help?
Code: Select all
P51D
JSBSim convergence, usually, when it works
wind default 150° 3kt
__________________________________________

LSGG runway 23
  Sorry, qdot doesn't appear to be trimmable
  Trim Results:
          Altitude AGL:    2.8  wdot: -2.67e+02 Tolerance: 1e-03  Failed
           Pitch Angle:  -0.23  qdot:  1.09e+01 Tolerance: 1e-04  Failed
            Roll Angle:    8.2  pdot: -1.14e-01 Tolerance: 1e-04  Failed

  Trim Statistics:
    Total Iterations: 7
    Sub-iterations:
    wdot: 26 average: 3.7143  successful:  1  stability: 2.7778
    qdot: 0 average: 0  successful:  0  stability: 2
    pdot: 89 average: 12.714  successful:  7  stability: 2.3232
    Run Count: 380

_________________________________________

KSFO runway 28R
  Trim Results:
          Altitude AGL:    5.1  wdot:  3.21e+01 Tolerance: 1e-03  Failed
           Pitch Angle: 0.0062  qdot:  1.00e-04 Tolerance: 1e-04  Failed
            Roll Angle:   0.19  pdot:  2.85e-04 Tolerance: 1e-04  Failed

  Trim Statistics:
    Total Iterations: 61
    Sub-iterations:
    wdot: 135 average: 2.2131  successful:  0  stability: 2
    qdot: 124 average: 2.0328  successful:  0  stability: 2
    pdot: 205 average: 3.3607  successful:  61  stability: 2.3796
    Run Count: 2288
____________________________________________

Last edited by dany93 on Sat May 28, 2016 10:03 pm, edited 1 time in total.
dany93
 
Posts: 785
Joined: Mon Sep 07, 2009 3:43 pm
Location: France (Paris region)
Version: 2020.2.0
OS: Linux Mint 18 (64 b)

Re: P-51D stall and spin: make it milder at takeoff and land

Postby erik » Fri May 27, 2016 6:15 am

Ron suggested to try to remove the calculation with propulsion/engine/prop-induced-velocity_fps
and see if that helps?
Code: Select all
        <function name="aero/thrust-qbar_psf">
            <product>
               <v> 0.5 </v>
                <p> atmosphere/rho-slugs_ft3 </p>
                <pow>
                    <sum>
                        <p> velocities/u-aero-fps </p>
                        <product>
                         <p> propulsion/engine/prop-induced-velocity_fps </p>
                         <v> 2.0 </v>
                       </product>
                    </sum>
                    <v> 2.0 </v>
                </pow>
            </product>
        </function>


Erik
erik
 
Posts: 1708
Joined: Thu Nov 01, 2007 1:41 pm

Re: P-51D stall and spin: make it milder at takeoff and land

Postby bcoconni » Fri May 27, 2016 11:56 am

Hi Dany,

I could reproduce the bug under FlightGear and committed a new tentative to fix the bug in FlightGear.
According to my own tests, the bug is no longer occuring. Could you check as well ?

Thanks.

Bertrand.
bcoconni
 
Posts: 41
Joined: Sat Nov 13, 2010 2:27 pm
Location: France
IRC name: Bertrand0
Version: Git
OS: Linux

Re: P-51D stall and spin: make it milder at takeoff and land

Postby dany93 » Fri May 27, 2016 1:15 pm

Hi erik,

Thank you, to Ron too.

You have caught something, although I don't see where the problem is.

By removing the calculation with propulsion/engine/prop-induced-velocity_fps (and replacing everywhere else thrust-qbar_psf for qbar_psf) I have no crash!
JSBSim Iterations: same values as previously.
Tested at LSGG,
- wind from the tail,
- or wind strictly = 0 kt

I wondered if propulsion/engine/prop-induced-velocity_fps could diverge through J= 0, but I could never reveal it.

Hal V Engel added the pressures. I have tested a formulation where I add the velocities (which seems more rigorous IMO, although there should not make a large difference).
Code: Select all
        <function name="aero/function/velocity-induced-fps">
            <description> velocity including the propulsion induced velocity.</description>
            <sum>
                <property>velocities/u-aero-fps</property>
                <property>propulsion/engine/prop-induced-velocity_fps</property>
                <property>propulsion/engine/prop-induced-velocity_fps</property>
            </sum>
        </function>

        <function name="aero/thrust-qbar_psf">
            <description> q bar including the propulsion induced velocity.</description>
            <product>
                <property>aero/function/velocity-induced-fps</property>
                <property>aero/function/velocity-induced-fps</property>
                <property>atmosphere/rho-slugs_ft3</property>
                <value>0.5</value>
            </product>
        </function>

But at no avail. Same crashes or bumps.

@Bertrand
I've just seen your message before posting mine, after having done my tests. I'll see.
dany93
 
Posts: 785
Joined: Mon Sep 07, 2009 3:43 pm
Location: France (Paris region)
Version: 2020.2.0
OS: Linux Mint 18 (64 b)

Re: P-51D stall and spin: make it milder at takeoff and land

Postby dany93 » Fri May 27, 2016 2:50 pm

Something is wrong with my compilation. I think I had a problem with SIMGEAR compilation. Solved. See my next message.
I use download_and complile.sh version 2.33
with (for updating)
Code: Select all
WHATTOBUILDALL=(SIMGEAR FGFS DATA)

It usually works well.
Here, my FG version number has not been changed, I still have
adeb0241ae (your commit from from May 23)
instead of
f25304ace5a081

My flightgear/bin files are still from 23 May 2016.

Attempted 4 times (the last ones with FGFS DATA, then FGFS only) .

My FlightGear compilation seems unfinished (or I don't understand)
Code: Select all
(........ )
make[2]: *** [src/GUI/CMakeFiles/fglauncher.dir/AddCatalogDialog.cxx.o] Erreur 1
make[1]: *** [src/GUI/CMakeFiles/fglauncher.dir/all] Erreur 2
make: *** [all] Erreur 2
INSTALL flightgear
[  0%] Built target fgsqlite3
[  8%] Built target iaxclient_lib
[ 13%] Built target flite_hts
[ 15%] Built target hts_engine
[ 15%] Built target FGAdminUI
[ 16%] Built target fgadmin
[ 16%] Built target fgelev
[ 17%] Built target fgpanel
[ 18%] Built target fgviewer
[ 18%] Built target GPSsmooth
[ 18%] Built target MIDGsmooth
[ 18%] Built target UGsmooth
[ 18%] Built target terrasync
[ 18%] Built target fgcom
[ 18%] Automoc for target fglauncher
[ 18%] Built target fglauncher_automoc
[ 18%] Building CXX object src/GUI/CMakeFiles/fglauncher.dir/AddCatalogDialog.cxx.o
/home/dany/fgfs/flightgear/src/GUI/AddCatalogDialog.cxx: In member function ‘void AddCatalogDialog::onCatalogStatusChanged(simgear::pkg::Catalog*)’:
/home/dany/fgfs/flightgear/src/GUI/AddCatalogDialog.cxx:186:18: error: ‘class simgear::pkg::Catalog’ has no member named ‘setUrl’
             cat->setUrl(http->getDefaultCatalogFallbackUrl());
                  ^
make[2]: *** [src/GUI/CMakeFiles/fglauncher.dir/AddCatalogDialog.cxx.o] Erreur 1
make[1]: *** [src/GUI/CMakeFiles/fglauncher.dir/all] Erreur 2
make: *** [all] Erreur 2
dany93
 
Posts: 785
Joined: Mon Sep 07, 2009 3:43 pm
Location: France (Paris region)
Version: 2020.2.0
OS: Linux Mint 18 (64 b)

Re: P-51D stall and spin: make it milder at takeoff and land

Postby dany93 » Sat May 28, 2016 2:57 pm

bcoconni wrote in Fri May 27, 2016 11:56 am:I could reproduce the bug under FlightGear and committed a new tentative to fix the bug in FlightGear.
According to my own tests, the bug is no longer occuring. Could you check as well ?

I finally succeeded to get the updated compilation.
FG 2016.3.0, Revision 1a0f3d88260

Congratulations, Bertrand! :D :D I could not reproduce the bug. (LSGG runway 23, wind = 0 kt, or 3kt from 50°, slow rolling for having J=V/ND go through 0, from <0 to >0 values,...)
I hope that's for real, even if it is still to observe more.

Many Many Thanks.
And I think other people will thank you too.

Dany
Last edited by dany93 on Sun May 29, 2016 9:51 am, edited 1 time in total.
dany93
 
Posts: 785
Joined: Mon Sep 07, 2009 3:43 pm
Location: France (Paris region)
Version: 2020.2.0
OS: Linux Mint 18 (64 b)

Re: P-51D stall and spin: make it milder at takeoff and land

Postby bcoconni » Sat May 28, 2016 4:55 pm

Great! I will push the bug fix to JSBSim next week (I don't have access to my computer over the weekend)

And thank you for the detailed bug report you made, this was a significant contribution to the bug fix.

Bertrand
bcoconni
 
Posts: 41
Joined: Sat Nov 13, 2010 2:27 pm
Location: France
IRC name: Bertrand0
Version: Git
OS: Linux

Re: P-51D stall and spin: make it milder at takeoff and land

Postby bcoconni » Sun Jun 12, 2016 10:09 am

dany93 wrote in Mon May 23, 2016 9:13 pm:Can it be help?
Code: Select all
P51D
JSBSim convergence, usually, when it works
wind default 150° 3kt
__________________________________________

LSGG runway 23
  Sorry, qdot doesn't appear to be trimmable
  Trim Results:
          Altitude AGL:    2.8  wdot: -2.67e+02 Tolerance: 1e-03  Failed
           Pitch Angle:  -0.23  qdot:  1.09e+01 Tolerance: 1e-04  Failed
            Roll Angle:    8.2  pdot: -1.14e-01 Tolerance: 1e-04  Failed

  Trim Statistics:
    Total Iterations: 7
    Sub-iterations:
    wdot: 26 average: 3.7143  successful:  1  stability: 2.7778
    qdot: 0 average: 0  successful:  0  stability: 2
    pdot: 89 average: 12.714  successful:  7  stability: 2.3232
    Run Count: 380

_________________________________________

KSFO runway 28R
  Trim Results:
          Altitude AGL:    5.1  wdot:  3.21e+01 Tolerance: 1e-03  Failed
           Pitch Angle: 0.0062  qdot:  1.00e-04 Tolerance: 1e-04  Failed
            Roll Angle:   0.19  pdot:  2.85e-04 Tolerance: 1e-04  Failed

  Trim Statistics:
    Total Iterations: 61
    Sub-iterations:
    wdot: 135 average: 2.2131  successful:  0  stability: 2
    qdot: 124 average: 2.0328  successful:  0  stability: 2
    pdot: 205 average: 3.3607  successful:  61  stability: 2.3796
    Run Count: 2288
____________________________________________



Regarding the particular issue of JSBSim not being able to trim the P51 on ground, I have committed some fixes to JSBSim and ported these fixes to FlightGear (commit dc7f06). Now most aircrafts no longer seem to be 'dropped' on the runway when the sim starts and the error message about the trim failure is no longer issued.

However JSBSim is still failing to trim the P51 on ground. As far as I can see this is due to the fact that the P51 starts with its landing gears retracted as can be seen if you replay the first seconds of the sim (CTRL+r). Actually it seems that the P51D deploys its landing gears as the sim starts. I am not familiar enough with the P51 model but may be something needs to be fixed on the aircraft so that it starts with the landing gears deployed ?

EDIT A video will make my point clearer. One can see that the landing gears are deploying after the sim starts. (This is my first video on YouTube: I have not managed to center the video :? )

Last edited by bcoconni on Sun Jun 12, 2016 11:55 am, edited 1 time in total.
bcoconni
 
Posts: 41
Joined: Sat Nov 13, 2010 2:27 pm
Location: France
IRC name: Bertrand0
Version: Git
OS: Linux

Re: P-51D stall and spin: make it milder at takeoff and land

Postby dany93 » Sun Jun 12, 2016 10:46 am

Thank you Bertrand for these JSBSim fixes and for the extra informations.
I'm not truly familiar with the P51D (Hal V Engel's work!) but I'm going to see to try to understand if I can do something.

Dany
dany93
 
Posts: 785
Joined: Mon Sep 07, 2009 3:43 pm
Location: France (Paris region)
Version: 2020.2.0
OS: Linux Mint 18 (64 b)

Re: P-51D stall and spin: make it milder at takeoff and land

Postby bcoconni » Sun Jun 12, 2016 3:11 pm

I found it ! That was a bug in the <kinematic> function of the landing gears which was introducing some lag in the landing gear deployment while we want them to instantaneously deploy at initialization.
It is now fixed in both JSBSim and FlightGear (commit a61c0b)

You should no longer see the trim failure error message. Let me know otherwise.
bcoconni
 
Posts: 41
Joined: Sat Nov 13, 2010 2:27 pm
Location: France
IRC name: Bertrand0
Version: Git
OS: Linux

Re: P-51D stall and spin: make it milder at takeoff and land

Postby dany93 » Sun Jun 12, 2016 4:41 pm

I've updated my FG version with your commit dc7f06.
Sorry ! I had'nt seen your previous message. I have to do the updating with your last commit.

Thank you for having taken the time to do this video.
I perfectly see the gear movement at LSGG with Ctrl-R, exactly like the one on your video.
It depends on the airport, not seen at LFDV, grass ground (the aircraft appears with the tail up, then the tail falls down on the ground). Same Messages of "Trim results: failed".

However, I do not find where it comes from, how to avoid it.
I tried by adding a few lines in p51d-jsbsim-set.xml, intended at starting with the gears down:
Code: Select all
  <gear>
    <gear n="0">
       <position-norm type="float">1</position-norm> <!-- add by dany -->
    </gear>
    <gear n="1">
       <position-norm type="float">1</position-norm>
    </gear>
    <jackstandsZ type="float">0</jackstandsZ>
 </gear>

Code: Select all
 <controls>   
 (......)
   <gear>
      <gear-safe-light-check type="int">0</gear-safe-light-check>
      <gear-unsafe-light-check type="int">0</gear-unsafe-light-check>
      <leverPos type="float">0.0</leverPos>
      <gear-down type="bool">1</gear-down> <!-- add by dany -->
   </gear>
 (.....)
 </controls>

It changes nothing (aircraft rising and gear extension at start, Trim failing).

I found nothing in the nasal files, although that's not that easy.

A test which confirms that it is related to the gear retraction / extension
In the FDM, I see these lines (line 1066)
Code: Select all
            <switch name="gearPosTimed">
              <default value="0.0"/>
              <test value="gear/gear-pos-norm-up">
                 gear/gear-cmd-norm == 0
              </test>
              <test value="gear/gear-pos-norm-down">
                 gear/gear-cmd-norm == 1
              </test>
              <output>gear/gear-pos-norm</output>
           </switch>

If I comment them, I have no "Trim results: failed" message, the console is clean, but the gear no longer retracts :? .
I don't understand the use of these lines, how they work and why.
dany93
 
Posts: 785
Joined: Mon Sep 07, 2009 3:43 pm
Location: France (Paris region)
Version: 2020.2.0
OS: Linux Mint 18 (64 b)

Re: P-51D stall and spin: make it milder at takeoff and land

Postby bcoconni » Sun Jun 12, 2016 5:14 pm

dany93 wrote in Sun Jun 12, 2016 4:41 pm:A test which confirms that it is related to the gear retraction / extension
In the FDM, I see these lines (line 1066)
Code: Select all
            <switch name="gearPosTimed">
              <default value="0.0"/>
              <test value="gear/gear-pos-norm-up">
                 gear/gear-cmd-norm == 0
              </test>
              <test value="gear/gear-pos-norm-down">
                 gear/gear-cmd-norm == 1
              </test>
              <output>gear/gear-pos-norm</output>
           </switch>

If I comment them, I have no "Trim results: failed" message, the console is clean, but the gear no longer retracts :? .
I don't understand the use of these lines, how they work and why.


This is a trick to have different times for gear deployment and folding. There are 2 <kinematics> tags which compute the position of the gear given gear/gear-cmd-norm.
If gear/gear-cmd-norm == 1 then its a gear deployment that is commanded and the gear position is driven by gear/gear-pos-norm-down.
If gear/gear-cmd-norm == 0 then its a gear folding that is commanded and the gear position is driven by gear/gear-pos-norm-up.
bcoconni
 
Posts: 41
Joined: Sat Nov 13, 2010 2:27 pm
Location: France
IRC name: Bertrand0
Version: Git
OS: Linux

Re: P-51D stall and spin: make it milder at takeoff and land

Postby dany93 » Sun Jun 12, 2016 5:30 pm

(Your commit a61c0b)

OK, You've got it ! :D

It works properly, no gear extension at initialization (test Ctrl-R), Terminal is clean (no messages from JSBSim failing to converge or else) .

Thank you once more...

Also for your explanation on the script giving different times for gear deployment and folding.

Dany
dany93
 
Posts: 785
Joined: Mon Sep 07, 2009 3:43 pm
Location: France (Paris region)
Version: 2020.2.0
OS: Linux Mint 18 (64 b)

Re: P-51D stall and spin: make it milder at takeoff and land

Postby Thorsten » Sun Jun 12, 2016 6:03 pm

I found it ! That was a bug in the <kinematic> function of the landing gears which was introducing some lag in the landing gear deployment while we want them to instantaneously deploy at initialization.


Is this landing-gear specific or more general?

I've had plenty of headaches with initializing kinematics (I have a few fairly long-running ones in the Shuttle systems, like fuel cells coming to operating conditions...) - and no matter what I set for their property, they init at zero and ramp up.

Which means in practice you init without having power for 30 seconds, which, well, kills you in most stages of the flight. So I'd love to be able to just set them to a value at startup rather than watch them crawl there.
Thorsten
 
Posts: 11765
Joined: Mon Nov 02, 2009 8:33 am

Re: P-51D stall and spin: make it milder at takeoff and land

Postby bcoconni » Mon Jun 13, 2016 5:57 pm

The bug fix is addressing a misbehaviour of all the kinematic functions when they are evaluated while trimming. In such a case we are aiming for a steady state so we don't want <kinematic> to introduce a lag or any time dependent behaviour. Instead we want it to jump directly to its final state. The commit a61c0b fixes just that. So the output of <kinematic> should not be affected when executed outside the trimming context.

Regarding your particular problem, have you tried to set the output of <kinematic> directly to the targeted value ?
bcoconni
 
Posts: 41
Joined: Sat Nov 13, 2010 2:27 pm
Location: France
IRC name: Bertrand0
Version: Git
OS: Linux

PreviousNext

Return to Aircraft

Who is online

Users browsing this forum: legoboyvdlp and 1 guest