How youkoutaku/dr-tvfc works
Project Type & Purpose
• This MATLAB-based project is a simulation implementation of a distributed robust time-varying formation control (DR-TVFC) strategy for multi-agent systems (MASs) under disturbances.
• It includes the design of a distributed finite-time estimator for the leader’s states, a prescribed-time modification mechanism, and a sliding mode controller for robust formation tracking.
• The simulation output is visualized through various plotting scripts (both 3D motion and several performance/error plots).
File Structure
• The top-level directories are:
• MATLAB: Contains core simulation and controller modules.
○ build.m – likely the driver that sets everything in motion.
○ config.m – houses all system and control parameters.
○ formation_shape.m – defines the time-varying formation geometry.
○ leader_states.m – generates the reference trajectory by producing leader’s states.
○ main.m – the heart of the system where estimation, prescribed time modification, sliding mode control, and complete simulation are run.
• Plot: Contains scripts to generate and animate various system figures, such as motion trajectories, error plots, and illustrations of internal variables (sliding mode variables, prescribed time function, etc.).
• Additional files like CHANGELOG.md, LICENSE, and configuration files (.gitattributes) indicate project management best practices.
Key Components
a. Core Computation Modules:
• Configuration & Initialization (config.m)
• Acts as the starting point: defines all system parameters and control gains.
• Leader State Generator (leader_states.m)
• Responsible for generating reference trajectories (the desired state).
• Determines the prescribed time-varying formation geometry.
• Main Simulation Engine (main.m)
• Integrates the estimator, controller, and prescribed time modification function.
• Contains the logic to compute control inputs based on sliding mode design.
b. Estimator & Controller:
• Distributed Finite-Time Estimator:
• Uses local information and neighbor communications to quickly estimate the leader’s state.
• Sliding Mode Time-Varying Formation Controller:
• Uses the estimated states to compute robust control actions.
• Implements the prescribed-time modification function.
c. Visualization & Analysis Modules (located in the Plot folder):
• Each plotting script (e.g., fig_motion.m, fig_error_e.m, Animation.m, etc.) visualizes specific aspects of the simulation like agents' trajectories, estimator errors, sliding variables, virtual inputs, etc.
Establishing the Relationships & Data Flow
• Both outputs feed into the main simulation engine (main.m), where distributed estimation and the sliding mode control law operate concurrently.
• Resulting system states, estimation errors, and control inputs are then sent to dedicated plotting modules in the Plot directory to visually represent the dynamics and performance of the system.
• Data flow from configuration to simulation.
• Interaction between estimation and control within the simulation.
• Transformation of simulation outputs into multiple figures and animations.
Architectural Patterns & Design Principles
• Modular design: Components are neatly segregated by function (control, estimation, plotting).
• Separation of concerns: The computational core (in MATLAB) is distinct from the visualization logic (in Plot).
• Reusability: Configuration parameters and simulation components can be utilized independently in different scripts or simulation runs.
Elements
• Rectangles or blocks for each key component:
• Configuration (config.m)
• Leader State Generation (leader_states.m)
• Main Simulation Engine (main.m); include sub-modules inside for estimator, sliding mode controller, and prescribed time modification.
• Visualization Modules (each one representing Plot scripts)
• Initialization ⇒ Trajectory/Formation Definition ⇒ Simulation Execution ⇒ Plotting/Animation.