Board index FlightGear Development Aircraft

JSBSim Piper J-3 Cub  Topic is solved

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

Re: JSBSim Piper J-3 Cub

Postby Alant » Wed Aug 09, 2017 4:53 pm

Can you check the centre of gravity and the aerodynamic reference point that are used in your FDM and the various data sources.
Also is the pitch moment that you are using wing only, or is it wing+tail+fuselage?

Alan
Alant
 
Posts: 913
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10

Re: JSBSim Piper J-3 Cub

Postby dany93 » Wed Aug 09, 2017 5:29 pm

dany93 wrote in Mon Aug 07, 2017 9:42 am:The empty CG location seems correct relative to the FDM axes (reference for seats, loads,.. locations) because the limits with loads (at least those that I tested) are correct, inside the weight and balance graphs.
Moving the AERORP forwards from initially 18.90" (which seems correct IMO) to 15.67" helps, with keeping your (= Du Y) initial Cm_alpha and Cm_elevator values. But it becomes located before the most aft CG (19" or 20"). Usually considered as bad for stability IRL.

In the FDM (by erik),
The empty CG in the FDM is at -13.80, in accordance with this N18SY Weight and balance (at least).
I don't hope much by moving the AERORP.

We are focusing on the tail effect, but I think that the numbers (Du Y or Megginson's table) are for wing+tail+fuselage.
dany93
 
Posts: 768
Joined: Mon Sep 07, 2009 3:43 pm
Location: France (Paris region)
Version: 2018.4.0
OS: Linux Mint 18 (64 b)

Re: JSBSim Piper J-3 Cub

Postby wlbragg » Wed Aug 09, 2017 6:51 pm

Code: Select all
Notice that these limits should be different for the J3Cub -34 to +29 deg) and the PA18 (-25 to +15 deg).

J3Cub (-34 to +29 deg)
PA18 (-25 to +15 deg)
I'd like to at least get this "difference" implemented.

For the logic, think this is working correctly

Code: Select all
   <aerosurface_scale name="Elevator Control J3Cub">
      <input>fcs/pitch-trim-sum</input>
      <range>
        <min> -0.51 </min>
        <max>  0.34 </max>
      </range>
      <output>fcs/elevator-pos-rad-j3cub</output>
   </aerosurface_scale>

   <aerosurface_scale name="Elevator Control PA-18">
      <input>fcs/pitch-trim-sum</input>
      <range>
        <min> -0.44 </min>
        <max>  0.26 </max>
      </range>
      <output>fcs/elevator-pos-rad-pa18</output>
   </aerosurface_scale>

   <fcs_function name="fcs/elevator-pos-rad">
      <function>
          <sum>
            <product>
                <eq>
                    <property>/sim/model/j3cub/pa-18</property>
                    <value>0</value>
                </eq>
                <property>fcs/elevator-pos-rad-j3cub</property>
            </product>
            <product>
                <eq>
                    <property>/sim/model/j3cub/pa-18</property>
                    <value>1</value>
                </eq>
                <property>fcs/elevator-pos-rad-pa18</property>
            </product>
          </sum>
      </function>
      <output>fcs/elevator-pos-rad</output>
   </fcs_function>


EDIT: If you happen to notice other differences along the way, ie: aileron, rudder, etc., let me know and I can plug those in also.
Last edited by wlbragg on Wed Aug 09, 2017 6:54 pm, edited 1 time in total.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4909
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: JSBSim Piper J-3 Cub

Postby Alant » Wed Aug 09, 2017 6:52 pm

The aerodynamic moments are not measured about the CG, they are measured about some reference point. Oftehn the 1/4 chord point is used, but it can be any arbitrary point. This is not necessarily the same as the CG. The FDM must use the same one that was used in the dataset.

Alan
Alant
 
Posts: 913
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10

Re: JSBSim Piper J-3 Cub

Postby Bomber » Wed Aug 09, 2017 7:09 pm

Code: Select all
   <function name="aero/force/LIFT">
      <sum>
         <property>aero/force/Lift_propwash</property>
         <property>aero/force/Lift_alpha</property>
         <property>aero/coefficient/CLDf</property>
         <property>aero/force/Lift_pitch_rate</property>
         <property>aero/force/Lift_alpha_rate</property>
         <property>aero/force/Lift_elevator</property>
      </sum>
   </function>


Lift_alpha is wing+tail+fuselage.


Code: Select all
   <function name="aero/force/PITCH">
      <sum>
         <property>aero/moment/Pitch_propwash</property>
         <property>aero/moment/Pitch_alpha</property>
         <property>aero/moment/Pitch_elevator</property>
         <property>aero/moment/Pitch_damp</property>
         <property>aero/moment/Pitch_alphadot</property>
         <property>aero/coefficient/Cmdf</property>         
      </sum>
   </function>


Pitch_alpha is wing+tail+fuselage.
"If anyone ever tells you anything about an aeroplane which is so bloody complicated you can't understand it, take it from me - it's all balls" - R J Mitchel
Bomber
 
Posts: 1934
Joined: Fri Dec 14, 2007 7:06 pm
OS: Windows XP and 10

Re: JSBSim Piper J-3 Cub

Postby dany93 » Wed Aug 09, 2017 10:23 pm

Alant wrote in Wed Aug 09, 2017 6:52 pm:The aerodynamic moments are not measured about the CG, they are measured about some reference point. Oftehn the 1/4 chord point is used, but it can be any arbitrary point. This is not necessarily the same as the CG. The FDM must use the same one that was used in the dataset.

Thank you Alan for this remark.

Megginson table uses stability axes which, if I understand well, have their origin at the CG.
<megginson/>
(linear aerodynamic coefficients)
These coefficients [...] use stability axes.


I hope that "Du Y" thesis does the same, but I don't know.

However, the difference between CG and AERORP or 1/4 chord is not large as seen from the tail, it should not give such a large difference. For Cmalpha we have -2 to -1.3 (Re dependent) from Du Y, -0.61 to -0.65 from Megginson, Cessna 182. A factor 2 or 3.
dany93
 
Posts: 768
Joined: Mon Sep 07, 2009 3:43 pm
Location: France (Paris region)
Version: 2018.4.0
OS: Linux Mint 18 (64 b)

Re: JSBSim Piper J-3 Cub

Postby Alant » Wed Aug 09, 2017 10:36 pm

"Megginson table uses stability axes which, if I understand well, have their origin at the CG."

Sorry, but no, both the stability axis and the body axis co-ordinate systems can have any arbitrary point as their origin. When you use a dataset all coefficients, derivatives, moments etc. have to be transformed to the reference point that you use in your FDM.

Be aware that CG in a dataset often means the reference point about which the moments are measured. CG in a real aircraft moves with loading (fuel passengers etc), The reference point is fixed - it is where the moments are measured about.

Alan
Alant
 
Posts: 913
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10

Re: JSBSim Piper J-3 Cub

Postby Octal450 » Thu Aug 10, 2017 5:01 am

Wayne,
Yes, I always quit via the "X" on my operating system.

Solution to this is to run a aircraftdata save via nasal when then setting is toggled, see here example in my A320.

Line 362-367: https://github.com/it0uchpods/A320Famil ... g/main.xml

Then just add this in any nasal file (in this case, one in the "libraries" node:

Code: Select all
var saveSettings = func {
   aircraft.data.add("/first-property", "/second-property");
   aircraft.data.save();
}

saveSettings();


Then it will save as soon as the option is toggled. Remember, to add in the -set files the properties with <first-property userarchive="y" type="bool">0</first-property> etc

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

Re: JSBSim Piper J-3 Cub

Postby Thorsten » Thu Aug 10, 2017 5:46 am

Solution to this is to run a aircraftdata save via nasal when then setting is toggled, see here example in my A320.


Actually, I suspect it's poor design to auto-save things when you force-quit a program, because the very reason you force-quit it might have been that the settings are bad. So imo FG should not do that and only save settings when a regular exit is done (and you should adjust your habit of force-quitting software).
Thorsten
 
Posts: 11087
Joined: Mon Nov 02, 2009 8:33 am

Re: JSBSim Piper J-3 Cub

Postby wlbragg » Thu Aug 10, 2017 7:31 am

Thanks Josh.

Thorsten, I think what Josh posted is less about saving all settings upon a forced exit, but saving the setting the second it is selected.

I am more concerned about why Josh's "normal" exit is not saving the particular setting were talking about as he is exiting correctly. It is defined in -set.xml as a persistent property and thus should be cached upon a normal exit. There is no reason I should have to add any code to save this data during a normal exit.

I really shouldn't have to do anything, it should just work.

Josh, just out of curiosity, what type of properties do you need to save that way and why?

Have you noticed any other setting in the Cub menu that are not persistent?
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4909
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: JSBSim Piper J-3 Cub

Postby Thorsten » Thu Aug 10, 2017 8:55 am

Thorsten, I think what Josh posted is less about saving all settings upon a forced exit, but saving the setting the second it is selected.


Same thing - assume the setting happens to screw your graphics driver and you see only garbage in the FG window, you force-kill FG and re-start - and voila, the setting will have been saved and FG never starts up again.
Thorsten
 
Posts: 11087
Joined: Mon Nov 02, 2009 8:33 am

Re: JSBSim Piper J-3 Cub

Postby dany93 » Thu Aug 10, 2017 2:11 pm

wlbragg wrote in Wed Aug 09, 2017 6:51 pm:J3Cub (-34 to +29 deg)
PA18 (-25 to +15 deg)

EDIT: If you happen to notice other differences along the way, ie: aileron, rudder, etc., let me know and I can plug those in also.

It works right.

Except that for the J3Cub, -34 deg to +29 deg is -0.59 rd to +0.51 rd.
Code: Select all
        <min> -0.59 </min>
        <max>  0.51 </max>

These values and the following can be found in:
J3Cub p. PDF 2/21,
PA-18 p. PDF 6/16.

Ailerons:
J3Cub = PA-18: +/- 18 deg (+/- 0.31 rd) good.

Rudder:
J3Cub: + / - 30 deg (+/- 0.52 rd), good.
PA-18: +/- 20 deg or +/- 25 deg, depends on the version (see the link above).
dany93
 
Posts: 768
Joined: Mon Sep 07, 2009 3:43 pm
Location: France (Paris region)
Version: 2018.4.0
OS: Linux Mint 18 (64 b)

Re: JSBSim Piper J-3 Cub

Postby Octal450 » Thu Aug 10, 2017 3:47 pm

@Thorsten
I doubt the setting: Skip ADIRS Alignment, or Always show Sidestick position would screw up FGFS :)

@Wayne
Settings for the aircraft, like Skipping the ADIRS alignment during manual start (>10min), or always showing the position of the sidestick on the PFD. (Real airbus hides, once gear leaves ground). You could use this for settings such as Allow damage, or start with engine running.

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

Re: JSBSim Piper J-3 Cub

Postby Richard » Thu Aug 10, 2017 4:30 pm

it0uchpods wrote in Thu Aug 10, 2017 5:01 am:Wayne,
Yes, I always quit via the "X" on my operating system.

Solution to this is to run a aircraftdata save via nasal when then setting is toggled, see here example in my A320.


I realise it's probably not well known that you have to exit via the menu or by ESC otherwise settings aren't saved. I tend to exit via keystroke ESC return or CTRL-C[1].

However I use this extensively so that I can get back to the last saved situation and I'd prefer that all models work the same way - and don't implement force save.

The reasoning behind this is simple; if the FG operation is decided to be wrong it could be changed - and it is better if (wherever possible) models operate in a consistent manner.

I'm not saying your way is wrong and FG traditionally allows a great deal of flexibility in the models; but I'd rather not see something widely adopted that isn't optimal.
---------
[1] Using the mouse is tedious.
Richard
 
Posts: 716
Joined: Sun Nov 02, 2014 10:17 pm
Version: Git
OS: Win10

Re: JSBSim Piper J-3 Cub

Postby Octal450 » Thu Aug 10, 2017 4:40 pm

Umm.....

OK, each to his own.

I would get really pissed if my FG crashes, and my setting got lost, and I did not realize. The way programs work outside FlightGear is once a setting is changed it is either saved right away, or after pushing "APPLY". Having settings save on shutdown is silly in my opinion.

But, each to his own.

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

PreviousNext

Return to Aircraft

Who is online

Users browsing this forum: MSN [Bot] and 3 guests