Board index FlightGear Development Spaceflight

Space Shuttle - Development

Discussion about development and usage of spacecraft

Re: Space Shuttle - Development

Postby Johan G » Wed Sep 04, 2019 6:31 pm

GinGin wrote in Wed Sep 04, 2019 5:32 pm:Nasa datas
1mn30: 84Kfeet // 1900 ft/s
1mn50: 125Kfeet// 2200ft/s
2mn: Staging 146Kfeet// 2400 ft/s

[...]

After Update:
[...]
1mn30: 87Kfeet// 2000ft/s
1mn50: 130Kfeet// 2300 ft/s
1mn56: Staging 148 Kfeet// 2400 ft/s

Oh, wow! :D 8) :mrgreen:
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: 6625
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: Space Shuttle - Development

Postby Vinny002 » Wed Sep 04, 2019 11:10 pm

Hi, GinGin! Yes, I am very interested in trying out new stuff from the repositories in the flightgear space shuttle wiki page! Thanks!
Vinny002
 
Posts: 89
Joined: Mon Jul 01, 2019 9:55 pm

Re: Space Shuttle - Development

Postby GinGin » Thu Sep 05, 2019 9:40 pm

GinGin
 
Posts: 1580
Joined: Wed Jul 05, 2017 11:41 am
Location: Paris
Callsign: Gingin

Re: Space Shuttle - Development

Postby GinGin » Sun Sep 22, 2019 7:35 pm

I tried the new option to custom shape the trajectory .

Stage 1 ( follow perfectly my guidance)

Image


Stage 2 ( same as above, I need to rescale it now upwards)

Image

Really great work, thanks
GinGin
 
Posts: 1580
Joined: Wed Jul 05, 2017 11:41 am
Location: Paris
Callsign: Gingin

Re: Space Shuttle - Development

Postby Thorsten » Sun Sep 29, 2019 3:51 pm

Do we have any features I promised but did not yet code / major bugs/ things that need to be addressed?

I'm thinking of preparing another milestone (testing some, perhaps adding more scenarios, writing the documentation,...) - so if there's anything we need to have addressed, please let me know.

(I'll probably still tinker some with the handover issues, trying to figure out why there's sometimes so much of a velocity mismatch...)
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Space Shuttle - Development

Postby eatdirt » Sun Sep 29, 2019 4:25 pm

Do we have any features I promised but did not yet code / major bugs/ things that need to be addressed?


Everything is quite working fine on my side, with so much features added! that's going to be quite a milestone!

I just remember to have set some personal DAP settings for docking on ISS, as I remember that the default ones were not fuel friendly for docking, but also when tracking.
I did not follow if the default values have been improved in this respect, but that might be a minor thing to do for the milestone release?
eatdirt
 
Posts: 1012
Joined: Wed Aug 15, 2018 3:06 pm

Re: Space Shuttle - Development

Postby Thorsten » Sun Sep 29, 2019 4:35 pm

As the DAP-A and B are fully configurable via the mission file and via SPEC 20, I won't change the defaults as the default DAP-A gives a rather crisp response like people are used to from an airplane, whereas large deadbands etc. take getting used to.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Space Shuttle - Development

Postby GinGin » Sun Sep 29, 2019 4:46 pm

Nice milestone incoming indeed .
Do you wish to add the little change I made for adi color ( whiter ), throttle .xml ( correct order and power for abort max and nominal settings via spec 51 ), equipment load ( from 40000 pounds to 5000) first stage ascent ( closer to reality and more margin for max q).

Apart of that , I thing you fixed all the minor things . I will check back the bug fixes thread but It seems really nice .

I was wondering eventually if it was possible to tweak a bit more j 3 gravity for the other target
GinGin
 
Posts: 1580
Joined: Wed Jul 05, 2017 11:41 am
Location: Paris
Callsign: Gingin

Re: Space Shuttle - Development

Postby Thorsten » Mon Sep 30, 2019 7:04 am

Do you wish to add the little change I made for adi color ( whiter ), throttle .xml ( correct order and power for abort max and nominal settings via spec 51 ), equipment load ( from 40000 pounds to 5000) first stage ascent ( closer to reality and more margin for max q).


ADI color - I don't have strong feelings either way.

throttle.xml - what exactly was the issue? That we use 100% rather than 104%? I thought the rest of the assignments were as I found them documented. The 'nominal' throttle probably has to be mission-filed so that also the earlier Shuttle profiles make sense, I believe initially throttle was set to 100% (?) - I can't recall what document I saw this in, so my memory may be deceiving.

Equipment load - yeah, we wanted to change that along with the ascent profile. How invasive are your changes, i.e. do they break the lofting / climbout bias control parameters? How are trajectory discrepancies when varying through the possible range of inclinations and payload (I've done quite some testing for the existing code that it doesn't get stuck under some exotic scenario, and I'd like to avoid re-introducing such issues).

Can you post the alternative auto-launch script as well as the ascent profile in the mission file?
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Space Shuttle - Development

Postby GinGin » Mon Sep 30, 2019 6:25 pm

For Adi color, I put 0.8 for parameters.

For throttle, two things.
The 104% for nominal one indeed ( used quite early in STS program)
And the order for Max and abort

Abort was at 109 and max at 106
It is the other way around

Code: Select all
<switch name="systems/throttle/throttle-factor">
         <default value="1.0"/>
         <test value="1.09">
            systems/throttle/throttle-mode == 1   
         </test>
         <test value="1.06">
            systems/throttle/throttle-mode == 2   
         </test>
         <test  value="1.04">
            systems/throttle/throttle-mode == 3   
         </test>
      </switch>




For the first stage one modifications, I tested it a lot ( from polar to equatorial orbit, and even with the roll at launch), and it works well. I spent time to find the sweet spot for pitch accelerations to avoid abrupt changes in AOA
It permits also a lot flater trajectory for RTLS, and a "huge margin" of a couple of AOA degrees at Max Q

I removed the lofting for the SRB part as it follows a precise open loop guidance.
I let it for the second stage ( loft and climb out bias)

Here the lines for first stage

Code: Select all
# auto launch guidance for the Space Shuttle
# Thorsten Renk 2016


var auto_launch_stage = 0;
var auto_launch_timer = 0.0;
var aux_flag = 0;

var auto_launch_throttle_down = 18.0;
var auto_launch_throttle_up = 42.0;
var auto_launch_throttle_to = 0.0;

var auto_launch_traj_loft = 0.0;
var auto_launch_mps_climbout_bias = 0.0;
var auto_launch_srb_climbout_bias = 0.0;

var xtrack_refloc = geo.Coord.new();
xtrack_refloc.last_xtrack = 0.0;
xtrack_refloc.correction = 0.0;


xtrack_refloc.approach_speed = 0.0;
xtrack_refloc.last_app_speed = 0.0;
xtrack_refloc.buffer = 0.0;

var auto_launch_loop = func {

var shuttle_pos = geo.aircraft_position();

#var actual_course = SpaceShuttle.peg4_refloc.course_to(shuttle_pos);
#var dist = SpaceShuttle.peg4_refloc.distance_to(shuttle_pos);

var actual_course = SpaceShuttle.xtrack_refloc.course_to(shuttle_pos);
var dist = SpaceShuttle.xtrack_refloc.distance_to(shuttle_pos);

var launch_azimuth = getprop("/fdm/jsbsim/systems/ap/launch/launch-azimuth");

var xtrack = SpaceShuttle.sgeo_crosstrack(actual_course, launch_azimuth, dist)  * 0.0005399568;

# compute speed by a running average

xtrack_refloc.approach_speed = (xtrack_refloc.last_xtrack - xtrack)/ 0.1; # using loop time constant
xtrack_refloc.buffer = (xtrack_refloc.approach_speed + xtrack_refloc.last_app_speed)/2.0;
xtrack_refloc.last_app_speed = xtrack_refloc.approach_speed;
xtrack_refloc.approach_speed = xtrack_refloc.buffer;



xtrack_refloc.last_xtrack = xtrack;


setprop("/fdm/jsbsim/systems/ap/launch/cross-track", xtrack);
setprop("/fdm/jsbsim/systems/ap/launch/cross-track-approach-speed", xtrack_refloc.approach_speed);

if (auto_launch_stage == 0)
   {
   # check for clear gantry, then initiate rotation to launch course
   
   if (getprop("/fdm/jsbsim/velocities/vtrue-fps") > 120.0)
      {
      auto_launch_stage = 1;
      setprop("/fdm/jsbsim/systems/ap/launch/stage", 1);
      aux_flag = 0;
      }
   }
else if (auto_launch_stage == 1)
   {

   # enable throttling already during rotation to azimuth

   #print ("Auto launch timer: ", auto_launch_timer);

   if ((auto_launch_timer > auto_launch_throttle_down) and (auto_launch_timer < auto_launch_throttle_up))
      {
      if (aux_flag == 0)
         {
         if (getprop("/fdm/jsbsim/systems/ap/automatic-sb-control") == 1)
            {
            if (SpaceShuttle.failure_cmd.ssme1 == 1)
               {setprop("/controls/engines/engine[0]/throttle", auto_launch_throttle_to);}
            if (SpaceShuttle.failure_cmd.ssme2 == 1)
               {setprop("/controls/engines/engine[1]/throttle", auto_launch_throttle_to);}
            if (SpaceShuttle.failure_cmd.ssme3 == 1)
               {setprop("/controls/engines/engine[2]/throttle", auto_launch_throttle_to);}
            }
         aux_flag = 1;
         }
      # throttle up if we lose an engine

      if (getprop("/fdm/jsbsim/systems/mps/number-engines-operational") < 3.0)
         {
         if (getprop("/fdm/jsbsim/systems/ap/automatic-sb-control") == 1)
            {
            if (SpaceShuttle.failure_cmd.ssme1 == 1)
               {setprop("/controls/engines/engine[0]/throttle", 1.0);}
            if (SpaceShuttle.failure_cmd.ssme2 == 1)
               {setprop("/controls/engines/engine[1]/throttle", 1.0);}
            if (SpaceShuttle.failure_cmd.ssme3 == 1)
               {setprop("/controls/engines/engine[2]/throttle", 1.0);}
            }
         }

      }
   else if (auto_launch_timer > auto_launch_throttle_up)
      {
      if (aux_flag == 1)
         {
      
         if (getprop("/fdm/jsbsim/systems/ap/automatic-sb-control") == 1)
            {
            if (SpaceShuttle.failure_cmd.ssme1 == 1)         
               {setprop("/controls/engines/engine[0]/throttle", 1.0);}
            if (SpaceShuttle.failure_cmd.ssme2 == 1)         
               {setprop("/controls/engines/engine[1]/throttle", 1.0);}
            if (SpaceShuttle.failure_cmd.ssme3 == 1)         
               {setprop("/controls/engines/engine[2]/throttle", 1.0);}
            }
         aux_flag = 2;
         }
      }


   # check for launch course reached, then initiate pitch down assuming we're high enough

   if (math.abs(getprop("/fdm/jsbsim/systems/ap/launch/stage1-course-error")) < 0.1)
      {
      auto_launch_stage = 2;
      setprop("/fdm/jsbsim/systems/ap/launch/stage", 2);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 70.0);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.25);
      aux_flag = 0;
      }

   

   }
