Space Engineers

Space Engineers

Not enough ratings
Automated Bridge Crane Guide (Martian Engineering Series)
By Engineered Coffee
Master Your Logistics!
Straight from my Martian Engineering YouTube series, this guide dives into how I fully automated the Bridge Crane using only vanilla components; timers, event controllers, sensors, buttons, and lights!

Check it out on the Workshop: [ECI] Clang Krane Automated Bridge Crane Warehouse with T.E.D.!

While specific to my series build, I hope this guide has some universal lessons you can implement in YOUR creations!

There is also some pretty neat upgrades since we last dived in during the series, so look forward to a more in depth tutorial soon!

This guide covers:
  • ROTATE TO ANGLE and SET AND MOVE for pinpoint precision.
  • Event Controller limiter logic to Stop "Clang" breaking the hinges and pistons.
  • Control Panel Layout for pickup and drop off selection and to start the automated cycles
  • Sequencing multiple Timers, Event Controllers, and Sensors for the LOAD and UNLOAD cycles.
  • Integrating error handling.
   
Award
Favorite
Favorited
Unfavorite
1. Crane Layout and How It Moves
The crane operates with three primary axes of movement:
  1. Long Travel (X-axis): The yellow bridge moves along the main support beams.
  2. Short Travel (Y-axis): The black trolley slides across the yellow bridge.
  3. Vertical Lift (Z-axis): A scissor lift equipped with magnetic plates to grab containers.
The crane's job is to load and unload containers between:
  • Storage Stacks: 5, 3-high stacks along the back wall
  • Loading/Unloading Bays: 3 bays with alignment clamps for the HEMTT trucks.
Each movement is done by scissoring arms made of hinges and pistons. All the hinges are rotated so at 0° the arms are extended staight, and at -90° degrees the arms are fully bent in. To get more reach, the arms are able to extend with the pistons.

Note that each arm's pistons and hinges are grouped. They all need to rotate and extend at the same rates to keep the beam travels perfectly straight.

2. Safety First! Preventing Clang
With an arm fully bent in, if both the pistons are extended and the hinges rotated at the same time, the arm's sideways reach will grow until a certain angle that it starts to shrink back to a straightened arm. This can cause Clang issues of the arm smashing into the sidewalls of the beams as shown above.

2.1. Vertical Travel Lift Hook Arms
The 2 arms for the Lift Hook are opposing, so the sideways growth is not a problem. The speeds are also synchronized between the hinge rpm and the piston speed so is has minimal deviation.

2.2. Short Travel Trolley Arm
The Trolley arm has a tighter constraint, the piston's cant extend synchronized with the hinges without hitting the sidewall. The pistons need to extend slower as the hinges stretch out straight, but retract faster before the hinges bend in. Luckily it only has 2 positions, over the truck and over the truck bay, so these 2 speeds are easily programmed in Section 3.

2.3. Long Travel Bridge Arms
The main Bridge section is far more complicated. It has multiple locations, without necessarily knowing what direction it will be going. It could be going from Truck Bay A to Stack 4 or from Stack 4 to Truck Bay B.

So to prevent collisions, the long travel uses a couple event controllers to lock the hinges and turn off the pistons:

[Crane] EC-Safety-LongHinge (Piston Limiter with Hinge Angle)
This Event Controller ensure the hinges are fully extended (arm is straight) before pistons can extend.
  • Event: Rotor/Hinge Angle ≥ −1° *
  • True Actions:
    1. Turn ON pistons
  • False Actions:
    1. Turn Off pistons
  • Note: All hinges move from 0° (straight) to −90° (retracted).
[Crane] EC-Safety-LongPiston (Hinge Limiter with Piston Position)
This Event Controller ensures the pistons are retracted before hinges can bend the arm.
  • Event: Piston Position % ≥ 2% *
  • True Actions:
    1. Turn ON hinge lock
  • False Actions:
    1. Turn Off hinge lock
2.4. Why It Works:
When the crane arms bend in (< −1°), only the hinges can move. The pistons are off.

Once the arm is straight (≥ −1°), the pistons turn on and can extend. When the pistons are out (≥ 2%), the hinges are locked straight and can't bend.

