You are currently viewing a new version of our website. To view the old version click .
Robotics
  • Article
  • Open Access

26 May 2024

Optimization of Q and R Matrices with Genetic Algorithms to Reduce Oscillations in a Rotary Flexible Link System

,
and
1
Department of Electronic Technology, Systems Engineering and Automation, Universidad de Cantabria, Avda. de los Castros, Santander, 39005 Cantabria, Spain
2
Faculty of Systems and Telecommunications, Universidad Estatal Península de Santa Elena, Avda. La Libertad, La Libertad, Santa Elena 7047, Ecuador
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
This article belongs to the Section Industrial Robots and Automation

Abstract

Automatic control of robots with flexible links has been a pivotal subject in control engineering and robotics due to the challenges posed by vibrations during repetitive movements. These vibrations affect the system’s performance and accuracy, potentially causing errors, wear, and failures. LQR control is a common technique for vibration control, but determining the optimal weight matrices [Q] and [R] is a complex and crucial task. This paper proposes a methodology based on genetic algorithms to define the [Q] and [R] matrices according to design requirements. MATLAB and Simulink, along with data provided by Quanser, will be used to model and evaluate the performance of the proposed approach. The process will include testing and iterative adjustments to optimize performance. The work aims to improve the control of robots with flexible links, offering a methodology that allows for the design of LQR control under the design requirements of controllers used in classical control through the use of genetic algorithms.

1. Introduction

In robotics, particularly in systems incorporating flexible links, effective vibration management is essential for maintaining system precision and stability. Flexible links are highly valued in the field of robotics for their capacity to enhance the accuracy in the transmission of motion and forces, and for their utility in passive vibration reduction [1]. In addition, Flexible-link robots present several advantages over their rigid counterparts, mainly due to their lightweight construction, which leads to high throughput and low power consumption [2], although passive reduction methods are effective under certain conditions, they exhibit limitations in dynamic environments where the demands for responsiveness and adaptability intensify. In contrast, active control systems can provide superior adaptability and precision by dynamically adjusting control parameters in response to real-time environmental conditions. This is particularly relevant in advanced robotics applications where even minor deviations can lead to significant errors or system failures. Therefore, the integration of active control strategies emerges as a critical solution to overcome the limitations of purely passive isolation methods in robots with flexible components.
Active control of robots with flexible links has been a topic of significant importance in control engineering and robotics [3]. On one hand, flexible links present an engineering challenge due to the vibrations that occur during the transitional phase of controlling the position of a robotic arm, affecting both the performance and the precision of the system [4]. The issues arising from these vibrations range from positioning errors to component wear, and occasionally, system failures. On the other hand, studies such as [5] investigate how micro-positioning systems, which utilize flexibility based on the elastic deformation of joints or mechanism sections, eliminate wear, noise, and friction. These characteristics are crucial when considering the automation of robots with flexible links in environments that demand high precision, such as in surgical robotics or micro-device manufacturing. The discussion includes the use of active control systems, deliberating on the design of controllers and actuators and the selection of essential materials for precision. Cases like these motivate the pursuit of better techniques that effectively address the ability to control these vibrations according to the system’s requirements.
The linear quadratic regulator (LQR) is one of the most common and effective approaches in controller design, given its ability to provide good performance based on quadratic criteria. In LQR control, the performance index is minimized with optimal weight matrices. The [Q] and [R] matrices are the most crucial parameters to keep actuator voltage within certain limits while maintaining maximum control performance. Hence, the importance in LQR control lies in determining the optimal state weighting matrix [Q] and the input weighting matrix [R] [6].
In advanced control systems, proper design and tuning of controllers are essential to ensure the desired system performance; however, the appropriate choice of weighting matrices in LQR design is crucial and can be complex in many situations. Optimizing these matrices can be challenging, as manual selection or the use of traditional optimization techniques may not always yield the best results, especially in complex or nonlinear systems. To overcome this challenge, this study proposes the use of genetic algorithms as in [7] to find the weights for the gain matrix K according to the controller design requirements.
In [8], optimization deals with performance criteria such as rise time, overshoot, control energy, and a measure of robustness, among others. Optimization is achieved through the use of an elitism-based genetic algorithm (GA). Also, Ref. [9] investigates dynamic modeling and vibration control for a large flexible space truss. The space truss is a typical periodic triangular prism structure consisting of beams and rods. Considering the transverse deformation of the entire structure, the equivalent dynamic model of the space truss is established using the principle of energy equivalence. Fourth-order governing equations of the equivalent cantilever beam model are derived and solved by adopting Hamilton’s principle and the Galerkin method to achieve its discrete dynamic model. The LQR vibration controller is designed when the space truss is subjected to periodic and impulse excitation. The control moment is applied to the large-scale finite element model of the space truss, and numerical simulations prove the effectiveness of the designed LQR vibration controller for the suppression of vibrations.
In [10], the so-called linear quadratic regulation problem is a modern control strategy that, through the configuration of the weight matrices Q and R, takes on the tedious task traditionally performed by specialists in controller optimization, finding the control parameters that minimize unwanted deviations. However, there are no simple analytical methods that assist the designer in defining the values of these matrices, which depend on the system, the control to be achieved, and the efforts of the control variables, making deep knowledge of the process essential for the engineer. Classic approaches such as trial and error, Bryson’s method, and pole placement are tedious and do not guarantee the expected performance. This research proposed a methodology based on genetic algorithms and particle swarm optimization to define the weight matrices Q and R, achieving the design of optimal controllers in a simple, fast manner starting from basic knowledge of the system to be controlled. The controller is evaluated using MATLAB and Simulink, assessing the effectiveness of the proposed scheme in terms of tracking and robustness through three test cases.
Our research is conducted on a cantilever beam, which is attached to a DC motor, and the model representation is executed in state space. The model is compared with the actual plant (rotary flexible link) with data provided by Quanser®, a global leader in hardware for real-time control design in education and research [11], where the GA-LQR controller is evaluated. This work highlights the genetic algorithm used for the optimization of a LQR under specific designer conditions swiftly and effectively in robots with flexible links, aiming to minimize oscillations at the tip of the link by controlling its base.
The primary contributions of this research include the development of a GA-LQR controller that integrates classic control design criteria, such as percentage overshoot and settling time [12], directly into the algorithm’s cost function, allowing for precise alignment of the Q and R parameters with the specific design objectives of the controller. The results of the simulations clearly confirm that the proposed control system effectively minimizes the end vibrations of the manipulator, fulfilling the requirements set out in the design of the genetic algorithm. Moreover, a general methodology has been established for enforcing specific design requirements for position control of the tip of a rotating flexible link, using genetic algorithm techniques over a LQR for the optimization of desired parameters.
The use of a reference model for the GA ensures that the resulting parameters are aligned with a known desired behavior, although it is essential that the reference model be representative enough of the real system for the optimized parameters to be effective in practice. For future work, the challenge of using the GA-LQR control in real time is proposed. One approach could consider running the GA on a slower cycle, which allows for reviewing and adjusting the LQR parameters based on the system’s recent performance, while a faster LQR controller handles real-time control. Additionally, an improvement would be to develop a faster and more efficient version of the GA that can operate in real time or near-real time. It is hoped that this proposal will contribute to the scientific and technological community by offering other perspectives to develop controllers for flexible systems. Furthermore, this approach may serve as a foundation for future research and applications in the industry.

3. GA-LQR Control

The design of LQR (linear quadratic regulator) control and closed-loop simulation in this context aims to first design a state feedback control based on LQR that is optimal for two main purposes: first, to control the servo position to reach a desired angle and second, to minimize the residual oscillations or vibrations of the flexible link, especially when the servo changes position. To be able to apply the LQR controller, certain criteria must first be checked: identification or verification of the stability of a system by observing the location of the eigenvalues in the complex plane [31].
det ( s I A ) = s 4 + a 1 s 3 + a 2 s 2 + a 3 s + a 4
The eigenvalues of the system are negative, ensuring its stability. The controllability of the system is also verified; for this, the Kalman controllability criterion is based on the controllable matrix, formed from the matrices B , A B , A 2 B , , A n 1 B , where n is the dimension of the state vector x . If the rank of this matrix equals the dimension of the system’s state space, then it can be asserted that it is completely controllable [32]. In this system, the rank of ξ equals n; therefore, it is completely controllable.
ξ = B A B A 2 B A n 1 B
rank ( ξ ) = n
Linear quadratic regulation (LQR) stands out as a powerful technique for controller synthesis. This approach is based on minimizing a quadratic cost function that balances system performance and control effort. By employing LQR, an optimal solution is sought that not only ensures system stability but also optimizes its response according to predefined performance criteria and energy efficiency. The following sections will describe how LQR is utilized to determine the gain matrix K, which is crucial for achieving the desired closed-loop behavior of the system.
LQR control, also known as linear quadratic control, is an optimal control strategy that seeks to maximize the performance of a system through the optimization of a cost function. This technique focuses on solving the regulation problem, which is addressed by minimizing a quadratic index with a linear solution. Thus, LQR control aims to minimize the quadratic function or cost index to improve system performance [33]. It requires the controller to minimize a performance index of the form [34]
J = t 0 ( x T Q x + u T R u ) d t
where Q is a positive definite or positive semidefinite Hermitian matrix of nxn, R is a positive definite Hermitian matrix of rxr, and S is a positive definite or positive semidefinite Hermitian matrix of nxn.
The matrices Q and R determine the relative importance of the error and the cost of this energy.
The control signal is given by:
u ( t ) = K x ( t )
Substituting Equation (78) into Equation (77) gives
J = t 0 ( x T Q x + x T K T R K x ) d t
The Hermitian matrix P is real and nxn, and for fully controllable state systems, it is positive definite or positive semidefinite. Equation (80) is equated as follows, and it must comply with the subsequent reduced equation.
x T ( Q + K T R K ) x = ( d ( x T P x ) ) / d t
Deriving the above expression results in
x T ( Q + K T R K ) x = x ˙ T P x x T P x ˙ = x ˙ T [ ( A B K ) T P + P ( A B K ) ] x
If A – BK is a stable matrix and there exists a positive definite matrix P that satisfies the above equation, then it is satisfied that
( A B K ) T P + P ( A B K ) = ( Q + K T R K )
For the determination of R, it is rewritten as R = T T T , where T is a nonsingular matrix, having
( A B K ) T P + P ( A B K ) + ( Q + K T T T T K ) = 0
Rewriting the previous equation yields
A T P + P A + [ T K T T B P ] T [ T K T T B P ] P B R 1 B T P + Q = 0
J is minimized with respect to K from the previous equation, and the following is obtained:
K = R 1 B T P
The matrix K, identified in Equation (85) as the optimal solution, indicates that the most effective control method for tackling the linear quadratic control problem takes on a linear form.
The P matrix from Equation (85) must satisfy the reduced equation, also called the Riccati equation, shown in Equation (86), which has a unique solution. Therefore, it can be concluded that the optimal controller for the linear quadratic regulator problem has a unique solution in the form of a control signal that is a state feedback controller.
A T P + P A P B R 1 B T P + Q = 0
Searching for the optimal configuration for matrices Q and R can be complicated. Both manual selection and conventional optimization methodologies often fail to achieve the most effective results, particularly in systems of complex or nonlinear nature [35], where this optimization strategy is applied to determine the optimal values in the LQR matrices used in the control of flexible structures, such as cantilever beams.
Genetic algorithms (GAs), founded on the Darwinian theory of species evolution, seek to find the optimal solution to a problem through the implementation of three distinctive operations that make up their genetics: Selection, crossover, and mutation cycles are repeatedly performed until satisfying a pre-established termination criterion. These algorithms do not require detailed knowledge of the problem to be solved but apply heuristics for the solution, which significantly restricts the number of data needed for their operation [36]. The parameters for the development of the genetic algorithm for this proposal are presented in Table 3.
Table 3. Initial parameters of the proposed GA.
The following presents the implementation of a genetic algorithm to optimize the coefficients of the Q and R matrices of the well-known LQR control algorithm according to the requirements for the control design. For this proposal, two parameters of the system dynamics are selected, and the cost function designed for this GA measures these two variables for each system output: overshoot (percentage), the percentage difference between the maximum value and the final value of the controlled signal, and the settling time, which is the time it takes for the signal to remain within 2% of its final value. Finally, it penalizes deviations from these values. The LQR design is based on minimizing the cost function:
J = 0 x T ( t ) Q x ( t ) + u T ( t ) R u ( t ) d t
where:
x ( t ) is the state vector.
u ( t ) is the control vector.
Q , R are defined weighting matrices.
The cost function design is made to evaluate the performance of a stable, time-invariant, second-order underdamped system with multiple outputs (SIMO: single-input multiple-output). It is based on two important metrics in control system theory: maximum overshoot and settling time. These are crucial metrics in many control applications, as they indicate how quickly and accurately a system can reach and maintain its desired state. It also allows for a quadratic penalty for deviations from desired targets, providing a stronger penalty for larger deviations, which helps guide the algorithm toward solutions that closely match the desired criteria. Furthermore, The cost function balances system performance by penalizing both overshoot and undesirable settling time. Primarily, it is designed with the real characteristics of a control system in mind, so the optimization results will be relevant and applicable in practical scenarios. Lastly, it allows for a clear and quantifiable measure of performance that the algorithm can optimize.
The cost function comprises two main components: the relative maximum oscillation component ( O S ) and the settling time component ( T S ).
For the first component, the relative maximum oscillation for each output variable is calculated. This is determined as the maximum change between the values of the variable ( θ ) and the reference (step signal), expressed as a percentage.
For the second variable ( α ), the oscillation is calculated differently, considering the maximum absolute change relative to the initial value.
If the relative maximum oscillation exceeds a certain threshold, the number of samples before this oscillation occurs is calculated and multiplied by the time interval to obtain the stabilization time ( T S ) for that variable.
The settling time component ( T S ) represents the time required for each variable to reach a certain level of stability after undergoing significant oscillations. It is determined as the number of samples before the variable returns within a specific stability threshold and is multiplied by the time interval.
Finally, the cost function aggregates these components for each variable as shown in expression (88).
F = ( O S B γ ) 2 + ( O S P γ ) 2 + ( T S B β ) 2 + ( T S P β ) 2
where
O S B is the maximum overshoot of the base angle of the RFL.
O S P is the maximum overshoot of the tip angle of the RFL.
γ is the desired maximum overshoot.
T S B is the settling time of the base angle of the RFL.
T S P is the settling time of the tip angle of the RFL.
β is the desired settling time.
This cost function seeks to penalize solutions that have significant oscillations or take a long time to stabilize. The values of the deviations can change depending on the context of the problem and the designer’s preferences. A lower cost indicates a better and more stable solution in terms of reducing the magnitude of oscillations and the stabilization time of the measured variables.
The f n function is the cost function, which is described as follows:
Input: matrix y, sampling time t s .
Output: cost function value f, peak overshoot m p maxTip , peak overshoot m p maxBase , minimum settling time t s min .
  • Determine n u m _ o u t p u t s as the number of columns in y.
  • Initialize m p (peak overshoots) and s t (settling times) arrays to zeros.
  • For each output i from 1 to n u m _ o u t p u t s :
    (a)
    Extract the i-th column y i from y.
    (b)
    If i is 2 (special case for the second output):
    -
    Calculate i n i t i a l _ v a l u e as the first element of y i .
    -
    Determine m a x _ c h a n g e as the maximum absolute deviation from i n i t i a l _ v a l u e .
    -
    Compute the relative peak overshoot m p ( i ) .
    -
    Update m p maxPunt as the maximum of m a x _ c h a n g e .
    (c)
    Else (for other outputs):
    -
    Calculate m p ( i ) as the relative peak overshoot from the final value.
    -
    Update m p maxBase as the maximum of m p .
    (d)
    Determine n as the last time index where the output deviation exceeds 1%.
    (e)
    If no such n is found, set n to 0.
    (f)
    Compute the settling time s t ( i ) for output i.
  • Determine t s min as the minimum settling time across all outputs.
  • Compute the cost function f as a weighted sum of squared deviations from desired overshoot and settling time.
