Space Engineers

Space Engineers

75 ratings
Landing Gear Balancer
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
389.624 KB
Dec 21, 2024 @ 7:51am
Jan 3 @ 11:19am
2 Change Notes ( view )

Subscribe to download
Landing Gear Balancer

Description
Adjustable landing gear pistons to compensate for uneven terrain and land with your ship horizontal.

Version 1.0 - 2024-12-21 - First public release
Version 1.1 - 2025-01-03 - Added a timer before turning off, for commands "retract" and "extend"

Designed for use with:
- Up to 8 landing gear kits (1 kit = piston+landingpad+camera)

Functions
- use one downward-facing camera on each landing kit to measure distance from ground
- adjust the lenght of all landing gear pistons to compensate
- provide warning if the terrain is too uneven
- in long legs mode, all pistons are extended by default, and they retract if needed due to uneven terrain
- in short legs mode, all pistons are retracted by default, and they extend if needed due to uneven terrain
- the script activates autolock on each leg, and turns itself off when one has locked

Installation
- Set up to 8 landing kits, with a magnetic plate on a piston, and a downward facing camera
as close as possible (but with a direct, unobstructed view of the ground)
- Create groups for each landing kit, named LGB_kit1, LGB_kit2 etc. with the 3 items in each. The name of the items themselves is irrelevant.
- (optional) Install an LCD screen with the proper name (see below) to see what the script does
- install the script in a programmable block
- recompile the script if needed to let it autoconfigure itself

Usage
- When close the the ground, activate the script in long legs or short legs mode
- Keep the ship horizontal yourself, or use another script (ex: Flight Assist) to do it
- The script start to check the ground below an altitude of 100m (configurable)
- If the ground is too uneven, thescript does it best and the LCD turns red.

Command line arguments
- off: turns the script off (ex : when already landed, etc.) without moving the pistons
- on: activate the leg balancer, preferring long legs
- on_longlegs: activate the leg balancer, preferring long legs
- on_shortlegs: activate the leg balancer, short long legs
- retract: retract all legs, and turn the script off
- extend: extend all legs, and turn the script off

More info
On Github : https://github.com/silverbluemx/SE_LandingGearBalancer
13 Comments
TheKeixs Jan 17 @ 8:03pm 
el diavlo que genialida
Invention64 Jan 7 @ 6:15am 
@silverbluemx technically you could use a PID to achieve this, as it doesn't need to know which direction a control will move it, just that there is controls and a measurable goal.

But like you said definitely overcomplicated for a script like this.
silverbluemx  [author] Jan 5 @ 6:30am 
@Sarianos : What you suggest would probably be more complex than what I've done.
At this point this script relies on the pilot or another script (such as Flight Assist for example) to level the ship (*). Then each landing leg (or "kit") individually adjusts its own length based on:
- the distance to the ground that it locally measures
- the minimum and maximum distance of all other legs.
The legs (or "kits") don't know if they're at the front of the ship, the left, etc. so they don't know how they should extend/retract to *make* the ship level.

(*) This piece of info wasn't in the description before, I've added it.
[RTB] Sarianos Jan 4 @ 9:30pm 
@silverbluemx
In theory could this be used with wheels on pistons instead of mag-pads to create a self levelling rover?
lnadon005 Jan 4 @ 12:27pm 
Thank you, the fix works perfectly, Great Work
lnadon005 Jan 4 @ 5:47am 
Thank you for your quick response, will test and report back
silverbluemx  [author] Jan 3 @ 11:34am 
@Inadon005 : Well... looking at the code, I don't understand how it might have worked during my tests. Maybe I overlooked something.
Anyway, I've uploaded a fix. Now when using the "retract" and "extend" commands, the script waits roughly 5sec before turning everything off.
Let me know if you have any issue remaining after that.
lnadon005 Jan 2 @ 1:47pm 
Nice been looking for something like this, only one problem, when retracting the script turns off before the movement starts, have to select each kit and manually turn them on to retract. any advice?
ZEN Dec 31, 2024 @ 11:56am 
I have 2 stacked suspension blocks with wheels replaced with rotor heads, those rotor heads are attached to a grd with a landing gear

I have 5 of those that act as my ships cushioned landing gear
ditb3 Dec 31, 2024 @ 9:04am 
I don't realize what SE script we are still missing yet until you release this script, impressive work! I've not tested this on subgrids yet but I believe the script's method will work without much modification if all subgrid landing gears are symmetrically placed at all four angles, assuming the script will handle the subgrids