A kind of crane loading and unloading simulation based on finite-state Machine

Hong Guang, Weibing Bai, Xin Yu2015 · DOI

Abstract: Aiming at the insufficiency of actual crane training, this research adopts finite-state machine (FSM) technology to establish an emulational training system. The system implements crane loading and unloading operations by defining a specific FSM architecture. Through dynamics analysis, several states were established and described with mathematical models simplified for real-time simulation. The paper details the flow for establishing the FSM and the concrete implementation methods within the Unity3D engine. An instance of the training system demonstrates that the models are accurate and the state transitions are logical.

Introduction

Training crane operators on actual machinery presents significant challenges: the equipment is expensive, the risk of accidents is high, and hardware availability is often limited for large groups of students. Consequently, traditional training efficiency is often poor. While virtual simulations offer a solution, existing methods frequently fall into two extremes. Professional mechanical simulation tools (like ADAMS or Solidworks) offer high precision but lack the fluid interaction needed for a "game-like" training experience. Conversely, web-based languages like VRML are interactive but struggle with complex physics.

This paper bridges this gap by using the Unity3D game engine governed by a formal mathematical Finite-State Machine (FSM) model. This approach ensures the simulation is both physically realistic and logically sound, providing a balanced environment for operator training.

Methodology

Structural Decomposition and Kinematics

The researchers began by dividing the crane into four primary mechanical frameworks to analyze its kinematics and dynamics. These components are essential for defining how the virtual model responds to control inputs.

The structural components of the crane, including the gyre, lift, range, and vice arm frameworks.

As shown in Figure 1, the crane is discretized into the gyre framework, lift framework, range framework, and vice crane arm. Each of these parts corresponds to specific degrees of freedom in the simulation.

Finite-State Machine (FSM) Modeling

The crane's operation is defined as a formal system $M=(S, \Sigma, \delta, S_0, S_F)$. The operation is broken down into six distinct states:

  • Initial ($S_0$): The starting idle state.
  • Lifting ($S_1$): Vertical movement of the load.
  • Rotating ($S_2$): Horizontal rotation of the crane body.
  • Translating ($S_3$): Movement along the range framework.
  • Vice-arm rotation ($S_4$): Specific movement of the secondary arm.
  • Final ($S_5$): Completion of the task.
Detailed FSM state transition logic, including joystick event handling and time-based thresholds for inertia.

Mathematical Motion Modeling

To ensure realistic movement, the authors modeled the "Lifting" state ($S_1$) in three distinct phases:

  1. Force Buildup: The time required for tensile force to overcome gravity.
  2. Constant Motion: Linear motion once the object is in flight.
  3. Inertial Stopping: When the joystick is released, displacement continues to increase with a decreasing amplitude, modeled via exponential decay: $dx(t)/dt = k_2 \exp(-t/\lambda_0)$.

This exponential decay model is critical for teaching students how to account for momentum. As seen in the FSM logic (Figure 3), the system uses a time threshold ($t=5\lambda$) to determine when a movement has fully ceased before transitioning back to the idle state ($S_0$).

Implementation in Unity3D

The system utilizes "Configurable Joints" within Unity3D. These joints are highly flexible, allowing developers to manually configure driving forces and torques that respond to joystick inputs based on the derived mathematical models. To avoid mathematical pitfalls like gimbal lock, the authors utilized quaternions for all rotational transforms, ensuring smooth and accurate movement of the crane's gyre and vice arm.

Key Results and Insights

The resulting training system demonstrates high logical consistency and physical precision. By using empirical constants ($k_0, k_1, k_2$) derived from measurements of real-world cranes, the simulation achieves a level of accuracy suitable for professional training.

One of the core "aha moments" of the study is the use of discrete logic to manage continuous physical processes. By defining transitions based on joystick events and specific time thresholds, the system ensures the crane behaves predictably and safely within the virtual environment. Furthermore, choosing Unity3D ensures the application is cross-platform, allowing it to be deployed over the internet to solve the "lack of equipment" problem.

Limitations and Future Work

The primary limitation is the input method. While the software logic is sound, the testing used a standard game joystick, which does not replicate the tactile feedback of a real crane's control levers. Future work will involve designing custom hardware that mirrors the physical layout of a real crane to improve immersion. Additionally, future studies could provide quantitative comparisons between this FSM-based simulation and high-fidelity mechanical solvers to further validate its precision.

Summary updated

Abstract

Aiming at the insufficiency of the actual crane, finite state machine technology was adopted for setting up an emulational training system. The system implemented a kind of crane loading and unloading operation. Therefor a sort of finite-state machine for the crane was set up. By the dynamics analysis for the crane, several states of the finite state machine were established during loading and unloading process. All the states were bewritten with some mathematic models. The models were simplified to adapt to the simulation system. Then the flow for establishing finite state machine was given, and the concrete methods in Unity3D engine for establishing finite state machine were described. Finally an instance of a kind of crane loading and unloading training system was implemented based on the aforementioned models and methods. The instance shows that the models are accurate and the finite-state machine states are logical.
BibTeX
@misc{guang2015kind,
  author = {Hong Guang and Weibing Bai and Xin Yu},
  title = {{A kind of crane loading and unloading simulation based on finite-state Machine}},
  year = {2015},
  doi = {10.2991/icmmcce-15.2015.66},
}
Figure