Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Isaac Sim PID/RL Crane Control

Industrial overhead crane PID/RL control system with anti-swing compensation, built on NVIDIA Isaac Sim and IsaacLab.

Crane Control Demo

Features

  • 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

Physical Model

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)

Requirements

  • NVIDIA Isaac Sim 2023.1.1 or later
  • IsaacLab (properly configured)
  • Python 3.10+
  • CUDA compatible GPU

Installation

1. Install Isaac Sim

Follow the official Isaac Sim installation guide.

2. Install IsaacLab

# Clone IsaacLab
git clone https://github.com/isaac-sim/IsaacLab.git
cd IsaacLab

# Create conda environment and install
./isaaclab.sh --install

3. Clone This Repository

# Clone into IsaacLab source directory
cd /path/to/IsaacLab
git clone git@github.com:Kanye-Est/Isaac-sim-PID-crane-control.git source/crane_control

Or clone to a separate location and update paths accordingly.

Usage

Quick Start

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

Command Line Arguments

1D Control (run_crane_control.py)

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

2D Control (run_crane_2d_control.py)

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

Examples

# 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 --headless

Project Structure

Isaac-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

Control Algorithm

System Diagram

                    ┌─────────────────────────────────────────────────┐
                    │                                                 │
  Target Pos ────>  ⊕ ─── Position Error ──> [PID Controller] ──┐    │
                    ↑                                           │    │
                    │                                           ↓    │
              Current Pos                                    ⊕ ────> Velocity ──> [Crane Joint]
                    ↑                                        ↑                    │
                    │     ┌──────────────────────┐           │                    │
                    │     │  Anti-Swing Controller│───────────┘                    │
                    │     │  (angle + velocity)  │                                │
                    │     └──────────────────────┘                                │
                    │              ↑                                              │
                    │         Swing Angles                                        │
                    │              │                                              │
                    └──────────────┴──────────────────────────────────────────────┘

PID Controller

Standard PID with anti-windup and derivative filtering:

output = Kp * error + Ki *error + Kd * d(error)/dt

Default parameters: Kp=0.5, Ki=0.01, Kd=0.3

Anti-Swing Compensation

Reduces cable swing by moving the cart in the swing direction:

v_comp = K1 * θ_upper + K2 * ω_upper + K3 * θ_lower + K4 * ω_lower

Default parameters: K1=1.0, K2=0.3, K3=1.5, K4=0.5

Parameter Tuning

PID Tuning Steps

  1. Set Ki=0, Kd=0, increase Kp until oscillation
  2. Increase Kd to dampen oscillation
  3. Add small Ki to eliminate steady-state error

Anti-Swing Tuning

  • K1, K3 (angle gains): Higher = stronger swing suppression
  • K2, K4 (velocity gains): Add damping
  • Lower cable gains (K3, K4) typically higher due to heavier load

Convergence Criteria

The simulation runs until:

  • Position error < 0.1 m
  • All swing angles < 0.05 rad (~2.9°)
  • Stable for 600 consecutive frames (~10 seconds)

Troubleshooting

Common Issues

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

License

MIT License - see LICENSE file.

Acknowledgments

About

An algorithm based on PID/RL to control industrial cranes

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages