# MPC controller

## MPC controller - title

**MPC Controller**

## MPC controller - overview

**Control Function Overview**

**Author / organization: **Alexander Engelmann / KIT

**Versions: **1

**Date: **18.05.2018

**Methodology: **The basic idea of MPC is to repeatedly compute open-Ioop optimal control sequences by solving optimal control problems (OOPS) and applying the ﬁrst piece at the optimal control input. After that. the controller typically recieves new measurements, computes a new optimal control input and applies the ﬁrst part of this input once more.

## MPC controller - input output

**Input and Output **

**Input variables : **

- Oudoor temperature measurments and forecast
- Solar irradiation measurements and forecast
- Ground Temperature measurments and forecast
- Ground water temperature measurements and forecast
- Electrical energy consumption measurements and forecast
- District heating energy consumption measurements and forecast
- Battery overall SOS

**Output variables: **

- Heat pump electrical power
- Concrete core activation system
- Hot water butter
- Space heating power via radiators
- Battery power feed in/out

## MPC controller - short description

**Short Description**

The main control loop tor the KIT Flexoffice/Factory use case is an economic Model Predictive Controller (MPC) for controlling many actors simultaneously in the electrical and thermal domain of the building/factury. Specifically, this control approaches combines functionality of many individual controllers in one (computationally complex) optimization based control scheme.

In our speciﬁc application, different MPC control schemes are used. In general the same MPC structure of the MPC controller can be used to achieve different goals by choosing an appropriate objective function.

## Electric bioler aggregator - related document

## MPC controller - details

**Control Function Details**

Version No. | 1 | ||

Date | 18/05/2018 | ||

Author(s) | Alexander Engelmann |

The main control loop tor the KIT Flexoffice/Factory use case is an economic Model Predictive Controller (MPC) for controlling many actors simultaneously in the electrical and thermal domain of the building/factury. Specifically, this control approaches combines functionality of many individual controllers in one (computationally complex) optimization based control scheme.

In our speciﬁc application, different MPC control schemes are used. In general the same MPC structure of the MPC controller can be used to achieve different goals by choosing an appropriate objective function.

Specifically for our case we would like to achieve three (partialty conflicting) goats via MPC:

- Minimize the fluctuation in energy consumption from the electricity grid
- Minimize the fluctuation in energy consumption from the district heating grid
- Minimize the in energy consumption for the office/factory

**Input variables : **

- Oudoor temperature measurments and forecast
- Solar irradiation measurments and forecast
- Ground Temperature measurments and forecast
- Ground water temperature measurments and forecast
- Electrical energy consumption measurments and forecast
- District heating energy consumption measurments and forecast
- Battery overall SOS

**Output variables: **

- Heat pump electrical power
- Concrete core activation system
- Hot water butter
- Space heating power via radiators
- Battery power feed in/out

Further details, please see related documents.

MPC has several limitations. First of all, in case the system model gets very complex the resulting optimization problems are hardly solvable fast enough or even not solvable at all. Therefore. the ability to provide models which cover only the mainly relevant effects are essential. Practically, small lack of accuracies in the model are often well compensated by the feedback nature of MPC.

A very basic limitation is the requirement of recursive feasibility. E.g. in case of an electrical energy system, if the prediction horizon is not chosen long enough the storage might run out of energy because certain weather conditions in the future are not considered. Under certain assumptions recursive feasibility can be ensured for economic MPC.

Another limitation of MPC is that it (as other control schemes) requires measurements or estimations of the current state in order to set the correct initial condition for the open loop OCP. In general, they might not be available or even faulty. While one in the first case one has to ensure the availability of enough measurement points, the latter can be addressed by implementing certain fault detection schemes.

Last but not least MPC heavily depends on forecasts e.g. for the weather or demand in energy systems. In case they are not available, MPC can‘t be applied. Furthermore, in case that the forecasts are very

inaccurate the performance of MPC drops and can lead to non-optimal behavior, However. there are methods to deal with this e.g. via probabilistic forecasts where the uncertainty level is atso provided by the forecasting algorithm and this information is included to the MPC scheme.

Use case example | Minimize fluctuation in electric energy consumption | ||

| 09/05/2018 | ||

| -- | ||

| Minimize fluctuation (peak shaving) in electric energy | ||

| The inputs anf forecasts have to be available, the optimal control problem has to be feasible | ||

| The actors are steered in a way such that the above goal is reached (flatteded energy consumption profile, smaller residual load) | ||

| High | ||

| 15 min | ||

| As described in the methodology part, the standard functionality consists of four steps: - Obtain new measurements and forecasts
- Parameterize the OCP With these measurements forecasts
- Solve OCP
- pply first step of the optimal input u(t) to the system
| ||

| Fallback to the standard heating system control in case of a failure in the MPC loop ( e.g. solver doesn‘t ﬁnd an OCP solution, too long computation time, infeasibility, ....) | ||

| - | ||

| - | ||

| - |

There is a certain degree of ambiguity for the outputs of the MPC control scheme for the heating system. in order to get a computabte model for MPC we use power set points for the thermal devices like the heat pump or the concrete core activation. However, in all these cases this power can be reached either by increasing the mass flow or the temperature.

Furthermore. we assume that the uncderlying controllers (e.g. controlling the output of the heat pump) are infinitely fast. This might not be the case in reality and the actors need some time to reach the computed set points. Hence this could result in a significant difference between simulation with a high-resolution simulation method compared to the trajectories of computed by MPC.