Space Engineers

Space Engineers

Not enough ratings
Auto Landing Tutorial Ship (UPDATING)
   
Award
Favorite
Favorited
Unfavorite
Type: Blueprint
File Size
Posted
1.135 MB
2 Jun, 2019 @ 1:56am
1 Change Note ( view )

Subscribe to download
Auto Landing Tutorial Ship (UPDATING)

Description
This ship is just for tutorial of auto landing script.



Formulas
G² = natural gravity x² + natural gravity y² + natural gravity z²

X1 = (X0 + G² / X0) / 2 , Repeat : X1 --> G (The Babylonian square-root algorithm)

D = MS² / 2F , F = Max Downside Thruster Power - Total Ship Weight



Code
@Variables{ <--- Formulas used below
MyGrav = math ((ChangeIntervalSlider of Code <--- X0 = ChangeIntervalSlider of Code
+ (((natural gravity x of Fighter Cockpit * natural gravity x of Fighter Cockpit) <--- G²
+ (natural gravity y of Fighter Cockpit * natural gravity y of Fighter Cockpit)
+ (natural gravity z of Fighter Cockpit * natural gravity z of Fighter Cockpit))
/ ChangeIntervalSlider of Code)) / 2)
MyStopDist = math (10 + ((Ship Total Mass of Fighter Cockpit
* (Ship Speed of Fighter Cockpit * Ship Speed of Fighter Cockpit))
/ (2 * ((2 * 98400) <--- 2 * 98400 : Max Downside Thruster Power
- (Ship Total Mass of Fighter Cockpit * ChangeIntervalSlider of Code))))) <--- Ship Weight = Mass * G
}



@Auto Landing{
If HandBrake of Fighter Cockpit = Off
{
HandBrake of Fighter Cockpit = On
}
ChangeIntervalSlider of Code = 10 <--- X0 Initial value must be > 0
Run Programmable Block R / Hover Aligner = go <--- Aligner On
@Auto Landing Loop <--- Entering Infinite Loop
Run Programmable Block R / Hover Aligner = stop
OnOff of Hydrogen Thruster Up = On
If HandBrake of Fighter Cockpit = On
{
HandBrake of Fighter Cockpit = Off
}
If Surface Altitude of Fighter Cockpit < 3
{
DampenersOverride of Fighter Cockpit = Off
}
}



@Auto Landing Loop{
ChangeIntervalSlider of Code = MyGrav <--- Repeating this while loop to get G
DampenersOverride of Fighter Cockpit = On
If Surface Altitude of Fighter Cockpit > MyStopDist <--- Altitude to start thrusting
{
OnOff of Hydrogen Thruster Up = Off
}
Else <--- Below is final action when altitude =< MystopDist
{
If Ship Speed of Fighter Cockpit > 1 <--- Final Landing Speed
{
OnOff of Hydrogen Thruster Up = On
}
Else
{
OnOff of Hydrogen Thruster Up = Off
}
}
If Surface Altitude of Fighter Cockpit > 3 <--- Loop Breaking Altitude must be higher than altitude of cockpit on ground
{
If HandBrake of Fighter Cockpit = On <--- Another condition to break loop
{
@Auto Landing Loop
}
}
Else <--- Micro burst for soft landing below
{
OnOff of Hydrogen Thruster Up = Off
Delay 130 <--- Adjust this value to find the best,1000=1sec
OnOff of Hydrogen Thruster Up = On
Delay 1000
}
}
6 Comments
Exhilus 4 Jul, 2020 @ 10:28pm 
This script has aged well if it's caught the attention of whiplash.
Whiplash141 28 Jun, 2020 @ 6:36pm 
Clever :)
dummy puppy 11 Jul, 2019 @ 8:20am 
thank you
BreezeRider  [author] 11 Jul, 2019 @ 2:58am 
@alexey.kirkov you mean argument of programming block, right? then for this ship, Code(Auto Landing)
dummy puppy 11 Jul, 2019 @ 2:50am 
i have another question what is the command to run the autolanding script
Exhilus 16 Jun, 2019 @ 6:33pm 
Math = Brain hurt