The hinges can only bend again after the pistons are fully pulled back in (< 2%). This setup means the arm never tries to bend when its pistons are out, or vice-versa, keeping the crane safe to use for coming and going to all bay and stack locations.

*The −1° and 2% are a little buffer to ensure the Event Controllers are triggered.
3. Pinpoint Accuracy with ROTATE TO ANGLE and SET AND MOVE
The crane really only exists because of the ROTATE TO ANGLE command for hinges/rotors and the SET & MOVE command for pistons. This allows for precise control of the pistons and hinges for multiple positions, not just the min and max range.

3.1 Getting the Crane Locations
This is super tedious, but necessary, the precise piston lengths, pistons speeds, hinge angles, and hinge rpm, need to be figured out for each location, in each direction: X (long travel), Y (short travel), and Z (lift). This is done manually, adjusting values to see what aligns*. These are recorded on and LCD on the control wall. The times were later measured to help with the timer delays in the later automation.

For this bridge crane there are 12 locations to record:
  • 5 long positions: the 5 stack positions on the back wall, luckily the 3 bays are aligned to stack 1, 3, and 5 so they share settings.
  • 2 short positions: The back stack wall, and over the trucks.
  • 5 lift positions: The truck bed, 3 stack heights, and a retract up to the top.
Or you could do trigonometry and calculate your angles and pistons lengths, I totally didn't do that for the lift positions...


3.2. Position Timers
Each of these 12 locations are recorded on 16 Position Timers Some positions are duplicated to help the automation later.
These timers collect the locations' pair of commands for the hinges' ROTATE TO ANGLE and the pistons' SET & MOVE. These commands can be paired into a single triggered command because we have either sync'd the movement or have the Safety Limiter Event Controllers from Secion 2.

Long Travel Position Timers (X-axis):
These 9 timers control the crane's horizontal movement along the X-axis:
  • [Crane] PT-LongStack-1 through 5: For aligning with the 5 storage stack locations.
  • [Crane] PT-LongBay-A through C: For aligning with the 3 loading/unloading bay locations.
  • [Crane] PT-LongHome: For the crane's default home position along the X-axis.

Short Travel Position Timers (Y-axis):
These 2 timers control the trolley's movement along the Y-axis:
  • [Crane] PT-ShortStack: Positions the trolley over the stack wall.
  • [Crane] PT-ShortBay: Positions the trolley over the bay wall.

Vertical Lift Position Timers (Z-axis):
These 5 timers control the vertical movement of the crane's lift along the Z-axis:
  • [Crane] PT-LiftBay: Lowers the lift to the standard bay loading/unloading height.
  • [Crane] PT-LiftStack-Bottom/Middle/Top: Lowers the lift to specific heights for stacking containers.
  • [Crane] PT-LiftTop: Retracts the lift fully upwards to clear obstacles.

3.3. Programming Multiple Position Timers
LongStack-3, LongBay-B, and LongHome positions share the same hinge Rotate to Angle and piston Set & Move commands. Luckily, multiple timers can be programmed simultaneously by holding Ctrl and selecting them.
For this example, the following actions are added to all selected timers:
  1. Rotate to Angle; [Crane] LongHinges, Angle: 0°, Speed: 1.00.
  2. Set & Move; [Crane] LongPistons, Dist: 0m, Speed: 0.075.
Then, for actions specific to the each timer, exit the group edit, select only the 1 block and you'll see the group actions retained.
For example [Crane] PT-LongHome timer has a bunch more actions related to its role as the home position, which is covered later.

3.4. Manually Moving the Crane
Now we can move the crane manually to each position with these timers. The cab on the ceiling of the warehouse has several buttons on Toolbar 1 & 2 to Trigger Now these Position Timers. The crane will now move to the X, Y, or Z direction pushed, note the hinges and pistons are cooperating with the Safety Limit event controllers.

*NOTE: Later automation will turn off the Position Timers, so if you want to use these commands with the blueprint, turn all the Position Timers ON before selecting the cab toolbar buttons.

Toolbar 1: 5 Long Travel Stack positions + 3 Long Travel Bay positions
Toolbar 2: 2 Short Travel Stack positions + 5 Lift positions
4. The Control Center: Dynamic Selection
We want to automate even further, so this custom console features several buttons for the player to control the crane. The 3 buttons on the left and the 5 on the right trigger Selection Timers. Because buttons can only perform 1 action, these timers are basically Action Collectors and not used for a timed delay. The console also includes buttons to initiate Load and Unload sequences, each sequence is discussed in dedicated sections.

4.1. [Crane] ST-Stack-1 through 5 (Stack Selector Timers)
These Selector Timers activates specific Position Timers (from Section 3) for the chosen stack location while deactivating others, so only one stack position is selected at a time. It also turns on and off the respective indicator lights on the control panel to help the player see what is selected.

[Crane] ST-Stack-1:
This example shows the [Crane] ST-Stack-1 turning on the PT-LongStack-1, while turning off the others. The other [Crane] ST-Stack timers follow a similar convention for their respective stack numbers.
Page 1 Actions (Lights):
  1. Turn ON; [Crane] Light-SelectStack-1.
  2. Turn Off; [Crane] Light-SelectStack-2.
  3. Turn Off; [Crane] Light-SelectStack-3.
  4. Turn Off; [Crane] Light-SelectStack-4.
  5. Turn Off; [Crane] Light-SelectStack-5.
Page 2 Actions (Position Timers):
  1. Turn ON; [Crane] PT-LongStack-1.
  2. Turn Off; [Crane] PT-LongStack-2.
  3. Turn Off; [Crane] PT-LongStack-3.
  4. Turn Off; [Crane] PT-LongStack-4.
  5. Turn Off; [Crane] PT-LongStack-5.
4.2. [Crane] ST-Bay-A through C (Bay Selector Timers)
These timers function similarly to the Stack Selector timers, ensuring only one bay can be selected at a time by activating its corresponding light and position timer, and deactivating all others. It also has a 3rd action to turn Off and ON an inverse bit light. (See Section 8.7)

[Crane] ST-Bay-A:
Actions:
  1. Turn ON; [Crane] Light-SelectBay-A.
  2. Turn Off; [Crane] Light-SelectBay-B.
  3. Turn Off; [Crane] Light-SelectBay-B.
  4. Turn ON; [Crane] PT-LongBay-A.
  5. Turn Off; [Crane] PT-LongBay-B.
  6. Turn Off; [Crane] PT-LongBay-C.
  7. Turn OFF; [Crane] Light-PToffBay-A.*
  8. Turn ON; [Crane] Light-PToffBay-B
  9. Turn ON; [Crane] Light-PToffBay-C
    *Note the inverse relationship of ON/OFF
4.3. Operation Buttons
  • [Crane] Button-Load: Trigger Now GROUP; [Crane] Timer-Load-1, [Crane] Timer-Load-4.*
  • [Crane] Button-Unload: Trigger Now GROUP; [Crane] Timer-Unload-1, [Crane] Timer-Unload-4.*
    *The inclusion of triggering Load-4 & Unload-4 is explained in the Section 8: Error Handling
4.4. Demo Buttons
The blue Demo Buttons are used for Section 5 and the tutorial, but are not included on the Workshop blueprint.
5. Demonstrating Long Travel Movement
Now that we have the ability to select the bay and stack we want from the control panel, we can use a single trigger for each side of the warehouse to move the crane along this Long Travel path and stop at the selected locations! To demonstrate the two blue Demo Buttons on the control panel trigger these two timers:

5.1. [Crane] DemoTimer-LongStacks
Actions:
  1. Trigger Now; [Crane] PT-LongStack-1.
  2. Trigger Now; [Crane] PT-LongStack-2.
  3. Trigger Now; [Crane] PT-LongStack-3.
  4. Trigger Now; [Crane] PT-LongStack-4.
  5. Trigger Now; [Crane] PT-LongStack-5.

5.2. [Crane] DemoTimer-LongBays
Actions:
  1. Trigger Now; [Crane] PT-LongBay-A.
  2. Trigger Now; [Crane] PT-LongBay-B.
  3. Trigger Now; [Crane] PT-LongBay-C.

Why it works
These timers attempt to trigger ALL the Postition Timers at once. But since only one stack and one bay was selected on the control panel, only the Postition Timer that is ON will be triggered. The crane moves to the ON location!

These Demo Timer are just to illustrate the concept of triggering multiple positions. While these timers aren't used again, the triggering of multiple Postition Timers is used throughout the LOAD and UNLOAD sequences.
6. The LOAD Cycle: Containers from Stack to Trucks
The LOAD cycle is initiated by pressing [Crane] Button-Load on control panel. Before pressing the button, make sure a truck is aligned in the bay, and the bay and container stack have been selected on control panel. This button triggers a sequence of timers to move crane to selected stack, pick up container, move it to selected bay, drop it off on the truck, and then return to the home position.
6.1. [Crane] Timer-Load-1 (Long and Short to Stack)
When [Crane] Button-Load is pressed, the crane moves over top the correct container stack by moving in both the Long and Short travel directions. Using the concepts from Section 5, the timer attempts to trigger all 5 Long Travel Position Timers (PT-LongStack-1 through 5).
Page 1 Actions:
  1. Trigger Now; [Crane] PT-LongStack-1.
  2. Trigger Now; [Crane] PT-LongStack-2.
  3. Trigger Now; [Crane] PT-LongStack-3.
  4. Trigger Now; [Crane] PT-LongStack-4.
  5. Trigger Now; [Crane] PT-LongStack-5. (Attempts to go to all Stack positions)
  6. Trigger Now; [Crane] PT-ShortStack. (Moves the crane to the back stack wall)
  7. Start; [Crane] Timer-Load-2. (Starts the next timer in the sequence, note it is NOT trigger now)
  8. Turn ON; [Crane] LCD-DirectionArrow. (Control panel LCD showing if Loading or Unloading)
  9. Increase Rotation; [Crane] LCD-DirectionArrow. (Arrow default is point left, this rotates in once 90° to point up)