else if (auto_launch_stage == 2)
   {

   if ((auto_launch_timer > auto_launch_throttle_down) and (auto_launch_timer < auto_launch_throttle_up))
      {
      if (aux_flag == 0)
         {
         if (getprop("/fdm/jsbsim/systems/ap/automatic-sb-control") == 1)
            {
            if (SpaceShuttle.failure_cmd.ssme1 == 1)
               {setprop("/controls/engines/engine[0]/throttle", auto_launch_throttle_to);}
            if (SpaceShuttle.failure_cmd.ssme2 == 1)
               {setprop("/controls/engines/engine[1]/throttle", auto_launch_throttle_to);}
            if (SpaceShuttle.failure_cmd.ssme3 == 1)
               {setprop("/controls/engines/engine[2]/throttle", auto_launch_throttle_to);}
            }
         aux_flag = 1;
         }
      # throttle up if we lose an engine

      if (getprop("/fdm/jsbsim/systems/mps/number-engines-operational") < 3.0)
         {
         if (getprop("/fdm/jsbsim/systems/ap/automatic-sb-control") == 1)
            {
            if (SpaceShuttle.failure_cmd.ssme1 == 1)
               {setprop("/controls/engines/engine[0]/throttle", 1.0);}
            if (SpaceShuttle.failure_cmd.ssme2 == 1)
               {setprop("/controls/engines/engine[1]/throttle", 1.0);}
            if (SpaceShuttle.failure_cmd.ssme3 == 1)
               {setprop("/controls/engines/engine[2]/throttle", 1.0);}
            }
         }

      }
   else if (auto_launch_timer > auto_launch_throttle_up)
      {
      if (aux_flag == 1)
         {
      
         if (getprop("/fdm/jsbsim/systems/ap/automatic-sb-control") == 1)
            {
            if (SpaceShuttle.failure_cmd.ssme1 == 1)         
               {setprop("/controls/engines/engine[0]/throttle", 1.0);}
            if (SpaceShuttle.failure_cmd.ssme2 == 1)         
               {setprop("/controls/engines/engine[1]/throttle", 1.0);}
            if (SpaceShuttle.failure_cmd.ssme3 == 1)         
               {setprop("/controls/engines/engine[2]/throttle", 1.0);}
            }
         aux_flag = 2;
         }
      }

   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 571.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 69.4);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.04);
      }

   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 678.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 68.6);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.04);
      }
      
    if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 747.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 67.8);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.04);
      }
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 846.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 66.2);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.04);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 932.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 64.4);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.04);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 1068.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 62.1);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.04);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 1149.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 61.1);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.04);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 1304.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 59.0);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.06);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 1382.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 58.2);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.06);
      }

   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 1463.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 57.8);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.06);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 1550.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 57.1);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.06);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 1693.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 54.7);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.06);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 1797.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 52.9);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.06);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 2027.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 48.7);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.06);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 2154.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 46.4);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.06);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 2286))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 43.0);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.06);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 2353.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 42.0);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.06);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 2421.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 41.6);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.06);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 2746.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 38.6);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.06);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 3019.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 36.3);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.06);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 3157.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 35.3);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.06);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 3350.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 33.9);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.06);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 3573.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 32.4);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.06);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 3950.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 29.8);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.1);
      }   
      
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 5000.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 22.6);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.1);
      }   




