Outerra forum

User mods, screenshots & videos => Aircraft => Topic started by: bomber on August 12, 2014, 03:28:37 pm

Title: formation flying
Post by: bomber on August 12, 2014, 03:28:37 pm
(http://target4today.com/_posted_images_/2014-08/formation-flying.JPG)

(http://target4today.com/_posted_images_/2014-08/formation-flying-2.JPG)

So first I spawn a single comet, which has an anti-gravity system so it just sits there above the mountains... I move away from it 100m and spawn a second one  and then a third, so now I have 3 floating ships. I then open the throttle on this third comet to 20% and point it off down the valley....after a while I press esc move to the 1st comet, take control opening the throttle and set of in hot pursuit. When I catch up and fly information I take the first image.. I then press esc go back to the comet I left behind, take control of that and then follow again in hot pursuit... It takes about 5 minutes to catch up and then when I take the 2nd image...

Conclusion : 3 iterations of JSBsim working at the same time with the ability to jump between them and take control at any time...

Guys, hats off this is a piece of work.
Title: Re: formation flying
Post by: CaptTrego on August 12, 2014, 03:38:01 pm
...........!!!!!!    8) 8) 8)
Title: Re: formation flying
Post by: Mossie on August 12, 2014, 04:43:39 pm
OMG
Title: Re: formation flying
Post by: bomber on August 12, 2014, 06:10:45 pm
ok I've added it for your download here...

http://target4today.com/index.php/downloads/download/2-t4t-mod-files/2-outerra-files (http://target4today.com/index.php/downloads/download/2-t4t-mod-files/2-outerra-files)

throttle forward thrusters
mixture reverse thrusters
joystick control yaw, up, down oh and sideways

Now this is a flight model for a 'Capital' Ship... not a frigate or fighter.. it's kinda like a proof of concept.

Do not crash into the ground, or your no-claims gets waived !
Title: Re: formation flying
Post by: bomber on August 15, 2014, 01:54:50 pm
(http://target4today.com/_posted_images_/2014-08/formation-flying-3.jpg)

been doing some 'proper' formation flying...

Ok this is however using the Ask-13 glider flight model with this external..

I am experiencing some issues with the flight model from Flightgear to Outerra and I'd like to work it through with an Outerra developer if I can.

Regards

Simon
Title: Re: formation flying
Post by: cameni on August 15, 2014, 02:49:32 pm
Probably best describing the problem here, I'll drag Angrypig to answer ;)
Title: Re: formation flying
Post by: Acetone on August 15, 2014, 03:35:18 pm
You can also use the quickspawn keys. "7" to spawn a Cessna, full throttle, "7" again, etc... In less than one minute you'll have dozens of birds trying to take of to the sky. However, the result is not going to be a proper flight formation, but rather a complet mayhem since planes (in JBSIM?) are not really stable without a lot of trimming. The majority of them will go kissing the ground after a quick turn, and a few will keep a kind-of-ok trajectory and will fly in all the directions.

Most amazing thing is that you can go far away from them, when you come back they will still be here (if you manage to find the spot again), flying awkwardly before having an appointment with a cliff, or better a quick bath in the deep depths of the ocean.

 ;D
Title: Re: formation flying
Post by: bomber on August 15, 2014, 04:21:25 pm
with an autopilot system they can fly to any preset script your heart so desired
Title: Re: formation flying
Post by: bomber on August 15, 2014, 04:30:57 pm
(http://target4today.com/_posted_images_/2014-08/formation-flying-4.jpg)

http://target4today.com/_posted_images_/2014-08/ask-13.xml (http://target4today.com/_posted_images_/2014-08/ask-13.xml)

The initials problems lie on lines 4623 and 4628.....
Title: Re: formation flying
Post by: cameni on August 16, 2014, 02:38:05 am
Hmm, that error message is mine, JSBSim sometimes generates NaN positions when querying elevations. May be an effect of it first getting some bad values in previous frames.
Title: Re: formation flying
Post by: bomber on August 16, 2014, 06:16:01 am
I agree I think that's correct that it's a bad value in the previous frame..

To put it simply the code needs to generate a lift value, this is then used to calculate the exact centre of lift of the wing and thus the roll moment and also induced drag.

but in the first frame there is no lift I suspect and so the result is a failure to calculate the values.

the planes flying at present because I can substitute a calculated centre of lift with a fixed value, but I'd rather not.
I can also remove the induced drag from both the yaw moments and the overall drag.... but again I'd rather not.

Where do we go from here ?

Title: Re: formation flying
Post by: cameni on August 16, 2014, 08:42:18 am
Does it happen right from the start, or some time later?
Title: Re: formation flying
Post by: bomber on August 16, 2014, 08:47:36 am
Right from the start..
Title: Re: formation flying
Post by: cameni on August 16, 2014, 10:35:52 am
Ok, we'll probably need to debug it. Can you upload that version?
Title: Re: formation flying
Post by: bomber on August 16, 2014, 10:40:08 am
http://target4today.com/_posted_images_/2014-08/ask-13.xml (http://target4today.com/_posted_images_/2014-08/ask-13.xml)

right click 'save link as'
Title: Re: formation flying
Post by: cameni 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.
Title: Re: formation flying
Post by: cameni 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
Title: Re: formation flying
Post by: bomber on August 27, 2014, 04:51:15 pm
Thanks Cameni, downloaded and will take a look...
Title: Re: formation flying
Post by: bomber 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.

(http://target4today.com/_posted_images_/2014-08/roll moment.JPG)

Hopefully this'll help you identify the culprit.

Regards

Simon
Title: Re: formation flying
Post by: cameni 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  ???
Title: Re: formation flying
Post by: bomber 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>
Title: Re: formation flying
Post by: cameni 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.
Title: Re: formation flying
Post by: bomber on August 28, 2014, 06:45:39 am
We don't have a problem with that bit of code though
Title: Re: formation flying
Post by: cameni on August 28, 2014, 07:03:31 am
How so? It produces NaN/Inf value that propagates through the property tree.
Title: Re: formation flying
Post by: bomber on August 28, 2014, 07:36:52 am
OK I'll see if I can initialise it with a small value...
Title: Re: formation flying
Post by: bomber 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>
Title: Re: formation flying
Post by: bomber 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>
Title: Re: formation flying
Post by: bomber 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>
Title: Re: formation flying
Post by: cameni 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.