
control input using respectively the GPC and the 
PID controller. 
 
Fig 3. RLC system response (vs(k) solid line and ve(k) dashed 
line) (GPC controller) 
  
Fig 4. GPC control input  
 
 
 
 
 
 
 
 
 
 
 
 
 
Fig 5. RLC system response (vs(k)solid line and ve(k) dashed 
line) (PID controller) 
 
 
 
 
 
 
 
 
Fig 6. PID control input 
In the table below, we compare the performance of 
execution time between PID and GPC controller. 
 
TABLE III. 
 Performance  comparison between GPC and PID Controller 
 PID GPC controller 
Average execution time (μ s)  4.613  532.142 
Based on this table, we note that the computing 
time of the GPC is greater than that of the PID.  
Indeed, the GPC algorithm has several matrix 
resolutions, see Table II.  
The implementation of the PID and the GPC 
controller on STM32 was successful. From the 
experimental results we can see that both 
controllers have a good tracking of the reference 
input. Although the execution time of the PID 
algorithm is less than that of the GPC; the latter has 
the advantage of anticipating the change in the 
reference input and thus acts before it occurs, which 
is not the case of the PID controller. 
 
V. Conclusion 
In this work, we have implemented a PID and a 
GPC controllers on a STM32 microcontroller. The 
IAR embeded workbench was used to load the 
firmware which enables the microcontroller to 
control a second order system. The presented work 
is the first step that enables us to consider in the 
future the control of complex and nonlinear systems 
with the GPC strategy implemented on the STM32 
microcontroller. 
REFERENCES 
[1] E.Aridhi, M. Abbes, A. Mami. “FPGA Implementation of 
Predictive Control”, MELLECON’2012, March 25-28, 
Hammamet Tunisia. 
 [2] K. Watanabet, K. Ikeda, T. Fukuda, S.G. Tzafestas.  
“Adaptive Generalized Predictive Control using A State-Space 
Approach”,IEEE  International Workshop on Intelligent Robots 
and Systems IROS’91, p. 1609-1614, November 3-5, 1991, 
Osaka Japan.  
[3] STMicroelectronics. Datasheet STM32F100, 2009. 
www.st.com  
[4] M. Mathelin and I. Bara. Commande numériques des 
systèmes. Cours, Ecole Nationale Supérieure de Physique de 
Strasbourg, 2ème année, 2007 
[5] J. Ghabi. Synthèse et implémentation sur FPGA de la 
commande prédictive robuste des systèmes linéaires 
multivariables. PhD thesis, Ecole Nationale d’Ingénieurs de 
Monastir, 2010. 
[6] A. Kheriji, F. Bouani, and M. Ksouri, “Efficient 
implementation of constraind robust model predictive control 
using a state space model,” in Proceedings of International 
Conference on Informatics in Control, Automation and Robotics 
(ICINCO), 2010. 
[7] Y. F. Chan, M. Moallem, W. Wang, “Efficient 
implementation of PID control algorithm using FPGA 
technology”, Proceedings of the 43ed IEEE Conference on 
Decision and Control, V5, PP. 4885-4890, Bahamas2004. 
[8] U. R. Y. Jayaraman, “Fpga implementation of predictive 
control strategy for power factor correction,” in Proceedings of 
World Academy of Science, Engineering and Technology, 2008. 
[9] G. Palomo, K. Hilton, and J. Rossiter, “Predictive control 
implementation in a plc using the iec 1131.3 programming 
standard,” in Proceedings of American Control Conference, 
2009. 
[10] G. Pannochia, “Robust model predictive control with 
guaranteed set point tracking,” Journal of Process Control, vol. 
14,pp.927–937, 2004
 
 
978-1-4673-5549-0/13/$31.00 ©2013 IEEE