Embedded Implemen a ion o a Neu al Ne wo k emula ing Nonlinea
MPC in a p ocess con ol applica ion*
Sebas ian Leonow1and Raphael Dy ska1and Ma in M¨
onnigmann1
Abs ac — We p esen he design, aining, and implemen-
a ion o a nonlinea au o eg essi e neu al ne wo k o he
con ol o a mul i-inpu , mul i-ou pu hyd aulic plan . The
ne wo k mimics he op imal con ol signals o a nonlinea model
p edic i e con olle and is implemen ed on a low-le el mic o-
con olle . While ained wi h simula ion da a only, expe imen s
on he eal plan show ha no only he se poin acking, bu
o some deg ee also he cons ain sa is ac ion and unmeasu ed
dis u bance ejec ion a e adap ed by he neu al ne wo k. In
con as o he op imiza ion-based p edic i e con olle , he
neu al ne wo k easily uns on an ESP32 mic ocon olle and
Mic opy hon wi h gua an eed e alua ion ime and s ill achie es
simila con ol pe o mance as he p edic i e con olle .
I. INTRODUCTION
Nonlinea model p edic i e con ol (NMPC) is a powe ul
me hod o he con ol o cons ained nonlinea sys ems wi h
mul iple inpu s and ou pu s. I is based on pe iodically sol -
ing a nonlinea p og am (NLP) o a ini e p edic ion ho izon
unde conside a ion o he sys em dynamics (see, e.g., [1],
[2]). While powe ul om a heo e ical poin o iew, he
complexi y o he unde lying op imiza ion p oblem is o en
a limi ing ac o o i s applica ion. Se e al app oaches exis
in o de o educe he compu a ional e o , ei he om an
algo i hmic poin o iew (see, e.g., [3]), o by exploi ing
s uc u al in o ma ion o he solu ion (see, e.g., [4], [5]).
Especially challenging o an applica ion on embedded ha d-
wa e wi h s ongly limi ed esou ces o compu a ional powe
and memo y, he embedded implemen a ion o NMPC also
ecei ed a lo o a en ion du ing he las yea s (see, e.g., [6],
[7], [8]).
Besides esea ch ocusing on NMPC di ec ly, a ious
app oaches exis ha combine machine lea ning me hods
wi h linea model p edic i e con ol (MPC) and NMPC.
An o e iew o con ibu ions combining MPC and machine
lea ning me hods is gi en in [9]. In [10], cons ain sa is-
ac ion o a lea ning-based con olle o a linea sys em is
p o ided by in oducing sa e y se s and a backup con olle
in case o cons ain iola ion. To speed up he solu ion o
he unde lying op imiza ion p oblem, he au ho s in [11] use
classi ica ion me hods o p edic he se o ac i e cons ain s
expec ed o he MPC solu ion o he cu en s a e o wa m-
s a he unde lying ac i e-se algo i hm.
*This pape is unded by he Eu opean Union’s Ho izon Eu ope unde
g an no. 101079342 (Fos e ing Oppo uni ies Towa ds Slo ak Excellence
in Ad anced Con ol o Sma Indus ies)
1All Au ho s a e wi h Depa men o Mechanical Enginee ing, Au-
oma ic Con ol and Sys em Theo y, Ruh -Uni e si ¨
a Bochum, 44801
Bochum, Ge many seba ian.leonow, aphael.dy ska,
[email p o ec ed]
Ins ead o assis ing in he solu ion p ocess i sel , machine
lea ning, and especially neu al ne wo ks a e also used o
eplace he MPC and NMPC con olle comple ely. In [12],
[13], [14], neu al ne wo ks we e used o eplace explici
MPC con olle s, i.e., mul i-pa ame ic solu ions o a linea
MPC p oblem. In [15] and [16], he mixed in ege op imiza-
ions wi hin an MPC con olle o domes ic hea ing sys ems
we e mimicked by a neu al ne wo k. The au ho s in [17]
lea ned he con ol laws esul ing om MPC o con olling
he empe a u e o a six-zone building in a simula ion case
s udy. Ano he applica ion o eplacing op imal con ol wi h
a neu al ne wo k is gi en in [18] o he con ol o esonan
powe con e e s in a ha dwa e-in- he-loop se up.
In his pape , we p esen he design o a nonlinea au-
o eg essi e ne wo k wi h exogenous inpu s ha mimics he
op imal con ol o an NMPC and discuss i s implemen a-
ion on an ESP32 mic ocon olle using Mic opy hon as
online in e p e e . We compa e he pe o mance o he neu al
ne wo k based con ol o he o iginal NMPC by applying
bo h a ian s o a labo a o y hyd aulic plan . Besides he
acking o e e ence alues, we also aim a lea ning some
deg ee o cons ain sa is ac ion by applying cons ain s o
he NMPC con ol and using he esul ing con ol ac ion as
a ge da a o he neu al ne wo k aining. Al hough his
p ocedu e does no yield a gua an eed cons ain sa is ac ion
as discussed in [10], i showed sa is ying esul s in a way
ha he neu al ne wo k based con ol pe o ms simila ly o
he NMPC in e e ence acking, dis u bance ejec ion, and
cons ain sa is ac ion, in he sample applica ion (see Sec.
IV).
II. NEURAL NETWORK BASED CONTROL
The aim o ou app oach is o mimic he con ol ac ions
o an NMPC by a neu al ne wo k, by p o iding con ol
e e ences ( )and plan ou pu s y( )as ea u es o he
ne wo k and ecei ing he esul ing con ol ac ion u( )as
a ge . P o iding ( )and y( )ins ead o he con ol e o
e( ) = ( )−y( )is c ucial o he ne wo k o inhe i a
obse e
(EKF) NMPC
neu al ne wo k
Fig. 1. The neu al ne wo k based con olle co e s obse e and NMPC.
laye 1 laye 2
inpu s
ou pu s
ou pu eedback
Fig. 2. NARX a chi ec u e, depic ed o one neu on in each laye , wi h
weigh s wand d, and biases b. The supe sc ip indices iand jco espond
o he enume a ed neu ons in each laye . The i s subsc ip index deno es
he co esponding laye , he second subsc ip index, i applicable, deno es
he assignmen o a weigh (wo d) o he plan ou pu s yo he ( ed back)
ne wo k ou pu s u. The uni delay is deno ed by z−1. The neu ons om
laye 1 ha e a nonlinea ac i a ion unc ion h(σi), whe e σideno es he
sum o all weigh ed inpu s and he bias o he cu en neu on i.
ce ain deg ee o cons ain sa is ac ion wi h espec o y( )
(see Sec. III-B). The ne wo k and NMPC con olle s uc u e,
and plan in e aces a e ou lined in Fig. 1.
We chose a nonlinea au o eg essi e neu al ne wo k wi h
exogeneous inpu s (NARX) as undamen al neu al ne wo k
a chi ec u e. This choice is based p ima ily on p e ious
expe imen s ha showed p omising esul s, in pa icula
compa ed o ecu en ne wo ks, whe e he NARX a chi ec-
u e pe o med signi ican ly be e . We speci ically used a
ully connec ed NARX wi h wo laye s and one delay s age
as depic ed in Fig. 2. Laye 1 consis s o 10 neu ons, while
laye 2 consis s o 2 neu ons.
In he ully connec ed NARX all inpu s (k)y(k)and
( ed back) ou pu s u(k−1) om he p e ious ime s ep a e
connec ed o all laye 1 neu ons h ough he co esponding
weigh s wi
1,u and wi
1,u, espec i ely. One delay s age is
included o all inpu s and he delayed inpu s a e also
connec ed o all neu ons om laye 1 h ough he weigh s
di
1,y and di
1,u, espec i ely.
A o al numbe o 2·(| |+|y|+|u|)inpu s o each
neu on om laye 1 esul s, whe e |·| deno es he size o he
co esponding ec o s. The second laye neu ons co espond
wi h he numbe o ou pu s |u|and a e connec ed o all
laye 1 neu ons. Table I summa izes he ne wo k a chi ec u e.
Fo he weigh s wi
1,y ∈R(| |+|y|)×1,wi
1,u ∈R|u|×1,
di
1,y ∈R(| |+|y|)×1, and di
1,u ∈R|u|×1 ollows. The wo
second-laye neu ons a e connec ed o all i s laye neu ons,
esul ing in wj
2∈R10×1. All biases ba e scala . The i s -
laye neu ons ha e a sigmoid ac i a ion unc ion o co e he
nonlinea NMPC con ol wi h
h(σi) = 1
1 + exp(−σi).(1)
The second laye neu ons ha e a linea ac i a ion unc ion.
The ou pu eedback is closed when he NARX is applied
in he closed con ol loop, such ha he cu en ou pu o
he ne wo k u(k)becomes a ne wo k inpu (u(k−1)) in he
nex ime s ep. Since he con ol ac ions u(k)and u(k−1)
a e al eady known du ing aining ( om he NMPC), he
NARX eedback loop is opened and u(k)and u(k−1) a e
used as bo h, a ge alues and ea u es, espec i ely, so ha
he NARX becomes an easie o ain eed o wa d ne wo k
(see [19]).
TABLE I
SPECIFIC NARX ARCHITECTURE.
size delays connec ion ac i a ion
inpu s | |+|y|+|u|- - -
laye 1 10 1 ull sigmoid (1)
laye 2 |u|- ull linea
ou pu s |u|- - -
A. Nonlinea model p edic i e con olle
We use a gene ic NMPC con olle p o ided by he Ma lab
Model P edic i e Con ol Toolbox 1and sol e he nonlinea
op imiza ion p oblem
VN(x) = min
y(·),u(·),ε Jy+J∆u+Jε(2a)
subjec o
x(k+ 1) = (x(k), u(k)), k = 0, ..., N −1(2b)
y(k) = g(x(k)), k = 0, ..., N (2c)
y−ε≤y(k)≤y+ε, k = 0, ..., N, (2d)
ε≥0(2e)
u≤u(k)≤u, k = 0, ..., N −1.(2 )
o a cu en s a e x(0) in e e y ime s ep, and apply he
op imal inpu alue u∗(0) o he plan . The cos unc ions
a e de ined as
Jy=
N
X
k=1
k (k)−y(k)k2
Q, Jε=kεk2
S,
J∆u=
N−1
X
k=0
ku(k)−u(k−1)k2
R.
Cos unc ion Jypenalizes he de ia ion o ou pu y(k) om
he gi en e e ence alue (k) o ime s ep k. The inpu a e
u(k)−u(k−1), i.e., he change in he applied inpu alue
be ween wo ime s eps, is penalized in J∆u o a oid as -
changing ac ua o use.
The slack a iable is in oduced o ensu e easibili y by
so ening he ou pu cons ain s on y(k). The use o he slack
a iable εis penalized by he he cos unc ion Jε.
The unde lying op imiza ion p oblems we e sol ed using
he SQP algo i hm as pa o he Ma lab unc ion mincon.
An Ex ended Kalman Fil e (EKF) was used wi hin he
Nonlinea Model P edic i e Con ol Toolbox o econs uc
he s a e ec o x om plan ou pu s yand con olle ou pu s
u.
III. APPLICATION: EMBEDDED PROCESS CONTROL
We chose a labo a o y-scale hyd aulic plan wi h com-
bined p essu e and low a e con ol as a demons a o o
he ou lined con ol concep . The plan is depic ed in Fig.
3 and consis s o a a iable-speed cen i ugal pump and
a con ollable discha ge al e. Pump and al e a e he
ac ua o s equi ed o se a desi ed p essu e and low a e
in an enclosed chambe . The plan inpu s a e u= (n, )T
1h ps://de.ma hwo ks.com/help/mpc/index.h ml
M
~
~
pump
mo o
in e e
al e
ou le
inle
PLC
PC wi h
MATLAB
OPC
con olled
chambe
ESP32
analog
in e ace
Fig. 3. Labo a o y scale hyd aulic plan .
o pump speed and al e opening, espec i ely. The plan
ou pu s a e y= (p, q)T, i.e. he measu ed p essu e and low
a e.
The plan con igu a ion esembles a equen eal-wo ld
con ol ask ha can be ound, e.g., in e e se osmosis plan s
o seawa e desalina ion [20]. The ac ua o s and senso s
a e connec ed o a PLC and a s anda d PC wi h Ma lab /
Simulink, which a e used o implemen he NMPC. The PC
is explici ly no equi ed o un he NARX-based con ol, bu
pe o ms da a logging o he e alua ion.
A. Plan model
A plan model is equi ed o he NMPC and consis s o
he componen models o pump, al e, and senso s. The
model is o ganized in a Hamme s ein s uc u e wi h pump
and al e as s a ic, nonlinea models and he senso s as linea
dynamic models.
1) Pump model: We assume quasi-s a ic condi ions o
he pump and chose a s anda d cen i ugal pump model
o compu e he s eady s a e discha ge p essu e ϕ om he
s eady s a e low a e ψand he o a ional speed n(see [21]),
and adap ed he model o he cu en pump:
ϕ=cϕ,1·ψ2+cϕ,2·ψ·˜n+cϕ,3·˜n1.7,(3)
wi h pa ame e s cϕ,1=−8.726·10−6,cϕ,2=−1.691·10−6,
cϕ,3= 201.906 ·10−6and a o a ional speed scaling ˜n=
0.6·n+ 40.
2) Val e model: As o he pump we assume quasi-s a ic
condi ions also o he al e and use he gene ic o i ice
equa ion (see [22] p. 18 )
ψ=pϕ·c ( ),(4)
wi h he al e coe icien c ( )implemen ed as piecewise
linea unc ion.
3) Senso models: The p essu e and low a e senso s a e
ep esen ed as linea dynamic, disc e e- ime s a e space mod-
els wi h s a e ec o x(k) = xp(k)xq,1(k)xq,2(k)T
and a sampling ime TS= 0.5s. TSwas chosen ela i ely
la ge o mee he cycle ime o he online NMPC e alua ion
(see Fig. 9 in Sec. IV). The plan model x(k+ 1) =
(x(k), u(k)) esul s wi h
(x(k), u(k)) = ap01×2
02×1Aq·x(k) + I2×2
01×2·ϑ(k),
(5)
Fig. 4. The ull ope a ing ange o he plan is inside o he solid black
bo de , while we es ic he admissible ange o pand qwi hin he
highligh ed g ay a ea by he con olle cons ain s (6). The blue ajec o y
depic s da a o h ee open-loop s ep esponses, whe e blue do s co espond
o sampled ime poin s and lines a e added o con enience.
wi h 0and Ideno ing ze o and iden i y ma ices, espec-
i ely, and
ap= 0.6065, Aq=0.6065 0
0.3033 0.6065.
The ec o ϑ(k) = ϕ(k)ψ(k)Tin okes he nonlin-
ea models (3) and (4), and he e o e connec s (5) o he
plan inpu s u(k). The measu ed plan ou pu s a e y(k) =
p(k)q(k)Twi h p(k) = xp(k)and q(k) = xq,1(k).
The plan model (5) is used in he NMPC o closed-loop
con ol o he eal plan and o aining da a gene a ion as
desc ibed in Sec. II-A.
Fig. 4 depic s he ull ope a ing ange o he plan ,
bounded wi h a solid line, o e he inpu ange n, ∈
[0,100]%. We delibe a ely limi he admissable ope a ing
ange o he plan ou pu s o yand ¯y, highligh ed by he
ec angula a ea in Figu e 4, wi h
0.25
30 ≤y(k)≤0.35
50 .(6)
The lowe and uppe bounds on yco espond o he NMPC
cons ain s (2d).
The blue ajec o y depic s he open loop ope a ion o
he plan wi h da a om h ee s ep esponses, om u=
47,45Ta poin (1) o u=67,45Ta poin (2) o
u=47,54Ta poin (3), o illus a e he open-loop
cha ac e is ics.
B. NMPC uning and aining da a gene a ion
The NARX aining da a was gene a ed in an ex ensi e
simula ion s udy pe o med wi h he NMPC in oduced in
Sec ion II-A unning agains he plan model (5) o e a 5
hou in e al, esul ing in 36000 da a poin s.
The e e ences o he aining da a gene a ion we e
aken andomly om a se ∈[ min, max]wi h min =
0.22,20Tand max =0.42,70T, which is also depic ed
in Fig. 6. Since we aimed a lea ning cons ain sa is ac ion
as well, e e ence alues ou side o he ou pu cons ain s
we e in e nally limi ed o he co esponding bound du ing
he simula ion s udy, o no include he e ec o cons ain
so ening in he aining da a. The e o e a modi ied e e ence
alue ˜ (k)was o wa ded o he NMPC such ha
˜ (k) = min( (k), y),
˜ (k) = max( (k), y),
holds. The aining da a consis s o da a se s and y,
hus con ains he o iginal, unmodi ied e e ence alues o
ain e e ences ou side he bounds and lea n cons ain
sa is ac ion by he ne wo k. No e ha he dis inc ion be ween
and ˜ is no possible when using he con ol e o e= −y
as ea u e inpu ins ead o independen da a se s and y,
since econ ains ela i e in o ma ion only. The di e en com-
bina ions o e e ences, as well as he dis inc ion be ween
con ol o he plan model and he eal plan , a e summa ized
in Fig. 5. The inpu alues, i.e., he pump speed and he
al e opening, a e bo h scaled o a ange om 0 o 100%,
which hus de ine he lowe and uppe bounds on u(k)as
in (2 ). Con ol and p edic ion ho izons we e bo h chosen o
N= 5. The weigh ing ma ices on ou pu s, inpu s, and slack
a iables ha e he ob ious dimensions. They we e uned such
ha he NMPC leads o he desi ed con ol pe o mance and
ead
Q=1040
0 1, R =0.25 0
0 0.25, S = 105.
The EKF was implemen ed using a Gaussian whi e noise
co a iance ma ix o he p ocess noise as well as o he
measu emen noise
QEKF = 10 ·I3×3, REKF = 0.01 ·I2×2.
C. NARX aining and embedded implemen a ion
We implemen ed he NARX s uc u e in Ke as and applied
he non-no malized aining da a gene a ed by he NMPC
as ou lined in Sec. III-B. T aining was pe o med wi h he
simula ion
EKF
NMPC
plan
model
EKF
NMPC
NARX
eal
plan
eal
plan
e alua ion
NARX
aining
∈ ,
∈ min ,
max
∈ min ,
max
Fig. 5. The aining da a o he NARX was gene a ed om a simula ion
un o he NMPC (+EKF), whe e he e e ences we e in e nally kep wi hin
he limi s ˜ ∈[y, ¯y], while a la ge e e ence se ∈[ min, max]was
used as ea u e inpu o he NARX, as well as o he e alua ion.
Fig. 6. Le : T aining da a wi h s eady-s a e plan ou pu s yand e e ences
as a esul o he NMPC con ol. Righ : Pe o mance h oughou he aining.
NADAM sol e , a ba ch size o 32 and he mean squa ed
e o (mse) as loss me ic. Figu e 6 depic s he aining da a
se in he le diag am, whe e only he s eady s a e alues
om he 5 hou da a se a e plo ed. The NMPC con ols
he plan wi hin he cons ained ope a ing a ea, while he
e e ences a e delibe a ely chosen om a la ge , andom
se , o an e icien aining o cons ain sa is ac ion.
The igh diag am in Fig. 6 depic s he aining p og ess
wi h he mse as loss measu e o e he aining epochs. We
s opped he aining a e 200 epochs since he pe o mance
s alled a an mse = 0.6045.
We expo ed he ained ne wo k pa ame e s om Ke as
in o a Py hon sc ip and an Mic opy hon on he ESP32 wi h
a cycle ime o TS o e alua e he ne wo k as con olle .
IV. RESULTS
We implemen ed he NMPC in Ma lab / Simulink and used
an OPC connec ion o he PLC o exchange measu emen s
and con ol ac ions wi h he plan . The sampling imes o
he NMPC and NARX e alua ion equal he sampling ime
o he plan model TS. The NARX-based con olle on he
ESP32 mic ocon olle was connec ed ia an analog in e ace
o Ma lab / Simulink and om he e o he PLC (c . Fig. 3),
which only se ed as an in e ace o he eal plan . This
allowed us o use Ma lab / Simulink o da a logging o
bo h con olle s.
A. Time se ies esul s
Figu e 7 depic s he ime se ies esul s o bo h con olle s
a he eal plan . The uppe wo diag ams depic he plan
ou pu s pand q, espec i ely, plo ed oge he wi h he
espec i e e e ence alues and he bounds om (6). The
lowe wo diag ams depic he plan inpu s nand .
As du ing he aining, we again delibe a ely chose e -
e ences ha iola e he bounds om (6), o demons a e
he cons ain sa is ac ion abili y o he neu al ne wo k. I
is ob ious om he uppe wo diag ams in Fig. 7 ha
bo h, he NMPC and he NARX, espec he cons ain s.
Howe e , he NMPC allows some o se iola ion due o he
slack a iable (see Sec. II-A). Since he NMPC used only
admissible e e ences ˜ du ing aining da a gene a ion ( o
Fig. 7. Time se ies esul s o a 25 minu e closed-loop con ol wi h NMPC
and NARX a he eal plan . The e e ences a e pand q o p essu e and
low a e, espec i ely.
no igge cons ain so ening, c . Fig. 5), he NARX con ol
ac ually espec s he limi s mo e s ic ly han he NMPC
con ol. The gene al con ol quali y is su icien o bo h
con olle s. The NARX con olle shows a sligh ly highe
s eady-s a e o se .
Table II summa izes he quan i a i e con ol quali y. We
use he mean squa ed e o
mse := K−1X
K
( (k)−y(k)) ◦( (k)−y(k)) ,
whe e ◦deno es he elemen wise p oduc , o e K= 1600
samples be ween = 600s and = 1400s (c . Fig. 7), i.e.
excluding he (delibe a e) e e ences ou side he cons ain s.
Table II also lis s he maximal absolu e cons ain iola ion
max(|(y−¯y)|,∀y > ¯y, |(y−y)|,∀y < y). The numbe s in
pa en hesis a e ela i e o he maximal plan ope a ing alues
max(p)=0.5ba and max(q) = 80 l/min.
The quan i a i e measu es unde line he obse a ions om
he ime se ies esul s in Fig. 7, namely ha he e e ence
acking is compa able be ween bo h con ol a ian s, bu he
cons ain sa is ac ion is be e wi h he NARX-based con ol.
Figu e 8 depic s a ime se ies o a dis u bance ejec ion
es , whe e we con on ed bo h con olle s wi h unmeasu ed
dis u bances on he wo plan inpu s. The ligh e g ay ba s
TABLE II
QUANTITATIVE CONTROL QUALITY MEASURES.
a ian a iable mse max. iola ion
NARX p4.96 ·10−4(0.1%) 0.0053 (1.1%)
q16.55 (16.5%) 0.684 (0.85%)
NMPC p2.32 ·10−4(0.05%) 0.03 (6.4%)
q16.12 (20.16%) 3.3 (4.11%)
ma k imespans whe e nis dis u bed by +10% o he i s
ba , ollowed by −10% o he second ba . The ollowing
da ke g ay ba ma ks a imespan whe e he al e was
dis u bed by +10%.
Bo h con olle s eac in a desi ed way by educing he
dis u bance, howe e , bo h ail o ejec i comple ely. Fo he
NMPC, he plan -model misma ch inc eases signi ican ly due
o he unmeasu ed dis u bance, leading o alse p edic ions o
he ajec o y and an unde -compensa ion o he dis u bance.
The cons ain iola ion du ing he second dis u bance ( o
∈[90,120]) leads o a mo e igo ous con ol ac ion o he
NMPC.
Fo he NARX-based con ol, he dis u bance ejec ion is
compa able o he NMPC esul s. This is ema kable because
i demons a es ha he neu al ne wo k was able o adap
he NMPC con olle beha io ins ead o jus memo izing
con ol ac ions, since he dis u bances we e no pa o he
aining da a.
Fig. 8. Time se ies o he dis u bance ejec ion es o bo h con ol a ian s.
Du ing he imespans ma ked by a ligh g ay colo ba he pump speed n
was dis u bed by +10% and −10% (in ha o de ), and du ing he imespan
ma ked by a da ke g ay ba he al e opening was dis u bed by +10%.
Fig. 9. P o iling esul s eco ded du ing he es un om Fig. 7. A boxplo
is included o bo h measu emen s, whe e he boxes co e 75% o he da a,
he whiske s co e 99.3%, and he magen a c osses ma k he emaining
da a poin s as ou lie s.
B. P o iling
The wo objec i es o he NARX-based con ol a e o
educe he compu a ional e o and o p o ide a s ic eal-
ime gua an ee. We quan i ied hese wi h a p o iling du ing
he con olle e alua ion om Fig. 7. The p o iling esul s a e
depic ed in Fig. 9. The NPMC was e alua ed on a s anda d
PC wi h a 3.20 GHz CPU, while he NARX was e alua ed
on he ESP32 se o 240 MHz.
We s ess he e alua ion imes a e no scaled by, o
weig hed wi h, he CPU equencies. Despi e i s d as ically
lowe CPU equency, he NARX e alua ion on he ESP32
ou pe o ms he NMPC e alua ion on he PC, eaching nea ly
a ac o o 10. Bo h a ian s s ay wi hin he sampling ime o
TS= 0.5s, howe e , he NMPC shows highe luc ua ions in
he e alua ion ime which sugges s o keep a g ea e ma gin
o he cycle ime o no ail in upda ing he con ol ac ion.
The NARX-based con ol uns wi h e y cons an e alua ion
ime, making i a o able o eal- ime condi ions.
V. CONCLUSIONS
We ou lined he mimicking o a nonlinea model p edic i e
con olle by a small-scale au o eg essi e neu al ne wo k
wi h he aim o e icien eal- ime implemen a ion on a
low le el ha dwa e. The esul s demons a e a compa able
con ol quali y be ween bo h, he compu a ionally expensi e
NMPC and he compu a ionally much cheape NARX-based
con olle , when applied o a hyd aulic plan . Rema kably,
he small-scale neu al ne wo k was able o lea n he NMPC
beha io ins ead o memo izing he con ol ac ions, as
demons a ed by he ejec ion o unmeasu ed dis u bances.
Mo eo e , he NARX-based con olle inhe i s a ce ain
deg ee o cons ain sa is ac ion, again compa able o he
NMPC.
REFERENCES
[1] D. Q. Mayne, J. B. Rawlings, C. V. Rao, and P. O. Scokae ,
“Cons ained model p edic i e con ol: S abili y and op imali y,” Au-
oma ica, ol. 36, no. 6, pp. 789–814, 2000.
[2] L. G ¨
une and J. Pannek, Nonlinea model p edic i e con ol. Sp inge ,
2017.
[3] M. Diehl, R. Findeisen, F. Allg¨
owe , H. Bock, and J. Schl¨
ode ,
“Nominal s abili y o eal- ime i e a ion scheme o nonlinea model
p edic i e con ol,” IEE P oceedings-Con ol Theo y and Applica ions,
ol. 152, no. 3, pp. 296–308, 2005.
[4] T. A. Johansen, “App oxima e explici eceding ho izon con ol o
cons ained nonlinea sys ems,” Au oma ica, ol. 40, pp. 293–300,
2004.
[5] R. Dy ska and M. M¨
onnigmann, “Accele a ing nonlinea model p e-
dic i e con ol by cons ain emo al,” in P oc. o he 7 h IFAC
Con e ence on Nonlinea Model P edic i e Con ol, 2021, pp. 278–
283.
[6] R. Qui ynen, K. Be n o p, and S. Di Cai ano, “Embedded op imiza ion
algo i hms o s ee ing in au onomous ehicles based on nonlinea
model p edic i e con ol,” in 2018 Annual Ame ican Con ol Con e -
ence (ACC). IEEE, 2018, pp. 3251–3256.
[7] S. Adhau, S. Pa il, D. Ingole, and D. Sonawane, “Implemen a ion and
analysis o nonlinea model p edic i e con olle on embedded sys ems
o eal- ime applica ions,” in 2019 18 h Eu opean Con ol Con e ence
(ECC). IEEE, 2019, pp. 3359–3364.
[8] A. Raha, A. Chak aba y, V. Raghuna han, and G. T. Buzza d, “Em-
bedding app oxima e nonlinea model p edic i e con ol a ul ahigh
speed and ex emely low powe ,” IEEE T ansac ions on Con ol
Sys ems Technology, ol. 28, no. 3, pp. 1092–1099, 2019.
[9] L. Hewing, K. P. Wabe sich, M. Menne , and M. N. Zeilinge ,
“Lea ning-based model p edic i e con ol: Towa d sa e lea ning in
con ol,” Annual Re iew o Con ol, Robo ics, and Au onomous Sys-
ems, ol. 3, pp. 269–296, 2020.
[10] K. P. Wabe sich and M. N. Zeilinge , “Linea model p edic i e sa e y
ce i ica ion o lea ning-based con ol,” in 2018 IEEE Con e ence on
Decision and Con ol (CDC). IEEE, 2018, pp. 7130–7135.
[11] M. Klauˇ
co, M. Kal´
uz, and M. K asnica, “Machine lea ning-based
wa m s a ing o ac i e se me hods in embedded model p edic i e
con ol,” Enginee ing Applica ions o A i icial In elligence, ol. 77,
pp. 1–8, 2019.
[12] A. Domahidi, M. N. Zeilinge , M. Mo a i, and C. N. Jones, “Lea ning
a easible and s abilizing explici model p edic i e con ol law by
obus op imiza ion,” in 2011 50 h IEEE con e ence on decision and
con ol and Eu opean con ol con e ence. IEEE, 2011, pp. 513–519.
[13] S. Chen, K. Saulnie , N. A anaso , D. D. Lee, V. Kuma , G. J.
Pappas, and M. Mo a i, “App oxima ing explici model p edic i e
con ol using cons ained neu al ne wo ks,” in 2018 Annual Ame ican
con ol con e ence (ACC). IEEE, 2018, pp. 1520–1527.
[14] K. Kiˇ
s, M. Klauˇ
co, and M. K asnica, “Explici MPC in he o m o
spa se neu al ne wo ks,” in 2021 23 d In e na ional Con e ence on
P ocess Con ol (PC). IEEE, 2021, pp. 163–168.
[15] Y. L¨
oh , M. M¨
onnigmann, M. Klauˇ
co, and M. Kal´
uz, “Mimicking
p edic i e con ol wi h neu al ne wo ks in domes ic hea ing sys ems,”
in 2019 22nd In e na ional Con e ence on P ocess Con ol (PC19).
IEEE, 2019, pp. 19–24.
[16] Y. L¨
oh , M. Klauˇ
co, M. Fika , and M. M¨
onnigmann, “Machine lea n-
ing assis ed solu ions o mixed in ege mpc on embedded pla o ms,”
IFAC-Pape sOnLine, ol. 53, no. 2, pp. 5195–5200, 2020.
[17] J. D goˇ
na, D. Pica d, M. K asnica, and L. Helsen, “App oxima e
model p edic i e building con ol ia machine lea ning,” Applied
Ene gy, ol. 218, pp. 199–216, 2018.
[18] S. Lucia, D. Na a o, B. Ka g, H. Sa nago, and O. Lucia, “Deep
lea ning-based model p edic i e con ol o esonan powe con e -
e s,” IEEE T ansac ions on Indus ial In o ma ics, ol. 17, no. 1, pp.
409–420, 2021.
[19] K. S. Na end a and K. Pa hasa a hy, “Lea ning au oma a app oach o
hie a chical mul iobjec i e analysis,” IEEE T ansac ions on Sys ems,
Man, and Cybe ne ics, ol. 21, no. 1, pp. 263–272, 1991.
[20] M. Mohammed and M. E. A. Mohamed, “Con ol o e e se osmosis
p ocess a a b ackish wa e desalina ion s a ion,” in In e na ional
Con e ence on Elec ical Sys ems & Au oma ion. Sp inge , 2022,
pp. 143–154.
[21] S. Leonow, F. Wollenhaup , and M. M¨
onnigmann, “Combined low and
p essu e con ol o indus ial pumps wi h simple adap i e MPC,” in
P oceedings o he 21s In e na ional Con e ence on P ocess Con ol
(PC17), High Ta as, 2017, pp. 315–320.
[22] J. F. G¨
ulich, Cen i ugal pumps. Sp inge , 2010, ol. 2.