Positive Feedback control in fractional order model of RC and RL
circuits using ATM32 & Arduino
M.I. Israel Ceron Morales Docente PA Adscrito a la carrera de Ingeniería electrónica del Instituto Tecnológico
Superior de Poza Rica.
M.C. Fernando Rodríguez García, PTC adscrito a la carrera de Ingeniería Electromecánica del ITSSMT.
M.I.A.P.I. Erikssen Aquino Díaz PTC adscrito a la carrera de Ingeniería Electromecánica del ITSSMT.
ABSTRACT
Electronic elements such as capacitors and inductors have been modeled with fractional order
calculus, this paper proposes the use of a control loop with positive feedback, by using this method
two feedback functions are proposed that allow the verification of models with fractional order
calculus. The options allow for the possibility to obtain oscillations and the implementation of these
systems with microcontroller-based development boards.
INTRODUCCIÓN
This document present a control option with positive feedback for the fractional order modelo r RC
and LR corcuits. Gomez-Aguilar [1,2] demonstrated a fractional order model for capacitors and
inductor, in order to obtain results that are closer to experimental data. Hidalgo-Reyes in [3]
updated the mathematical models. As shown by Morales-Delgado [4] models in many have an
analytical solutions, in Reis’ paper [5] fractional order models are applied in digital circuits. Cugnet
[6] applied the fractional order model on the measurement of the resistance of a lead-acid battery.
Nasser-Eddine [7] skip on spectroscopy by the usage of fractional order models. Beiza [8] applied
recursive algorithms to solve fractional order models and in Ceron’s work [9] fractional order
calculus is applied to model the dynamics of manipulator robot arms.
Positive feedback however, presents some challenges as shown in Marinangeli´s (2017) research.
This work intends to apply fractional order models to the RC and LR circuits as well to program
these models plus two controllers on development boards, namely STM32 and Arduino with the
goal to provide a cost effective method that saves on laboratory instrumentation.
DESARROLLO
Backgrond Theory
100CIA TEC
On Fig. 1 we can see the RC and LR circuits this paper´s going to focus on, these circuits
meet the criteria for the traditional mathematical models and are shown in (1) and (2)
respectively.
Both circuits can be condensed in a general model as shown in the equation (3) which is
the proposed fractional order model for these kinds of circuits.
Fig.1. Diagrams for RC and LR circuits a) and b) respectively.
Integer order models for the circuits on Fig. 1a) and Fig. 1b) are (1) and (2).
dV o 1 1
+ V o= V (1)
dt RC RC i
dV o 1 1
+ V o= V (2)
dt RC RC i
This paper proposes a general fractional order model for both circuits.
dV o 1 1
+ V = V (3)
dt RC o RC i
Where K=1/RC is for the RC circuit and K=R/L is for LR circuit.
Employing Laplace´s transform in (3) we obtain the diagram block show non Fig 2.
Fig.2. Block diagram of the general fractional order model for the circuits RC and LR,
Fig. 3 Positive feedback loop for fractional order model of the RC and LR circuits.
100CIA TEC
In Krishna’s work [10] the approximation for the fractional order model are (4) and (5).
μ AS+1
S= (4)
S+A
μ AS+1
S= (5)
S+A
To Laplace’s transfor (3) we substitute (4) and we obtain (5).
dV o K d V i KA KA Vo
= + V i− V o−
dt A+ K dt A+ K A +K A +K
Thus, the constant input is (7).
V i=C (7)
Substituting (7) in (6) and simplifying it we get (8).
dV o KA KA Vo
= V i− V o−
dt A+ K A +K A+K
Lyapunov’s candidate function is (9).
1 2
v= V o (9)
2
Differentiating (9) with regards to time and substituting it in (8) we obtain (10).
KAC KA 2 V 2o
V − V − <0 (10)
A + K o A + K o A+ K
Applying the approximation (11).
C=V o (11)
Substituting (11) in (10) and simplifying with algebra we finally obtain Lyapunov’s
demostrations of stability as long as the criteria for stability shown in (12) are met.
μ<1 (12)
II. POSITIVE FEEDBACK CONTROL
In this work a control with positive feedback is proposed, in [11] this type of control is
applied.
The diagrams are presented using operational amplifiers.
A. First positive control feedback
Parting from the diagram shown in Fig. 3 we get (13)
100CIA TEC
Vo K
= μ (13)
V i S + K (1−H (s ))
If H(s) is a constant then we get (14).
1
H ( s )= (14)
KA
The schematic corresponding ti the propose cintrol in (14) is shown in Fig. 4.
Fig. 4 Control diagram with operational amplifiers for the RC circuit.
Fig. 5 Control diagram with operational amplifiers for the LR circuit
B. Second positive control feefback
The second positive control feedback is shown in (15).
1
H ( s )=−S2 + S μ (15)
k
Substituting (15) in (13).
N 2 R x C x R y C y S V o ( P0 S + P1 S+ P2 ) V o V o
2 2
V i= + +
N1 N 1 ( Q 0 S +Q 1 S+Q2 ) N 1
2
Where the constant in terms of elements of the diagram are shown in (17-25).
100CIA TEC
R2 ( R3 + R4 )
N 1=
( R 1 + R 2 ) R3
R4 R6 ( R7 + R 8 )
N 2=
( R 5 + R 6 ) R 7 R3
R4 R8
N 3=
R3 R7
A Rb C b
P0= −N 3 Rf a C a
K
Rb Cb A Rb N 3 Rf a
P 1= + − − A N 3 Rf a C a
K K Rf b Ra
Rb A N 3 Rf a
P2= −
K Rf b Ra
Q0=R b C b
Rb
Q 1 = A Rb C b+
Rf b
A Rb
Q 2=
Rf b
The Expected resonant circuit expected is shown in Fig. 6.
Fig. 6 Diagram of a positive feedback loop of the second proposal for the fractional order model of
RC and LR circuits.
C. Development boards STM32 and Arduino
100CIA TEC
In Order to present a low cost alternative. This paper has used two popular development
boards among engineering students, namely the STM32L476RG NUCLEO board which
includes an Analog-to-Digital converter with two outputs through an operational amplifier,
and the well known Arduino board.
The STM32 board allows its use as a signal generator, in this case forinput of
constant voltaje and the Arduino board is used to view analog signals like an oscilloscope.
The STM32L476RG NUCLEO board can generate analog sidnals due to its 12-bits
DAC converter, it’s used to generate the set-point of the diagram shown in Figures 4,5 and
6. The Arduino board includes a software that contains a Serial monitor which we can use
to visualize analog signals.
The programming of these development boards is done through programming code
similar to C, hence it’s not necessary present a detailed tutorial on programming
lanfguages in this work, however it’s necessary to mention that the difference equiations
are recursive and it’s not needed to use real time operative systems (RTOS).
Finnally, the STM32L$/&RG board requires two software program, namely STM32CubeMx
and Keil U Vision, Although there exists the possibility of programming in MBED, and
online platform and in regards to the Arduino board it is programmed in its corresponding
software.
RESULTS
This section shows the results taking in consideration experimental data the
following parameters in mind; Resistance R=15110 Ohmsm Capacitor C=0.00331 Farads,
the sampling period is T=0.1 Seconds, the fractrion is μ=0.9945 and the set point is
V_i=1.22 volts.
Fig. 7 Experimental data for the RC circuit along the traditional and fractional models.
Some numerical values of the experimental data can be show non table 1. We can see
differences on the numerical values.
TABLE I
EXPERIMENTAL DATA
Vi Vo Vo Vo
Time
Set-Point Traditional Experimental Fractional
[Seg.]
[volts] [volts] [volts] [volts]
0 0.0000 0.0000 0.0000 0.0000
0.1 1.2200 0.0242 0.0099 0.0249
0.2 1.2200 0.0480 0.0395 0.0487
0.3 1.2200 0.0713 0.0593 0.0720
0.4 1.2200 0.0942 0.0790 0.0948
100CIA TEC
0.5 1.2200 0.1166 0.1037 0.1171
0.6 1.2200 0.1387 0.1334 0.1391
50.0 1.2200 1.2200 1.2026 1.2009
Some graphs with experimental data are shown, such as Fig. 8, where the Resistances R_a, R_b,
R_1 and 〖Rf〗_1 take three values as shown in the picture.
Fig. 8 Diagrams of feedback control for RC circuit
Fig. 9 Experimental data of the RC circuit from diagram in Fig. 4.
Fig. 10 Diagrams of second control proposal fractional order model for RC-LR.
100CIA TEC
Fig. 11 Photograph showing an experimental assembly for RC-LR circuits.
IV. CONCLUSIONS
The results allows us to conclude that the RC and LR circuits present a fractional order
model with a better approximation of the data compared to traditional integer order models.
The implementation of analog circuits with operational amplifiers is hard due to the fact that
the values of the elements aren’t exactly the same as the ones used in simulations.
The implementation with development boards is faster and easier due to the ease of
reconfiguration through coding, we junt need to take into account the fact that the voltajes needed
to use the STM32 boards is 3.3 volts to generate analog signals and in the case of Arduino it needs
5 volts plus development boards don’t have an option for symmetrical voltaje when handling analog
signals.
ACKNOWLEDGMENT
The authors thank the institutions for supporting this Project.
REFERENCES
[1] Goméz-Aguilar, J.F., Rosales-García, J., Razo-Hernández, J. R. and Guía
Calderón, M., “Fractional RC and LC Electrical Circuits”, Ingenieria Investigacion y
tecnologia, vol. 15, pages. 311–319, 2015.
[2] Gómez-Aguilar J.F., Yépez-Martínez H., Escobar-Jiménez R.F., Astorga-Zaragoza
C.M., Reyes-Reyes J.. “Analytical and numerical solutions of electrical circuits described by
fractional derivatives”. Applied Mathematical Modelling. Volume 40, Issues 21-22, Pages
9079-9094, 2016.
[3] Hidalgo-Reyes J.I., Gómez-Aguilar J.F., Escobar-Jiménez R.F., Alvarado-Martínez
V.M., López-López M.G., “Classical and fractional-order modeling of equivalent electrical
circuits for supercapacitors and batteries, energy management strategies for hybrid
systems and methods for the state of charge stimation: A state of the art review”.
Microelectronics Journal. Volume 85, Pages 109-128, 2019.
[4] Morales-Delgado V.F., Gómez-Aguilar J.F., Taneco-Hernandez M.A., “Analytical
solutions of electrical circuits described by fractional conformable derivatives in Liouville-
Caputo sense”. AEU – International Journal of Electronics and Communications. Volume
85, Pages 108-117, 2018.
[5] Reis C., Tenreiro Machado J.A., Boaventura Cunha J., Figueiredo L.,
“FRACTIONAL-ORDER EVOLUTIONARY DESIGN OF DIGITAL CIRCUITS”. IFAC
Proceedings Volumes. Volume 39, Issue 11, Pages 420-425, 2006.
[6] Cugnet M., Sabatier J., Laruelle S., Grugeon S., Chanteur I., Sahut B., Oustaloup A.
Tarascon Jean-Marie., “Fractional order model validation for the lead-acid battery
resistance estimation: application to cranking capability”. IFAC Proceedings Volumes.
Volume 42, Issue 8, Pages 558-563, 2009.
[7] Nasser-Eddine A., Huard B., Gabano Jean-Denis, Poinot T., “A two steps method
for electrochemical impedance modeling using fractional order system in time and
100CIA TEC
frequency domains”. Control Engineering Practice. Volume 86, Pages 96-104, 2019.
[8] Beyza Ahlatcioglu Ozkuk. “An iterative algorithm to solve a linear fractional
programming problem”. Computers & Industrial Engineering. Volume 140. 2020.
[9] Ceron.Morales I., “Fractional Ordel model and fractional order control for 1, 2 & 3
DOF robot arm in STM32L476 development board”. Memorias del Congreso Nacional de
Control Automático, Asociación México de control Automático, Puebla, México, 2019.
[10] Krishna B.T., “Studies on fractional order differentiators and integrators: A Survey”.
Signal Processing. Volume 91, Pages 386-426, 2011.
100CIA TEC