Skip to content

MatLab Files pertaining to the "Federated Data-EnablEd Predicitve Control" algorithm as presented on ArXiV .

Notifications You must be signed in to change notification settings

PichiControlEngineering/F-DeePC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Federated Data-enabled Predictive Control (DeePC)

Overview

This project implements a Federated Data-enabled Predictive Control (DeePC) framework for any specified dynamic system. The script employs both a regular and federated DeePC controller to compare their performance and effectiveness in controlling the system. We generate 3 trajectories, from which we construct 3 different DeePC controllers: 1. The noiseless trajectory from the nominal system (oracle) 2. A noisy variant of the oracle trajectory above (regular) 3. A weighted average of many different trajectories, derived from similar systems (federated)

Contents

  • Main Script (GenerateFigures): The primary script that generates synthetic system data, runs the DeePC control loop, and plots and saves the corresponding figures, as seen in the paper related to this script.

Requirements

  • MatLab Optimization Toolbox (quadprog.m) Federated DeePC (or any predictive control method), solves a QP at each timestep. This implementation uses MatLabs quadprog, mainly for speed. Other QP programs, such as YALMIP or CVX can be used, but its implementation is not used here.

How It Works

  1. Parameter Initialization:

    • Statespace matrices of the nominal system (A, B, C, D) and DeePC settings (horizon, regularization, federated parameters) are defined.
    • Noise settings and input signal configurations are established.
  2. Data Generation & Hankel Matrices:

    • System input-output data is collected using systemDataGen.m.
    • Hankel matrices are created using createHankel.m for different cases:
      • Regular noiseless control
      • Noisy control
      • Federated control (multiple systems with variations)
  3. Federated DeePC Implementation:

    • Generate federated data-set by generating many trajectories from many controllers
    • Weighting factors are computed for federated data aggregation.
    • Federated Hankel matrices are generated by blending multiple system variations.
  4. Controller Execution:

    • Three controllers are applied to the system:
      • Regular DeePC (Noiseless, M=1)
      • Federated DeePC (M>1, leveraging distributed data)
      • Oracle Control (Optimal control using full noiseless data)
    • The DeePCcontroller.m function is used to optimize control inputs, solving an online optimization using quadprog().
  5. Simulation & Visualization:

    • The system is simulated with each controller using stepStates.m.
    • Performance metrics such as Mean Squared Error (MSE) and control effort are computed.
    • PlotFunction.m is used to visualize system state evolution and control signals.

Dependencies (Non-Local Functions)

The main script relies on the following external functions, all collected in the \Functions\ file:

Function Description
addNoise.m Adds noise to signals to test robustness.
createHankel.m Constructs Hankel matrices for DeePC.
DeePCcontroller.m Implements the DeePC optimization procedure.
PlotFunction.m Generates plots to visualize system performance.
systemDataGen.m Generates input-output data for system identification.
stepStates.m Simulates system state evolution using a given controller.

Running the Script

To run the project:

  1. Ensure athe current matlab directory is that of "\..\ConferencePaper".
  2. Execute GenerateFigures.m in MATLAB.
  3. View generated plots and performance metrics for comparison.

IEEE style Paper

The repo contains code for a paper titled "Toward Federated DeePC: borrowing data from similar systems" , which will be posted on ArXiV very soon!

  • The file GenerateFigures.m contains all the required code, together with the files in Functions to regenerate the data and corresponding figures in the paper

About

MatLab Files pertaining to the "Federated Data-EnablEd Predicitve Control" algorithm as presented on ArXiV .

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages