MPC#

Solves a condensed QP every clock step (A, B, Q, R, N, u bounds from a JSON file).

mpc · control · no feedthrough: a feedback loop may pass through it

The model is a JSON file on the block:

{ "A": [[1]], "B": [[1]], "Q": [[1]], "R": [[0.1]], "N": 20, "u_min": [-1], "u_max": [1] }

It is condensed into one QP over the horizon N and solved by the optimization toolkit every step.

Inputs#

Port

Type

Unit

Components

y

numbers

—

—

ref

numbers

—

—

x0

numbers

—

—

Outputs#

Port

Type

Unit

Components

u

numbers

—

—

status

text

—

—

iterations

signal

—

—

solve_time

signal

—

—

Parameters#

Param

Type

Default

Options or unit

file

file

—

—

max_time

number

0.0

—

max_iter

number

4000.0

—