Page 2 Actions:
  1. Turn ON; [Crane] Light-Loading indicator. (Control panel indicator)
  2. Turn ON; [Crane] Light-RotatingBusy-1.
  3. Turn ON; [Crane] Light-RotatingBusy-2. (Crane beam indicators)
  4. Increase Rotation; [Crane] LCD-DirectionArrow. (Rotates the arrow another 90° to point right, it must be on another page, can't have 2 of the same commands on a single page)
6.2. [Crane] Timer-Load-2 (Lift Down to Container)
After a 15-second delay to make sure the crane is over the containers (long enough for the furthest travel from the Home position), the lift goes down to the to the containers. This timer turns on the Load Lift Detection event controller and starts some error checking (explained in Section 8)
  1. Turn On; [Crane] PT-LiftStack-B.,
  2. Trigger Now; [Crane] PT-LiftStack-B. (attempts to move the crane to the lowest stack position)
  3. Toggle On; [Crane] EC-LoadLiftDetection. (used to stop the lift at the highest container)
  4. Unlock; [Crane] StackConnectors. (Unlocks the container for lift)
  5. Start; [Crane] Timer-PickupError-TimedOut. (Error check for empty stack)
6.3. [Crane] EC-LoadLiftDetection (Container Detection)
This Event Controller is crucial for detecting a container. It will stop the lift's downward movement if a container is detected and immediately trigger the upward cycle with [Crane] Timer-Load-3. If no container is detected, the PickupError timer will lapse and trigger the error interrupt cycle.
  • Event: Landing Gear/Mag Plate ready/idle.
  • Block: all [Crane] MagPlate-Lift.
  • True Actions:
    1. Hinge Lock ON; for [Crane] LiftHinges.
    2. Turn Off; [Crane] LiftPistons. (Stops lift from travelling down)
    3. Stop; [Crane] Timer-PickupError-TimedOut. (Stop "no container error" from activating
    4. Start; [Crane] Timer-Load-3.
6.4. [Crane] Timer-Load-3 (Lock and Lift to Ceiling)
After a 1-second delay, the lift moves upward and away from the Stack wall.
  1. Lock; [Crane] MagPlates-Lift group. (locks lift to container)
  2. Trigger Now; [Crane] PT-LiftTop. (Commands container up)
  3. Hinge Lock Off; [Crane] LiftHinges.
  4. Toggle Block On; [Crane] LiftPistons. (Allows Lift to move)
  5. Toggle Block Off; [Crane] EC-LoadLiftDetection. (Disable detection when not in use)
  6. Decrease Rotation; [Crane] LCD-DirectionArrow.
  7. Decrease Rotation (2nd page); [Crane] LCD-DirectionArrow. (Shows container is now loading to the truck)
6.5. [Crane] Timer-Load-4 (Long Travel to Bay)
After a 5-second delay, the crane moves over the correct bay this stage ensures the container has fully cleared the stack before initiating horizontal movement, preventing any collisions. It then executes its actions, leveraging the principles of precise positioning demonstrated in Section 5:
  1. Trigger Now; [Crane] PT-LongBay-A.
  2. Trigger Now; [Crane] PT-LongBay-B.
  3. Trigger Now; [Crane] PT-LongBay-C.
  4. Start; [Crane] Timer-Load-5.
  5. Lock; [Crane] StackConnectors.
  6. Turn Off; [Crane] Light-DestFull.
  7. Turn ON; [Crane] LCD-DirectionArrow.
  8. Turn Off; [Crane] Timer-Load-4.
6.6. [Crane] Timer-Load-5 (Container Down to Truck)
After a 26-second delay, the crane scans to make sure the truck isn't already loaded and drops the container down to the truck
  1. Turn ON [Crane] Sensor-Load. (Error handling, see Section 8)
  2. Set Velocity 15rpm; [Crane] Hinge-LoadSensor.
  3. Trigger Now; [Crane] PT-LiftBay.
  4. Start; [Crane] Timer-LoadSensorReset.
  5. Start; [Crane] Timer-Load-6.
6.7. [Crane] Timer-Load-6 (Unlock, Return Home, and Reset)
After an 11-second delay, this stage completes the load cycle. This delay ensures the container has fully descended to the truck and is ready to be released, provided no errors have occurred earlier in the cycle.
  1. Unlock; all [Crane] MagPlate-Lift blocks, releasing the container into the bay.
  2. Start; [Crane] PT-LiftTop.
  3. Start; [Crane] PT-LongHome.
  4. Turn Off; [Crane] Light-Loading indicators.
  5. Turn Off; [Crane] Light-RotatingBusy-1.
  6. Turn Off; [Crane] Light-RotatingBusy-2 lights.
6.8. [Crane] PT-LongHome
This is mainly a Position Timer to return the crane to the home position for the long travel, but it also has a lot more commands to reset the indicators and systems to prepare for the next cycle.
    Page 1 Acctions:
  1. Rotate to Angle; [Crane] LongHinges, Angle: 0°, Speed: 1.00.
  2. Set & Move; [Crane] LongPistons, Dist: 0m, Speed: 0.075.
  3. Turn Off; [Crane] Light-Loading.
  4. Turn Off; [Crane] Light-Unloading. (Resets the control panel active cycle lights)
  5. Turn ON; [Crane] Button-Load.
  6. Turn ON; [Crane] Button-Unload. (Allows player to start a new cycle)
  7. Turn Off; [Crane] RotatingStrobe-1.
  8. Turn Off; [Crane] RotatingStrobe-2. (Turns off busy lights on the crane structure)
  9. Decrease Rotation; [Crane] LCD-DirectionArrow.
    Page 2 Actions:
  10. Decrease Rotation; [Crane] LCD-DirectionArrow. (resets the LCD to point left
  11. Turn Off; [Crane] LCD-DirectionArrow.
7. The UNLOAD Cycle: Container from Truck to Stack
To initiate the UNLOAD cycle, select a truck bay to unload from, select a stack position to load to, and press [Crane] Button-Unload. The crane will lift the container off the truck, move it to the correct stack, self-determine the stack height, and returning home.

7.1. [Crane] Timer-Unload-1 (Long Travel to Bay)
This timer moves the crane over the bay, turns on indicators, and disables the operator buttons
  1. Trigger Now; [Crane] PT-LongBay-A.
  2. Trigger Now; [Crane] PT-LongBay-C.
  3. Start; [Crane] Timer-Unload-2.
  4. Turn ON; [Crane] Light-Unloading indicator.
  5. Turn Off; [Crane] Button-Load.
  6. Turn Off; [Crane] Button-Unload.
  7. Turn ON; [Crane] LCD-DirectionArrow.
7.2. [Crane] Timer-Unload-2 (Vert Travel to Bay)
After an 4-second delay to make sure the hook is over the truck before the lift gets there, the lift descends to the container and turns on the lift detector and error handler.
  1. Trigger Now; [Crane] PT-LiftBay.
  2. Toggle On; [Crane] EC-UnloadLiftDetection.
  3. Start; [Crane] Timer-PickupError-TimedOut.
  4. Start; [Crane] Timer-Unload-3. (See Section 8)
7.3 [Crane] EC-UnloadLiftDetection (Container Detection)
Uses the mag plates to detect the container, allowing it to lift quickly
  • Event: Landing Gear/Mag Plate ready/idle.
  • Block: all [Crane] MagPlate-Lift.
  • True Actions (Container Detected):
    1. Stop; [Crane] Timer-PickupError-TimedOut. (stops "No Container" error)
    2. Start; [Crane] Timer-Unload-3.
7.4. [Crane] Timer-Unload-3 (Lift from Bay)
After a 1-second delay, the mag plates lock and lift lift ascends.
  1. Lock; [Crane] MagPlates-Lift group.
  2. Start; [Crane] PT-LiftTop.
  3. Turn Off; [Crane] EC-UnloadLiftDetection (prevent accidental triggers)
  4. Turn ON; [Crane] Timer-Unload-4. (part of error reset, see Section 8)
  5. Start; [Crane] Timer-Unload-4.
7.5. [Crane] Timer-Unload-4 (Long Travel to Stack)
After a 3-second delay for the container to clear the truck, crane moves to the stack position.
Page 1 Actions:
  1. Trigger Now; [Crane] PT-LongStack-1.
  2. Trigger Now; [Crane] PT-LongStack-2.
  3. Trigger Now; [Crane] PT-LongStack-3.
  4. Trigger Now; [Crane] PT-LongStack-4.
  5. Trigger Now; [Crane] PT-LongStack-5. (Learnings from Section 5)
  6. Start; [Crane] Timer-Unload-5, which prepares for the next movement.
  7. Turn Off; [Crane] Light-DestFull. (part of error reset, see Section 8)
  8. Turn ON; [Crane] LCD-DirectionArrow.
  9. Increase Rotation; [Crane] LCD-DirectionArrow.
Page 2 Actions (Re-enabled with Stack Error):
  1. Increase Rotation; [Crane] LCD-DirectionArrow.
  2. Turn Off; [Crane] Timer-Unload-4. (part of error reset, see Section 8)
  3. Turn ON; [Crane] Light-Unloading.
  4. Turn ON; [Crane] Light-RotatingBusy-1.
  5. Turn ON; [Crane] Light-RotatingBusy-2.
7.6. [Crane] Timer-Unload-5 (Before Short Travel to Stack)
After a 26second delay to ensure the bridge is over the correct stack, activates some height detection sensors, and starts moving the container to the stack wall.
Page 1 Actions:
  1. Turn ON; [Crane] PT-LiftStack-B.
  2. Turn ON; [Crane] PT-LiftStack-M.
  3. Turn ON; [Crane] PT-LiftStack-T. (Enables all positions before scan)
  4. Turn ON; [Crane] Sensor-Unload-B.
  5. Turn ON; [Crane] Sensor-Unload-M. (Determines correct stack height).
  6. Turn ON; [Crane] Sensor-Unload-T. (Error Handling, See Section 8)
  7. Set velocity 10rpm; [Crane] SensorHinges group. (Swing in for detection)
Page 2 Actions:
  1. Trigger Now; [Crane] PT-ShortStack.
  2. Start; [Crane] Timer-Unload-6 (Vert Travel to Stack).
  3. Start; [Crane] Timer-UnloadSensorReset. (Moves sensors back for next cycle)
7.7. [Crane] Sensor-Unload-B/M (Bottom and Middle Container Scan)
These 2 sensors swing from a known empty area to the container locations to see if they are occupied. If occupied, the corresponding Position Timer is turned off, so only the topmost empty position dropped to in the next Unload timer.
  • In range Actions:
    1. Turn Off; [Crane] PT-LiftStack-B / [Crane] PT-LiftStack-M.
  • Out of range Actions: N/A
7.8. [Crane] Timer-UnloadSensorReset
Turns off the sensors and swings them back to the neutral position, ready for the next scan.
  1. Turn Off; [Crane] Sensor-Unload-B.
  2. Turn Off; [Crane] Sensor-Unload-M.
  3. Turn Off; [Crane] Sensor-Unload-T.
  4. Set velocity -10rpm; [Crane] SensorHinges group.
7.8. [Crane] Timer-Unload-6 (Vert Travel to Stack)
After a 10-second delay, The lift descends to the stack. The Position Timer trigger order ensures the bottom most ON timer overrides the previous timer, but will not extend too far because the sensors turned off the occupied spots.
  1. Trigger Now; [Crane] PT-LiftStack-T.
  2. Trigger Now; [Crane] PT-LiftStack-M.
  3. Trigger Now; [Crane] PT-LiftStack-B. (Order is important)
  4. Toggle On; [Crane] EC-UnloadLiftComplete.
7.9. [Crane] EC-UnloadLiftComplete (Event Controller)
The old system waited for a set time to get to the bottom stack. So if unloading to the top, the crane would pause until the timer expired. Instead, it now has adjusted hinge and piston values to ensure the pistons finish last for each height. This allows this event controller to detect the 100% piston travel and trigger the crane to immediately drop and lift away.
  • Event: Piston Position % ≥99% (for [Crane] LiftPistons)
  • True Actions:
    1. Unlock; [Crane] MagPlates-Lift group.
    2. Start; [Crane] PT-LiftTop.
    3. Start; [Crane] PT-ShortBay.
    4. Start; [Crane] Timer-Unload-7.,
7.10. [Crane] Timer-Unload-7 (Long Back to Home)
After a 5-second delay for the hook to clear the stack, the crane returns home and resets for the next cycle.
  1. Trigger Now; [Crane] PT-LongHome. (See Section 6 for actions)
  2. Toggle Off; [Crane] EC-UnloadLiftComplete.
  3. Lock; [Crane] StackConnectors. (Connecting the container to the system)
8. Error Handling
There are a few conditions the crane monitors to keep it moving smoothly.

8.1. [Crane] Timer-PickupError-TimedOut
As the lift is dropped down to the stack during Load-2 or down to the truck during Unload-2, this 17s imer is started. If the mag plates don't detect a container before the time runs out, the Pickup Error is triggered sending the crane home so it doesn't go through the whole cycle with no container.
  1. Trigger Now; [Crane] PT-LiftTop. (Lift to Ceiling)
  2. Trigger Now; [Crane] PT-ShortBay. (Extend to bay wall)
  3. Turn ON; [Crane] Light-ErrorStrobe-1.
  4. Turn ON; [Crane] Light-ErrorStrobe-2.
  5. Start; [Crane] Timer-PickupError-SendHome.
8.2. [Crane] Timer-PickupError-SendHome
After a 6s delay for the hook to clear the stack containers, the hook moves along the Long direction to home, it also self clears the error lights as the cycle is reset and the player can select a new pickup location.
  1. Trigger Now; [Crane] PT-LongHome.
  2. Turn Off; [Crane] Light-ErrorStrobe-1.
  3. Turn Off; [Crane] Light-ErrorStrobe-2.
8.3. [Crane] Sensor-Load (Truck Already Loaded)
This sensor activated by Load-5. Just before container descends to the truck, the sensor is swung over the truck to detect if it already has a container. This will trigger an error light on the control panel and send the container to hang from the home position, allowing the player to put the container in a new stack or bay location to clear the error. See 8.5.

Because the sensor only triggers when the state changes from undetected to detected, the hinges swing from a known empty spot to the truck location. So if there is a container the detected actions will trigger.

Detected Actions:
  1. Turn ON; [Crane] Light-DestFull. (Error light on the control panel)
  2. Stop; [Crane] Timer-Load-6. (Stops normal cycle)
  3. Trigger Now; [Crane] PT-LiftTop.
  4. Trigger Now; [Crane] PT-LongHome.
  5. Turn Off; [Crane] Light-Loading.
  6. Turn ON; [Crane] Light-ErrorStrobe-1.
  7. Turn ON; [Crane] Light-ErrorStrobe-2.
8.4. [Crane] Sensor-Unload-T (Stack Already Full)
Similar to the Load Sensor above, this sensor detects if the top of the selected stack already has a container, preventing the crane from stacking where there is no space.
  1. Turn ON; [Crane] Light-DestFull.
  2. Stop; [Crane] Timer-Unload-6. (Stops normal cycle)
  3. Trigger Now; [Crane] PT-LongHome.
  4. Trigger Now; [Crane] PT-ShortBay.
  5. Turn Off; [Crane] Light-Unloading.
  6. Turn ON; [Crane] Light-ErrorStrobe-1.
  7. Turn ON; [Crane] Light-ErrorStrobe-2.
8.5. [Crane] EC-DestFullHandler (Event Controller)
When the Destination Full Error Light is turned on by the Load Sensor or the Top Unload Sensor, this event controller will disable the Load-1 and Unload-1 timers, and enable the Load-4 and Unload-4 timers. This allows the player to hit the normal Load & Unload buttons on the control panel to put the errored container away, starting from the drop-off point of the cycles, not the pickup.

This is why there are extra commands in Load-4 and Unload-4. They are midpoint restarts of the cycle. This is also why they turn themselves off, so that when the error is cleared, the buttons return to starting the normal, full cycles.
  • Event: Block switched on/off.
  • Block: [Crane] Light-DestFull.
  • True Actions (If [Crane] Light-DestFull is ON - Error State):
    1. Turn Off; [Crane] Timer-Load-1.
    2. Turn Off; [Crane] Timer-Unload-1.
    3. Turn ON; [Crane] Timer-Load-4.
    4. Turn ON; [Crane] Timer-Unload-4.
  • False Actions (If [Crane] Light-DestFull is OFF - Normal State):
    1. Turn ON; [Crane] Timer-Load-1.
    2. Turn ON; [Crane] Timer-Unload-1.
    3. Turn Off; [Crane] Timer-Load-4.
    4. Turn Off; [Crane] Timer-Unload-4.
8.6. [Crane] Sensor-BayOccupied-A/B/C
Sensors above each loading bay detect if there is a truck present. If there is no truck, the sensor disables the selection button, selection light, and the Position Timer for that bay so that a automation doesn't load or unload the empty bay. It also turns on [Crane] Light-PToffBay. This light is used as an inverse bit for the event controller in 8.7 below.

When the trucks come back into the bay only the selection button is reenabled, forcing the player to select the desired bay before starting a cycle.

The Occupied Light is just an extra display inside the control room showing what bays are occupied.
  • In range Actions:
    1. Turn ON; [Crane] Light-BayOccupied-A/B/C.
    2. Turn ON; [Crane] Button-Bay-A/B/C.
  • Out of range Actions:
    1. Turn Off; [Crane] Light-BayOccupied-A/B/C.
    2. Turn Off; [Crane] Button-Bay-A/B/C.
    3. Turn Off; [Crane] Light-SelectBay-A/B/C.
    4. Turn Off; [Crane] PT-LongBay-A/B/C.
    5. Turn ON; [Crane] Light-PToffBay-A/B/C.
8.7. [Crane] EC-AllBaysEmpty (Event Controller)
This Event Controller turns off the Load and Unload buttons if ALL bays are empty, to stop the cycles from starting without an available truck. Because the AND gate only works for blocks switched on, we can't just detect if all Position Timers are off, so instead [Crane] Light-PToffBay-A/B/C is turned on when the Position Timer is off, allowing the AND gate check.
  • Event: Block switched on/off.
  • Block: [Crane] Light-PToffBay-A, [Crane] Light-PToffBay-B, [Crane] Light-PToffBay-C.
  • And Gate: ON
  • True Actions:
    1. Turn Off; [Crane] Button-Load.
    2. Turn Off; [Crane] [Button-Unload].
  • False Actions:
    1. Turn ON; [Crane] Button-Load.
    2. Turn ON; [Crane] Button-Unload.