Example #1
0
        public static bool Atmospheric()
        {
            Console.WriteLine("Set TargetAltitude in meter :");
            TargetAltitude = Double.Parse(Console.ReadLine());
            Console.WriteLine("Target Altitude set to " + TargetAltitude + "m");

            Thread Events = new Thread(FlightEvent);

            Events.Start();

            //Thread.Sleep(999999999);
            if (Startup.Igntion(3) == true)
            {
                Thread Enginess = new Thread(ThrottleGuidance);
                Enginess.Start();
                AscentGuidance();

                Starship.starship.AutoPilot.Engage();
                Starship.starship.AutoPilot.TargetRoll = 0;

                Enginess.Abort();

                Thread WingsControl = new Thread(Starship.PIDcontrolNewStarship);
                WingsControl.Start();

                Console.WriteLine("Landing control started");
                Thread.Sleep(40000);
                Confirmed = true;
                while (Starship.starship.Flight(Starship.starship.SurfaceReferenceFrame).SurfaceAltitude > 1200)
                {
                }
                Thread LBC = new Thread(Starship.Tamere);
                LBC.Start();
                Console.WriteLine("Landing Burn control Started");
                Landing.LandingBurn(Starship.starship);

                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        public static bool Small()
        {
            Console.WriteLine("Set TargetAltitude in meter :");
            TargetAltitude = Double.Parse(Console.ReadLine());
            Console.WriteLine("Target Altitude set to " + TargetAltitude + "m");

            Wings.WingUpR[0].Deployed();
            Wings.WingUpR[0].Orientation(80);
            Wings.WingUpL[0].Deployed();
            Wings.WingUpL[0].Orientation(80);
            Wings.WingDownR[0].Deployed();
            Wings.WingDownR[0].Orientation(80);
            Wings.WingDownL[0].Deployed();
            Wings.WingDownL[0].Orientation(80);

            if (Startup.Igntion(1) == true)
            {
                Starship.starship.Control.Throttle = Throttle.ThrottleToTWR(Starship.starship, 1.25f, 1);
                Thread.Sleep(2500);
                Starship.starship.AutoPilot.Engage();
                Engines.RaptorSL[0].Trim(4, 0);
                Starship.starship.AutoPilot.TargetPitch   = 86;
                Starship.starship.AutoPilot.TargetHeading = (float)Landing.ZoneHeading(Starship.starship);
                Starship.starship.AutoPilot.TargetRoll    = 0;

                Starship.starship.AutoPilot.AttenuationAngle = new Tuple <double, double, double>(1, 1, 1);
                Starship.starship.AutoPilot.StoppingTime     = new Tuple <double, double, double>(3, 3, 3);
                Starship.starship.AutoPilot.DecelerationTime = new Tuple <double, double, double>(10, 10, 10);
                Starship.starship.AutoPilot.RollThreshold    = 1;
                Starship.starship.AutoPilot.PitchPIDGains    = new Tuple <double, double, double>(50, 50, 0);
                Starship.starship.AutoPilot.YawPIDGains      = new Tuple <double, double, double>(30, 30, 0);
                Starship.starship.AutoPilot.RollPIDGains     = new Tuple <double, double, double>(30, 30, 0);

                while (Starship.starship.Orbit.ApoapsisAltitude - 97.6 < TargetAltitude - (Starship.starship.Flight(Starship.starship.Orbit.Body.ReferenceFrame).VerticalSpeed * 1.6f))
                {
                    Starship.starship.Control.Throttle = Throttle.ThrottleToTWR(Starship.starship, 1.15f, 1);
                }
                Console.WriteLine("Apogee");
                Thread LBC = new Thread(Starship.Tamere);
                LBC.Start();
                while (Starship.starship.Flight(Starship.starship.Orbit.Body.ReferenceFrame).VerticalSpeed > -5)
                {
                    if (Starship.starship.Flight(Starship.starship.SurfaceReferenceFrame).SurfaceAltitude - 20 < TargetAltitude - 5)
                    {
                        Starship.starship.Control.Throttle = Throttle.ThrottleToTWR(Starship.starship, 0.6f, 1);
                    }
                    else
                    {
                        Starship.starship.Control.Throttle = 0.001f;
                    }
                }

                Console.WriteLine("Max altitude : " + Starship.starship.Flight(Starship.starship.SurfaceReferenceFrame).SurfaceAltitude + "m");

                while (Starship.starship.Flight(Starship.starship.Orbit.Body.ReferenceFrame).VerticalSpeed > -6)
                {
                }

                Console.WriteLine("Landing Burn control Started");
                Landing.LandingBurn(Starship.starship);

                return(true);
            }
            else
            {
                return(false);
            }
        }