Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Outerra Tech Demo download. Help with graphics driver issues

Pages: 1 [2]

Author Topic: formation flying  (Read 20555 times)

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: formation flying
« Reply #15 on: August 26, 2014, 06:02:36 pm »

There seems to be some NaN values appearing in JSBSim when it computes wind relative speed. I'm not sure if this is the problem though, must figure out how to move past this trap in debugger.
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: formation flying
« Reply #16 on: August 27, 2014, 10:24:28 am »

Okay, after fixing the wind relative speed bug in JSBSim it no longer generates NaNs. Updated jsbsim binaries here:
https://drive.google.com/file/d/0B2spgr2B2dvNODc3bi1zLWo3dFU/edit?usp=sharing
Logged

bomber

  • Hero Member
  • *****
  • Posts: 523
  • newbie
Re: formation flying
« Reply #17 on: August 27, 2014, 04:51:15 pm »

Thanks Cameni, downloaded and will take a look...
Logged
"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 Mitchell

bomber

  • Hero Member
  • *****
  • Posts: 523
  • newbie
Re: formation flying
« Reply #18 on: August 27, 2014, 05:14:34 pm »

Sorry Cameni still fails....

Hopefully you've downloaded and flown the glider ask-13...

The image below shows one of three sections of the code that I've identified as causing a problem, I've commented out the code and added the alternative...

I'd like to use the commented out code as it's important for stalling.



Hopefully this'll help you identify the culprit.

Regards

Simon
Logged
"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 Mitchell

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: formation flying
« Reply #19 on: August 27, 2014, 05:37:58 pm »

Hmm, I was using your ask-13 file, which has this in it:

Code: [Select]
<sum name="T4T/moments/Roll_wing">
<product name="T4T/moments/Z-Roll_wing_left">
<property>T4T/forces/z-vector_wing_left</property>
<property>T4T/moments/wing_left_CoL-Y</property>
<!--<property>T4T/structure/wing_left_4/y</property>  -->
</product>
<product name="T4T/moments/Z-Roll_wing_right">
<property>T4T/forces/z-vector_wing_right</property>
<property>T4T/moments/wing_right_CoL-Y</property>
<!-- <property>T4T/structure/wing_right_4/y</property>  -->
</product>
</sum>

No more NaN messages and no asserts, but the aircraft spins quite wildly. However, I now tried it on another computer, and got a NaN when evaluating property T4T/forces/drag/wing_left_induced_vortex, deeper down when it was trying to get value for qbar-psf  ???
Logged

bomber

  • Hero Member
  • *****
  • Posts: 523
  • newbie
Re: formation flying
« Reply #20 on: August 27, 2014, 05:50:42 pm »

but the aircraft spins quite wildly.

oh stop teasing   :)


And yes that's another one of the 3 sections of code, here I've commented it out to make the glider fly...

Code: [Select]
<function name="T4T/forces/drag/TOTAL_DRAG">
<description>Drag</description>
<sum>
<product>
<property>T4T/forces/x-vector-fuselage</property>
<value> -1 </value>
</product>
<product name="T4T/forces/drag/TOTAL_WIND-DRAG">
<property>T4T/metrics/drag_modifier</property>
<sum>
<!-- <property>T4T/forces/drag/wing_left_induced_vortex</property>
<property>T4T/forces/drag/wing_right_induced_vortex</property> -->
<property>T4T/forces/drag/wing_left-parasite</property>
<property>T4T/forces/drag/wing_right-parasite</property>
<property>T4T/forces/drag/fuselage-plan_left-parasite</property>
<property>T4T/forces/drag/fuselage-plan_right-parasite</property>
<property>T4T/forces/drag/fuselage-side-parasite</property>
</sum>
</product>
</sum>
</function>
Logged
"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 Mitchell

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: formation flying
« Reply #21 on: August 28, 2014, 05:00:20 am »

So after stuffing it with asserts:

Code: [Select]
    <function name="T4T/aero/h-stab_right_roll-adjustment">
        <description>The adjustment to the AoA from the roll rate</description>
<product>
<value> 57.288 </value> <!-- Converts Rads to Degs -->
<atan> <!-- angle in Rads -->
<quotient> <!-- tan of the angle -->
<product>
<!-- Revolutions per Second -->
<quotient>
<property>velocities/p-aero-rad_sec</property>
<value> 6.284 </value>
</quotient>
<!-- Circumference -->
<value> 6.283 </value> <!-- 2 x Pi -->
<property>T4T/structure/h-stab_right/y</property>
</product>
<property> velocities/vt-fps </property>
</quotient>
</atan>
</product>
    </function>

Quotient with velocities/vt-fps = 0.0 in denominator.
Logged

bomber

  • Hero Member
  • *****
  • Posts: 523
  • newbie
Re: formation flying
« Reply #22 on: August 28, 2014, 06:45:39 am »

