Skip to content

Commit 5339554

Browse files
committed
added: current state estimate in getinfo for MPC
1 parent 4aee803 commit 5339554

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/controller/execute.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ The function should be called after calling [`moveinput!`](@ref). It returns the
9393
- `:ΔU` or *`:DeltaU`* : optimal manipulated input increments over ``H_c``, ``\mathbf{ΔU}``
9494
- `:ϵ` or *`:epsilon`* : optimal slack variable, ``ϵ``
9595
- `:D̂` or *`:Dhat`* : predicted measured disturbances over ``H_p``, ``\mathbf{D̂}``
96+
- `:x̂` or *`:xhat`* : current estimated state, ``\mathbf{x̂}_i(k)``
9697
- `:ŷ` or *`:yhat`* : current estimated output, ``\mathbf{ŷ}(k)``
9798
- `:Ŷ` or *`:Yhat`* : optimal predicted outputs over ``H_p``, ``\mathbf{Ŷ}``
9899
- `:Ŷs` or *`:Yhats`* : predicted stochastic output over ``H_p`` of [`InternalModel`](@ref), ``\mathbf{Ŷ_s}``
@@ -167,6 +168,7 @@ function getinfo(mpc::PredictiveController{NT}) where NT<:Real
167168
info[:u] = info[:U][1:model.nu]
168169
info[:d] = mpc.d0 + model.dop
169170
info[:D̂] =
171+
info[:x̂] = mpc.estim.x̂0 .+ mpc.estim.x̂op
170172
info[:ŷ] = mpc.
171173
info[:Ŷ] =
172174
info[:x̂end] = x̂0end + mpc.estim.x̂op
@@ -177,6 +179,7 @@ function getinfo(mpc::PredictiveController{NT}) where NT<:Real
177179
info[:DeltaU] = info[:ΔU]
178180
info[:epsilon] = info[]
179181
info[:Dhat] = info[:D̂]
182+
info[:xhat] = info[:x̂]
180183
info[:yhat] = info[:ŷ]
181184
info[:Yhat] = info[:Ŷ]
182185
info[:xhatend] = info[:x̂end]

0 commit comments

Comments
 (0)