The process of interaction of the genetic algorithm with the Simulink model to find the optimal controller parameters is as follows: The initial parameters of the genetic algorithm are established, and the initial population is generated. Each individual in the initial population is evaluated. This involves running the simulation in real-time with each individual’s parameters, followed by calculating the cost function for each set of parameters. The results of this initial evaluation are used to rank the population according to their performance. Then, the GA cycle generates a new temporary population, which includes elite individuals and new individuals created through crossover and mutation. With these results, pairs of individuals are selected, crossover and mutation operations are applied to create new individuals, and restrictions are applied. Finally, for each new individual, a simulation is set up and run using that individual’s parameters, the cost function is calculated for each new parameter configuration, and the population is updated with the new individuals, recalculating the selection probabilities based on the cost function. The parameters of the best individual are used to adjust the controller in the Quanser Interactive Labs virtual scenario.
Below is the control algorithm for the AG-LQR controller:
Definition of constants and parameters:
A , B , C , D , t s = 0.01 , p c = 0.9 , p m = 0.8 , N g = 10 , N i = 2 N g , N gen = 10 N g , N e = 2 , Q min , R min
where A , B , C , D are the matrices that define the dynamics of a system in the state equations or transfer functions, t s is the sampling time in seconds, p c is the crossover probability in genetic algorithms, indicating the frequency at which pairs of individuals are combined to produce offspring, p m is the mutation probability in genetic algorithms and reflects the frequency at which individuals undergo random changes, N g is the population group number, N i is the population size, N g e n is the total number of generations in a genetic algorithm, N e is the number of elite individuals, and finally Q m i n and R m i n are the initialization values for the weighting matrices Q and R in optimal control.
Population initialization:
Q n 0 = diag ( [ P o p ( n 0 , 1 ) + P o p ( n 0 , 2 ) + zeros ( 1 , size ( A , 1 ) 2 ) ] )
R n 0 = P o p ( n 0 , 3 )
Evaluation process of the matrix values Q and R:
for n : i
Q n = diag ( [ P o p ( n , 1 ) + P o p ( n , 2 ) + zeros ( 1 , size ( A , 1 ) 2 ) ] )
R n = P o p ( n , 3 )
K = lqr ( sys , Q , R )
Sys cl = ss ( A B × K , B , C , D , t s )
y t = step ( Sys cl )
f n = cos to ( y t , t s )
Fitness function for the GA:
F n = 1 1 + f
P = F n F n
P T = 0 i P i
In this context, P T is a cumulative probability vector used for the stochastic selection of individuals in the iterative process for the genetic algorithm. Then, the process of selection, crossover, mutation, and insertion is repeated to generate the next generation of the population.
Finally, the K gains are calculated from the optimal values of Q and R obtained that meet the design requirements:
q 1 = P o p ( 1 , 1 )
q 2 = P o p ( 1 , 2 )
r 1 = P o p ( 1 , 3 )
Q = diag ( [ q 1 , q 2 , zeros ( 1 , size ( A , 1 ) 2 ) ] )
R = r 1
[ K r ] = lqr ( s y s , Q , R )
This approach provides a design that allows for the controlling of two parameters of the two output variables, θ and α , demonstrating the computational work of the GA on the dynamic characteristics of the system, the overshoot, and the settling time, which enables one to obtain optimal values for the GA-LQR controller for these two parameters.

4. Lyapunov’s Theorem in GA-LQR Stability Analysis

The stability analysis of the GA-LQR designed controller follows the same fundamental principles of Lyapunov’s stability analysis that apply to any LQR design. The primary difference lies in how the matrices Q and R are selected. The condition A c l T P + P A c l < 0 is a key expression in control theory for verifying the stability of a system using Lyapunov’s Theorem for continuous-time systems.

4.1. Lyapunov’s Theorem

Lyapunov’s theorem is a fundamental tool for determining the stability of dynamic systems without the need to explicitly solve the differential equations describing them. According to this theorem, if a Lyapunov function V ( x ) can be found such that:
  • V ( x ) > 0 for all x 0 (positive definite).
  • V ˙ ( x ) < 0 for all x 0 (negative definite time derivative).
Then, the system is stable in the sense of Lyapunov.

4.2. Application to GA-LQR

In the context of LQR, when designing a controller, we transform the system dynamics into a closed-loop form A c l = A B K . To verify the stability of this closed-loop system, we choose V ( x ) = x T P x as a candidate Lyapunov function, where P is a symmetric positive definite matrix obtained from solving the Riccati equation.
For the Linear Quadratic Regulator (LQR) method to function correctly and for the solution of the Riccati equation (which produces the matrix P) to ensure stability, the matrices Q and R must satisfy certain properties:
  • The matrix Q must be positive semidefinite. This condition ensures that the state variables are properly penalized, contributing to the system’s performance optimization.
  • The matrix R must be positive definite. This requirement guarantees that the control effort is penalized, helping to avoid excessive control actions that could destabilize the system.
These properties are crucial for ensuring that the LQR method not only minimizes the quadratic cost function but also maintains the stability of the controlled system [32].

Derivative of V ( x ) :

The derivative of V ( x ) along the trajectories of the system is
V ˙ ( x ) = x ˙ T P x + x T P x ˙
Substituting x ˙ = A c l x :
V ˙ ( x ) = ( A c l x ) T P x + x T P ( A c l x )
V ˙ ( x ) = x T A c l T P x + x T P A c l x
V ˙ ( x ) = x T ( A c l T P + P A c l ) x
x ˙ = A c l x : This equation demonstrates how the system states x evolve over time under the influence of the controller. The matrix A c l encapsulates both the original dynamics of the system and the influence of the controller. This integrated dynamic model is crucial for understanding and predicting the system’s behavior under controlled conditions.

4.3. Lyapunov Condition

For V ˙ ( x ) to be negative definite, it is necessary that the matrix A c l T P + P A c l be negative definite. This is expressed as
A c l T P + P A c l < 0
This condition ensures that the Lyapunov function V ( x ) decreases along all system trajectories, implying that the closed-loop system is stable.

4.4. Process of Stability Verification

  • Matrix Q is positive semidefinite and matrix R is positive definite. While these conditions ensure that the fundamental requirements for the application of the LQR method are met, they alone do not guarantee system stability. It is crucial to perform additional stability verification, as the controller’s ability to stabilize the system depends on the entire closed-loop system dynamics, not just on the positiveness of Q and R. The matrix K derived from the solution to the Riccati equation must be validated to ensure that it leads to a closed-loop system matrix A c l = A B K with eigenvalues having negative real parts, confirming stability. Simply meeting the positivity conditions of Q and R is necessary but not sufficient; explicit stability checks must be integrated into the control design process to ensure robust and reliable controller performance.
  • The system has been analyzed for controllability and the results confirm that the system is fully controllable. The controllability matrix C o is given by:
    C o = 10 5 × 0.0000 0.0001 0.0022 0.0545 0.0000 0.0015 0.0388 0.5034 0.0001 0.0035 0.1596 5.5443 0.0001 0.0038 0.2424 9.3199
    The controllability matrix has a rank of 4, indicating that the system is fully controllable. This confirms that any state can be reached from any initial state, ensuring effective response to control inputs across all state variables.
  • Obtaining the matrix P through the solution of the Riccati equation:
    A T P + P A P B R 1 B T P + Q = 0
    The matrix P calculated for our GA-LQR controller is as follows:
    P = 54.7975 0.1152 2.3261 1.0537 0.1152 5.1686 4.3326 2.0855 2.3261 4.3326 4.4682 2.3730 1.0537 2.0855 2.3730 1.3842
    The symmetry of this matrix ensures the validity of the Lyapunov function used in our stability analysis.
    Furthermore, the eigenvalues of P, which are λ = [ 0.0405 , 0.6612 , 8.6945 , 13.7583 ] , all positive, confirm that P is definitively positive definite, ensuring that our Lyapunov function is adequate for demonstrating the stability of the system.
  • Ensuring that the derivative of the Lyapunov function V ( x ) = x T P x is negative for all x 0 . This is a crucial condition indicating that the closed-loop system is stable.
    The closed-loop system matrix A c l = A B K , obtained by applying the feedback control law, is crucial in this analysis. The stability can be verified by examining the eigenvalues of A c l . Specifically, the system is stable if all eigenvalues of A c l have negative real parts.
    Using MATLAB, the eigenvalues of the matrix A c l were computed as follows:
    Eigenvalues = 36.6266 + 0.0000 i 9.5173 + 24.2550 i 9.5173 24.2550 i 0.1391 + 0.0000 i
    Analysis of these eigenvalues indicates that all have negative real parts, confirming that the system is stable. This is because the real parts of the eigenvalues, which affect the exponential decay or growth of the system’s response, are all negative.
    The negative real parts of the eigenvalues ensure that V ˙ ( x ) < 0 for all x 0 , confirming that the derivative of the Lyapunov function is negative in all cases except the trivial case of x = 0 . This analysis verifies the system’s stability, ensuring that any deviations from the equilibrium state will decay over time, leading to the system settling back to stability.
These steps underline the critical aspects of verifying the stability of a control system designed with optimization techniques, ensuring that despite the modifications in the parameters Q and R, the system remains stable and performs as expected.

5. Evaluation of the GA-LQR Control Results

5.1. Response to a Step Signal

To evaluate the proposed control system, the system’s response is compared to the response generated by an LQR controller.
In (Figure 6), the response of the base position to a step signal is compared due to the LQR control and the GA-LQR control. Both controllers stabilize the system at the desired value. The settling time appears to be fast for both, although it is slightly faster for LQR. The LQR curve shows a rapid rise compared to the GA-LQR curve, indicating a quicker response and possibly better handling of uncertainty or changes in system dynamics.
Figure 6. Simulated response comparison.
In (Figure 7), oscillations are due to the nature of the system, here, the GA-LQR response shows a quicker reduction of oscillation, thanks to the control of damping in the system, while the LQR response shows persistent oscillation, indicating a less optimal adjustment to suppress vibrations.
Figure 7. Response comparison of the link tip.
Settling time is hard to determine in oscillatory systems like this, but the goal would be to minimize the amplitude and number of oscillations as shown in Figure 7.
To determine the dynamic characteristics of the system outputs, the discrete model was obtained. Below, Table 4 and Table 5 show the results in response to a step signal.
Table 4. Comparison of the system dynamics (link base) against proposed controllers.
Table 5. Comparison of system dynamics (tip of the link) against proposed controllers.
In Figure 7, the oscillations at the tip of the link are observed, comparing the dynamics against the two controllers.
In Table 5, some dynamic characteristics measured at the tip of the link can be observed. It is shown that the design of the proposed algorithm meets the specified requirements, such as significantly reducing oscillations at the tip of the link as outlined in the proposal.

5.2. Error Dynamics in Flexible Link Control Systems

The Figure 8 of the tip error shows that both GA-LQR and conventional LQR experience significant initial error peaks. The GA-LQR reduces the error more quickly and stabilizes with a slightly lower steady-state error compared to the conventional LQR. This suggests that while the GA-LQR is optimized for a quick response, it achieves better steady-state precision at the tip of the link, which is influenced by more complex dynamics due to its flexibility.
Figure 8. Response comparison of the error Link Tip.
In the Figure 9 of the base error, we observe that both controllers initially also show error peaks. However, the GA-LQR shows a slower reduction of error compared to the conventional LQR and maintains a marginally higher steady-state error. Despite this, the control and correction of the error at the base are more straightforward and effective due to the lower complexity compared with the control of the tip.
Figure 9. Response comparison of the error base.
Although both controllers are capable of managing errors at the base and the tip, correcting the error at the base is inherently easier due to its more direct control and less complicated dynamics. In contrast, the error at the tip, influenced by the flexibility of the link, requires a more sophisticated approach, making this task more challenging and complex.

5.3. Comparison with Other Controllers

In [37], the control applied to a flexible link system is displayed; it can be compared in Table 6, which shows two measured variables of the dynamics of the tip of the flexible link for four types of controllers: fuzzy, neural network (NN), GA-LQR, and LQR, highlighting differences in their settling times and peak magnitudes. The controllers vary significantly in response speed; the GA-LQR (0.45 s) and LQR (0.7 s) offer fast response times, suitable for applications that demand quick corrections, whereas the fuzzy controller, with a settling time of over 60 s, is much slower, being suitable for applications where precision is more important than speed, and the NN (9 s) provides a balance between rapid response and moderate control. Regarding the magnitude of the peaks, the GA-LQR shows the smallest peak (0.0216), indicating smooth control and minimal disturbance, ideal for sensitive systems. On the other hand, the LQR, although effective, generates higher oscillations (0.0400), and both fuzzy and NN maintain moderate peaks (0.0573), suggesting proper management of oscillations without inducing major disturbances.
Table 6. Comparison of system dynamics for additional controllers.

5.4. Constant Periodic Amplitude Trajectory

The evaluation of controllers with a constant periodic signal is crucial for determining the system’s ability to accurately and stably follow repetitive trajectories. This simulation reveals the system’s response to cyclic inputs, essential in applications such as engines and robots where precision in recurrent movements is required.
As observed in Figure 10 and Figure 11, against a constant periodic amplitude trajectory, the GA-LQR controller is a better option compared to an LQR controller for a flexible rotary system where vibration suppression and smooth transition are critical. It is noted that the energy transmission from the base to the tip of the flexible link is more controlled under GA-LQR control, causing a lower amplitude of tip oscillations, as seen in Figure 11, while the LQR control, due to its more aggressive response at the base, transmits less controlled energy along the link, resulting in a more vibrant response.
Figure 10. Response comparison for constant periodic amplitude trajectory of the link base.
Figure 11. Response Comparison for constant periodic amplitude trajectory of the link tip.

5.5. Increasing Amplitude Trajectory

Trials conducted in engineering contexts, such as in crane robots and flexible manipulators, indicate that different controllers play a crucial role in reducing vibrations during repetitive movements that feature variable setpoint profiles [38]. Figure 12 and Figure 13 highlight that, for an increasing amplitude trajectory, the control scheme offers similar performance in vibration suppression, keeping the maximum deflection angle restricted. Although there is an initial deviation in tracking during the transient phase, it offers smooth tracking in certain cases, like in the square trajectory.
Figure 12. Comparison of the link base response to increasing gain.
Figure 13. Comparison of the link tip response to increasing gain.
In Figure 12, for the base of the system, the GA-LQR controller reaches and follows the reference with less precision and shows a slower response than the standard LQR. In Figure 13, the GA-LQR demonstrates a reduction in the amplitude of oscillations compared to the LQR, showing a better capability of controlling vibrations induced by the flexibility of the link. This is crucial in systems where vibration control is fundamental for the precision and structural integrity of the system.
In Figure 14, one of the transitions in response to an increasing amplitude trajectory has been amplified, and it is observed that the LQR response shows greater amplitude in oscillations, indicating a less damped response and a more aggressive control approach. In contrast, the GA-LQR appears to dampen oscillations more quickly, which is desirable in applications where precision and stability are required. Similarly, the time it takes each controller to stabilize the response after a transition is observed. The GA-LQR shows faster stabilization, suggesting a better adaptation to the dynamic conditions of the system.
Figure 14. Comparison of the link tip’s response to a transition with increasing gain.
Overall, the results indicate that the GA-LQR offers a significant improvement in the control of flexible rotary systems, effectively balancing tracking speed and vibration attenuation.

5.6. Performance Comparison of GA-LQR and LQR Control Systems

The transmissibility metrics are vital in this analysis, highlighting the effectiveness of controllers in damping vibrations.
To understand how a structure responds to vibration introduced at its base, in [39], a mass on a spring is considered, which is referred to as a single-degree-of-freedom (SDOF) system, with a unitary sinusoidal acceleration (1 g) introduced at the base of the spring. The transmissibility function, T R ( f ratio ) , provides the peak response. The acceleration of the mass as a function of f ratio , which is the ratio of the input frequency f to the natural frequency f n of the SDOF system, is expressed next.
The transmissibility function, T R ( f ratio ) , is defined as
T R ( f ratio ) = 1 + ( 2 ζ f ratio ) 2 ( 1 f ratio 2 ) 2 + ( 2 ζ f ratio ) 2
where ζ is the damping ratio (damping factor divided by the critical damping factor). It shows the transmissibility function for various damping ratios, indicating how the vibrational energy from the base or motor affects the tip of the link, we consider the following:
Low Frequency Robustness: Crucial since rotary systems tend to exhibit low-frequency oscillations due to imbalances.
High-Frequency Noise Sensitivity: Important, as less energetic high-frequency vibrations should not be amplified to maintain precision.
Peak Response: Critical in a flexible link, excessive peaks could cause displacements exceeding design limits or induce material fatigue.
Transmissibility indicates how much vibrational energy from the base or motor affects the tip of the link. The data suggest that the GA-LQR, with its lower peak response, might better control these vibrations. Both the GA-LQR and LQR systems demonstrate transmission ratios close to unity across most frequency ranges, indicating that the output is approximately equal to the input in terms of amplitude. However, the LQR system features a pronounced peak near 10 rad/s, suggesting heightened sensitivity at this resonance frequency. This could potentially amplify any disturbances or inputs at this specific frequency. In contrast, the GA-LQR system also exhibits a peak, albeit less pronounced, which suggests better suppression of resonance compared to the LQR system.
The peak of the GA-LQR is narrower compared to that of the LQR, indicating that the GA-LQR system is more selective in terms of frequency. This might be desirable if only a specific frequency needs to be amplified or attenuated. At high frequencies, both systems show good attenuation, which is desirable to minimize the impact of noise and other unwanted signals typically present at these frequencies. The LQR appears to offer a smoother response and is less prone to pronounced resonances, which might be more suitable in applications where large amplifications due to certain input frequencies are undesirable. On the other hand, the GA-LQR might be more appropriate in applications where greater sensitivity or control at a specific frequency is needed.
The Table 7 compares the GA-LQR and LQR control systems, highlighting their performance in low-frequency robustness, high-frequency noise sensitivity, and resonance peak overshoot. The GA-LQR outperforms the LQR in reducing noise sensitivity and managing resonances, offering a more stable response. Although the LQR is more susceptible to noise, its robustness makes it suitable for less demanding applications, emphasizing the need to select the appropriate controller based on design specifications.
Table 7. Comparative analysis of GA-LQR and LQR control systems.

6. Conclusions

This study has effectively demonstrated how the modeling and control of a single-degree-of-freedom flexible robotic link can be efficiently managed using the Euler–Lagrange method and LQR controller. The integration of a genetic algorithm for optimizing the Q and R matrices has proven to be an innovative solution that successfully addresses the complexity of their configuration. Looking forward, plans are in place to apply and expand this method to more complex and multilink robotic system configurations, leveraging the robustness and flexibility of the GA to tackle greater challenges and complexities in the field of robotics.
This article has presented an GA-LQR controller to address the problem of tracking and vibration suppression of the flexible manipulator. By using GA to optimize Q and R, this allows us to explore a larger solution space and potentially find parameter combinations that would not be obvious or easy to test manually. In the GA-LQR control, classic control design criteria such as percentage overshoot, settling time, etc., are directly incorporated into the algorithm’s cost function, allowing one to align Q and R parameters with the specific design objectives of the controller. The GA-LQR control algorithm is versatile for multivariable systems, optimizing design variables via specialized cost functions to meet specific requirements. However, the selection of priorities within the system settings depends on the control engineer. This decision shapes the algorithm’s effectiveness in achieving control objectives, underscoring the engineer’s crucial role in customizing the implementation to the system’s needs.
The results in the simulations clearly confirm that the proposed control system minimizes the end vibrations of the manipulator as requested in the design of the genetic algorithm. This research has provided a general methodology for enforcing certain design requirements for position control of the tip of a rotating flexible link using genetic algorithm techniques over an LQR for the optimization of desired parameters.
Using a reference model for the GA allows us to ensure that the resulting parameters are aligned with a known desired behavior. However, the reference model must be representative enough of the real system for the optimized parameters to be effective in practice.
For future work, the challenge of using the GA-LQR control in real time is proposed. One approach could consider the possibility of running the GA on a slower cycle, where upon finding variations from the expected model, it reviews and adjusts the LQR parameters based on the system’s recent performance, while a faster LQR controller handles real-time control. Lastly, an improvement would be to develop a faster and more efficient version of the GA that can run in real time or near-real time.

Author Contributions

Conceptualization, C.A.S.E., J.R.L. and C.T.-F.; methodology, C.A.S.E., J.R.L. and C.T.-F.; software, C.A.S.E. and J.R.L.; validation, C.T.-F. and J.R.L.; formal analysis, C.A.S.E., J.R.L. and C.T.-F.; investigation, C.A.S.E. and J.R.L.; writing—original draft preparation, C.A.S.E., J.R.L. and C.T.-F.; writing—review and editing, J.R.L. and C.T.-F.; supervision, J.R.L. and C.T.-F. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Universidad Estatal Península de Santa Elena, Ecuador, as part of its Academic Improvement Plan. This funding is internal and specific to the university, and no additional external public, commercial, or non-profit funding was received.

Data Availability Statement

