Skip to content

mhsnar/REAP-T

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

172 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

REAP-T Demo GIF

Robust to Early Termination Model Predictive Control Toolbox (REAP-T)

๐Ÿ› ๏ธ Getting Started:

  1. Extract the YALMIP zip file to the location of the REAP-T file.
  2. Run the REAPT_GUI function in MATLAB.

๐Ÿš€ Usage:

  1. Import your system and desired configurations:
    • After running REAPT_GUI, import your system model and specify your desired configurations, enable plots, and simulate the system to observe results.
  2. Execute the package to start the control process.

๐Ÿ“‹ Input Fields Explained

System Matrices

  1. Matrix A
    Represents the state-transition matrix of the system.
    Example:
    A = [0 1; -2 -3]

  2. Matrix B
    Input matrix defining how the control inputs affect the system.
    Example: B = [0; 1]

  3. Matrix C
    Output matrix, mapping the state to system outputs.
    Example:
    C = [1 0]

  4. Matrix D
    Feedthrough matrix, directly connecting input to output.
    Example: D = 0

Constraints

  1. X Constraint U.B. (Upper Bound)
    Upper bounds for the system state vector (x).
    Example: [5; 5]

  2. X Constraint L.B. (Lower Bound)
    Lower bounds for the system state vector (x).
    Example: [-5; -5]

  3. U Constraint U.B. (Upper Bound)
    Upper bounds for the control input vector (u).
    Example: [1]

  4. U Constraint L.B. (Lower Bound)
    Lower bounds for the control input vector (u).
    Example: [-1]

Cost Function Weights

  1. Matrix Qx
    Weighting matrix for penalizing state deviations in the cost function.
    Example:
    Qx = [1 0; 0 1]

  2. Matrix Qu
    Weighting matrix for penalizing control efforts in the cost function.
    Example:
    Qu = [0.01]

  3. Initial Condition ((x_0))
    Initial state of the system.
    Example: [0; 0]

Simulation Parameters

  1. Prediction Horizon
    The number of future steps the controller optimizes for.
    Example: 10

  2. Desired Target
    Desired value for the reference trajectory or desired steady-state configuration (Equilibrium point)

  3. # Time Instants
    Total number of time steps for the simulation.
    Example: 100

  4. Sampling Period ((\Delta T))
    Time interval between successive steps.
    Example: 0.2

  5. Terminal Constraint The mode of the terminal constraints; could be prediction-based or Lyapunov-based.

Plots

  1. Select Plots
    Choose which aspects of the system to visualize:
  • States: Display state trajectories.
  • Control Inputs: Show control signals over time.
  • Output: Visualize system output.
  • Sigma: Plot algorithm-specific sigma values.

Algorithm Mode

  1. Algorithm Mode Dropdown
  • Automatic: Let the system decide optimal parameters (disables Omegastar input).
  • Manual: Allows customization of the Omegastar parameter.

This interface makes it easier to define and simulate discrete-time systems with constraints and optimization. Start exploring your systems now! ๐Ÿš€

๐Ÿ“š Examples:

For guidance, the package includes two examples:

  1. Parrot Bebop 2 Drone:
    • This example demonstrates the implementation of REAPT on a Parrot Bebop 2 drone.
  2. F-16 Aircraft Model:
    • This example showcases REAPT applied to a F-16 Aircraft Model.

โ–ถ๏ธ Running Examples:

  1. Navigate to the examples directory:
    • Open the folder containing the examples within the extracted files.
  2. Run the example scripts:
    • Follow the instructions in the example scripts to see the results and understand how to set up and execute your own system.

๐Ÿค Support:

For any issues or questions, please refer to the issues page on GitHub.

Citing REAP-T:

If you use the REAP Toolbox, please use the following BibTeX entry:

@article{amiri2025reap,
  title={REAP-T: A MATLAB Toolbox for Implementing Robust-to-Early Termination Model Predictive Control},
  author={Amiri, Mohsen and Hosseinzadeh, Mehdi},
  journal={arXiv preprint arXiv:2507.00863},
  year={2025}
}



About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published