ADRC Toolbox
ADRC Toolbox
for MATLAB/Simulink
b Energy and Electricity Research Center, Jinan University, 519070 Zhuhai, P. R. China
Abstract
In this study, an active disturbance rejection control (ADRC) toolbox for MAT-
LAB/Simulink is introduced. Although ADRC has already been established as
a powerful robust control framework with successful industrial implementations
and strong theoretical foundations, a comprehensive tool for computer-aided
design of ADRC has not been developed until now. The proposed open-source
ADRC Toolbox is a response to the growing need in the scientific community
and the control industry for a straightforward software application of the ADRC
methodology. Its main purpose is to fill the gap between the current theories and
applications of ADRC and to provide an easy-to-use solution for users in vari-
ous control fields who want to employ the ADRC scheme in their applications.
The ADRC Toolbox contains a single, general-purpose, drag-and-drop function
block that allows the synthesis of a predefined ADRC-based strategy with min-
imal design effort. Additionally, its open structure allows creation of custom
control solutions. The efficacy of the ADRC Toolbox is validated through both
simulations and hardware experiments, which were conducted using a variety of
problems known in the motion, process, and power control areas1 .
∗ Correspondingauthor
Email addresses: [email protected] (Krzysztof Lakomy),
[email protected] (Wojciech Giernacki),
[email protected] (Jacek Michalski), [email protected] (Rafal
Madonski), [email protected] (Rafal Madonski)
1 The contents of this paper refer to version 1.1.3 of the ADRC Toolbox; the current version
1. Introduction
With the development of modern control techniques, new reliable tools for
rapid prototyping are being developed. The intensive expansion of the MAT-
LAB/Simulink2 software environment over the past decade in both academia
and industry strongly supports the current trend of using high-level program-
ming for designing, analysing, and applying control systems. By analysing the
market and scientific literature, one can find various software toolboxes that
support the synthesis of control systems, with emphasis on identifying dynamic
systems [1], modelling and solving optimisation problems [2], signal differentiat-
ors [3], disturbance observers [4], fractional-order control [5], aerospace vehicle
applications [6], or rapid prototyping [7].
Several types of supporting software solutions have been developed for con-
trol systems based on active disturbance rejection control (ADRC) methodo-
logy. ADRC is a highly practical control framework introduced to the general
audience in [8, 9]3 and later streamlined by [10]. Since its inception, it has
attracted considerable attention from both scholars and industry practition-
ers. The effectiveness of its disturbance-centric approach ([11]) for handling
uncertainties in governed systems has been verified through both theoretical
analyses [12] and numerous control problems in motion, process, and power
control areas [13, 14, 15]. The combination of modern control elements with
the pragmatism of the minimum-modelling approach has made ADRC an in-
teresting alternative to proportional integral derivative (PID) controllers [16].
Recent surveys [17, 18, 19] have captured the significant impact that ADRC
has had on the control field in the last two decades. Conquering market share
2
from popular PID-type controllers, however, is not an easy feat and demands
improvements in many areas. Many studies have been conducted thus far (see
a summary in [20]), and it is thus not surprising that various software programs
have been developed over the years to facilitate the implementation of ADRC.
The ADRC-based systems was implemented so far in a variety of program-
ming languages, like C [21] or Python [22], and in different programming en-
vironments like the an open-source Scilab/Xcos [23] and OpenPCS [24]. In
[25, 26, 27], various general-purpose function blocks were developed for the in-
dustrial implementation of ADRC in programmable logic controllers (PLCs).
Two versions of the ADRC library for PLCs were proposed in [25], one as a
standard version (with basic functionalities), and the other dedicated to exper-
ienced ADRC users allowing for partial dynamic model incorporation, relative
disturbance order selection, and nonlinear estimation error function. In [26, 27],
the general purpose ADRC function block addresses practically important as-
pects of process control, like the impact of the derivative backoff, autotuning, or
time delay handling. Although the above Scilab/Xcos and PLC implementations
of ADRC are neither dedicated to MATLAB/Simulink nor publicly available,
they provide important information about parameters and functionalities that
a practically appealing ADRC software toolbox should possess.
Regarding software support for ADRC implementation in MATLAB/Simulink,
to the best of our knowledge, only a few approaches are currently available. In-
teractive ADRC tuning tools, in the form of graphical user interfaces (GUIs),
were developed in [28, 29]. In [28], ADRC tuning was realised through a dedic-
ated GUI, where the user inputs both the system model and ADRC parameters.
Then, the tool visualises the calculated tracking and disturbance rejection per-
formance (based on some predefined robustness constraints). The tool can also
initiate randomised Monte Carlo tests to check robustness against system para-
metric uncertainty in prescribed ranges. In [29], an interactive ADRC design
for flight attitude control was proposed. In particular, computer-aided design
software, based on the MATLAB GUI, was designed to integrate the tuning and
simulation processes with a stability margin tester.
3
A tutorial for ADRC design was published in [30]. The Authors publicly
shared their implementation examples on the official MATLAB File Exchange
website, which is dedicated to free, open-source code sharing. In [31, 32, 33],
MATLAB/Simulink module-based ADRC designs were presented. These works
describe drag-and-drop creation of different ADRC schemes by manually com-
bining various modules (subsystems) typically seen in a conventional ADRC
block diagram, such as the tracking differentiator, extended state observer, and
state feedback controller. Although the proposed module-based design offers
flexibility in structure selection, and allows the ADRC to be customised to a
given control scenario, it inevitably increases the commissioning time and the
required know-how because users need to implement and independently tune all
the necessary ADRC components separately.
Given the above literature overview of available software solutions for ADRC
implementation, a new MATLAB/Simulink toolbox is developed in this study.
The proposed ADRC Toolbox expands the current state-of-the-art solutions
by distilling the best practices and most useful features into a single tool for
continuous-time implementation of ADRC that provides prospective users with
software that:
4
The goal of the proposed ADRC Toolbox is to provide an intuitive blockset
within the MATLAB/Simulink environment that will allow users to implement
the ADRC structure with relatively little effort and limited knowledge of the de-
tails of observer-based control. The introduction of the toolbox aims to decrease
the time and effort needed to design and implement basic ADRC schemes, and
open new possibilities to swiftly deploy ADRC for real-world control problems.
To validate the efficacy of the proposed ADRC Toolbox for MATLAB/
Simulink, several tests were conducted utilising selected problems from mo-
tion, process, and power control areas that differ from each other in terms of
order, type, and structure of the controlled dynamics and the type of acting ex-
ternal disturbance. Some of the validating tests were performed in simulations,
whereas others were realised in laboratory hardware. Such diversified groups
were deliberately selected to examine the ADRC Toolbox in various control
scenarios. The mentioned tests are added in the ADRC Toolbox as examples
to allow reproducibility of the results shown in this paper.
Notation. Throughout this paper, R is used as the set of real numbers and
Z as the set of integers. The i-th derivative of the signal x(t) with respect to time
di x(t) dx(t) d2 x(t)
t is represented by x(i) , dti for i ∈ Z, and ẋ , dt and ẍ , dt2 are also
used to denote the first and second derivatives.
A standardised notation for cer-
0 (n−1)×1 I (n−1)×(n−1)
tain vectors and matrices is used, i.e., A n , ∈ Rn×n ,
1×(n−1)
0 0
b n , [001×(n−1) 1]> ∈ Rn , c n , [1 0 1×(n−1) ]> ∈ Rn , and d n , [00n−2 1 0]> ∈ Rn ,
while 0 and I correspond, respectively, to zero and identity matrices of ap-
propriate dimensions. The symbol x̂(t) represents the estimate of the variable
A) is the i-th eigenvalue of matrix A , and 1(t) denotes the unit step
x(t), eigi (A
function (Heaviside function). Signal x, described as x ∼ N µ, σ 2 , has a nor-
mal distribution with standard deviation σ and expected value µ. To keep the
equations visually appealing, selected functions within the article are written as
f := f (t); hence, direct time dependence is selectively omitted.
5
2. Overview of implemented ADRC algorithm
• extended state, which results from extending the original model of the
controlled dynamics with an auxiliary state variable, representing solely
the total disturbance;
Assumption 1. The variable x(t) and its derivatives up to the (n − 1)-th order
are defined on an arbitrarily large bounded domain Dx , {[x ẋ . . . x(n−1) ]> ∈
R : k[x ẋ . . . x(n−1) ]> k < rx } for some rx > 0.
6
Assumption 2. The measurement noise w(t) belongs to a bounded set Dw ,
{w ∈ R : |w| < rw } for some rw > 0.
Assumption 3. The external disturbance d∗ (t) and its derivative d˙∗ (t) belong
to the bounded sets Dd∗ , {d∗ ∈ R : d∗ < rd∗ } and Dd˙∗ , {d˙∗ ∈ R : d˙∗ < rd˙∗ },
for some rd∗ , rd˙∗ > 0.
Assumption 4. The fields f ∗ (x, ẋ, . . . , xn−1 , t) : Dx ×R → R and b∗ (x, ẋ, . . . , xn−1 , t) :
Dx × R → R/{0} are continuously differentiable Lipschitz functions.
The most common control task in terms of ADRC applications is for x(t)
to follow a desired trajectory xd (t) ∈ R; in other words, the control task is
to stabilise a control error e(t) , xd (t) − x(t) in zero. In the case of systems
affected by possibly nonlinear external disturbances and measurement noise,
one can usually achieve practical stabilisation, that is, one can assure that
Remark 1. It should be noted that the form of the control task formulated as
(2) is general and can address many conventionally considered control tasks,
such as trajectory tracking and set point following.
Because the control task (2) is formulated in the control error domain, it
will be more convenient to also design the control system for dynamics (1) in
the error-domain form, that is,
(n) (n) ∗ (n−1) (n−1)
e (t) = x d − f x d − e, ẋ d − ė, . . . , x d − e , t
∗ (n−1)
−b x d − e, ẋ d − ė, . . . , x d − e (n−1)
, t u(t) − d∗ (t), (3)
y(t) = e(t) − w(t),
7
Assumption 5. The reference xd (t) and its derivatives up to the (n − 1)-th or-
(n−1) >
der are defined on an arbitrary large bounded domain Dxd , {[xd ẋd . . . xd ] ∈
(n−1) >
R: k[xd ẋd . . . xd ] k < rxd } for some rxd > 0.
Remark 4. In the specific context of ADRC, the synthesis of the control system
expressed in the error domain has a certain beneficial characteristic; namely,
consecutive time derivatives of xd (t) do not necessarily need to be known in
advance. Details can be found in [37, 38].
Assumption 6. The structure and parameters of system (4) are highly uncer-
tain up to a point where the dynamics order n and a rough estimate b̂(êe, t) ≈
b(ee, t) are the only available information concerning the controlled system.
8
and is at least equal to
b(ee, t) 2
∀t≥0 ∈ 0, 2 + , for b̂(êe, t) 6= 0. (5)
b̂(êe, t) n
where
h i
d(ee, êe, u, t) = −d∗ (t) + f (ee, t) + b(ee, t) − b̂(êe, t) u(t), (7)
rd˙ > 0.
ẑz˙ (t) = A n+1ẑz (t) + d n+1 b̂(ẑz , t)u(t) + l n+1 y(t) − c >
z (t) ,
n+1ẑ (9)
9
where the observer gain vector l n+1 = [l1 l2 . . . ln+1 ]> ∈ Rn+1 is bandwidth-
parametrised (see [10]) with a single parameter ωo > 0 such that
(n + 1)!
li , ωi , for i ∈ {1, ..., n + 1}. (10)
i!(n + 1 − i)! o
Now, knowing how to calculate the values of ẑz , one can introduce a robust active
disturbance rejection controller in the form of
1 h ˆ
i
u(t) , −kk nêe(t) − d(t) , (11)
b̂(êe, t)
n!
ki , ωi , for i ∈ {1, .., n}. (12)
i!(n − i)! c
Remark 7. The presence of the control signal u(t) in the total disturbance d(·),
visible in (7), does not cause instability of the system as long as condition (5)
is satisfied.
After the application of (9) and (11) in (8) and (6), the subsystems that
describe the dynamics of the observation error z̃z (t) , z (t) − ẑz (t) and the closed-
loop control error e (t) can be written as
z̃z˙ (t) = (A
˙ − l n+1 w(t),
An+1 − l n+1c n+1 ) z̃z (t) + b n+1 d(t)
(13)
An − b nk n ) e (t) + [kk n 1]z̃z (t).
ėe(t) = (A
Lemma 1. For ωo > 1, and under Assumptions 1-6, the observation error
subsystem in (13), parameterised by (10), is input-to-state stable with respect
to inputs d˙ and w, and locally satisfies
1
kz̃z (t)k ≤ ωon c1 kz̃z (0)k exp (−c2 ωo t) + c3 rd˙ + ωon+1 c4 rw ,
(14)
ωo
10
Figure 1: The proposed ADRC Toolbox (left) with the drag-and-drop ADRC function block
(right), as seen in MATLAB/Simulink.
Lemma 2. For ωc > 1, and under Assumptions 1-6, the control error subsys-
tem in (13), parameterised by (12), is input-to-state stable and locally satisfies
kee(t)k ≤ ωcn−1 c5 kee(0)k exp (−c6 ωc t) + ωcn−2 c7 sup kz̃z (t)k, (15)
t≥0
11
Figure 2: The graphical user interface (GUI) for the proposed ADRC function block.
12
• the observer bandwidth ωo – see (9) and (10); and
Additionally, the ADRC function block enables two practically important func-
tionalities, specifically, the control signal saturation and an anti-peaking mech-
anism. A thorough description of the aforementioned parameters and function-
alities, together with the heuristics and interpretations concerning tuning, are
provided in the following subsections.
13
setting the value b̂(·). Not only can it lead to system instability when set outside
the aforementioned acceptable range, but it can also cause the total disturbance
to be more difficult to estimate, because the difference between the real input
gain parameter b(·) and its assumed value b̂(·) is incorporated within the total
disturbance, represented by (7). Furthermore, when the value b̂(·) approaches
the boundaries of (5), unwanted oscillations may occur in the system behaviour.
The input gain parameter b̂(·) is also control signal scaling factor (11). Thus,
it also has an impact on the system performance when the admissible range of
control signals is limited by a relatively narrow saturation set.
In addition to its simplistic form, this approach results in relatively good per-
formance, even when compared to situations in which the eigenvalues are selec-
ted separately (see [22]).
According to the theoretical results from Lemma 1, relatively higher values
of observer bandwidth have several effects on the system performance:
• the estimation error of the extended state is less affected by the deriv-
ative of total disturbance influencing dynamics (8), since the component
connected with d˙ is multiplied by 1/ωo ;
• the peaking phenomenon reaches higher values due to the multiplier of the
first component in (14) equal to ωon , but does not last as long, because the
14
speed of exponential decay that is connected with the peaking phenomenon
is proportional to ωo .
An − b nk n ) = −ωc ,
eigi (A for i ∈ {1, ..., n}. (17)
15
3.5. Control signal saturation
When one knows the physical limitations of the controlled plant, enabling
the control signal saturation function in the provided ADRC function block may
have an enormous impact on the control performance. When this functionality
is disabled (default setting), the observer treats unsaturated control u as the
signal that affects the system dynamics, whereas in reality, the dynamic sys-
tem may be subject only to its saturated value. Such a situation may result
in a virtual change in b(·) from the observer perspective and cause aggressive
and unpredictable transients. In the worst case, it can lead to control system
instability owing to the divergence from the range discussed in Remark 5. De-
pending on the selected saturation function status in the ADRC function block,
the control signal takes the following form:
u∗ (t), when saturation OFF (default);
u , for u∗ (t) < umin ,
min
u(t) =
u∗ (t), for umin ≤ u∗ (t) ≤ umax , when saturation ON,
u∗ (t) > umax ,
u
max , for
(18)
h i
ˆ
where the auxiliary variable u∗ (t) , b̂(êe1,t) −kk nêe(t) − d(t) is the originally
defined control signal resulting from (11).
16
3.6. Anti-peaking
where Td > 0 is the time that must pass before applying the control signal, and
u∗ (t) is the auxiliary variable that represents the control signal after passing the
saturation logic defined in (18).
Remark 9. Here, similar to Remark (8), which discusses the control signal
saturation, the use of the anti-peaking mechanism (19) in the considered ADRC
algorithm is inconsistent with Lemmas 1 and 2 (both derived for the case without
anti-peaking). The theoretical ramifications of this have been studied before, for
example, in [47, 46], where it was shown that under certain conditions, which are
relatively easy to satisfy in practice, the stability of the system can be retained.
3.7. Overview
17
ADRC const const
function
block
ωo ωc
tuning
(10),(12)
kn
ln+1 const
e observer n
(9)
const
x
controller
(11)
b
const Td
umin
const
(18) (19) u
const umax
saturation anti-peaking
Figure 3: Schematic diagram of the ADRC function block (available in the developed ADRC
Toolbox; cf. Fig. 1).
18
Table 1: Overview of parameters and functionalities of the ADRC function block.
4. Validation
To verify the efficacy of the proposed ADRC Toolbox with its ADRC func-
tion block, a set of tests was conducted in Examples #1 through #5. The tests,
described in Table 2, utilise a group of systems from various control areas that
differ from each other in terms of order, type, and structure of the controlled
dynamics as well as type of external disturbance. Some of the control examples
were performed in simulation, whereas others were realized in hardware. In con-
trast to simulation studies, physical benchmarks also consider real process char-
acteristics such as discrete sampling intervals, communication overhead related
to the process, requirements to meet a cycle time, and mathematical modelling
mismatches. Such diversified group was purposefully selected to test the ADRC
Toolbox in various control scenarios. Moreover, the experimental part of the
validation was conducted using only hardware components that are relatively
cheap and easily accessible. The choice of testing the proposed ADRC Toolbox
exclusively using commercial off-the-shelf hardware systems was deliberate be-
cause it allows the Toolbox users to reproduce the results shown later in this
paper. The tuning methodology in all the upcoming examples is based on the
guidelines from Sect. 3.
19
SISO? single ADRC block
1. Identify type of controlled system
MIMO? m ADRC blocks*,**
3. Connect control error(s) to the input of the ADRC block(s) and connect
the output of the ADRC block(s) to the input(s) of the controlled system
Figure 4: Design steps for deploying the proposed ADRC function block.
20
Table 2: Methodology of ADRC Toolbox validation.
Criterion
Example no. Plant
Order (n) Type Structure Ext. disturb. (d∗ ) Control area Validation
#1 (Sect. 4.1) Generic plant 4 Linear SISO Step n/a Simulation
#2 (Sect. 4.2) Coupled tanks 1 Nonlinear MIMO Step Process Simulation
#3 (Sect. 4.3) Power converter 2 Linear SISO Harmonic Power Simulation
#4 (Sect. 4.4) DC motor 2 Linear SISO None Motion Experiment
#5 (Sect. 4.5) Heaters 1 Nonlinear MIMO None Process Experiment
where f ∗ x, ẋ, ẍ, x(3) , t = −4x(3) −6ẍ−4ẋ−x, b∗ = 1, and d∗ (t) = 70· 1(t−10).
The control objective here is to generate the control signal u so the output
signal x tracks the desired trajectory xd , despite the presence of an external
disturbance and the parametric uncertainty of the model. Additionally, two
scenarios are considered in this study: without sensor noise (w(t) ≡ 0) and
with sensor noise w(t) ∼ N 0, 10−12 . The ADRC function block (from the
21
Reference Control system Control plant
generator Step Measurement
disturbance noise
ADRC
Figure 5: Block diagram of the generic control system (Example #1) with the ADRC function
block from the proposed ADRC Toolbox.
isfactory manner for all tested scenarios. The implemented robust controller
drove the control error toward zero and performance recovered after the ap-
pearance of the external disturbance at t = 10s. One can also see the influence
of the saturation mechanism and the measurement noise. In the case of the
saturation, the control error converges faster when the saturation is off, except
for the effects of the initial oscillatory behaviour of the output and control sig-
nal peaks, reaching the magnitude of u ≈ 106 in the initial transient, which
would probably not be feasible for most real-world controllers. In the case of
measurement noise, owing to the particular structure of the observer and the
controller (both utilising the output signal), the noise is clearly manifested in
the control signal. At the same time, for the considered system, the noise in
the control signal is mostly filtered by the plant dynamics and does not have a
significant impact on the controlled variable.
This example considers a hydraulic system, which consists of two tanks con-
nected by a flow channel and two independent inlet flows, one for each tank.
The fluid levels in the tanks are considered as the system outputs; hence, the
22
2 1 150
Saturation OFF
Saturation ON 100
1.5 Reference output 0.5
50
1 0 0
-50
0.5 -0.5
-100
0 -1 -150
0 5 10 15 20 0 5 10 15 20 0 5 10 15 20
2 1 150
Saturation OFF
Saturation ON 100
1.5 Reference output 0.5
50
1 0 0
-50
0.5 -0.5
-100
0 -1 -150
0 5 10 15 20 0 5 10 15 20 0 5 10 15 20
where u1 [m3 /s] and u2 [m3 /s] are the inlet flows (control signals) for the first
and second tanks, respectively; y1∗ [m] and y2∗ [m] are the measured system out-
puts, which consist of, respectively, first and second tank fluid levels h1 [m]
and h2 [m] and the corresponding sensor noises w1 [m] and w2 [m]; the auxili-
ary variable h := h1 − h2 represents the fluid level difference; g[m/s2 ] is the
gravitational acceleration; a[m2 ] is the cross-sectional area of the pipes; and
c[m2 ] is the cross-sectional area of the tanks. It is assumed that the system
model (21) has the same parameters for both tanks and pipelines. The para-
meters of the system model used in the simulation were c = 1.2 · 10−2 m2 ,
a = 7.5·10−5 m2 , and g = 9.81m/s2 . Referring to the generalised form of the sys-
23
p
tem description from (1), one can assign x(t) := h1 (t), f ∗ (x, t) = − ac 2gx(t) −
a
p ∗ 1
c sign(h (t)) 2g|h (t)|, and b = c for the first tank dynamics and x(t) := h2 (t),
p p
f ∗ (x, t) = − ac 2gx(t) + ac sign(h (t)) 2g|h (t)|, and b∗ = 1c for the second tank
dynamics.
The control objective here is to manipulate two inlet flows u1/2 to make
the output levels h1/2 track the respective reference set points xd1/d2 [m]. The
control process should be carried out despite external disturbances d∗1 (t) =
−1.4·10−4 ·1(t−90) and d∗2 (t) = −0.7·10−4 ·1(t−130), the parametric uncertainty
of the model, and Gaussian sensor noise w1/2 ∼ N 0, 0.8 · 10−10 . It is worth
noting that, in this example, the tanks are treated as two independent systems;
therefore, two independent ADRC function blocks are used, one to govern each
input-to-output channel of the MIMO system. In such a configuration, the
influence of the cross-couplings is treated as part of the total disturbance of the
system.
In this example, the two ADRC blocks are implemented with design para-
meters n = 2, b̂ = 0.8, ωc = 0.3, and ωo = 3 for the first tank, and n = 2, b̂ = 1,
ωc = 0.12, and ωo = 1.2 for the second tank. The control signal saturation is
turned on with limits umin = 0 and umax = 4 · 10−4 (where the latter value
corresponds to the fluid flow rate of 1440l/h) and the anti-peaking function is
turned off (default setting). The block diagram of the implemented ADRC-
based system in MATLAB/Simulink is shown in Fig. 7, and the results of using
the ADRC Toolbox in the above control problem are shown in Fig. 8.
In this figure, one can see that the ADRC scheme successfully realises the
control task in both control channels of the considered multidimensional sys-
tem. After the transient stages, both tank levels are maintained at the desired
predefined values, and the implemented ADRC controllers manage to quickly
and accurately compensate for the influence of external disturbances before they
have a visible effect on the process variables. However, the impact of d∗1 and
d∗2 is clearly seen in the control signals u1/2 at t = 90s and t = 130s, when
they are abruptly forced by the control structure to generate more energy to
handle the disturbances in real time. Interestingly, the ADRC block paramet-
24
Reference Control system Control plant
generator
ADRC
const controller
0.2 ADRC
0.35 ADRC
const ADRC
controller
Figure 7: Block diagram of the coupled tank control system (Example #2) with the ADRC
function blocks (from the proposed ADRC Toolbox), each controls one degree of freedom.
10-4
0.4 0.4 4
Tank 1 control error
Tank 2 control error
0.3 0.3 3
0.2 0.2 2
Tank 1 level
0.1 Tank 2 level 0.1 1
Tank 1 reference level Tank 1 inlet flow
Tank 2 reference level Tank 2 inlet flow
0 0 0
0 50 100 150 200 0 50 100 150 200 0 50 100 150 200
ers for governing the first tank dynamics have higher tuning parameter values
ωc and ωo and lower estimated input gain values b̂, when compared to those
for the second tank. This results in faster convergence of the control error for
the first tank, but also creates larger noise amplification in the control signal,
which could be potentially problematic in real-world implementations. These
observations directly correspond to the theoretical findings described for b̂, ωo ,
and ωc in Sects. 3.2, 3.3, and 3.4, respectively.
25
where u ∈ [0, 1] is the duty ratio (control signal); y ∗ [V] is the measured system
output, which consists of the average capacitor voltage vo [V] and the sensor noise
w[V]; R[Ω] is the load resistance of the circuit; L[H] is the filter inductance; C[F]
is the filter capacitance; Vin [V] is the input voltage source; and the external
disturbance d∗ is dependent on the time-varying load resistance RL [Ω]. The
parameters of the power converter used in the simulation were taken from a real
system that was utilised in [36, 52] and are Vin = 20V, L = 0.01H, C = 0.001F,
and R = 50Ω. Referring to the generalised form of the system description in
Vin
(1), we can assign x(t) := vo (t), f ∗ (x, ẋ, t) = − CR
1
ẋ(t) − 1
CL x(t), and b∗ = CL .
The control objective here is to generate the control signal u that will make vo
track a reference capacitor output voltage trajectory xd [V] despite the unknown
external disturbance related to load resistance RL = 85 sin(40πt) + 100, the
presence of sensor noise w ∼ N (0, 5 · 10−5 ), and the parametric uncertainty of
the internal model dynamics.
In this example, the ADRC function block is implemented with the design
parameters n = 2, b̂ = 2 · 106 , ωc = 500, and ωo = 3000, the anti-peaking
mechanism turned off (default setting), and the saturation of the control signal
turned on, with umin = 0 and umax = 1. A block diagram of the implemented
ADRC-based system in MATLAB/Simulink is shown in Fig. 9, and the results
of using the proposed ADRC Toolbox in the above control problem are shown
in Fig. 10. The obtained results show that the applied ADRC function block
can realise the given control objective by providing satisfactory results for out-
put voltage tracking. Although the influence of the harmonic load resistance
(RL ) has a visible effect on the shape of the control signal and the resultant
output voltage, which is manifested through abrupt spikes of ±0.2V, the aver-
age value of the control error remained within a practically acceptable range.
This example demonstrates that although ADRC is a powerful, robust control
scheme, it has limitations. The challenging form of the external disturbance,
on the one hand, invites the ADRC user to increase the observer and controller
bandwidths to achieve better disturbance rejection and reference tracking, but
on the other hand, it precludes obtaining high control performance owing to
26
Reference generator Control system Control plant Unknown load:
Variable resistance
ADRC PWM +
Pulse Low-pass
filter
ADRC
controller
PWM
generator V
-
V
10
Const
GND
Figure 9: Block diagram of the DC-DC buck power converter control system (Example #3)
with the ADRC function block from the proposed ADRC Toolbox.
15 0.3 1
0.2 0.8
10
0.1 0.6
0 0.4
5
Output voltage -0.1 0.2
Reference voltage
0 -0.2 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
200
1
150
100 0.5
50
0
0
0 0.2 0.4 0.6 0.8 1 0 2 4 6
10-3
plant restrictions (e.g. finite actuation capabilities, sampling time) and ADRC
function block limitations (e.g. the particular structure of the implemented ob-
server; see [52, 38]). Hence, a compromise between the two should be found in
engineering practice.
27
12V DC
voltage source
where u[V] is the source voltage (control signal); d∗ is the external disturbance;
y ∗ [rad/s] is the measured system output, which consists of the motor shaft
angular velocity ω[rad/s] and the sensor noise w[rad/s]; Ra [Ω] is the arma-
ture resistance; La [H] is the armature inductance; J[kg·m2 ] is the rotor inertia;
bf [Nm/rad] is the friction coefficient; and kφ [Vs/rad] is the constant design
parameter. Referring to the generalised form of the system description in (1),
2
Ra J+La bf dω(t) Ra bf +kφ
we can assign x(t) := ω(t), f ∗ (x, ẋ, t) = − La J dt − La J ω(t), and
kφ
b∗ = La J .
The control objective here is to apply the control input u that will make ω
track a reference motor shaft angular velocity xd [imp/sec] despite the presence
of sensor noise and parametric uncertainty of the internal model dynamics.
In this example, the ADRC function block is implemented with the design
parameters n = 2, b̂ = 600, ωc = 40, and ωo = 90, the anti-peaking mechanism
28
Reference Control system Control plant
generator
PWM
ADRC
Step ADRC
controller Pololu motor
+ encoder
Arduino MKR WiFi 1010
+ Arduino MKR Motor Carrier
Sine
Figure 12: Block diagram of the DC motor control system (Example #4) with the ADRC
function block from the proposed ADRC Toolbox.
turned off (default setting), and the saturation of the control signal turned on,
with limits umin = −100 and umax = 100. The block diagram of the implemen-
ted ADRC-based system in MATLAB/Simulink is shown in Fig. 12, and the
results of using the proposed ADRC Toolbox in the above control problem are
shown in Fig. 13. The obtained experimental results demonstrate the effective-
ness of the ADRC function block in hardware applications. The motor output
signal tracks the desired trajectory, which is a combination of a unit step and a
harmonic function. As expected, both the control signal and the control error
exhibited rapid changes when the system responded to the step change. Such an
abrupt reaction, although kept at bay by the activated saturation mechanism,
could be further minimised, for example, by adding a smoothing function, as
was done in Example #3. Here, however, the step function was left deliberately
to check how the control system performs in the case of an instantaneous change
in the target signal (which often happens in engineering practice). It should be
noted that the ADRC has not completely compensated for the harmonic com-
ponent, which is present in both the control signal and the control error (in-
herited from the reference signal). Although the obtained control performance
may be considered satisfactory, the implemented control structure causes the
control error to oscillate around ±1rad/s. Here again, similar to Example #3,
one could point to several specialised methods that would further increase the
harmonic disturbance rejection. However, this is beyond the proposed ADRC
Toolbox, at least in its current form.
29
25 100
10
20
50
15
5
10 0
5 0
-50
0 Output velocity
Reference velocity
-5 -5 -100
0 5 10 15 20 0 5 10 15 20 0 5 10 15 20
Remark 10. TO run and repeat the results from this hardware example, two
MATLAB add-ons need to be installed: ”MATLAB Support Package for Arduino
Hardware” and ”Simulink Support Package for Arduino Hardware”.
30
PC
5V DC
+
voltage source
Matlab/Simulink
USB
Overlay
Arduino connection Temperature
Leonardo Control Lab
where u1 [W] and u2 [W] are the output energy (control signals) from the first
and second heaters, respectively; y1∗ [℃] and y2∗ [℃] are the measured system
outputs, which consist of the first and second heater temperatures T1 [℃] and
T2 [℃] and corresponding sensor noises w1 [℃] and w2 [℃]; d∗1 and d∗2 are the
external disturbances that affect particular channels; and the functions fi∗ (·) =
1 ∗ αi
4 4
mCp U A(T∞ (t) − Ti (t)) + σA(T∞ (t) − Ti (t)) + Q12 (t) and bi = mCp for i ∈
{1, 2}. In addition, Cp [J/kg-K] is the heat capacity, T∞ [℃] is the ambient
temperature, U [W/m2 -K] is the heat transfer coefficient, A[m2 ] is the surface
area not between the heaters, As [m2 ] is the surface area between the heaters,
is the emissivity, m[kg] is the mass, σ[W/m2 -K4 ] is the Boltzmann constant,
and αi [W/(% heater)] is the i-th heater factor. The heat transfer exchange
Q12 between the heaters is a combination of convective heat transfer QC12 =
U As (T2 − T1 ) and radiative heat transfer QR12 = σA(T24 − T14 ), defined as
Q12 = QC12 + QR12 . A detailed derivation of the structure and parameters
of (24) using physics-based and data-driven techniques can be found in [54].
Referring to the generalised form of the system description in (1), one can
assign x(t) := T1 (t), f ∗ (x, t) = 1
mCp
4
[ U A(T∞ (t) − T1 (t)) + σA(T∞ (t) − T14 (t)) +
α1
Q12 (t) ], and b∗ = mCp for the first heater dynamics and x(t) := T2 (t), f ∗ (x, t) =
α2
1
mCp
4
[ U A(T∞ (t) − T2 (t)) + σA(T∞ (t) − T24 (t)) − Q12 (t) ], and b∗ = mCp for the
second heater dynamics.
In this example, the control objective is to adjust both heater power outputs
u1/2 and transfer the thermal energy from the heaters to the temperature sensors
to ensure that T1/2 maintains the desired temperature set points xd1/d2 , despite
the parametric uncertainty of the system model and sensor noise.
31
The block diagram of the implemented ADRC-based system in MATLAB/
Simulink is shown in Fig. 15. One can see that in the performed example,
the heaters are treated as two independent systems. The equations (1) are
therefore derived independently for each degree of freedom of the system (24).
Consequently, two ADRC function blocks are used, each to govern one input-to-
output channel of the system. In such a configuration, the unmodelled influence
of the cross-couplings is treated as part of the total disturbance of the system.
The two ADRC function blocks are implemented here with design parameters
n = 1, b̂ = 3, ωc = 6, and ωo = 15 for the first heater, and n = 1, b̂ = 5, ωc = 6,
ωo = 15 for the second heater. Both function blocks have the anti-peaking
mechanisms turned off (default setting), and the saturation of the control signals
turned on, with user-defined limits umin = 0 and umax = 100. The results of
using the proposed ADRC Toolbox to the above control problem are shown in
Fig. 16. The experimental results validate the control structure with multiple
ADRC function blocks as a viable solution for the considered cross-coupled
MIMO plant. For the chosen tuning parameters, the target temperature set
points were tracked with acceptable margins of error. Without the necessity of
precise system modelling, the implemented robust ADRC approach managed to
deal with plant modelling uncertainties, including the cross-couplings between
the system’s degrees of freedom. By comparing the selected ADRC parameters,
one can see that a smaller estimated input gain (b̂) was selected for the first
heater. As a result, a steeper slope of convergence to the desired values was
observer for the first heater output, which also resulted in a signal overshoot of
approximately 3℃. This is an expected result, which stems from the fact that b̂ is
also a scaling factor for the entire control signal (see (11) and discussion thereof
in Sect. 3.2). Regarding the control effort, one can see that the user-defined
reference temperatures became challenging for the governed plant and pushed
the control signals to extremes. This justifies the incorporation of the saturation
mechanism in the proposed ADRC function block and shows the importance of
activating saturation if the admissible range of the control signal is known.
This is especially important in hardware experiments, where the control signals
32
Reference Control system Control plant
generator
ADRC
const controller
40 ADRC
50 ADRC
const ADRC
Temperature Control Lab (TCLab)
controller
Figure 15: Block diagram of the temperature control lab control system (Example #5) with
the ADRC function blocks (from the proposed ADRC Toolbox), each of which controls one
degree of freedom.
60 30 100
Heater 1 control error
Heater 2 control error 80
50 20
60
40 10
40
Heater 1 temperature
30 Heater 2 temperature 0
Heater 1 reference temperature 20 Heater 1 PWM
Heater 2 reference temperature Heater 2 PWM
20 -10 0
0 100 200 300 400 500 0 100 200 300 400 500 0 100 200 300 400 500
usually operate within certain physically limited bounds. It is also important for
the considered observer-based control algorithm, which works correctly only if
it is given accurate information about the input-output behaviour of the system
(for details see Sect. 3.5).
Remark 11. To run and repeat the results from this hardware example, extra
MATLAB add-ons need to be installed (see Remark 10) as well as dedicated
TCLab libraries (available under the MIT licence at the producer website, men-
tioned earlier).
The presented ADRC algorithm (Sect. 2), toolbox parameters and func-
tionalities (Sect. 3), and validation tests (Sect. 4) shown in this paper are for
ADRC Toolbox version 1.1.3, which was current at the time of this paper’s
33
publication. The latest version of the ADRC Toolbox can be downloaded from
https://www.mathworks.com/matlabcentral/fileexchange/102249-ac
tive-disturbance-rejection-control-adrc-toolbox and installed in
MATLAB/Simulink by following the instructions therein. In addition to the
necessary installation file, the website also contains contact information for the
ADRC Toolbox developers and Q&A section. The ADRC Toolbox can also be
installed as an add-on directly from MATLAB using the ”Add-On Explorer”
function.
Regarding software development of the ADRC Toolbox, all related files,
including MATLAB code, data, apps, examples, and documentation, are pack-
aged in a single installation file (.mltbx), which greatly simplifies the sharing
and installation of the ADRC Toolbox. This form of software development is
convenient for end users, who can install the ADRC Toolbox without being
concerned with the MATLAB path or other installation details, because the
provided .mltbx file manages these details.
6. Conclusions
This work demonstrated the effectiveness and ease of use of the developed
ADRC Toolbox for numerical simulations and hardware experiments performed
in the MATLAB/Simulink software environment. The ADRC Toolbox is pro-
posed to address the recent interest in the ADRC methodology and the growing
use of MATLAB/Simulink in both academia and industry. Through a variety of
case studies, it has been shown that the developed ADRC function block can be
used for various applications and may be easily integrated with existing Simulink
models. The implemented functionalities can help create custom ADRC applic-
ations swiftly and in a straightforward manner, thus potentially decreasing the
time and effort usually required. The improvements on the implementation side
of ADRC, introduced through the development of the ADRC Toolbox, are ex-
pected to make ADRC an even more compelling choice for solving real-world
control problems.
34
The developed ADRC Toolbox is available to end users as open-source soft-
ware. It is planned to be further developed with new functionalities based on
feedback from the control community. Importantly, the ADRC Toolbox is an
open-source project that is freely available to interested users. The current ver-
sion of the ADRC Toolbox can be downloaded from https://www.mathworks.
com/matlabcentral/fileexchange/102249-active-disturbance-rejecti
on-control-adrc-toolbox.
Acknowledgements
• The hardware setups used in the conducted experimental tests were pur-
chased by R. Madonski and K. Lakomy with their private funds.
• The example ’tclab temp control’, provided alongside the ADRC Toolbox,
uses a Simulink function block called ’Temperature Control Lab’ as well
as the ’TCLab’ hardware platform, both available at http://apmonito
r.com/heat.htm
35
Appendix
Example #2
Symbol Unit Value Name
a [m2 ] 7.5 · 10−5 pipes cross-section area
c [m2 ] 1.2 · 10−2 tanks cross-section area
2
g [m/s ] 9.81 gravitational acceleration
Example #3
Symbol Unit Value Name
Vin [V] 20 input voltage source
L [H] 0.01 filter inductance
C [F] 0.001 filter capacitance
R [Ω] 50 load resistance
Example #5
Symbol Unit Value Name
α1 [W] 0.01 heater 1 factor
α2 [W] 0.01 heater 2 factor
Cp [J/kg-K] 500 heat capacity
2
A [cm ] 10 surface area not between heaters
As [cm2 ] 2 surface area between heaters
m [kg] 0.004 mass
U [W/m2 -K] 10 overall heat transfer coefficient
- 0.9 emissivity
2 4 −8
σ [W/m -K ] 5.67 · 10 Boltzmann constant
References
36
6/j.conengprac.2012.10.007.
[9] J. Han, From PID to Active Disturbance Rejection Control, IEEE Trans-
actions on Industrial Electronics 56 (3) (2009) 900–906. doi:10.1109/TI
E.2008.2011621.
37
[10] Z. Gao, Scaling and bandwidth-parameterization based controller tuning,
in: Proc. American Control Conference, 2003, pp. 4989–4996. doi:10.110
9/ACC.2003.1242516.
[14] Q. Zheng, Z. Gao, Active disturbance rejection control: some recent exper-
imental and industrial case studies, Control Theory and Technology 16 (4)
(2018) 301–313. doi:10.1007/s11768-018-8142-x.
38
[18] W.-H. Chen, J. Yang, L. Guo, S. Li, Disturbance-observer-based control
and related methods - an overview, IEEE Transactions on Industrial Elec-
tronics 63 (2) (2016) 1083–1095. doi:10.1109/TIE.2015.2478397.
[23] L. Wang, L. Qing, C. Tong, Y. Yin, J. Li, S. Song, Active disturbance re-
jection control simulation toolbox in open-source software Scilab/Xcos, in:
Proc. IEEE International Workshop on Open-source Software for Scientific
Computation, 2011, pp. 71–76. doi:10.1109/OSSC.2011.6184697.
[24] S. Zhao, Z. Gao, Modified active disturbance rejection control for time-
delay systems, ISA Transactions 53 (4) (2014) 882–888. doi:10.1016/j.
isatra.2013.09.013.
39
[26] P. Nowak, K. Stebel, T. Klopot, J. Czeczot, M. Fratczak, P. Laszczyk,
Flexible function block for industrial applications of active disturbance
rejection controller, Archives of Control Sciences 28 (3) (2018) 379–400.
doi:10.24425/acs.2018.124708.
[29] S. Ma, M. Sun, Z. Chen, Interactive ADRC design for flight attitude control,
in: Proc. Data Driven Control and Learning Systems, 2017, pp. 611–616.
doi:10.1109/DDCLS.2017.8068142.
[31] H.-J. Hu, Z. Zhu, Modeling and simulation of linear active disturbance re-
jection controller in Simulink, in: Proc. International Conference on Elec-
tronic, Control, Automation and Mechanical Engineering, 2017, pp. 547–
552. doi:10.12783/dtetr/ecame2017/18451.
40
[33] M. Kia, P. Mansouri, A. Javdani, Modeling and simulation of a single
gain tuning ADRC controller in Matlab/Simulink, in: Proc. International
Symposium on Industrial Electronics, 2020, pp. 154–159. doi:10.1109/IS
IE45063.2020.9152398.
41
[40] S. Chen, Y. Huang, Z. Zhao, The necessary and sufficient condition for
the uncertain control gain in active disturbance rejection control (2020).
arXiv:2006.11731.
[47] M. Ran, J. Li, L. Xie, A new extended state observer for uncertain nonlinear
systems, Automatica 131 (2021) 109772. doi:10.1016/j.automatica.2
021.109772.
42
ranean Conference on Control and Automation, 2013, pp. 1411–1416.
doi:10.1109/MED.2013.6608905.
43