For the Dap, we might just change one deadband whichis really tight.
After Meco, with the MPS dump, RCS are firing a lot.

This one <dap-A-PRI-rate-db type="double">0.001</dap-A-PRI-rate-db>
0.05 is working well and spare a lot of RCS propellant during Transition DAP before OPS 2 and Spec 23 tweaking.

After Meco, with the MPS dump, RCS are firing a lot.




Two minor things ( that are really not necessary for the milestone though)
The PFD not feed with datas before ignition

Like that:

Image


And some stuff on DAP layout


MM 304/ 305//// 602/ 603 Dap mode on PFD

A small thing I noticed recently.
In the Major Mode above ( basically entry stuff), DAP on PFD is a bit different, showing Pitch and Roll/Yaw in a separated manner ( DAP in other MM)
I think it is coming from the fact that except for entry, when we swith one mode in manual ( R/Y or Pitch, the both go into manual, and for entry, we can select one in manual and the other one in auto)


Image


Image



I tested the cross feeding fix, it is perfect.
Hac in spec 51 same
Size of IDP really nice
Custom Shape for MM 102/103 works good
GinGin
 
Posts: 1580
Joined: Wed Jul 05, 2017 11:41 am
Location: Paris
Callsign: Gingin

Re: Space Shuttle - Development

Postby Thorsten » Mon Sep 30, 2019 6:56 pm

Here the lines for first stage


Just a general comment. That:

Code: Select all
  if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 571.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 69.4);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.04);
      }

   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 678.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 68.6);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.04);
      }
     
    if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 747.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 67.8);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.04);
      }
     
   if ((getprop("/fdm/jsbsim/velocities/vtrue-fps") > 846.0))
      {
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-target", 66.2);
      setprop("/fdm/jsbsim/systems/ap/launch/pitch-max-rate-norm", 0.04);
      }   
(...)


is very inefficient. What happens when vtrue is >5000 is that first the first if-clause is true, so the two setprop() commands are executed. Then the second if-clause evaluates to true, so again two setprop() are executed. So we end up with 50 cases of property I/O, out of which 48 are overwritten by the last two.

Needless to say, we don't want to do that because property I/O is relatively of expensive (not necessarily the 50 done here as such, but combined with the 400 the ADI uses, the other 50 a DPS screen typically uses etc it sums up). So we actually want to structure the code in such a way that only one case of property I/O is written :D
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Space Shuttle - Development

Postby GinGin » Mon Sep 30, 2019 7:11 pm

Yes, it adds for sure some lines :)


I see what you mean now with the 50 I/o

We can’t stop the previous I/o with an aux flag at each end of if property ?


I tried with less value, but effect was huge on flight path, especially near Max Q where every inches of attitude matters to stay well below 2 ° of AOA and not be too long at high Q.

It is not really efficient code wise, but in flight , it is much more efficient on the flight path than just 2 or 3 commands for a 2 mn flight

I had another example, need to find it.
It was getting rid of almost all the open loop value with just a constant pitch value ( 0.6 degres/ seconds) after bucket to reach the proper attitude at 2 mn
Starting at 70 ° at 30 seconds, ending up at 20 ° at 2 mn
Last edited by GinGin on Mon Sep 30, 2019 11:50 pm, edited 3 times in total.
GinGin
 
Posts: 1580
Joined: Wed Jul 05, 2017 11:41 am
Location: Paris
Callsign: Gingin

Re: Space Shuttle - Development

Postby eatdirt » Mon Sep 30, 2019 11:11 pm

This one <dap-A-PRI-rate-db type="double">0.001</dap-A-PRI-rate-db>
0.05 is working well and spare a lot of RCS propellant during Transition DAP before OPS 2 and Spec 23 tweaking.


For the only thing I can comment on in all the exhaustive Gingin's testings, is that I ended up with almost the same value for dap-A-PRI-rate-db, mine was at 0.06. It is a quite a bit longer to get into an attitude, but, up to this, I did not notice any other issue with such a deadband. But I agree with Thorsten, the settings should be beginner's friendly first!
eatdirt
 
Posts: 1012
Joined: Wed Aug 15, 2018 3:06 pm

Re: Space Shuttle - Development

Postby wkitty42 » Tue Oct 01, 2019 11:18 am

Thorsten wrote in Mon Sep 30, 2019 6:56 pm:
Here the lines for first stage


Just a general comment. That:

Code: Select all
(...)

is very inefficient. What happens when vtrue is >5000 is that first the first if-clause is true, so the two setprop() commands are executed. Then the second if-clause evaluates to true, so again two setprop() are executed. So we end up with 50 cases of property I/O, out of which 48 are overwritten by the last two.

would the fix for this to be reversing the if statements so the highest is checked first and then works down to the lowest or will that lead to the same problem when lowers values are checked except now wrong data is used? sounds like they need a range for their check... if ((blah>foo) and (blah<bar))...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9123
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Space Shuttle - Development

Postby Thorsten » Tue Oct 01, 2019 11:31 am

would the fix for this to be reversing the if statements so the highest is checked first and then works down to the lowest


No, I'd code this how I have coded the ascent AP as well - using an auxiliary flag.

Each conditional checks both condition and flag, each time the conditional is true the setprop() are executed just once (and not every iteration) and the flag is incremented, and ideally each conditional is an else if so that we don't have to go through the whole shbang all the time but can stop evaluating as soon as we have a match,

(And yeah, for the if... else if... to work you'd need to reverse order).
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

PreviousNext

Return to Spaceflight

Who is online

Users browsing this forum: No registered users and 1 guest