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)
- 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.
- 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.
-
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.
-
Data Generation & Hankel Matrices:
- System input-output data is collected using
systemDataGen.m. - Hankel matrices are created using
createHankel.mfor different cases:- Regular noiseless control
- Noisy control
- Federated control (multiple systems with variations)
- System input-output data is collected using
-
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.
-
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.mfunction is used to optimize control inputs, solving an online optimization using quadprog().
- Three controllers are applied to the system:
-
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.mis used to visualize system state evolution and control signals.
- The system is simulated with each controller using
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. |
To run the project:
- Ensure athe current matlab directory is that of "\..\ConferencePaper".
- Execute
GenerateFigures.min MATLAB. - View generated plots and performance metrics for comparison.
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.mcontains all the required code, together with the files inFunctionsto regenerate the data and corresponding figures in the paper