![MathJax Logo](/templates/jsp/_style2/_tandf/pb2/images/math-jax.gif)
ABSTRACT
The controller is present in at least 90% of industrial applications due to its simplicity and robustness to control linear and non-linear systems. Its main drawbacks include difficulty in achieving proper gains tuning for complex systems and lack of adaptability attributed to its fixed gains when system dynamics change. Despite the emergence of promising controllers like Neural Networks, Fuzzy Logic, Sliding Modes, or Genetic Algorithms, diverse research efforts focus on using these to improve the
rather than replacing it, aiming for either ideal fixed gains or adaptive gains. Nevertheless, while some require system models, training data, rules establishment, extensive iterations, and demanding computational resources, the
and the novel
controller do not. The new seesaw algorithms propose alternative behaviours based on the current error and its derivative, which are dynamic parameters that change over time. These behaviours can be inserted into the
to imbue it with adaptive characteristics, achieving adaptive
(
) controllers with faster signal rise and stabilization times, reduction of the maximum peak, and less error accumulation compared to conventional
.
1. Introduction
The need for adaptability in controllers arises due to the changes experienced by systems. Consider the Segway as an example. During operation, it encounters various changes such as users with distinct physical attributes or changing payloads, diverse terrains, and weather conditions, all affecting its performance. Even natural wear and tear of components alters the system and affects the controller's performance. These examples can be extended to many other controlled systems.
The controller is widely used in the industry (Åström & Hägglund, Citation2001), comprising 90-95% of control applications. including modern applications such as autonomous cars, unmanned aerial vehicles, and autonomous robots (Díaz-Rodríguez et al., Citation2019). This controller, with its three terms, is employed to achieve system stability and to decrease steady-state error (Johnson et al., Citation2005), addressing both transient and steady-state responses. Due to its structure, easy implementation, and maintenance (Åström & Hägglund, Citation2001), it offers simple and efficient solutions to many control problems. However, each term of the
has a fixed gain without dynamics, making it unresponsive to changes. As a result, proper gain tuning is crucial for optimal performance (Ang et al., Citation2005; Johnson et al., Citation2005). However, even when tuned to withstand some variations, the
lacks adaptability.
Adaptive features in control algorithms aim to improve controller performance in response to system changes. This has led research efforts to combine PID controllers with other strategies (Swarnkar et al., Citation2014), either to achieve optimal PID gain tuning or to develop adaptive PID controllers (APIDs) with dynamic PID gains.
Noordin et al. (Citation2023) developed an that combines Sliding Mode Control (
) and Fuzzy Logic (
) for a drone's altitude control, aiming for adaptability to variable loads, achieving a 46% improvement over the
. Its complexity involves a sliding surface proposal, parameters and gains tuning rules, and
rules to mitigate chattering from
.
and
gains were manually adjusted. Zeng et al. (Citation2012) developed an
that combines Neural Networks (
) and
to enhance control against external weather fluctuations in a greenhouse. It involves at least a system model and a Radial Basis Function (
) network to identify and tune the
parameters. It was compared with an optimized
by Genetic Algorithm (
), an offline tuning that provides fixed gains.
requires a mathematical model and multiple iterations involving demanding computational resources. Authors claim that the
has better reference tracking and disturbance rejection. However, the
-optimized
shows better quantitative performance. Han et al. combined
,
,
, and
to achieve an
for vehicle suspension control (Han et al., Citation2022). Diverse control strategies were employed to adjust the system model through data training and parameter optimization. Also, different approaches were used to estimate a dynamic reference and to design a competent
for changing road scenarios. The
had remarkable results; still, the
controller exhibited adequate performance. Wogi et al. (Citation2022) developed an
combining
and
to control an induction motor. The
was compared with a Fuzzy
controller. Both controllers perform very well, although the Fuzzy
is superior. It is worth noting that the
required 49 rules for each
gain, and the inputs for these rules, which consequently establish the control signal, were the error,
, and its derivative,
, which coincidently are vital for the seesaw algorithms. Many other examples can be mentioned regarding adaptive
control (Karanjkar et al., Citation2014; Khan et al., Citation2016; Mahmoodabadi & Safi Jahanshahi, Citation2021; Prabhakar et al., Citation2019; Wang et al., Citation2015).
As can be seen, the label ‘adaptive’ has been used to describe controllers that can adjust their control coefficients in real-time to account for system variations (Swarnkar et al., Citation2014). However, combining two or more controllers can increase complexity in terms of understanding, implementation, and computational demands.
The proposed algorithms can endow controllers with adaptive features, achieving variable gains with dynamic adjustments according to
and
. These adaptive
controllers (
) derived from the new seesaw algorithms, do not require system models, training data, rule establishment, or extensive iterative processes. Since they are based on
, which is well-documented, their implementation and understanding are relatively straightforward, and excessive processing requirements will not be demanded.
The rest of this article is organized as follows: Section 2 provides a visual explanation of the algorithms. Sections 3 and 4 explore the mathematical aspects of the algorithms and their implementation. Section 5 presents the modelling of an inverted pendulum on a cart (IPC), which serves as our test plant. Section 6 presents the necessary code for programming and incorporating the algorithms into the . Section 7 demonstrates the functionality of the algorithms and their implementation into the
for controlling two different plants. Section 8 delves into the results. Section 9 outlines future work directions.
2. Graphic approach
Within a control strategy, the derivative of the error, , can be understood as an estimation of the future behaviour of a system; in this sense, there is a behaviour inherent in the original slope value,
(
), of a signal,
. Seesaw algorithms keep the current instant,
, as a pivot and modify the slope,
, that exists in the control strategy (
control) using
and
. The results thereof will give a new slope value, a new alternative slope,
(
), so that the perpendicularity of
can be manipulated. When
is modified and an alternative derivative,
, is generated, alternative behaviour proposals will be created and can be inserted into
formulation to make the
gains fit to them. This work shows two ways of modifying
from
and
: the MS and LS seesaw algorithms. The MS seesaw algorithm will speed up the approach toward the set point,
, and the LS seesaw algorithm will damp the approach toward the
. Visually, changing from
to
will exhibit a seesaw effect, no matter which algorithm is employed.
2.1. MS seesaw algorithm
From a graphical approach (), consider the current instant, , of the output and the original slope,
. A point,
, is generated over
.
is defined by
.
is the current error and
is a magnitude applied over
; therefore,
is
's magnitude variation over
.
With , another point,
, defined by
, is generated.
is a magnitude applied over the y-axis; therefore,
is
's magnitude variation over the
-axis. With
and the current instant,
, an alternative slope,
, which is different from
, is generated.
converges to the
in less time (). The behaviour that
proposes is manipulated with
and
.
2.2. LS seesaw algorithm
Considering and
, a point,
is generated at the intersection of
and the
. With
, another point,
, defined by
is generated.
is a percentage magnitude (between 0 and 1) applied over the
-axis; therefore,
is a percentage variation of
's magnitude on the
-axis. With
, a
value of less than
is generated (). The behavior that
proposes is manipulated with
.
3. Math formulation: Seesaw algorithms
The procedures of both seesaw algorithms are shown, and for both, the rectangular coordinates of the current instant,
, are established –
– and act as a pivot:
(1)
(1)
3.1. MS seesaw algorithm
The angle corresponding to
at
is calculated:
(2)
(2)
A new vector with polar coordinates is generated; here,
is defined by
and
is defined by
:
(3)
(3)
Polar coordinates are converted to rectangular coordinates
:
(4)
(4)
(5)
(5)
Although it presents magnitude, direction, and sense, the vector is established to not correspond to the position of the current instant,
; the same goes for
.
is added to the rectangular coordinates
to generate a point
over
that is different from
:
(6)
(6)
(7)
(7)
A new point, , is generated from
by the alteration of the
coordinate. This alteration is achieved with the addition or subtraction of
according to
. If
is negative, an addition must be made; if it is positive, a subtraction must be made.
is established to be negative when
exceeds the
, and
is positive if, at that instant,
is below the
.
In the case of addition, when is negative, consider
to be.
(8)
(8)
(9)
(9)
To generate in the case of addition, the slope between points
and
is calculated:
(10)
(10)
In the case of subtraction, when is positive, consider
as
(11)
(11)
(12)
(12)
To generate in the case of subtraction, the slope between points
and
is calculated:
(13)
(13)
3.2. LS seesaw algorithm
The angle corresponding to the
of
is calculated:
(14)
(14)
The rectangular coordinates of the intersection are set to be :
(15)
(15)
The -coordinate of the intersection between
and
is calculated:
(16)
(16)
(17)
(17)
A new point, , is generated from
, altering
:
(18)
(18)
alteration is achieved with the addition of
. The coordinates
are defined as
(19)
(19)
(20)
(20)
Point can be rewritten as
(18)
(18)
To generate , the slope between points
and
is calculated:
(21)
(21)
4. Math formulation: ![](//:0)
control
4.1. Alternative ![](//:0)
![](//:0)
![](//:0)
control (textbook
) is used as the foundation (Johnson et al., Citation2005):
(22)
(22)
where
is the controller output,
is the error
,
is the set point,
is the measured process variable
,
is the proportional gain,
is the integral gain,
is the derivative gain,
is the integral time, and
is the derivative time. All of these are known values.
As shown, it is possible to propose using
and
:
(23)
(23)
Once is generated, only the
term from the
is considered (EquationEq. 2
(2)
(2) 2):
(24)
(24)
from Equation (24) is replaced with
from Equation (23):
(25)
(25)
where
corresponds to a desired behaviour, and the
value acts as a reference target.
from Equation (24) is isolated as an incognita, and
is replaced with the value of
from Equation (25). This calculation results in an alternative gain,
:
(26)
(26)
Equation (26) was developed:
(27)
(27)
varies relative to
and
(
), which are dynamic values;
adapts to changes, but exhibits indeterminacy when
and nullity when
. To avoid indeterminacy, a number,
, is added to the denominator, thereby creating an applicable alternative gain,
:
(28)
(28)
4.2. Adaptive ![](//:0)
![](//:0)
![](//:0)
As is a dynamic value, eventually,
and, consequently,
, so, when nullified, the
gain cannot support control by itself. To avoid nullification and preserve the adaptive dynamics,
is added to
. The sum of
and
forms an adaptive gain,
; however, adding
to
might lead to instability. To avoid instability, a boundary called
is assigned to
as a scale factor:
(29)
(29)
4.3. Adaptive ![](//:0)
gains
replaces
in the
formula. The bounding
is used individually in each term, with
,
, and
:
(22)
(22)
(30)
(30)
(31)
(31)
(32)
(32)
An adaptive or
controller is obtained:
(33)
(33)
5. Test plant
shows a diagram of an IPC.
Here, is the cart's mass,
is the pendulum's mass,
is the pivot,
is the pendulum's length,
is the horizontal axis,
is the driving force, and
is the angle from the vertical
. The position of
is defined by
, and the position of
is defined by
. The system and modelling are based on cited references (Prasad et al., Citation2011; Prasad et al., Citation2012; Prasad et al., Citation2014).
and
are obtained:
(34)
(34)
(35)
(35)
A change in variables is made and the corresponding derivatives are obtained:
(36)
(36)
(37)
(37)
(38)
(38)
(39)
(39)
The variable change is completed:
(40)
(40)
(41)
(41)
6. Programming
In practice, can be replaced with the derivative of the negative process variable:
. It allowed us to avoid a phenomenon known as derivative kick (Johnson et al., Citation2005). Mathematically, since
is constant, its derivative is zero. Considering
, derivation proceeds:
(42)
(42)
To keep track of the already presented theory,
will be used instead of
for all of the following codes.
6.1. MS seesaw algorithm code
The following code must be implemented to increase the slope when the signal is convergent to the :
If
Condition: &
%positive error.
Action:
Output:
Else If
Condition: &
%negative error.
Action:
Output:
Else
Action:
Output:
6.2. LS seesaw algorithm code
The following code must be implemented to decrease the slope when the signal is convergent to the :
If
Condition: &
%positive error.
Action:
Output:
Else If
Condition: &
%negative error.
Action:
Output:
Else
Action:
Output:
6.3. Seesaw algorithms code for ![](//:0)
control
The previous codes are suitable for the visualization of the calculation of . However, when the seesaw algorithms are applied in the
, the very nature of each algorithm must be considered, such as whether it is desired to act at all times of the convergent signal toward the
or in specific intervals. If specific intervals are chosen, it is necessary (when programming) to change the ‘If and else Conditions’ when calculating
. For the plants evaluated in this article, a change in the ‘If and else Conditions’ – (
&
and
&
) – was performed in the MS seesaw algorithm code. Both algorithms can be ‘Conditions’ modified for the calculation of
if appropriate.
6.4. Alternative ![](//:0)
![](//:0)
code
Regardless of the algorithm used for , the following function is used for
:
Function:
6.5. Adaptive ![](//:0)
gain code
To calculate ,
, and
, the following functions are used:
Function:
Function:
Function:
6.6. Controllers structures
shows a comparison between the parallel structure and the proposed
parallel structure.
6.6.1. Parameters tuning
The gains of the controllers used as a base were tuned using the
Tuner of Simulink®. Once these values were obtained, they remained unchanged for the adaptive controllers
and
. The parameters for each algorithm were manually adjusted, following a Model-Based Tuning approach similar to heuristic
tuning:
. Initial adjustment of
and
, followed by a progressive activation and adjustment sequence of
,
, and
.
o
and
. Commencing with a 25/1 ratio, progressively decreasing it to 1/1.
. Initial adjustment of
, followed by a progressive activation and adjustment sequence of
,
, and
.
o
. Commencing with a value of 0.99. It can be increased or decreased within the suggested range between 7 and 0.1.
Progressive activation and adjustment involve setting the limiter to 1 and gradually decreasing the value for enhanced control. The process is repeated for subsequent parameters. If optimal results aren't achieved, readjust the parameters and then the limiters again.
7. Simulation results
7.1. Algorithms demonstrations
In all demonstrations, the ,
, and
values of the corresponding algorithms were graphed, (
is represented as a sine wave). Consider
.
7.1.1. ![](//:0)
generation with MS seesaw algorithm
shows the values from Equations (10) and (13). It merely depicts the static calculation of the alternative slope (
) with the MS seesaw algorithm (for both converging and diverging signals) for positive and negative errors.
7.2. Generic plant control with ![](//:0)
and ![](//:0)
![](//:0)
A transfer function, , is proposed:
(43)
(43)
shows the parameters for the , the
, and the
controllers.
Table 1. Controllers parameters.
shows the responses to a step input (with a value of 1) of the open-loop and -controlled system.
and show the transient and stationary responses to a step input (with a value of 1) of the and the
controllers. shows a quantitative comparison based on standard evaluation metrics obtained from the controller's signals (Abbas & Mustafa, Citation2023; Ogata, Citation2010).
Table 2. Controllers comparison.
shows a slope comparison between the and the
controllers. The
slope shows a more aggressive slope, and the
slope shows a softened one, both correspond to its very nature.
7.3. Equilibrium control of the IPC with ![](//:0)
and ![](//:0)
![](//:0)
shows the system parameters for the IPC.
Table 3. Parameters for the IPC.
The parameters are substituted into Equations (40) and (41).
(40)
(40)
(41)
(41)
Tables and show the parameters of the controllers.
Table 4. Equilibrium control parameters.
Table 5. Position control parameters.
shows the responses of the free system and the equilibrium and position -controlled system. Equilibrium's
was set to 0°, a fully vertical standing, and the position's
was set to 1.
compares the equilibrium control between the and
controllers. shows an equilibrium control quantitative comparison using evaluation metrics for transient and stationary response stages (Abbas & Mustafa, Citation2023; Ogata, Citation2010).
Table 6. Equilibrium control comparison.
shows a slope comparison of the equilibrium control between the and
controllers. The
generates a
value greater than
and The
generates a
value of less than
, which corresponds to its expected functionality.
The use of algorithms for the equilibrium control affected the position control accordingly; graphs the corresponding affectation of each algorithm. show the transient and stationary responses affected by the controllers (Abbas & Mustafa, Citation2023; Ogata, Citation2010).
Table 7. Affected position control comparison.
8. Discussion
The seesaw algorithms focus on convergent signals towards an , adapting to system changes but not necessarily controlling entirely different systems. They build upon a pre-existing
to enhance its functionality.
The MS seesaw algorithm aims to achieve faster response than the original, accelerating signal approximation and facilitating quicker attainment of the . However, it can lead to aggressive behaviour and oscillations rather than stabilization. It's advisable to deactivate it near the
(6.3 Seesaw algorithms code for
control).
The LS seesaw algorithm aims to reduce signal perpendicularity, smoothing its approach to the and mitigating oscillations around it. The maximum
value intended for the LS algorithm was 0.99 (99%). However, it was observed during development that this limit could be exceeded, resulting in significant improvements with values as high as 700%.
Throughout the development of the algorithms, tended to destabilize the system, so minimal values were usually employed, resulting in similar outcomes between using
or
. Despite these experiences, setting
to 0.5 significantly improved the IPC equilibrium control with the
controller. Setting
at the minimum shouldn't be considered a steadfast rule.
For the tested systems, controllers improved all signal rising and settling metrics and diminished maximum peak and error accumulation for both systems, fulfilling its goal and exhibiting its logic. For instance, the
exhibits more oscillations and a longer settling time,
, but a shorter rising time,
, compared to the
. Conversely, the
shows fewer oscillations and a shorter
, but a longer
, than the
.
Based on the ,
,
, and
criteria used for evaluating controllers, the
demonstrated superior performance for both plants. The seesaw algorithms enable the creation of faster and more accurate controllers compared to the
.
9. Future work
The Seesaw algorithms can be applied within a convergent signal, enabling their use concurrently in a single instance.
While it's understandable how changing the emerging parameters from the seesaw algorithms could affect outcomes, exploring tuning methods is essential.
While it's clear how the seesaw algorithms’ emerging parameters can impact results, exploring tuning methods is crucial.
The controllers can be systematically implemented by considering transfer functions from first to higher degrees.
Addressing performance comparisons and combinations with other controllers is crucial. Given that these controllers are
-based, the range of options is extensive.
The MS and LS algorithms provide two methods for proposing a slope. Exploring numerous other approaches could potentially yield better results.
Acknowledgements
The authors acknowledge CONAHCYT for providing a doctoral fellowship and CIDESI for the facilities, equipment, and software provided. Conceptualization, J.P.M.H. and J.C.S.V.; methodology, J.P.M.H.; software, J.P.M.H., C.H.S.S., and J.M.B.F; validation, J.P.M.H., D.M.O., and J.M.B.F.; investigation, J.P.M.H.; original draft preparation, J.P.M.H.; review and editing, J.P.M.H. and J.C.S.V.; supervision, J.C.S.V. All authors have read and agreed to the published version of this manuscript.
Disclosure statement
No potential conflict of interest was reported by the author(s).
References
- Abbas, I. A., & Mustafa, M. K. (2023). A review of adaptive tuning of PID-controller: Optimization techniques and applications. International Journal of Nonlinear Analysis and Applications, 15(2), 29–37. https://doi.org/10.22075/ijnaa.2023.21415.4024
- Ang, K. H., Chong, G., & Li, Y. (2005). PID control system analysis, design, and technology. IEEE Transactions on Control Systems Technology, 13(4), 559–576. https://doi.org/10.1109/TCST.2005.847331
- Åström, K. J., & Hägglund, T. (2001). The future of PID control. Control Engineering Practice, 9(11), 1163–1175. https://doi.org/10.1016/S0967-0661(01)00062-4
- Díaz-Rodríguez, I. D., Han, S., & Bhattacharyya, S. P. (2019). Analytical design of PID controllers. Springer International Publishing. https://doi.org/10.1007/978-3-030-18228-1
- Han, S.-Y., Dong, J.-F., Zhou, J., & Chen, Y.-H. (2022). Adaptive Fuzzy PID control strategy for vehicle active suspension based on road evaluation. Electronics, 11(6), 921. https://doi.org/10.3390/electronics11060921
- Johnson, M. A., Moradi, M. H., & Crowe, J. (2005). PID control: New identification and design methods; probability and its applications. Springer.
- Karanjkar, D. S., Chatterji, S., Kumar, A., & Shimi, S. L. (2014). Fuzzy adaptive proportional-integral-derivative controller with dynamic set-point adjustment for maximum power point tracking in solar photovoltaic system. Systems Science & Control Engineering, 2(1), 562–582. https://doi.org/10.1080/21642583.2014.956267
- Khan, L., Qamar, S., & Khan, U. (2016). Adaptive PID control scheme for full car suspension control. Journal of the Chinese Institute of Engineers, 39(2), 169–185. https://doi.org/10.1080/02533839.2015.1091427
- Mahmoodabadi, M. J., & Safi Jahanshahi, S. (2021). Optimal design of an adaptive robust proportional-integral-derivative controller based upon sliding surfaces for under-actuated dynamical systems. Cogent Engineering, 8(1), 1886738. https://doi.org/10.1080/23311916.2021.1886738
- Noordin, A., Mohd Basri, M. A., & Mohamed, Z. (2023). Real-time implementation of an adaptive PID controller for the quadrotor MAV embedded flight control system. Aerospace, 10(1), 59. https://doi.org/10.3390/aerospace10010059
- Ogata, K. (2010). Modern control engineering. Pearson.
- Prabhakar, G., Selvaperumal, S., & Nedumal Pugazhenthi, P. (2019). Fuzzy PD plus I control-based adaptive cruise control system in simulation and real-time environment. IETE Journal of Research, 65(1), 69–79. https://doi.org/10.1080/03772063.2017.1407269
- Prasad, L. B., Tyagi, B., & Gupta, H. O. (2011). Optimal control of nonlinear inverted pendulum dynamical system with disturbance input using PID controller & LQR. In 2011 IEEE International Conference on Control System, Computing and Engineering (pp 540–545). https://doi.org/10.1109/ICCSCE.2011.6190585.
- Prasad, L. B., Tyagi, B., & Gupta, H. O. (2012). Modelling and simulation for optimal control of nonlinear inverted pendulum dynamical system using PID controller and LQR. In 2012 Sixth Asia Modelling Symposium (pp. 138–143). https://doi.org/10.1109/AMS.2012.21.
- Prasad, L. B., Tyagi, B., & Gupta, H. O. (2014). Optimal control of nonlinear inverted pendulum system using PID controller and LQR: Performance analysis without and with disturbance input. International Journal of Automation and Computing, 11(6), 661–670. https://doi.org/10.1007/s11633-014-0818-1
- Swarnkar, P., Jain, S. K., & Nema, R. K. (2014). Adaptive control schemes for improving the control system dynamics: A review. IETE Technical Review, 31(1), 17–33. https://doi.org/10.1080/02564602.2014.890838
- Wang, W., Xu, L., & Hu, H. (2015). Neuron adaptive PID control for greenhouse environment. Journal of Industrial and Production Engineering, 32(5), 291–297. https://doi.org/10.1080/21681015.2015.1048752
- Wogi, L., Ayana, T., Morawiec, M., & Jąderko, A. (2022). A comparative study of fuzzy SMC with adaptive fuzzy PID for sensorless speed control of six-phase induction motor. Energies, 15(21), 8183. https://doi.org/10.3390/en15218183
- Zeng, S., Hu, H., Xu, L., & Li, G. (2012). Nonlinear adaptive PID control for greenhouse environment based on RBF network. Sensors, 12(5), 5328–5348. https://doi.org/10.3390/s120505328