Skip to content

About

IFT6162 project

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IFT6162 Project

by Alexandre Fournier, Simon Pino-Buisson and Justin Veilleux

Crane2D: Optimal Control of an STS Crane (Spatial MPC)

This project implements a Model Predictive Control (MPC) framework for a simulated Ship-to-Shore (STS) container crane. It solves a nonlinear optimal control problem to move a payload from point A to point B while minimizing time and energy, avoiding obstacles, and suppressing sway.

We based our implementation on the work presented by Barbosa and al..

The solver uses a Spatial Formulation, where the independent variable is the trolley position xp rather than time t. This allows for easier implemented obstacle avoidance over a fixed geometric horizon.

We optimize over the nonlinear dynamics of a full 2D crane simulation including hoist length variation, sway angles, and coupling effects.

The obstacle avoidance problem is handled throught dynamic constraint generation based on variable terrain/container stack heights.

We use a configurable trade-off (α) between Time Minimization (α=1) and Energy Minimization (α=0) to explore the balance between the two.

We use the CasADi optimizer with the IPOPT solver, featuring smooth power approximations and reduced-state formulations for numerical stability.

Project Structure:

Crane2D: Defines the physical dynamics of the crane (equations of motion and power calculations) and RK4 integration.

Port: Manages the environment, including obstacle course generation and height lookups.

MPC: The core controller class. Formulates the OCP (Optimal Control Problem), sets up constraints/objectives, and interfaces with the CasADi solver.

CraneParams: Dataclass containing physical constants (mass, gravity, max forces, limits).

Mathematical Model

State Vector: The formulation was reduced from the paper to ensure numerical stability with the spatial formulation by removing the y and yd (payload height) since it can be derived from the cable length l. This avoids redundant constraints.

x=[$t$, $v$, $l$, $\dot{l}$, $\theta$, $\dot{\theta}$]

$t$: Time elapsed [s]

$v$: Trolley velocity [m/s]

$l$: Hoist length [m]

$\dot{l}$: Hoist rate [m/s]

$\theta$: Sway angle [rad]

$\dot{\theta}$: Sway angular velocity [rad/s]

Control Vector u=[$F_t$, $F_h$, $z_t$, $z_h$]

$F_t$, $F_h$: Forces on trolley and hoist [N]

$z_t$, $z_h$: Power consumption variables [W]

Crane3D: Robust 3D Ship-Mounted Crane Control (R-ZOCBF MPC)

This repository implements a Nonlinear Model Predictive Controller (NMPC) for a ship-mounted crane operating in a 3D environment. The system is designed to transport a payload to a specific target on a ship deck while compensating for wave disturbances and avoiding obstacles.The core feature of this controller is the use of Robust Adaptive Zeroing Control Barrier Functions (R-ZOCBF). This allows the controller to dynamically tighten safety constraints based on state uncertainty, ensuring collision avoidance even when the sea state induces unpredictable motion.

Our work is a simplified version of the work of Das and al.

Key Features

3D Nonlinear Dynamics: Models the crane payload as a damped spherical pendulum attached to a rigid boom with variable luffing and slewing angles.

CasADi & IPOPT: Uses the CasADi framework with the IPOPT solver for fast, gradient-based trajectory optimization.

Wave/Wind Disturbance Simulation: Injects sinusoidal wave accelerations into the angular velocities of the payload to test robustness.

Adaptive Safety (R-ZOCBF): Uses Monte Carlo sampling within the control loop to estimate the necessary safety margin ($\delta$) to maintain recursive feasibility under uncertainty.

3D Visualization: Includes a fully interactive Matplotlib-based 3D animator to visualize the boom, tether, payload, obstacles, and the MPC "ghost" trajectory plan.

State Vector: x=[$\beta$, $\theta$, L, $\phi_p$, $\theta_p$, $\dot{\phi_p}$, $\dot{\theta_p}$]

Control Vector: u=[$\dot{\beta}$, $\dot{\theta}$, $\dot{L}$]

About

IFT6162 project

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages