Space Engineers: Configures gyroscopes to keep the ship level relative to local gravity.
This project is configured to be built within a separate IDE to allow for error checking, code completion etc.. Only the section in
#region CodeEditor
should be copied into the Space Engineers editor. This region has been automatically extracted into the correspondingtxt
file.
##Description Attempts to keep pitch and roll of the ship at 0
- measures pitch and roll
- relative to local natural gravity
- accounting for ship orientation
- uses a PID to determine correct response strength
- sets gyroscope overrides to return to level flight
- accounting for ship and gyroscope orientation
##Known Issues
- Can only handle single override gyroscope
- PIDs are not capped or wrapped: do not behave well if forces can induce more than half-rolls
- PID total error accumulates if running but not in control, leading to huge residual forces when enabled
##Hardware
Block(s) | number | Configurable |
---|---|---|
Ship Controller | single | by name constant |
Gyroscope | single | by name constant |
##Configuration
nameController
: the name of the Remote Control used to identify the main grid and get local gravitynameGyro
: the name of the Gyroscope that will have the override speeds set to stabilize the ship.period
: ticks between processing taking placeshipOrientation
: orientation of the ship compared to the grid
##Standard Blocks
Gyro
: IMyGyro API wrapper for setting Gyroscope valuesPID
: PID data, logic, storage for stabilising forcesValidateBlock()
: check that found blocks are usable- Status/Initialise/Validate framework