Space Engineers

Space Engineers

Not enough ratings
Automated Rotors
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
5.369 KB
Dec 12, 2017 @ 6:44pm
1 Change Note ( view )

Subscribe to download
Automated Rotors

Description
====================
Requirements
====================
Programmable Block
Rotor(s)

====================
Set Up
====================

This script uses the "Custom Data" on the programmable block. All automation commands must be placed here.

The following is an automation command example:
increment loop <RotorName> <=== Automation command, mode, and the rotors name rotorlock true <=== Rotor property value [360, -30, 5000] <=== An instruction set that includes: target angle, speed and direction (+/-), wait time before next execution (in milliseconds)


==== Executing The Script ====

To execute your automation two things are required.

1. You have created a script in the Custom Data on the programmable block.
2. You have entered a run command into the arguments textbox

Provided both have been entered correctly running the programmable block will perform the action.

Below are a list of programmable block arguments used to control how the automation should be run.

Argument: RUN

Runs the automation for specified rotors
run <rotor_name> run all


Argument: SET

Executes a one time instruction. this is often used to preset your rotors before running automation.
set [<target_angle>, <rotation_speed>] <rotor_name> set [<target_angle>, <rotation_speed>] all


Below are other arguments, they use the same "<rotor_name>" and "all" options like above.

suspend - Suspend execution
resume - Resume execution
reset - Execute the reset instruction set
kill - Set status to IDLE


==== Command Types ====
This section, and all sections below, detail the syntax for creating automation scripts. these scripts must be placed in the Custom Data of the programmable block.

Type: SIMPLE

The SIMPLE command takes a single instruction set and executes it.
simple <rotor_name> <property> <value> <value2> <=== Optional [<target_angle>, <rotation_speed>]


Example:
simple My Rotor 01 [90, 5]

This rotates the rotor named "My Rotor 01" clockwise to its 90 degree position at a slow speed.



Type: INCREMENT

The INCREMENT command take a single instruction set and increment the target rotors angle by the stated amount

increment <mode> <rotor_name> <property> <value> <value2> <=== Optional [<target_angle>, <rotation_speed>, <wait_before_next>]

Example:
increment once My Rotor 02 rotorlock true [45, -30]

This rotates the rotor "My Rotor 02" by 45 degrees counter clockwise very quickly

Example 2:
increment loop My Rotor 02 rotorlock true [45, 30, 5000]

This repeatedly rotates the rotor "My Rotor 02" by 45 degrees at high speed, every 5 seconds.



Type: AUTOMATE

The AUTOMATE command takes many instruction sets and executes them in order.
automate <mode> <rotor_name> <property> <value> <value2> <=== Optional [<target_angle>, <rotation_speed>, <wait_before_next>] [<target_angle>, <rotation_speed>, <wait_before_next>] [<target_angle>, <rotation_speed>, <wait_before_next>] ...

Example:
automate once My Rotor 03 precision: 0.05 [0, 100, 1000] [90, -5, 30000] [90, 5, 0]

This rotates to the rotors 0/360 degrees position, then rotates counter clockwise to the 90 degree position after 1 second, then rotates to the 90 degree position clockwise after 30 seconds.


==== Modes ====

once - Performs all instructions then idles
loop - Performs all instructions and repeats


==== Properties ====

reset - Provides the angle and speed to reset to when the reset command is called
Default: 0 degrees 30 RPM

precision - The zone on ether side of the target_angle that is considered equal to it
Default: 0.01 (must be greater than 0)

rotorlock - If true, locks the rotor when idle
Default: false
23 Comments
MrFox Mar 20, 2022 @ 7:19pm 
Dead.
R_Oerich Mar 17, 2022 @ 4:13am 
Is this still working 100%??
I cant get the rotor to stop at an angle using the arguments. the speed is adjusted, but it just turns to 360dg (or 000 if - speed) every time
MoonLiteNite Dec 26, 2021 @ 6:44pm 
Google sheet link to generator random numbers for this script. Works very nicely!
https://docs.google.com/spreadsheets/d/1pGThiRdso66mb-7QuPbKIvsufHoSKFGzG9bP_CSNvas/edit?usp=sharing
MoonLiteNite Dec 26, 2021 @ 6:12pm 
And to save anyone time, this does NOT work with hinges too well. You can get it to move, but basically it will lock up after some time. I spent 3 hours trying to get it to work. i thought MAYBE if you only fed it values so the hinge would bounce between say 10 and -10 with good +/- speeds as needed, it would never try and "loop" but something still causes the script to loop and want to push the hinge in a full circle, which isn't possible.

So even something like
Starting point of 0

Automation loop hinge
10, 10, 100
-10, -10, 100

This does not work :( there are some magic numbers that do work, but even those will mess up after 1 cycle.
MoonLiteNite Dec 26, 2021 @ 5:19pm 
@Gauge
I see you haven't messed with in a while, but i was unable to get the increment loop to work. Basically it just goes back to the starting +target angle.
So instead of looping adding on the TargetAngle, like starting point is 1 degree and i want to add 10. Instead of it going 1 > 11 > 21 > 31.
I am getting 1 > 11 > 11 > 11 > 11. Each time the rotor does a full loop around
I have tried a handful of things and no luck getting it to work :(
MoonLiteNite Dec 26, 2021 @ 5:14pm 
For anyone who wants this to move rotors in a random pattern. Use this with google sheets

A1: =RANDBETWEEN(0,259)
B1: =RANDBETWEEN(-25,30)
C1: =RANDBETWEEN(100,10000)
D1 =CONCATENATE("[",+A1,+",",B1,+",",C1,"]")

Drag those cells down a few dozen rows; now you can copy and paste that into your automated loop :) Granted you COULD find the pattern, but i did it like 48 rows and looks random enough.
Also use precision 5, this even adds more randomness.
akira Sep 26, 2021 @ 6:33pm 
Yes. MUCH better with just a few changes. I'll try to find time to record a very short and direct video on how to implement some simple actions and send it to you so you can approve and use it as you please. That would also be a great adition.
Gauge  [author] Sep 26, 2021 @ 5:34pm 
Cleaned it up a bit. Does that make more sense?
akira Sep 26, 2021 @ 3:14pm 
And how does it reflects on the comment section/feedbacks and amount of subscribers? Is that's a "good enough" level of information? 99% of the people who need it give up on using it, the other 1% has a lot of difficulties. Dunno, maybe improving it would be good for everyone.
Gauge  [author] Sep 26, 2021 @ 12:56pm 
I mean the documentation is right here on the page.