1. Introduction
Over the past decades, electric servo drives have become one of the most popular devices. They are widely used in robotics [
1], space technologies [
2], machine processing automation, and production process automation [
3]. They can be found in all branches of the manufacturing industry, working in cutting [
4], welding [
5], packaging, renewable energy [
6], and many, many other machines [
7]. Electric servo drives are found in numerous common devices, from home appliances to building automation devices to applications in diagnostic and medical equipment [
8]. They are used in all modern means of transport [
9], construction machines, and mining industry machines [
10]. Aircraft, naval, and military technology are other extensive fields of servo application [
11]. Simply put—precise control of the motion of various devices is a common, basic challenge of modern civilization, and this is exactly what servo drives are designed for. Moreover, due to the widespread use of such drives, their quality of operation and energy efficiency have a huge impact on global electricity consumption and the energy balance.
The main aim of an electric servo is to follow the desired trajectory of motion—position and velocity evolving in time. The servo trajectory must converge to the desired trajectory sufficiently fast, and the quasi-steady-state tracking error must be sufficiently small. From the perspective of control theory, these features are assured by the stability of the closed-loop system. An equally important goal is safe operation. It means that the hard constraints imposed on the position and velocity during motion must be observed under all circumstances: during the transient from arbitrary initial conditions, in the steady state, under external disturbances, in the presence of measurement noise and control constraints, and for any specific features of the hardware.
The well-known control technique that unifies stability and safe operation requirements is the design based on barrier Lyapunov functions (BLFs). The concept of barrier functions dates back to the 1940s (see set invariance research, Nagumo’s results [
12]), and the name can be connected with barrier functions used in optimization—components added to a cost function to prevent decision variables from entering a forbidden area. The modern concept of BLFs originated in the first decade of the 21st century, when the concepts of the control Lyapunov function (CLF) and the barrier function were connected [
13,
14]. A BLF is a CLF that grows to infinity when its arguments approach some limits. By ensuring the boundedness of the barrier Lyapunov function in the closed loop, we ensure that those limits are not transgressed. And as a BLF remains a Lyapunov function (positive definite with a negative definite system derivative), it is also used to prove the closed-loop system’s stability. Since then, BLFs have become a common tool used to derive controllers for numerous applications. Just one popular database reports more than 1500 references using the term “BLF” in the past three years. Variants of motion control are widely represented among them.
Most of the early works on BLFs used the logarithmic BLF for control design [
14]. Over time, other types of BLFs were introduced, such as the square of a tangent [
15], the tangent of a squared variable [
16], or an inverse hyperbolic tangent [
17]. Currently, several types of BLFs are in use. Although some comparisons are available [
16], the problem of systematically selecting a specific BLF for a particular application remains worth investigating. A recent literature review indicates that the BLF approach continues to be popular. Several new applications are listed in
Table 1. In addition to the application area, the table provides information on the type of BLF used, whether the control signal and measurement noise constraints are taken into account, and whether the implementation in a real system is described.
None of the mentioned works justified the choice of a specific BLF, nor did they consider control algorithms using different BLF types in subsystems. Therefore, the shape of the BLF was assumed a priori, without justification, and the same type of BLF was used in all control loops.
Although the BLF-based approach is so popular, it is also known to have several structural drawbacks:
As the constraints are imposed on the error system rather than on the original state variables, and the controller is designed recursively so that the acceptable constraint range in the actual loop depends on the controller parameters selected for the previous loop, complex feasibility conditions arise and must be solved or removed [
27,
28].
As the value of a BLF increases rapidly when the barrier is approached and is transformed into the control input, the control amplitude grows rapidly, and a BLF-based controller may become inapplicable because of control constraints.
Standard stability proofs and controller derivations do not take into account control constraints and measurement inaccuracies.
Especially, references concerning BLFs together with input constraints are scarce, although the problem is recognized [
25,
29]. Some approaches assume the transformation of the control input into an additional state variable [
30], while others combine BLFs with neural modeling and optimal control [
25]. However, it is mostly assumed that control constraints can be practically inactive due to parameter selection.
In this contribution, we propose a novel BLF-based adaptive controller for an electric servo (either linear or rotational) with modeling uncertainties, addressing a tracking problem. The novelty of the proposed controller lies in the fact that it is designed for implementation in the presence of control saturation, measurement noise, and errors. Therefore, the proposed algorithm is equipped with additional parameters that shape the control action and enable the calculation of threshold values of tracking errors that trigger maximum control efforts. The controller derivation is complemented by a tuning procedure that ensures safe system operation under active control constraints, measurement errors, and noise.
Unlike in most references, the maximum values of the saturated control input are effectively used to ‘push’ the tracking error away from the barrier. It is also emphasized that the choice of BLFs (from among several popular types described in the literature) is important for system operation under control constraints. It is demonstrated that using the same type of BLFs for both position and velocity constraints—a typical assumption in previous studies—is not an optimal choice. Selecting the best combination of BLFs is part of the proposed tuning procedure.
Furthermore, all feasibility issues—stemming from the dependence of the achievable limits of the speed tracking error on position constraints and the parameters of the position control loop—are addressed by the proposed approach. The structure of the BLF-based controller with nested loops is preserved, while the feasibility conditions are handled through the tuning procedure. This is in contrast to more complex approaches, where feasibility is ensured via nonlinear state transformations [
27,
28].
Most references merely acknowledge the existence of feasibility conditions constraining the general algorithm, leaving their resolution to specific applications. Finally, the proposed approach is successfully implemented as DSP-based control of two real servo systems, which proves its practical applicability despite the simplified servo model used in the control design.
We concentrate on time-independent, popular BLFs. We are aware that several other concepts of BLFs can be used. For example, time-varying BLFs were successfully applied to motion control in [
31,
32], integral BLFs [
33], asymmetric BLFs [
34], and zone BLFs [
35] are promising. However, these approaches are much more complex, while the aim of this paper is to develop a simple but efficient approach, which can be an attractive alternative and widely used in practical applications.
In
Section 2, basic facts about BLFs are recollected. The servo model, control objectives, and the derivation of the controller are presented in
Section 3.
Section 4 is devoted to the tuning procedure, ensuring safe operation. In
Section 5, examples, simulations, and real servo implementations are reported. Finally, conclusions are presented in
Section 6.
2. Barrier Lyapunov Functions
The concept of barrier Lyapunov functions (BLFs) was introduced 20 years ago, first regarding systems in Brunovsky canonical form [
13]. In [
14] basic definitions and properties of BLFs were derived. For the sake of completeness, we repeat them here.
Definition 1. Let be a continuously differentiable, proper, and positive definite function defined over the state-space of the nonlinear system . Let us denote the Lyapunov function system derivative by . V(x) is called a control Lyapunov function (CLF) for the system if, for any , there exists such u that . If for some positive definite P, it is called a quadratic Lyapunov function (QLF).
Definition 2. A barrier Lyapunov function (BLF) is a scalar function , described by the following:
It is defined on an open region D containing the origin of the state-space of the system .
It is continuous, positive definite.
It possesses continuous first-order partial derivatives at every point of D,
as x approaches the boundary of D,
along any system trajectory starting inside D.
Usually, it is assumed that D is a hyper-rectangle defined by .
Lemma 1. ([14]). Consider a smooth dynamical system , with the state variables . Let be a BLF satisfying . Let be a QLF. Let . If the inequality holds throughout the set , then any system trajectory that fulfils the initial constraints remains within for any . In Lemma 1, the state is split into the constrained variables and the unconstrained variables w. For each , a BLF is constructed, while a QLF may be used for . For tracking problems, the state variables considered are the tracking errors, and, in the case of motion control, these are position- and velocity-tracking errors. BLFs are separately designed for each of these errors.
Let us consider a scalar tracking error and a corresponding BLF .
We can choose among several types of BLFs. It is well known that the features of the obtained closed-loop system strongly depend on the selected BLF type. The main differences among them lie in their behavior near the constraint boundary—some grow faster, others slower. It is strictly connected with the values of BLF’s derivative
, which can be represented as
. Moreover, as it will become clear from the derivation presented in the next section,
acts as a gain transmitting the tracking error into the control law and the adaptive laws. The formulas describing a QLF and four selected BLFs according to this notation are presented in
Table 2, and the plots of
and
are presented in
Figure 1, assuming that the constraint
holds.
The contents of
Table 2 do not exhaust all possible forms of BLF construction. In fact, any smooth function that approaches zero as the variable nears the barrier can be inverted to obtain a BLF. For example, the function
provides a secant-type BLF [
36]. Recently, the most frequently used BLFs have been logarithmic functions [
18,
19], and control algorithms based on them have been most commonly implemented in real systems [
20,
21]. Papers describing controllers that use BLFs with a squared variable [
22] are less common. No publications employing BLFs based on the inverse hyperbolic tangent or the squared tangent were found among last year’s papers.
The set of functions presented in
Table 2 includes both the most popular and less frequently used types. The criterion for their selection was to present the greatest possible variety in terms of functional shape. Naturally, this set can be expanded to include other Lyapunov-based functions.
Considering practical implementation of the BLF-based controller, we have to take into account that the measured value can incidentally go outside the constraint (for example, as a result of a single measurement outlier). The -BLF is undefined in this situation, tan-BLF changes the sign, and atanh-BLF and tan2-BLF are symmetric with respect to the barrier, but the gains they generate are changing the sign. All this can be catastrophic for the proper system operation and should be avoided.
To summarize:
The choice of used BLFs is an important decision and should be considered carefully.
The shape of a BLF and of the gain it introduces is crucial for real system implementation, especially in the presence of control constraints and measurement noise, and hence, the BLF should be equipped with additional parameters able to change it near the barrier for safe operation.
In the
Section 3, an adaptive motion controller corresponding to these postulates will be derived.
3. BLF-Based Motion Adaptive Controller
Let us consider a universal, nonlinear model of an electric servo given by two differential equations:
The same Equations (1) are used to model both a servo generating linear motion and a rotational servo. While we acknowledge that this is a simplified, second-order model, we are confident—based on real servo applications reported in
Section 5—that this modeling approach is sufficiently accurate and well justified. It captures the main sources of control difficulty, such as nonlinear external forces or torques, including friction or nonlinear loads.
The proposed approach accounts for modeling uncertainties related to parameter inaccuracies as well as unstructured modeling errors and external disturbances. In modern electric servo drives, current regulation is performed by a fast controller integrated with a PWM converter. The switching frequencies of modern power electronic converters are much higher than the sampling rates used in speed and position control loops. As a result, the time constant of the current response is significantly shorter than the time constants associated with mechanical transients (see
Section 5).
Numerous experiments and real-world servo applications, as reported in
Section 5, demonstrate that the derived controller is typically robust to unmodeled current-loop dynamics. More critical factors affecting system performance include current constraints and the imprecisely known torque (or force)-to-current constant
, both of which are taken into account in the proposed model. Thus, the current control loop dynamics are neglected, and the desired motor current
is treated as the servo control input.
The state and control variables, as well as model parameters, are summarized in
Table 3.
The term represents the propelling force or torque. The constant is usually provided by the motor manufacturer, but, in some applications, it may be inaccurate or vary with external conditions, such as the motor temperature, etc. If is known exactly, assume that does not limit the generality of the analysis. However, if this constant is unknown, a slightly modified version of Equation (1) should be considered.
For the formal derivation of the controller, we also assume that the saturation affecting the motor current is inactive, although it must be taken into account at the implementation stage.
Finally, the simplified servo model is formalized as follows:
and the motor current is the control input.
The component
is intended to model all other forces/torques affecting the motion. It includes the impact of motor and load friction, as well as any external forces acting on the system. For instance, if the servo works against gravity while lifting or lowering a load, or against elastic forces when stretching or compressing a spring, these forces or torques should be included in the component
. The decision of which forces or torques to include in this model is application-specific and depends on the actual system. Sometimes, the function
can be naturally interpreted as a linear combination of known functions (see examples in
Section 5). More often, this component is unknown, but it can be represented by data obtained from some identification experiments [
37] and then approximated by a linear combination of known functions. This form can also be interpreted as the result of fuzzy modeling or modeling by artificial neural networks [
38]. However, it is assumed that
can be modeled by a linear-in-parameters model
:
The vector
consists of known functions of motor position and velocity, while the parameters
are constant and unknown. The actual number and form of the known functions
should be determined for each application. However, it is assumed that such a model with constant, bounded, unknown parameters
exists, and that the modeling error
is bounded at any moment during system operation:
The motor and load inertia (and therefore also is constant, but unknown. The constraints imposed on the motor current are known an inviolable.
The control aim is to follow a smooth, constrained, desired position trajectory
and it is required that the tracking error:
remains constrained within the imposed bounds
:
As an intermediate stage of the controller design, the desired velocity trajectory
will be proposed:
where
is a design parameter. Hence, if a steady state
is achieved, then
. The velocity tracking error is defined as follows:
A constraint is imposed on the velocity tracking error is as follows:
Therefore, taking into account the constrained desired trajectory (5), the selected parameter
, and the error constraints (7) and (10), the state variables are also bounded:
The constraints in (11) depend on the selected desired trajectory (and ), design parameter , and the imposed error constraints (7) and (10). The proper selection of these design components to match predefined global constraints (11), considering the servo dynamics (2), creates the feasibility problem, which must be addressed in any BLF-based design.
Because of (2), (3), (6), (8), and (9), the tracking errors are described by the following:
where
Note that is available for the controller.
The unknown parameters
will be replaced by adaptive parameters
, which will be updated using an adaptive law to be derived. The adaptation error is denoted by the following:
The controller derivation is based on proper shaping of error dynamics. Constraints (7) and (10) will be assured by two BLFs
and
. Let us denote the following:
Let us consider Lyapunov function:
where
and positive definite
are design parameters. The derivative of the Lyapunov function is given by the following:
We now propose the following control law:
where
are design parameters, and the strictly positive function
will be discussed in the next section. Roughly speaking:
when is far from the constraint to ensure sufficiently fast convergence of ;
when approaches the constraint to mobilize using maximum control value to avoid getting to close to the barrier.
Therefore, the error dynamics for
, as derived from Equation (13) and control law (19), become the following:
Now, substituting Equations (12) and (20) into the Lyapunov function derivative (18), taking into account that:
, and noticing the following:
we obtain the following:
This equation can now be simplified and rearranged to design an adaptive update law. Let us select adaptive laws with projection:
where the projection operator is defined by the following:
It is well known [
39] that for any trajectory
evolving according to differential equation
and starting within
(elementwise), these bounds are preserved for any
, and the inequality:
holds for any
as well.
Therefore, under adaptive law (23), the inequality (22) becomes the following:
The final controller is summarized in
Table 4.
The final closed-loop system is described by Equations (12), (20), and (23). Let us denote the set of state variables
lying within the constraints:
and the compact set
contains all possible values of the adaptive error
. Such a set exists as the ‘best’ values
in (14) are bounded, and the adaptive parameters are constrained
.
The system (12), (20), and (23) with state variables is said to be uniformly, ultimately bounded (UUB) to the target set , if there exist a compact set , called the target set, and a constant such that any trajectory starting in remains in for all .
The derived inequality (27) forms the basis for proving the closed-loop system stability in this sense. The stability of the closed-loop system is summarized by the following theorem.
Theorem 1. Consider the closed-loop system given by Equations (12), (20), and (23). Then, for any trajectory such that :
The condition holds for all .
The trajectory is UUB to a compact target set . Each tends to a compact interval containing 0. This interval can be made arbitrarily narrow and the convergence arbitrarily fast, by selecting sufficiently large design parameters.
All signals in the system are bounded.
If the linear-in-parameters model (2) is accurate, i.e., , than we can take to simplify the control law (19). Under this simplified control, statements 1–3 still hold and the tracking error converges to zero asymptotically.
The proof of the theorem is based on the following reasoning:
Since , , it follows from the inequality (27) that the Lyapunov function derivative along any trajectory of is negative outside the compact set , for any . Therefore, the Lyapunov function decreases until the trajectory enters the target set . The set can be shrunk by increasing . As the Lyapunov function is bounded, the BLFs and are also bounded, which guarantees that .
Let us stress that using BLF results in keeping the tracking errors within the constraints, while constraining position and velocity is a more practical control objective. As for the position, remains within the -tube around :
To constrain the velocity
, let us notice that the desired velocity
, defined by (8), differs from the tracked trajectory velocity
. Let us relate the tracking error bound (10) and the desired velocity
given by (8) to obtain:
Hence, the actual velocity
remains within the
-tube around the tracked trajectory velocity
only when the position tracking error is zero. In general, we have the following:
thus:
Therefore, the gain , which governs the convergence of the position error, directly enlarges the practical constraints on the velocity.
Let us consider the error dynamics (12) and (20). If we can neglect the adaptation and modeling errors and assume that the tracking errors
and
are small, so
and
,
, the simplified error dynamics is given by the following:
The characteristic polynomial of system (33) is as follows:
The imposed eigenvalues of the system (33) can be used to select .
Let us conclude the presented derivation and discussion with an example illustrating the impact of various BLFs and the problem of constrained control.
Example 1. All signals and parameters are presented using SI units, as shown in Table 3. Let us consider the desired trajectory presented in Figure 2. The maximum values of velocity and acceleration are This trajectory was generated starting from by subsequent integration with zero initial conditions. The rotational servo is given by Equation (1), where
. The external forces include friction—proportional to the angular velocity
, and a gravitational component, which varies during each full rotation and is proportional to
. Hence,
,
, and no modeling error is assumed:
. Under these assumptions, the error dynamics are given by the following:
The constraints imposed on the tracking errors , are and . Let us assume the controller gains are , , , . The eigenvalues of the simplified system (33) are and suggesting an aperiodic transient with a time constant . The velocity bound , according to Equation (32), is . It is assumed that the parameters are known exactly, so adaptation is switched off, and so . The controller is initialized with the following conditions: . Given that , , the initial tracking errors are , , . Thus, the initial point lies within the specified constraints.
Let us consider two selections of BLFs:
- (A)
-BLF, -BLF,
- (B)
-BLF, -BLF.
During the first experiment, the control was unconstrained:
. The results are presented in
Figure 3.
As observed in
Figure 3, selection
B of BLFs results in much more aggressive control: The trajectories get closer to the constraints, and the control signal reaches unacceptably high values (albeit briefly). The repulsion from the constraint boundary begins later (i.e., closer to the bound), requiring a rapid increase in control effort. However, the settling time and transient shapes are similar for both BLF selections. Quality indices concerning both BLF combinations are presented in
Table 5.
In the second experiment, the control input was constrained:
, and the control law was modified as follows:
This upper limit is significantly lower than the peak control values observed in the previous test. Therefore, it is expected that the position and/or velocity constraints might be violated. Since BLF values are undefined outside the constraint boundaries, a safety mechanism is introduced: If the limit is reached, the value of is held constant (i.e., blocked) for the controller.
The results are presented in
Figure 4. Only the controller with the first (A) selection of BLFs was able to keep the transient within the constraints. This controller reaches the control saturation level earlier, due to the higher value of the gain
, and is able to push the position error away from the constraint barrier. The second controller (BLFs B, red line in
Figure 4) reaches the maximum control value too late to effectively correct the trajectory.
For the final run, the coefficient
, scaling the BLF
, was increased to
. This change resulted in a stronger control response, which successfully maintained the tracking errors within the specified constraints. The corresponding plots are presented in
Figure 5. The eigenvalues of the simplified model (33) (which is acceptable approximation for small values
) are now
, consistent with the oscillatory behavior observed in
Figure 5.
Quality indices concerning both BLFs combinations are presented in
Table 6.
The presented results confirm that the proposed algorithm can achieve practically accurate tracking. They also emphasize that the selection of barrier Lyapunov functions (BLFs) is a critical design decision. Furthermore, implementation of the proposed controller under control constraints—which were not considered during the controller derivation —requires careful tuning of the parameters.
6. Conclusions
BLF-based technique continuously remains one of the most popular approaches to cope with state constraints. The new algorithm presented in this contribution is especially tailored for applications to control electric servos, which are supposed to track a desired (linear or angular) position. It is based on a simplified, second-order model of a servo, but it was demonstrated that this modeling approach is sufficiently accurate and justified. It covers the main sources of control difficulties—nonlinear external forces or torques, such as friction or a nonlinear load. The proposed approach allows for modeling uncertainty concerning model parameters as well as unstructured modeling errors or disturbances.
A distinctive feature of the proposed controller is that some extra tuning parameters were added to enable efficient and safe implementation in real applications, where the control variable is constrained. The problem of implementing the control algorithm in the presence of several factors not taken into account during theoretical derivation but common in practice was exhaustively investigated. Although control constraints and measurement errors were the main such factors considered in this paper, some others (like effects of discretization, delays, etc.) may be addressed in the same manner.
Practical safe operation of a servo is understood as remaining within the state constraints in any case—also when control constraints are active and the measurements are corrupted. It was proven that if the proposed BLF-based controller is applied, such safe operation is achieved by a proper tuning procedure, which was carefully derived and described. The main point is to activate maximum control pushing position and velocity away from a barrier. This must be performed in advance—when the tracking error achieves the critical value, which can be calculated beforehand if we are able to estimate maximum uncertainties. It was also stressed that the selection of specific BLFs used to derive the controller, although irrelevant for proving stability, has a strong influence on the practical implementation and control quality of a real system.
The proposed controller and the derived tuning procedure, aiming for practical safe operation of a servo, were confirmed in three ways: by a theoretical proof of stability using Lyapunov techniques, by extensive numerical simulations, and by laboratory experiments using two different servo systems—the first with a linear permanent magnet motor and the second with a rotational PMSM. All performed experiments demonstrate that the high control quality (fast transient response, accurate tracking) and safe operation (remaining within the state constraints) are not diminished even if severe unmodeled factors affect the actual, real system.
It was confirmed once again that, even if preliminary requirements impose constraints only on the position tracking error, it is advantageous to constrain the velocity tracking error as well. This provides a smoother trajectory and allows avoidance of rapid movements near the position-constraint boundary, which requires high control values. Proper choice of control system parameters is easier in the case of coexisting position and velocity constraints, as reported in [
41].
In addition to safe operation within constraints, the proposed controller ensures good tracking accuracy of the desired trajectory, despite unknown drive parameters. In practical applications, we achieved a quasi-steady-state tracking error no greater than twice the position measurement resolution.
This paper focuses on controlling an electric servo with one degree of freedom. The primary objective is to solve the tracking problem under hard position and velocity constraints while accounting for a nonlinear motion equation (e.g., nonlinear loads such as friction) with unknown parameters, control saturation, and measurement noise. Given the widespread use of servo systems performing single-degree-of-freedom motion, this problem is of significant practical and theoretical relevance.
Controlling multi-degree-of-freedom motion using BLFs can be approached in several ways. One-dimensional BLFs can be applied to each motion direction individually [
23]; constraints can be reduced to a scalar quantity, such as the norm of tracking errors [
24]; or multi-dimensional BLFs can be employed. While the derivation of adaptive controllers differs across specific applications, the issues of control saturation and measurement noise are common and can often be addressed using similar techniques. This presents a promising direction for future research.
For the sake of brevity, the approach presented here focuses on symmetric, time-invariant BLFs. Generalization to asymmetric constraints is straightforward. Time-varying constraints, however, require separate analysis—specifically, triggering error thresholds must be computed dynamically throughout the transient response. Nonetheless, the core idea remains applicable, making this another promising research area.
A completely different approach is required in the case of integral BLFs, which impose constraints on the state variables rather than on tracking errors, and for zone-BLFs, which enable energy-saving behavior within allowable constraint boundaries.