1. Introduction
The traditional formulation of the Computed Torque Control (CTC) assumes the possession of a precise system model and the lack of unknown or unobserved external disturbances, known nominal trajectory to be tracked
, the actual trajectory
according to (1) in which
denotes the generalized forces exerted by the robot drives,
being a positive definite (sometimes not very well conditioned but at least in principle invertible) inertia matrix of the robot arm, and
containing Coriolis and gravitational forces:
It is assumed that
and
can be measured by industrial sensors. By subtracting (1b) from (1c) and utilizing the existence of
, it is obtained that
Accordingly, the integral (
), the proportional (
), and the derivative (
) feedback gains must be appropriately set to guarantee the
,
, and
as
. The traditional way is based on the introduction of a “artificial state variable”
that evidently satisfies the LTI systems’ equation of motion in (
3).
By investigating the Jordan canonical form of matrix
A (e.g., [
1]), it can be stated that the system is stable if and only if the real part of each eigenvalue of matrix
A in (
3) is negative.
A more traditional approach is considering the symmetric positive definite matrix
Q and the matrix function
defined as
Evidently,
is symmetric, positive definite since the inverse of
is
and the inverse of
is
, i.e., these matrix exponential functions are invertible, therefore, they cannot map a nonzero array to zero. The time-derivative of
can be computed as
in which
In connection with the Canonical Form of Quadratic Matrices by Jordan [
1,
2],
exists only if each eigenvalue of the matrix
A has a negative real part. In this case
as
,
, and
is finite. For the special case of
, (5) yields that
in which evidently
(i.e., positive definite). For solving the so-called Lyapunov equation defined by (
7), modern program languages, such as e.g., Julia language [
3], simple functions are available by the use of which it can be checked whether a given setting of the parameters
,
, and
and given matrix
Q results in a solvable Lyapunov equation. This approach has a close relationship with the idea of PID controller.
The CTC controller can be introduced in a little bit different manner outlined in
Figure 1.
Assume that, for a second order system, on the basis of purely kinematic considerations, a “desired”
2nd time-derivative is constructed that guarantees the
,
, and
as
conditions if it is realized. If the available system model is not exactly precise (i.e., it contains the
,
approximate model) while the exact model contains the functions
,
, in
Figure 1, the control force is computed from the approximate model, and the realized
value will be
that in the special case of the “exact” approximate model leads to
. In this approach for designing
, we can follow a simpler choice than the more general PID-based approach. Let
const. and try to realize the motion according to
Since for differentiable
functions
, (
9) leads to
which evidently corresponds to particular possible PID feedback terms depending only on a single parameter
. To show that this setting results in vanishing tracking error as
, consider the functions
. Since
it follows that
. Consequently, the general solution of equations in (
9) for
is
in which the free coefficients
can be chosen according to the initial conditions. In other words, the linear set of the solutions is spanned by the basis vectors
so that each basis vector converges to 0 as
. It can be noted that, for tackling the problem of modeling errors, the traditional approach, such as the “Adaptive Inverse Dynamics Controller” or the “Adaptive Slotine-Li Controller” [
4], evolves by the use of Lyapunov’s stability theorem and his 2nd or “direct” method [
5,
6]. The “Robust Variable Structure/Sliding Mode Controller” invented in the Soviet Union in the past century (e.g., [
7,
8,
9]), instead of trying to realize (
9) (that according to the computations is very sensitive to the modeling errors), introduced the concept of “error metrics”
and the control goal
with
,
parameters. The simple idea behind (13) is that, for big
S components, the “tanh” function is saturated at
; therefore,
S can be driven to the vicinity of zero during finite time and subsequently can be kept around zero. The subtle dynamic details of how
is driven to zero or how is it kept near zero in this approach are not important; for this reason, a very approximate model can work well to maintain the
that has quite similar consequences as (
9) for the error integral and the error. This solution evidently can suffer from the phenomenon of chattering if parameter
K is very big and the “smoothing parameter”
w is too small.
Recently, control algorithms based on or incorporating CTC have been used in a wide variety of applied engineering research areas, such as motion control of miscellaneous robot manipulators with open and closed (or parallel) kinematic chains [
10,
11] and cable-driven robots [
12]; overhead crane payload sway control [
13]; attitude control of drone-like multi-rotor aircraft [
14]; operation of a musculoskeletal therapy device with artificial muscles [
15]; gait planning for bipedal robots [
16]. However, in almost all cases, separate integral, proportional, and derivative gains or parameters are used to “tune” the controlled system for the optimal trajectory tracking, which makes finding the ideal parameter set a complicated task.
The methodology followed in the article is as follows: first, a simple real-world testbed for control algorithms is introduced and its mathematical model is constructed based on various parameter estimation measurements (
Figure 2). Then, the performance of the one-parameter CTC algorithm is studied by comparing the simulated and measured (when the algorithm was running on a microcontroller, controlling the real-world testbed) trajectory tracking results. Further experiments were carried out on the real-world testbed showing trajectory tracking with alternative trajectory profiles (sine signal with increasing frequency). The resistance against outer disturbances tested with simulation and measurement as well and the results were compared qualitatively. Besides that, an alternative, more traditional control method (PID compensator with nonlinear feedforward term, referred to as “Nonlin. PID” in
Figure 2) is also tested for trajectory tracking by simulation and measurement. Finally, the robustness of CTC and “Nonlin. PID” methods against model parameter variations (when the controller, tuned for the original plant model, interacts with a plant with altered parameters) were compared using the simulational results of the two methods.
2. Structure and Mechanical Model of the Bi-Rotor Testbed
To justify the practical usability of the proposed one parameter CTC scheme, a simple twin-rotor experimental test stand was built, consisting of a beam rotating in the vertical plane around a horizontal axis in the vicinity of its middle point. The angular position of the arm—which is the controlled variable—can be varied by a control torque exerted by two propellers at both ends of the rod. Propellers were driven by electric motors with variable rotational speed, which can be regulated by a Pulse-Width Modulated (PWM) electric signal. The test platform is also equipped with a programmable microcontroller board on which the control algorithm can be implemented and executed in real-time. A photograph of the device and free body diagram of the arm belonging to the testbed is shown in
Figure 3. Basic information about the main components of the device is summarized in
Table 1.
The position of the lever arm is characterized by the inclination angle
given in degrees, which is defined as the angle between the horizontal direction (perpendicular to the gravitational gradient vector g) and the center-line of the arm. The instantaneous value of thrust force vectors generated by the left and right propellers are denoted by
and
. The distance between the center lines of the two rotors is
L. The gravitational force
(where
m is the mass of the arm) is acting at the
S center of gravity. The location of point
S relative to the rotational center point is given by distances
,
, where
is measured parallel with the arm center-line and
is measured perpendicular to the arm center-line. The horizontal and vertical components of the reaction force from the bearing are denoted by
and
.
,
and
are the instantaneous angular position, angular velocity, and angular acceleration of the lever arm, respectively. The damping torque
is considered to be proportional to the actual angular velocity:
where
d is a damping constant. By considering the aforementioned forces and torques, the lever arm equation of motion can be written in the following form:
where
is the lever arm moment of inertia calculated to the rotational center.
is the actual control torque, the second term in the equation is the torque of the gravitational force, and the third is the damping torque. Since the reaction forces
and
are rising at the center of rotation, they do not produce torque contribution. The connection between the
,
input PWM signals (to the left and right motors) and the exerted
,
thrust forces can be modeled as first order linear functions:
This consideration can be only held when
or
varies very slowly or when they are stationary constant values. Parameter
A is already known from experiments with the single-arm testbed. The actuator (BLDC motor with the propeller) dynamics is modeled with a dead-time, first-order block with parameters
force delay time and
force rising time, which was also measured previously when the single-arm version of the testbed was built (for more details about the force exertion dynamics, see [
17]):
The left and right motor PWM control signals are calculated from the single incoming control signal
according to the following logical rules:
The control signal distribution logic is also illustrated in
Figure 4.
Current control torque
generated by the two propellers is:
Therefore, momentary control torque acting on the arm written with the input signal
u is:
The equation of motion, including the actuation dynamics, becomes:
where
is a nonlinear function
. However, because of the tension and slight stuttering effects on the imperfect bearing,
might contain other unmodeled terms. In a stationary state, when
and
, equation of motion (
20) reduces to a time-invariant expression:
Stationary
states can be closely resembled, when input signal
u is increased linearly over time with a very small rate of change while the measured
values are also captured during the experiment, as depicted in
Figure 5. The connection between cohesive
value pairs can be well approximated by a fourth-order polynomial function
, which is considered as the static characteristic of the bi-rotor testbed:
After the experimental determination of the static behavior, dynamic parameter values for
and
d are fine-tuned to match with the experimental step response results (
Figure 6).
The values of identified model parameters can be found in
Table 2.
A prescribed control signal for a given desired acceleration
with current measured position and velocity values
, based on (
20) and (
22), is calculated as:
Equation (
23) serves as an inverse dynamic model for the controlled system. Here, it is worth mentioning that the inverse dynamic model described by the (
23) neglects the actuation dynamics (time delay and rise time) since it is already compensated by the derivative effect of the kinematic block (see in the next section).
3. Results
The details of the realized CTC control scheme as it was first tested in Matlab Simulink is illustrated by
Figure 7. For generating the rough nominal trajectory, the desired angular position was changed according to a predefined time schedule (0 degrees for 15 s, than
and 0 degrees for 10–10 s). From these rough values, a smooth time-dependent path is generated by the smoothed trajectory generator, which consisted of four first-order serially connected low-pass filters with time constants of 0.2 s. This step is essential, since the second-order temporal derivative of the nominal position (
) has to be finite and two times continuously differentiable function which can be fed to the kinematic block (described by Equation (
10)) to calculate the desired angular acceleration value
.
In the first 5 s of the operation, control signal
u is set to zero resulting in
s signal levels for the left and right motors. This phase is used for spinning up the rotors to reach their lowermost effective actuation levels (see
Figure 4). During this short “spinning up” phase, the arm executes small-amplitude free oscillation and the position is not controlled. Meanwhile, the measured angle is fed into the smooth trajectory planner, which thereby will be ready to generate a smooth transition path to the desired commanded position, when its output is already connected to the rough trajectory generator after 5 s. The measured transition between the uncontrolled first 5 s and the controlled state on the real physical system is also outlined later in the upper left graph in Figure 10.
During normal operation, the control signal
is calculated in two steps. First, the desired angular acceleration
is determined by the kinematic block in the function of nominal angular acceleration (
, originated from the smoothed trajectory generator), tracking error
, tracking error derivative
, and tracking error integral
according to Equation (
10). Then, the desired acceleration
, the measured current angular position
, and its derivative
are forwarded to the inverse dynamic model (Equation (
23)) to obtain the current control signal
, which here also plays the role of generalized control force
Q as also shown in
Figure 1. To keep the controller output in a feasible range (between
s and
s, see again
Figure 4), a saturation block is also added.
Besides the Simulink model, simulations were also carried out in the form of a Matlab script, where the simulation time step was s and a simple first-order Euler integration scheme was used to get the angular velocity and position values. For imitating the sensor noise, a random number with normal distribution was added to the realized positions, and the standard deviation parameter was 0.5053 degrees. The simulation was executed using six different trajectory tracking parameter values (, the unit of is s−1).
For performance evaluation of the proposed CTC scheme in the real world, a CircuitPython code was generated and compiled on the microcontroller board belonging to the test-bed. The execution cycle time of the real-time CTC algorithm was s (same value as the simulation time step). To attenuate tilt sensor noise without causing any additional time delay, fifty angle values were read from the tilt sensor in every computational cycle, and their mean value was utilized as the current value. Besides the mentioned straightforward “oversampling-averaging” technique, no other more advanced method was applied to improve the position signal quality. Instantaneous measured angular velocity was approximated by a simple numerical derivation (). Experimental measurements with a real-world test stand were also executed with six different values, lasting for 85 s.
Time series of the captured simulated and experimental data are compared in
Figure 8. Good quality trajectory tracking was achieved in general both for simulated and experimental cases. The only appreciable difference between simulations and experiments is the behavior during the uncontrolled phase in the first five seconds, which can be explained by the fact that one of the rotors starts to spin slightly earlier (about 0.3–0.5 s) than the other, resulting in a short living non-zero torque acting on the beam. In the plots depicting control signal variations, upper and lower limits (
s,
s) are outlined by a dashed line. The CTC algorithm results in highly fluctuating control signals for all scenarios. However, the wobbling in
seems to be more intense in simulations, since the sensor noise level was slightly over-estimated. As the
parameter increases, fluctuations become more and more significant, as well as
more likely tending to saturate at the limits of the usable signal range.
Small scale variations in the quality of trajectory tracking caused by changing parameter
can be highlighted by evaluating the absolute integral error between the realized and nominal trajectory, while the control algorithm is active:
Simulations and experimental measurements based on the aforementioned absolute integral error quantity are ranked in
Figure 9.
It can be observed that there is an optimal trajectory tracking parameter value that provides the smallest absolute integral error. The most advantageous value for
is 2.75 s
−1 in the case of experiments and 2.25 s
−1 for simulations. This observation can be explained as follows: for smaller
values, the trajectory tracking is less “aggressive”, therefore some details of the nominal trajectory are not followed perfectly, while, for larger
values, the controller is “overreacting”, causing frequent saturation on the output, and, for this reason, some features of the desired path are again missed. Some detailed views of the best experimental trajectory followings with
s
−1 are shown in
Figure 10.
To show that the proposed CTC scheme is not optimized just for a certain specific nominal trajectory,
s
−1 experimental setting is also tested in the frequency domain by applying a sinusoidal wave as the desired path with a decreasing time period known as “chirp signal” (see
Figure 11). Frequency is increased linearly over time from 0.001 Hz to 0.57 Hz, the peak-to-peak amplitude was 60 degrees with −30 minimal and +30 maximal values. The smooth transition between the controlled and uncontrolled phase is achieved by phase-shifting of the initial sine wave to match the last measured angle value at the end of the five seconds long “free oscillation” period. The trajectory tracking is almost perfect up to 0.3 Hz and a still acceptable quality path following can be observed up to 0.45 Hz (as a comparison: the natural frequency of the abandoned system, when oscillating freely is around 0.5 Hz). Low-grade path fidelity can be observed from 0.45 Hz to 0.65–0.7 Hz; stability loss is occurring around 0.75–0.8 Hz.
The change in the quality of trajectory tracking under the influence of external disturbance was first investigated by simulation (
Figure 12). The duration of the applied external disturbance torque was 10 or 1 s, and the absolute value was one-third of the maximal achievable control torque (which is exerted when the lowest
or the highest
control signal values are sent permanently to the input signal distribution function depicted in
Figure 4). When both short and long-duration disturbances occur or are removed, a transition period of about 10 s is needed for the algorithm to bring the controlled variable back to the vicinity of the prescribed nominal path.
To show that the effect of external torque perturbations is also neutralized in real life, “qualitative” measurement series were elaborated, where the external disturbance was induced manually by pushing one of the arms belonging to the test stand arm (the measured results are shown in
Figure 13, a similar magnitude of torque to the simulated disturbance could have been achieved by suspending weights to the arm, but the coordination of the weights’ loading and unloading with the simulation load timing would have been too complicated). Each manual push lasted about 1 to 3 s. It is worth mentioning here that, in this experiment, the nominal trajectory was not predefined, but was generated in real-time by the microcontroller based on rough trajectory data provided by an incremental encoder knob. Each time, the experimenter turned the encoder knob by one position, the rough trajectory increased or decreased by 2 degrees, and this was fed to the smoothed trajectory generator.
4. Performance Comparison of CTC and PID Compensator with a Nonlinear Feedforward Term
Since the desired nominal trajectory encompasses a wide range of motion (from –40 to +40 degrees), most conventional PID controller design methods, such as fitting a linear PID block to the linear approximated version of the original nonlinear system in a certain operating point, are out of the question. However, when the nonlinear part of the system model is supposed to be known or can be determined by carefully designed experimental measurements (e.g., approximation by polynomial functions, as was done previously in
Section 2), PID compensation can be an option together with a nonlinear feedforward [
4] term. In our particular case, the control signal for the bi-rotor testbed can be formulated as
where
is a built-in by default PID controller block in Matlab Simulink (referred to as the “ideal form” of PID blocks), which can be “tuned” automatically to get a desired step response function. With controller in (
25) (not considering the actuation time delay and rise time), the equation of motion (
20) becomes:
Since
(see Equation (
22)), the troublesome nonlinear part is canceled out and the resultant model can be further treated as an LTI system. Deficiencies of the actuator dynamics (dead-time, rise time) can also be compensated up to a certain limit by appropriate
choice. The Simulink model of the realized “PID with nonlinear feedforward” control scheme is depicted in
Figure 14, where the feedforward linearizator block contains formula
and the smoothed trajectory was generated in the same way as was done previously in the case of the CTC method.
The obtained
parameters from PID tuning are shown in
Table 3. Since the lower computational demand is relative to the CTC algorithm, simulation time step and execution cycle time for the real-time controller board were halved from their original value. On the “D” channel, a first-order low-pass filter was inserted to attenuate the noise on the angular velocity signal (in addition, the aforementioned oversampling and averaging method for conditioning the measured angular position signal has also remained in use).
Experimental and simulation results for trajectory tracking with “PID with nonlinear feedforward” control scheme are shown in
Figure 15. Trajectory tracking is much less accurate relative to the CTC results, even with carefully tuned PID parameters. The constant sections in the desired path are reached with a considerable amount of over- or undershoots. These temporal peaks can be totally eliminated by choosing a less “aggressive” PID parameter set option, but, in this case, the settling time (the amount of time necessary to reach a constant value) expanded to 7–8 s, which generally resulted in even worse quality trajectory tracking. Experimental results for path following are again slightly better than the simulation ones, which can be explained by the “pessimistic” noise level approximation, and also by the sensitivity of the PID-based algorithm to the variations of the static and inertial parameters (see
Figure 16 and the next two paragraphs about the model robustness).
To test the robustness and model parameter sensitivity of the two different proposed control schemes, a set of simulation studies were performed, where the original control scheme interacts with altered virtual plant versions (
Figure 16, for CTC,
s
−1 case was chosen as the “original” controller since it had the smallest absolute integral error value). In the first set of simulations, only inertial parameter
was varied by
relative to its identified value in
Table 2; in the second set, only the viscous parameter
d was varied by
; in the third set, only time-delay
was varied by
, and, finally, in the fourth set of simulations, all “static parameters” including
were altered by
at the same time in the plant model, while other system parameters were kept at a constant value.
While the CTC scheme was unaffected by all types of investigated model alternations, the “PID with nonlinear feedforward” algorithm shows a significantly different trajectory tracking behavior when the inertial or the static parameters were changed in the given range. The only disadvantage that can be mentioned in this comparison against the CTC is that it loses its stability when dead-time is increased drastically by factor 2.5 (0.2 s instead of the “true” 0.08 s), while the same time “PID with feedforward” still remains stable with very low quality trajectory tracking.
5. Conclusions
In highly nonlinear systems—e.g., in robotics, autonomous driving, navigation or attitude control of aerial vehicles—precise trajectory tracking is a crucial issue, especially if the system is loaded by time-delay as well. In this study, we have provided a generally applicable framework which aims to deal with this issue. We have developed and implemented an effective single parameter CTC control algorithm which was tested by various simulations and experiments that are ideal for applications where a specific nominal trajectory has to be followed precisely. The presented controller scheme preserves its stability and precision for a wide range of trajectory tracking parameter values even if the actuation dynamics are corrupted by severe time delays, saturation, significant external disturbances, and feedback sensor measurement noise. While designing the CTC controller, no high precision exact model is required, since it shows appreciable robustness against model parameter variations.
The robustness of the presented control scheme and its insensitivity to model parameter variations can be further improved by adding a fixed point iteration-based adaptive deformation block between the kinematic and inverse dynamic blocks in
Figure 7, which modifies or “deforms” the desired acceleration based on the last measured realized acceleration and the last calculated “deformed” acceleration value. Theoretical background and various simulation studies connecting to the CTC scheme supplemented by a fixed point transformation block can be found in [
18,
19,
20,
21]. It is worth noting that, while the theoretical background of this adaptive approach was elaborated in 1922 by Banach in his Fixed Point Theorem [
22], the first proposal for its application in adaptive control was only published in 2009 in [
21]. This method means a kind of “general framework” that can be filled in with various particular contents by specifying various functions, the use of which the task of finding the appropriate control signal can be transformed to iteratively finding the fixed point of a function. The function called “Robust Fixed Point Transformation” was the first example that was published in [
21]. Later different functions were suggested and investigated via simulations in [
23,
24,
25] that mean potential solutions. In the near future, experimental performance investigation of fixed point iteration based methods will hopefully be carried out by the help of the presented twin rotor test platform.