Space Engineers

Space Engineers

36 ratings
AutoThrottleV1.3
   
Award
Favorite
Favorited
Unfavorite
Tags: autopilot
File Size
Posted
409.945 KB
14 Apr, 2021 @ 3:47pm
1 Change Note ( view )

Subscribe to download
AutoThrottleV1.3

Description
Automatic throttle control for efficient take off, escape from gravity well, and landing. This script adjusts thrust overrides for fuel efficient ascent and descent,

* to / from orbit
* to / from landing site
* to / from cruise altitude

The script will automatically use whichever thrusters are pointed "down," so ships can take off horizontally and then pitch up to point at the sky and control will automatically switch from the bottom thrusters to the back thrusters. Capable of using subgrid thrusters.

Setup

1. Add the script to a programmable block (ensure there is no existing custom data in the PB)
2. Ensure the main control is marked as "main"
3. Sit in the ship's main control
4. Recompile the PB

At this point there is some configuration data written to the PB's custom data field. You may change this data if you like (see below "configuration")

NOTE: Regardless of whether you change this data or not, you will need to repeat steps 3 and 4 again (sit in the control seat and recompile the script).

The requirement to sit in the control seat is a bug I didn't notice until well after I'd started working on another project. This shouldn't be a requirement, but for now, it is. Same with having to recompile twice.

Use

The script is used by running the PB with different arguments. This can be done from the terminal window, or by assigning the PB call to a button panel, etc. The following commands are available. Running the exact same command a second time (while the script is active) will toggle the command off. Commands are case insensitive.

CRUISE # (e.g., "CRUISE 1500")
Ascend or descend to the provided altitude above ground level (AGL). When the number is omitted, the ship moves to the most recent set altitude. When the cruise altitude is below ground level, the system will transition to "land" mode.

LAND
Safely and efficiently lands the ship. This command adjusts the descent speed based on gravity and distance to the ground. Ship automatically slows for a safe and feather-soft landing. Upon contact with the ground, thrusters are set to 0% override, and dampeners are turned off. WARNING: Remain alert to keep the ship level or ship will drift.

ESCAPE
Ascend from gravity well until planetary gravity is 0. Once gravity is 0, thrusters are set to 0% override, and dampeners are turned on. This provides a fuel-efficient transition from ground to space.

IDLE
Turn off current mode, return thrusters to 0% override, and turn on dampeners. This is basically a universal "off" switch, regardless of the current operational state.

SPEED # (e.g., "SPEED 75")
Set the maximum ascent speed. When descending, a calculation is used to temporarily adjust this speed for safety. This calculation accounts for ship thrust/weight ratio and planetary gravity. This command can be combined with other commands, e.g., "cruise 2500 speed 80" Once set, this value becomes the default speed setting for all commands.

REFRESH
When custom data exists, read settings. When custom data does not exist, writes default settings. (Re) detects main control systems and thrusters.

Configuration

The default configuration works for most modest ships out of the box. However, your ship may need some custom adjustments.

MAX SPEED (0 .. ) [65]
This is the initial setting for the default maximum ascent speed. After you use the speed # command, this value is ignored.

CONTROL HEIGHT (- .. +) [4]
Set this value to the "block elevation" of the control seat from the bottom of the ship. For example, if the control seat is sitting on a deck that is 1 block thick and there is a landing gear under the deck, then this value must be 4 (1 for the control block row, plus 1 block of deck thickness, plus 2 for the block-height of the landing gear).

If landing system cuts off too early, reduce this number. If the landing system does not cut off after contact with the ground, increase this number.

SAFETY FACTOR (0.0 .. ) [0.5]
This is a factor in the calculation that reduces the target descent speed (from the set ascent speed). By default this value is 0.5, meaning (all other things being equal) the descent speed will be 1/2 of the ascent speed. You should never need to change this.

SCRIPT TAG
Add this value as a tag in the format "[AutoThrottle]" to the name of any LCD or Text Panel to display status. This tag can also be added to any cockpit or block with multiple screens. When doing so, the tag must be added to the custom data along with an indicator for which screen in the cockpit to use for display, e.g., add @0 [AutoThrottle] to display status on the primary screen.

Featured Craft

Other Mods You Might Like

Other Scripts You Might Like

Bugs, Suggestions, Questions, and Comments -> Discord[discord.gg]
I don't troubleshoot, give technical advice, or have discussions in the comment section. That's what the Discord is for. Comments get lost to time, but discord histories can be searched and referenced.
6 Comments
rickybee 3 Sep, 2024 @ 9:55am 
I like the script, especially for getting up into space. The only bad thing is that the script, once installed, keeps turning all the thrusters on when I log on. I have to keep turning them off when docked. It even turns on the thrusters of a ship that is connected to the ship with the script. I have to remember to turn my miner's thrusters off when it is being carried. Disabling the script when not needed seems to be the only solution. Anyway, thanks for your work on this.
Vas 14 Apr, 2024 @ 5:56pm 
Any plans to add a leveler function to the script? My ship for example likes to drift randomly to various sides, plus the wind in the game seems to help with that as I have the mod that adds wind affect on blocks.

Also, how well does this work with speed limit changes? I have it so large grids can go 432m/s and small around 700m/s.

And last! Might it be possible for the script to slow down its thrust as the gravity drops so that your ship stops closer to the edge rather than thrusting till you hit zero and then slowing down?

The thrusters on top of my ship tend to be the weakest as I usually manually thrust half way up then let gravity slow my ship down till I'm near the edge, then I stop a few hundred meters from the edge of the gravity well.
Patrick  [author] 11 May, 2023 @ 1:13pm 
You are welcome to visit the discord if you want to troubleshoot.
black_dragon1230 11 May, 2023 @ 11:47am 
The script wont display anything, its just a blank screen. Not sure why.
Patrick  [author] 28 Jan, 2022 @ 4:35pm 
It's an "Admin ship." I've added a link at the bottom of the description here.
Colonel Gant 25 Jan, 2022 @ 9:40pm 
What ship is that in the main picture? I like it.