Embedded predictive control for fast mechatronic
systems
Mohammad Abdollahpouri
Slovak University of Technology in Bratislava
Supervisor and co-supervisor:Prof. Boris Rohal-Ilkiv and Prof. Tor-arne Johansen
November 28, 2015
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 1 / 17
Overview
1 Introduction
2 Application studyToward embedded MHE and NMPCMHE vs. EKF for a vibrating cantilever beamNonlinear vibration systemPIL simulation for vibration energy harvesting
3 Theoretical studyTransforming non-convex problem to convexMulti-stage global estimation
4 Future career
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 2 / 17
Introduction
Motivation
Title: Embedded MPC for Control of Fast Mechatronic Systems
Real-time implementation using embedded platformsSolving non-convex problemsImplement the method for systems with fast dynamics
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 3 / 17
Introduction
Embedded systems
Micro-processor/controller
Low cost design
Reliability
InaccessibleSafety reasonsCosts a lot
Small size
Low energy consumption
Design for speci�c tasks
Real-time constraint
Possibility to become mobile
SoC with peripherals �DAC,ADC,USB,I2C,SPI,. . .
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 4 / 17
Application study Toward embedded MHE and NMPC
NMPC+MHE for Pendubot system
The system dynamics is nonlinear with fast dynamics
So-called RTI scheme was employed
minxp.q,up.q
» T0
�}xptq � xref ptq}
2
Q � }uptq � uref ptq}
2
R
dt
� }xpT q � xref pT q}2
P
s.t. 9xptq � fpxptq, uptq, b̂q,
xptq P X, xpT q P XT ,uptq P U, xp0q � x̂0.
where b̂ is the viscous friction coe�cients estimates
l1
x
y
0
g
lc1
l 2
l c2
q1
q2
τ1
m1,I1
m2,I2
active jointpassive jointcenter of m
The NMPC+MHE approach has been veri�ed in real time usingACADO Code Generation Tool (presented at 5th IFAC NMPC1)
1�Real-Time MHE-Based Nonlinear MPC of a Pendubot System�, Gulan, M.,Salaj, M., Abdollahpouri, M. and Roha©-Ilkiv, B., In Proceedings of the 5th IFACNonlinear Model Predictive Control Conference, Seville, Spain,2015.
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 5 / 17
Application study Toward embedded MHE and NMPC
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 6 / 17
Application study MHE vs. EKF for a vibrating cantilever beam
Cantilever vibrating beam setup
For small de�ection, dynamics are considered linear
:qptq � 2ζωn 9qptq � ω2nqptq � αuptq,
Parameters are assumed constant.The joint parameter and state estimation deals with nonlinear dynamics.
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 7 / 17
Application study MHE vs. EKF for a vibrating cantilever beam
Joint state and parameter MHE 2
Real-time implementation of MHE on Raspberry pi model B
Comparison study with standard EKF
Fault/Noise tolerant investigation of estimatorsEmulated structural change by adding weightExecution time analysis
xPC Cantilever beam
PCF8591RP
Measure
ment
PRBS
AI
DO
AI
DI
Fault
em
ula
tion
2Abdollahpouri, M., Takács, G., Roha©-Ilkiv, B. (2015). Real-time movinghorizon parameter estimation for a vibrating active cantilever. Submitted toMechatronics.
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 8 / 17
Application study MHE vs. EKF for a vibrating cantilever beam
Fault analysis on parameter estimation0 10 20 30 40 50
−3
−2
−1
0
1
2
3x 10
−3
Posi
tion (
m)
Time (sec)
0 1 2 3 4 50
10
20
30
40
50
60
70
Input
(V)
Time (sec)
0 10 20 30 40 50−0.5
−0.4
−0.3
−0.2
−0.1
0
0.1
0.2
0.3
0.4
0.5
Time (sec)
Vel
oci
ty (
m/s
ec)
Calculated
MHE
EKF
0 10 20 30 40 500
20
40
60
80
100
120
140
❫✦♥
✭r❛❞✴s❡❝✮
Time (sec)
0 10 20 30 40 500
1
2
3
4
5
6
Time (sec)
❫ ✾✭✲✮
0 10 20 30 40 50−0.02
−0.01
0
0.01
0.02
0.03
0.04
Time (sec)
❫ ✱
✭◆
✴❱
❦❣
✮
MHE
EKF
Measured
MHE
Measured
MHE
EKF
MHE
EKF
MHE
EKF
Figure: E�ects of sensor faults
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 9 / 17
Application study MHE vs. EKF for a vibrating cantilever beam
Noise analysis on parameter estimation
0 5 10 15 20 25 30 35 40 45 500
20
40
60
80
100
120
❫✦♥
✭r❛❞✴s❡❝✮
Time (sec)
0 5 10 15 20 25 30 35 40 45 500.001
1
2
3
❫ ✾✭✲✮
Time (sec)
0 5 10 15 20 25 30 35 40 45 50−0.015
−0.01
−0.005
0
0.005
0.01
0.015
0.02
❫ ✱
✭◆
✴❱
❦❣
✮
Time (sec)
MHE with Gaussian noise
EKF with Gaussian noise
MHE with uniform noise
EKF with uniform noise
Figure: Parameter estimation with additive measurement noise
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 10 / 17
Application study Nonlinear vibration system
Why nonlinear vibration system?
Needs to be implemented on embedded platform
Double applications � vibration control and energy harvestingState estimation and Nonlinear MPC
Nonlinear vibration attenuationVibration energy harvesting
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 11 / 17
Application study Nonlinear vibration system
Vibration energy harvesting
Mechanical strain energy Ñ electrical charge
Power is on the order of milliwatts
Battery-less wireless sensors
System dynamics represented by
rC1ppq � C2ppqq2s:q � C2ppqq 9q � rC3ppq � C4q
2sq�
C5v � C6q2v � C7ppq :u,
C8ppq 9v � C9ppqv � C5 9q � C6q29q � 0,
where p is time varying parameter, v is voltageacross the piezoelectric layer and q is displace-ment of the free end.
Chaotic behavior (Du�ng oscillator)
Find the varying parameters to maximize theharvested energy
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 12 / 17
Application study PIL simulation for vibration energy harvesting
Toward nonlinear vibration system 3
Processor in the loop simulationChaotic behaviorTime-varying parameter need to be estimated
TCP/IP
PCF8591
Raspberry Pi
target PChost PC
Simulink Real-Time REAL-TIME SIMULATION
EMBEDDED COMPUTING PLATFORM
AI/AO
DI/
DO
Figure: Estimated and true phase plane
3�Towards the Implementation of Embedded MHE for a Nonlinear VibrationEnergy Harvesting System�,Abdollahpouri, M. and et. al., submitted to ECC16.
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 13 / 17
Theoretical study Transforming non-convex problem to convex
A convexity-based homotopy for NMPC 4
Original control-a�ne process model for t P r0, T s
OCP : minxp.q,up.q
» T0
}xptq � xref ptq}2
Qdt� }xpT q � xref pT q}
2
QT:� }x� xref }
2
J
s.t. 9xptq � fpxptqq � gpxptqquptq,
xptq P X, xpT q P XT ,uptq P U, xp0q � x0.
A homotopy formulation with a pseudo state xc and a parameterλ P p0, 1q
P pλq : minxp.q,up.q,xcp.q
1
λ}x� xref }
2
J �1
1� λ}xc � x}
2J
s.t. 9xcptq � fpxptqq � gpxptqquptq,
xcptq P X, xcpT q P XT ,uptq P U, xcp0q � x0.
4Bonilla, J., Diehl, M., Logist, F., De Moor, B., and Van Impe, J. F. (2010). Aconvexity-based homotopy method for nonlinear optimization in model predictive control.Optimal Control Applications and Methods, 31(5), 393-414.
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 14 / 17
Theoretical study Transforming non-convex problem to convex
Cont.
λÑ 1, P pλq Ñ OCP and λÑ 0, P pλq Ñ CVX
CVXpλq : minup.q,xcp.q
}xc � xref }
2
J
s.t. 9xcptq � fpxref ptqq � gpxref ptqquptq,
xcptq P X, xcpT q P XT ,uptq P U, xcp0q � x0.
Extension of the method to PEP
PEP : minxp.q,p
}x� xm}2J
s.t. 9xptq � fpxptq, umptqq � gpxptq, umptqqp,
xptq P X,p P P.
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 15 / 17
Theoretical study Multi-stage global estimation
Redundant measurement can leads to LTV
Algebraic nonlinear transformation Ñ LTV model
Example: Let the nonlinear dynamics be 9x � v, 9v � �v2 � u and letd � v2 Ñ 9x � v, 9v � �d� u, 9d � �2 9vv � �2av
1st estimation is based on LTV model Ñ sub-optimal estimate2nd estimation using linearized model Ñ more accurate estimate
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 16 / 17
Future career
Impact of TEMPO on future
What we have learned/will learn...
Summer/Spring schoolsInternational conferences � Industrial sessionAutomotive Embedded Control Workshop in RenaultProfessional development and complementary skills workshop
International cooperation and building relationsBeing introduced to companiesDoes TEMPO have credit worldwide?
�give a man a �sh and you feed him for a day;
teach a man to �sh and you feed him for a lifetime�
Mohammad Abdollahpouri (STUBA) MTR Presentation November 28, 2015 17 / 17
IntroductionApplication studyToward embedded MHE and NMPCMHE vs. EKF for a vibrating cantilever beamNonlinear vibration systemPIL simulation for vibration energy harvesting
Theoretical studyTransforming non-convex problem to convexMulti-stage global estimation
Future career
fd@rm@0: fd@rm@1: