Industrial overhead crane PID/RL control system with anti-swing compensation, built on NVIDIA Isaac Sim and IsaacLab.
- 1D Control: Main cart movement along X-axis (track direction)
- 2D Control: Coordinated main cart (X) + trolley (Y) control
- Anti-Swing Compensation: Double-pendulum swing suppression
- Auto-Convergence: Runs until position and swing are stable
Track (slide)
└── Main Cart (vehicle) ← X-axis movement
└── Trolley (vehicle_small) ← Y-axis movement
└── Upper Cable (cable_upper) ← swing DOF
└── Lower Cable (cable_lower) ← swing DOF
└── Hook (crane)
└── Heavy Load (1000kg)
- NVIDIA Isaac Sim 2023.1.1 or later
- IsaacLab (properly configured)
- Python 3.10+
- CUDA compatible GPU
Follow the official Isaac Sim installation guide.
# Clone IsaacLab
git clone https://github.com/isaac-sim/IsaacLab.git
cd IsaacLab
# Create conda environment and install
./isaaclab.sh --install# Clone into IsaacLab source directory
cd /path/to/IsaacLab
git clone git@github.com:Kanye-Est/Isaac-sim-PID-crane-control.git source/crane_controlOr clone to a separate location and update paths accordingly.
cd /path/to/IsaacLab
# 1D Control: Move main cart to X=50m
./isaaclab.sh -p source/crane_control/src/run_crane_control.py --target_pos 50
# 2D Control: Move main cart to X=50m, trolley to Y=5m
./isaaclab.sh -p source/crane_control/src/run_crane_2d_control.py \
--main_cart_pos 50 --trolley_pos 5| Argument | Type | Default | Description |
|---|---|---|---|
--target_pos |
float | 0.0 | Target X position (meters) |
--sim_dt |
float | 1/60 | Simulation timestep (seconds) |
--headless |
flag | False | Run without GUI |
| Argument | Type | Default | Description |
|---|---|---|---|
--main_cart_pos |
float | 0.0 | Main cart target X (meters) |
--trolley_pos |
float | 0.0 | Trolley target Y, relative to main cart (meters) |
--sim_dt |
float | 1/60 | Simulation timestep (seconds) |
--headless |
flag | False | Run without GUI |
# Move main cart only (trolley stays at origin)
./isaaclab.sh -p source/crane_control/src/run_crane_2d_control.py \
--main_cart_pos 50 --trolley_pos 0
# Move trolley only (main cart at initial position ~30m)
./isaaclab.sh -p source/crane_control/src/run_crane_2d_control.py \
--main_cart_pos 30 --trolley_pos 5
# Headless mode (no GUI, faster)
./isaaclab.sh -p source/crane_control/src/run_crane_control.py \
--target_pos 50 --headlessIsaac-sim-PID-crane-control/
├── README.md # This file
├── LICENSE # MIT License
├── .gitignore
├── src/ # Control source code
│ ├── __init__.py
│ ├── pid_controller.py # PID controller class
│ ├── anti_swing.py # Anti-swing controller
│ ├── crane_utils.py # Utility functions
│ ├── run_crane_control.py # 1D control main script
│ └── run_crane_2d_control.py # 2D control main script
└── model/ # USD scene and assets
└── silicon_steel5/
├── 111.usda # Main scene file
└── [asset folders]/ # Referenced assets
┌─────────────────────────────────────────────────┐
│ │
Target Pos ────> ⊕ ─── Position Error ──> [PID Controller] ──┐ │
↑ │ │
│ ↓ │
Current Pos ⊕ ────> Velocity ──> [Crane Joint]
↑ ↑ │
│ ┌──────────────────────┐ │ │
│ │ Anti-Swing Controller│───────────┘ │
│ │ (angle + velocity) │ │
│ └──────────────────────┘ │
│ ↑ │
│ Swing Angles │
│ │ │
└──────────────┴──────────────────────────────────────────────┘
Standard PID with anti-windup and derivative filtering:
output = Kp * error + Ki * ∫error + Kd * d(error)/dtDefault parameters: Kp=0.5, Ki=0.01, Kd=0.3
Reduces cable swing by moving the cart in the swing direction:
v_comp = K1 * θ_upper + K2 * ω_upper + K3 * θ_lower + K4 * ω_lowerDefault parameters: K1=1.0, K2=0.3, K3=1.5, K4=0.5
- Set
Ki=0, Kd=0, increaseKpuntil oscillation - Increase
Kdto dampen oscillation - Add small
Kito eliminate steady-state error
K1, K3(angle gains): Higher = stronger swing suppressionK2, K4(velocity gains): Add damping- Lower cable gains (
K3, K4) typically higher due to heavier load
The simulation runs until:
- Position error < 0.1 m
- All swing angles < 0.05 rad (~2.9°)
- Stable for 600 consecutive frames (~10 seconds)
| Issue | Solution |
|---|---|
ModuleNotFoundError: pxr |
Run via ./isaaclab.sh -p, not python |
Failed to get rigid body handle |
Check USD prim paths match your scene |
| Crane moves opposite direction | Add/remove - in velocity command |
| Swing amplifies | Check anti-swing gain signs |
MIT License - see LICENSE file.
- Built on NVIDIA Isaac Sim
- Using IsaacLab framework
