This repository contains Assignment 2 of the 2025/2026 Laboratorio di Automatica course at the Università degli Studi di Brescia. The authors decline any responsibility for usage outside this scope. The provided tools support the development, simulation, and implementation of control systems for mechatronic applications. Developed by CARI JRL.
You need to install labauto_control_library and activate the Conda environment before using this repository.
The goal of this assignment is to move a crane while reducing oscillations by using an input shaper.
Students must implement at least one input shaper among the following:
- ZV (Zero Vibration)
- ZVD (Zero Vibration Derivative)
- ZVDD
- EI (Extra Insensitive)
The purpose is to reshape the reference command so that the oscillatory dynamics of the crane are excited as little as possible during motion.
The main script of the repository is:
robot_simulation.py— runs the simulation and must be modified to introduce the input shaper.
The student is expected to:
- understand how the motion command is generated and applied in simulation
- implement at least one input shaper
- integrate the input shaper into the simulation workflow
- evaluate the reduction of oscillations produced by the shaped command
This assignment focuses on command shaping, not on redesigning the whole control architecture.
The simulation infrastructure is already provided. In most cases, the required work is limited to the implementation and integration of the input shaper inside robot_simulation.py.
The repository typically contains:
robot_simulation.py— main simulation script- simulation, model, and configuration files needed by the MuJoCo environment
- robot description files and parameters
- support files that normally do not require modification
Students must implement an input shaper that modifies the commanded input through a sequence of delayed and weighted impulses.
Possible choices include:
The simplest input shaper, designed to cancel residual vibration for a nominal oscillation frequency and damping ratio.
A more robust version of ZV, with improved sensitivity to modeling errors.
An extension of ZVD with additional robustness.
An extra-insensitive shaper that further improves robustness to uncertainty in the oscillatory mode.
At least one of these shapers must be implemented and used in the simulation.
The repository includes a MuJoCo-based mechanical-system wrapper.
Its purpose is to:
- load the MuJoCo model
- manage actuators and joints
- run the physics simulation
- provide measurements to the control logic
- optionally visualize the simulation through
mujoco.viewer
The wrapper already handles:
- model loading
- actuator force application
- sensor reading
- simulation stepping
- optional viewer support
- platform-specific viewer checks, especially on macOS
This infrastructure should normally be reused as provided.
On macOS, the MuJoCo viewer requires mjpython.
Run scripts with:
mjpython robot_simulation.pyinstead of:
python robot_simulation.pywhen interactive visualization is enabled.
This repository depends on labauto_control_library.
Follow the installation instructions in the main library repository:
In summary:
- create and activate the Conda environment required by
labauto_control_library - install all the required dependencies
- install or update the library from GitHub
- run this assignment repository from the active environment
After activating the Conda environment, launch the simulation from the repository root:
python robot_simulation.pyOn macOS, use:
mjpython robot_simulation.pyif the MuJoCo viewer is enabled.
The main required modification is in:
robot_simulation.py
This file must be extended to include the selected input shaper (implemented as a class).
A typical implementation workflow is:
- identify the oscillatory mode to be attenuated
- choose a shaper type
- shape the reference command before it is sent to the crane
- compare the response with and without shaping
For this assignment, students are mainly expected to:
- understand the oscillatory behavior of the crane
- study the principle of input shaping
- implement one valid input shaper
- integrate it into the simulation
- evaluate its effectiveness in reducing residual oscillations
When implementing the input shaper, pay attention to:
- the oscillation frequency used to design the shaper
- the damping ratio assumption
- the delay introduced by the shaping process
- the trade-off between vibration reduction and execution speed
- robustness with respect to modeling uncertainty
A more robust shaper usually reduces oscillation more reliably, but it may also introduce a larger delay.
- Use a clean Conda environment.
- Do not source ROS in the same terminal when using the Conda environment, since dependency clashes may occur.
- Unless explicitly required, do not modify the simulation model files.
- Focus on the shaping logic and on the comparison between shaped and unshaped commands.
This assignment is intended to introduce students to a classical feedforward vibration-reduction technique widely used in flexible and oscillatory systems.
By the end of the assignment, students should be able to:
- explain the rationale behind input shaping
- implement at least one standard shaper
- integrate the shaper into a simulation workflow
- discuss the benefits and limitations of the chosen shaping strategy