We don't have a problem with that bit of code though
Logged
"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 Mitchell

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: formation flying
« Reply #23 on: August 28, 2014, 07:03:31 am »

How so? It produces NaN/Inf value that propagates through the property tree.
Logged

bomber

  • Hero Member
  • *****
  • Posts: 523
  • newbie
Re: formation flying
« Reply #24 on: August 28, 2014, 07:36:52 am »

OK I'll see if I can initialise it with a small value...
Logged
"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 Mitchell

bomber

  • Hero Member
  • *****
  • Posts: 523
  • newbie
Re: formation flying
« Reply #25 on: August 29, 2014, 02:43:38 pm »

Changed it to a value of 1 and still no work..... it's not this... it's to do with the induced drag.


Code: [Select]
    <function name="T4T/aero/wing_right_roll-adjustment">
        <description>The adjustment to the AoA from the roll rate</description>
<product>
<value> -57.288 </value> <!-- Converts Rads to Degs -->
<atan> <!-- angle in Rads -->
<quotient> <!-- tan of the angle -->
<product>
<!-- Revolutions per Second -->
<quotient>
<property>velocities/p-aero-rad_sec</property>
<value> 6.284 </value>
</quotient>
<!-- Circumference -->
<value> 6.283 </value> <!-- 2 x Pi -->
<property>T4T/structure/wing_left_4/y</property>
</product>
<value> 1 </value>
</quotient>
</atan>
</product>
    </function>
Logged
"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 Mitchell

bomber

  • Hero Member
  • *****
  • Posts: 523
  • newbie
Re: formation flying
« Reply #26 on: August 29, 2014, 02:58:26 pm »

Ok resolved the first issue.... just added the small value to the left and right normals... it's always good to talk. :)


Code: [Select]
<function name="T4T/forces/wing_normal_left"> <!-- normal force generated by the wing -->
<description>force normal left wing</description>
<sum>
<value> 0.000001 </value>
<property>T4T/forces/wing_normal_left_8</property>
<property>T4T/forces/wing_normal_left_7</property>
<property>T4T/forces/wing_normal_left_6</property>
<property>T4T/forces/wing_normal_left_5</property>
<property>T4T/forces/wing_normal_left_4</property>
<property>T4T/forces/wing_normal_left_3</property>
<property>T4T/forces/wing_normal_left_2</property>
<property>T4T/forces/wing_normal_left_1</property>
</sum>
</function>
Logged
"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 Mitchell

bomber

  • Hero Member
  • *****
  • Posts: 523
  • newbie
Re: formation flying
« Reply #27 on: August 29, 2014, 03:41:28 pm »

AND THE CROWD GOES WILD !

Ok found the pesky beast... had to add the 0.00001 value

Code: [Select]
<function name="T4T/forces/drag/wing_right_induced_vortex">
<description>Induced drag from the right wing</description>
<sum>
<value> 0.1 </value>
<product><!-- http://www.grc.nasa.gov/WWW/K-12/airplane/induced_html -->
<quotient name="T4T/coefficients/cdi-wing_right"> <!-- Coefficient of Induced Drag on right wing-->
<pow> <!-- (average)Cf squared -->
<quotient name="T4T/coefficients/cl-wing_right">
<product>
<cos><property>T4T/aero/alpha_positive-rad</property></cos>
<property>T4T/forces/wing_normal_right</property>
</product>
<sum>
<value> 0.00001 </value>
<product>
<value> 0.5 </value>
<property>metrics/Sw-sqft</property> <!-- Area of right wing -->
<property>aero/qbar-psf</property> <!-- dynamic pressure on the wing -->
</product>
</sum>
</quotient>
<value> 2.0 </value>
</pow>
<product> <!-- pi*AR*e-->
<value>3.142</value> <!-- pi -->
<property>T4T/metrics/wing_aspect</property>
<property>T4T/metrics/wing_efficiency</property><!-- efficiency value 1.0 for eliptical & 0.7 for straight wing-->
</product>
</quotient>
<property>aero/qbar-psf</property> <!-- dynamic pressure on the wing -->
<value> 0.5 </value>
<property>metrics/Sw-sqft</property> <!-- Area of right wing -->
<table>
<independentVar><property>aero/alpha-deg</property></independentVar>
<independentVar lookup="column">fcs/right-aileron-pos-norm</independentVar>
<tableData>
-1 0 1
-30 0 0 0
-24 0 0 1
-16 0 1 1
-1 1 1 1
9 1 1 1
14 1 1 0
27 1 0 0
30 0 0 0
</tableData>
</table>
</product>
</sum>
</function>
Logged
"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 Mitchell

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: formation flying
« Reply #28 on: August 29, 2014, 04:09:54 pm »

Yea these 0/0 cases are tricky. There should be some quotient variant that gives 0 there instead of NaN, if one knows it would be the valid result.
Logged
Pages: 1 [2]