The raw data supporting the conclusions of this article will be made available by the authors upon reasonable request.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Ding, B.; Li, X.; Chen, S.C.; Li, Y. Modular quasi-zero-stiffness isolator based on compliant constant-force mechanisms for low-frequency vibration isolation. J. Vib. Control. 2023, 10775463231188160. [Google Scholar] [CrossRef]
  2. Boscariol, P.; Scalera, L.; Gasparetto, A. Nonlinear Control of Multibody Flexible Mechanisms: A Model-Free Approach. Appl. Sci. 2021, 11, 1082. [Google Scholar] [CrossRef]
  3. Hernández, M.L.A.; de León Morales, J. Design of Different Controllers for a Flexible Robot in the Link. Ph.D. Thesis, Technological Institute of Nuevo Laredo, San Nicolás de los Garza, Mexico, 2024. Available online: http://eprints.uanl.mx/5760/1/1020126752.PDF (accessed on 10 May 2024).
  4. Sorcia-Vázquez, F. Control of a Flexible Link Robot Arm through Generalized PID and Model-Free Control. 2010. Available online: https://example.com/flexible-link-control (accessed on 15 October 2023).
  5. Ding, B.; Li, X.; Li, C.; Li, Y.; Chen, S.C. A survey on the mechanical design for piezo-actuated compliant micro-positioning stages. Rev. Sci. Instruments 2023, 94, 101502. [Google Scholar] [CrossRef]
  6. Aktas, K.G.; Esen, I. State-Space Modeling and Active Vibration Control of Smart Flexible Cantilever Beam with the Use of Finite Element Method. Eng. Technol. Appl. Sci. Res. 2020, 10, 6549–6556. [Google Scholar] [CrossRef]
  7. Jafari, M. Linear Quadratic Regulator with Genetic Algorithm for Flexible Structures Vibration Control. Master’s Thesis, Universiti Putra Malaysia, Seri Kembangan, Malaysia, 2015. [Google Scholar]
  8. Schoen, M.P.; Hoover, R.C.; Chinvorarat, S.; Schoen, G.M. System Identification and Robust Controller Design Using Genetic Algorithms for Flexible Space Structures. J. Dyn. Syst. Meas. Control 2009, 131, 031003. [Google Scholar] [CrossRef]
  9. Liu, M.; Cao, D.; Li, J.; Zhang, X.; Wei, J. Dynamic Modeling and Vibration Control of a Large Flexible Space Truss. Meccanica 2022, 57, 1017–1033. [Google Scholar] [CrossRef]
  10. Becerra, J.E.T. Fractional Order Modeling of Contact with the Environment in Flexible Robot Applications. 2018. Available online: https://ruc.udc.es/dspace/handle/2183/24982 (accessed on 6 December 2023).
  11. Quanser. Quanser Interactive Labs for Distance & Blended Control Systems and Robotics Courses. Available online: https://www.quanser.com/event-webinar/quanser-interactive-labs-for-distance-blended-control-systems-and-robotics-courses/ (accessed on 12 January 2024).
  12. Anayi, F.; Packianather, M.; Samad, B.A.; Yahya, K. Simulating LQR and PID controllers to stabilise a three-link robotic system. In Proceedings of the 2022 2nd International Conference on Advance Computing and Innovative Technologies in Engineering (ICACITE), Greater Noida, India, 28–29 April 2022; pp. 2033–2036. [Google Scholar] [CrossRef]
  13. Quanser. QLabs Virtual Rotary Flexible Link-Credible Lab Activities Off-Campus. 2022. Available online: https://www.quanser.com/products/qlabs-virtual-rotary-flexible-link/ (accessed on 16 August 2023).
  14. Mohamed, Z.; Martins, J.; Tokhi, M.; Costa, J.D.; Botto, M. Vibration Control of a Very Flexible Manipulator System. Control Eng. Pract. 2005, 13, 267–277. [Google Scholar] [CrossRef]
  15. He, X.; Zhang, S.; Ouyang, Y.; Fu, Q. Vibration Control for a Flexible Single-Link Manipulator and Its Application. IET Control Theory Appl. 2020, 14, 930–938. [Google Scholar] [CrossRef]
  16. Rao, J. Advanced Theory of Vibration; Wiley: New York, NY, USA, 1991. [Google Scholar]
  17. Meirovitch, L. Methods of Analytical Dynamics; Dover Publications: Garden City, NY, USA, 1970. [Google Scholar]
  18. Tokhi, M.; Azad, A. Flexible Robot Manipulators: Modelling, Simulation and Control; IET: London, UK, 2008; Volume 68. [Google Scholar]
  19. Tse, F.; Morse, I.; Hinkel, R. Mechanical Vibrations: Theory and Applications; Allyn & Bacon Inc.: Boston, MA, USA, 1978. [Google Scholar]
  20. Cannon, R.; Schmitz, E. Initial Experiments on the End-Point Control of a Flexible One-Link Robot. Int. J. Robot. Res. 1984, 3, 62–75. [Google Scholar] [CrossRef]
  21. Tokhi, M.; Azad, A. Flexible Robot Manipulators: Modelling, Simulation and Control; The Institution of Engineering and Technology: London, UK, 2017. [Google Scholar]
  22. Subedi, D.; Tyapin, I.; Hovland, G. Review on Modeling and Control of Flexible Link Manipulators. Model. Identif. Control 2020, 41, 141–163. [Google Scholar] [CrossRef]
  23. Pham, P.T.; Kim, G.H.; Nguyen, Q.; Hong, K.S. Control of a Non-uniform Flexible Beam: Identification of First Two Modes. Int. J. Control Autom. Syst. 2021, 19, 3698–3707. [Google Scholar] [CrossRef]
  24. Hughes, P. Space structure vibration modes: How many exists? Which ones are important? IEEE Control Syst. Mag. 1987, 7, 22–28. [Google Scholar] [CrossRef]
  25. University of New York. Modeling of a Flexible Link. 2024. Available online: http://engineering.nyu.edu/mechatronics/Mpcrl/WebExp/Flexiblelink/Modeling/index.html.htm (accessed on 28 April 2024).
  26. Sorcia-Vázquez, F.J.; García-Beltrán, C.D.; Reyes-Reyes, J.; Rodríguez-Palacios, A. Control of a Flexible Link Robot Arm Using Generalized PID and Model-Free Control; National Center for Research and Technological Development: Cuernavaca, Morelos, Mexico; Technological Institute of Zacatepec: Zacatepec, Morelos, Mexico, 2023. [Google Scholar]
  27. Ahmad, M.; Mohamed, Z.; Hambali, N. Dynamic Modelling of a Two-Link Flexible Manipulator System Incorporating Payload. In Proceedings of the 2008 3rd IEEE Conference on Industrial Electronics and Applications, Singapore, 3–5 June 2008; pp. 96–101. [Google Scholar] [CrossRef]
  28. Khairudin, M. Dynamic Modelling of a Flexible Link Manipulator Robot Using AMM. TELKOMNIKA 2008, 6, 6. [Google Scholar] [CrossRef][Green Version]
  29. Restrepo, D. The Lagrangian of the Standard Model; Institute of Physics, University of Antioquia: Medellín, Colombia, 2012. [Google Scholar]
  30. Arenas, T.C. Dynamic Analysis of a Flexible Mechanism by Finite Elements. Ph.D. Thesis, Universidad Nacional Autónoma de México, Faculty of Engineering, Ciudad Universitaria, Mexico City, Mexico, 2016. [Google Scholar]
  31. Abreu, V.V. Balance-Bot-ProQuest. 2009. Available online: https://www.proquest.com/openview/080d5273c83b3058e802b3684705a356/1?pq-origsite=gscholar&cbl=2026366&diss=y (accessed on 15 January 2024).
  32. Braschi, E.A. Practical Approach to Modern Control. Published by Casa del Libro. 2024. Available online: https://www.casadellibro.com/libro-practical-approach-to-modern-control/9786124191282/7580541 (accessed on 12 January 2024).
  33. Peñafiel, D.K.S. Design and Implementation of an Optimal LQG Controller for an Inverted Pendulum System Applied to LEGO Mindstorms Equipment. Ph.D. Thesis, Salesian Polytechnic University, Quito Campus, Quito, Ecuador, 2018. [Google Scholar]
  34. Ogata, K. Discrete-Time Control Systems. Available online: http://www2.pelotas.ifsul.edu.br/~coutinho/disciplinas/TCC/Discrete-Time_Control_Systems-Katsuhiko_Ogata.pdf (accessed on 15 January 2024).
  35. Lorbes, M. Genetic Algorithms and Particle Switching Optimization to Define the Weight Matrices of the Linear Quadratic Regulator Methodology. Univ. Sci. Technol. 2020, 24, 34–41. [Google Scholar]
  36. Raoufi, M.; Delavari, H. Designing a Model-Free Reinforcement Learning Controller for a Flexible-Link Manipulator. In Proceedings of the 2021 9th RSI International Conference on Robotics and Mechatronics (ICRoM), Tehran, Iran, 17–19 November 2021; pp. 1–6. [Google Scholar] [CrossRef]
  37. López, J.C. Control of a Single-Segment Flexible Manipulator. 2022. Available online: http://hdl.handle.net/10902/24745 (accessed on 15 May 2022).
  38. Viswanadhapalli, J.; Elumalai, V.; Shivram, S.; Shah, S.; Mahajan, D. Deep Reinforcement Learning with Reward Shaping for Tracking Control and Vibration Suppression of Flexible Link Manipulator. Appl. Soft Comput. 2023, 152, 110756. [Google Scholar] [CrossRef]
  39. Sarafin, T.; Doukas, P.; Demchak, L.; Browning, M. Introduction to Vibration Testing. Instar Engineering and Consulting, Inc., Rev. B. 2017. Available online: https://s3vi.ndc.nasa.gov/ (accessed on 16 December 2023).
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.