Auto-Tuning Process of State Feedback Speed Controller Applied for Two-Mass System

: The state feedback controller is increasingly applied in electrical drive systems due to robustness and good disturbance compensation, however its main drawback is related to complex and time consuming tuning process. It is particularly troublesome for designer, if the plant is compound, nonlinear elements are taken into account, measurement noise is considered, etc. In this paper the application of nature-inspired optimization algorithm to automatic tuning of state feedback speed controller (SFC) for two-mass system (TMS) is proposed. In order to obtain optimal coefﬁcients of SFC, the Artiﬁcial Bee Colony algorithm (ABC) is used. The objective function is described and discussed in details. Comparison with analytical tuning method of SFC is also included. Additionally, the stability analysis for the control system, optimized using the ABC algorithm, is presented. Synthesis procedure of the controller is utilized in Matlab/Simulink from MathWorks. Next, obtained coefﬁcients of the controller are examined on the laboratory stand, also with variable moment of inertia values, to indicate robustness of the controller with optimal coefﬁcients.


Introduction
The electrical drive system with elastic joints occurs in many industrial machines like robot arms, conveyor belts, rolling-mill machines, and servo systems. A long shaft between the motor and load machine in mechanical part of the system provides very low resonant frequency [1,2]. Due to this, the motor speed differs to the load one, and speed oscillations may occur. Such behaviour of the machine can cause unsatisfactory product quality. Another problem with elastic joints is the coupling shaft stress, resulting in negative influence on a life-time of the machine mechanical part. For that reason, the elasticity of the shaft should be taken into account during synthesis of the control structure.
Many control methods have been developed to provide high-performance operation of the machinery, and to prevent the shaft stress and oscillations [3][4][5][6]. A considerable part of them is based on well-known proportional-integral-derivative (PID) controller due to its simple implementation, intuitive tuning methods and limitation of the physical variables. The complexity of considered plant causes that several modifications of PID control scheme have been proposed. These are based on additional reference signal filtering, introduction of additional feedback or modification of the controller structure [3][4][5][6]. As it was shown in [7], the state feedback speed controller provides satisfactory performance of the two-mass system. Recently, the SFC is getting significant attention by the researchers and it is applied in wide-range of applications, e.g., cascade-free permanent magnet presented. The optimal values of the state feedback controller were obtained by Particle Swarm Optimization algorithm. It was shown that optimized coefficients provide a better robustness and time response specifications in comparison to other controllers commonly applied for inverted pendulum system, i.e., fuzzy logic and fuzzy PD.
In this paper automatic tuning of SFC for two-mass system is presented. This paper includes entire process of auto-tuning procedure: (i) assumptions on desired step-response characteristics, (ii) definition of objective function based on the assumptions made and, (iii) application of nature-inspired optimization algorithm to optimize defined objective function. The ABC is applied to select optimal weighting matrices Q and R. The assumptions take into account practical aspects of the machinery operation i.e., the stress-free and chattering-free operation of the two-mass system. To present advantages of the proposed approach, comparison with analytically calculated coefficients is included. Additionally, the stability analysis for the control system, optimized using the ABC algorithm, is presented. Finally, robustness of the proposed control scheme is also investigated on the laboratory stand with elastic joint and variable moment of inertia.
The paper is organized as follows: Section 2 includes description of mathematical model of the plant, definition of the control law and analytical tuning method of the controller. The application of ABC for auto-tuning process, and objective function definition with respective discussion are included in Section 3. Section 4 contains simulation and experimental results of the proposed auto-tuning approach and the analytical one. Stability and dynamics analysis are also included in this section. Finally, conclusions are presented in the last section.

Model of the Two-Mass System
In order to design state feedback controller for speed control of the two-mass system, the state-space representation of mathematical model have to be introduced and it is specified by the following equation [21]: d dt with: where: ω 1 (t), ω 2 (t) and ω 2 re f (t) are the angular speed of the motor shaft, angular speed of the system output, and the reference signal of angular speed, respectively; m e (t) is an electromagnetic torque generated by the motor; m s (t) is the torsional torque; T 1 , T 2 and T c are mechanical time constants of the motor, the load and an elastic part, respectively. It should be noted that in this particular case all state variables are measurable. In order to ensure steady-state error-free operation for step changes of reference speed and load torque, the x ω 2 (t) state-space variable has been introduced [22]. It is defined by the following equation: It is worth to point out that control loop of electromagnetic torque (i.e., current loop) is usually modelled as first order system: where: T me is equivalent current loop time constant. During synthesis of the regulator an ideal and immediate generation of electromagnetic torque was assumed. Therefore, dynamics of the current loop has been omitted, and G e (s) = 1. Such assumption is acceptable for relatively short time constant of the current control loop in comparison to the mechanical time constants, what occurs in this particular case. On the other hand, delays related to the electromagnetic torque excitation loop can be taken into account during design process of controller. In such a case Padè approximation can be applied, what will result in increasing of the model order. Finally, to simplify synthesis process of controller, the nonlinearities (i.e., friction torques of machines, backlash, etc.) were not considered. The time constants of TMS are listed in Table 1.

State Feedback Controller
The control law for discrete state feedback controller suitable for implementation in microprocessor based drive obtained for (2) is defined as follows: with: where: n is a discrete time index; k 1 , k 2 , k 3 and K i are gain coefficients of SFC. In order to tune SFC, linear-quadratic optimization method (LQR) is employed. The choice is related to: (i) repeatable results of optimization, (ii) the lowest value of the performance index and, (iii) the best dynamical behaviour in comparison to pole placement technique and direct selection of coefficients [23]. A discrete performance index of LQR minimized during optimization procedure has the following form: with: where: q 1 , q 2 , q 3 , q 4 and r 1 are coefficients of penalty matrices. The block diagram of TMS with SFC is presented in Figure 1.

Analytical Approach
For comparison purposes, coefficients of state feedback controller were also obtained using classical method. In this approach, a transfer function of the closed loop system shown in Figure 1 should be determined. It can be calculated from the following set of equations: where: Introducing the Laplace operator, above equations are presented below: transforming this system of equations accordingly, the following equation is obtained: based on above, the transfer function of closed control system can be defined: Now, above expression and Equation (7), following transmittance can be calculated: The characteristic equation is described by the following form: In order to calculate the equations defining gains of state controller, the above equation should be compared to a reference equation (the same order). The following polynomial was assumed: where: ω 0 -resonant frequency, ξ r -damping coefficient. Comparing the elements with the same powers of the Laplace operator, the following system of equations is achieved: and finally, after short transformations, the mathematical expressions are obtained:

Artificial Bee Colony Algorithm
The ABC was proposed by Karaboga in 2005 and it was inspired by intelligent foraging behaviour of honey bee swarm [24]. The ABC is global gradient-less optimization algorithm that provides better/similar performance than the most known algorithms (e.g., Differential Evolution, Particle Swarm Optimization, Genetic Algorithm) although it uses less control parameters and it can be efficiently used for solving multimodal and multidimensional optimization problems [25]. The task of bees is to find the position of food source with the highest nectar amount. Position of food source represents a possible solution of problem and nectar amount corresponds to the quality of the associated solution. Since the algorithm was inspired by foraging behaviour of honey bee swarm, it is divided into three phases: The algorithm sequentially executes depicted phases for predefined number of iterations (N). It is worth mentioning that single food source is connected to employed and onlooker bee, and the colony size (NP) is the main parameter of the ABC. Each phase has determined task in optimization process. The employed bees phase corresponds for exploration of search-space. These bees look for another food source taking into account position from their memory and position of another randomly selected food source. Position of new food source is given by the following equation: where: i is dimension index; v m , x m and r m are the new, actual and randomly selected food source, respectively. After evaluating the nectar amount value of new food source, it is compared with actual one. If new food source has higher amount of nectar, it replaces the actual food source. The onlooker bees phase corresponds to exploitation and bees during this phase use the additional information for generation of new food source position-nectar amount. Equation (16) is also used by the onlooker bees, but selection of random food source (r m ) is based on probability value, which is calculated as follows: where: p m is selection probability of the food source (x m ); FN is food source number; f itness is the value of the objective function. It is worth to point out that modification rate parameter (MR) is applied to optimization process. This parameter allows to reduce diversity of the colony during onlooker bees phase and it does not effect the exploitation. The pseudocode of ABC is presented in Algorithm 1. EMPLOYED BEES PHASE: 7: for m = 1 to FN do 8: Select r m randomly 9: Produce new solution v m by Equation (16) taking into account MR parameter 10: if fitness(v m ) > fitness(x m ) then 11: Set x m to v m

12:
Set trials m to 0 13: else 14: Increment trials m 15: end if 16: end for 17: ONLOOKER BEES PHASE: 18: for m = 1 to FN do 19: Calculate selection probability p m using Equation (17) 20: end for 21: for m = 1 to FN do 22: Select r m taking into account calculated selection probabilities 23: Produce new solution v m by Equation (16) 24: if fitness(v m ) > fitness(x m ) then 25: Set x m to v m The parameters of ABC used in auto-tuning process of SFC for TMS are summarized in Table 2, and these were selected according to information presented in [15]. It should be noted that chosen ABC parameters provides good exploitation and fast convergence in the global minimum. 10 −3 ÷ 10 4

Objective Function
As it was mentioned earlier, TMS is a complex mechanical device where the load angular speed differs from the motor one and where speed oscillations may occur. Due to this tuning process of controller seems not to be trivial task, especially if non-cascade structure is used. In order to apply tuning procedure based on the above-mentioned ABC algorithm, requirements related to the desired step-response characteristics should be defined. These are as follows: • overshoot-free response, • rise and settling times as short as possible, • chattering-free control signal, • limited noise amplification.
In order to assure above-mentioned requirements during auto-tuning process, complex objective function is required. Its respective components will be responsible for fulfilment of depicted above requirements. Firstly, to minimize rise and settling times, the error of angular speed of the system output (e re f (t)) needs to be minimized. Next, to reduce fluctuation of tension in elastic part and to assure overshoot-free step-response of TMS, the objective function is extended by component with derivative of difference between velocity before (ω 1 ) and after (ω 2 ) elastic part. The last elements from list depicted above are chattering-free control signal and limited noise amplification. In order to fulfill these requirements, a punishment for control signal changes has been introduced to the objective function. Finally, according to information presented in [26], time and error of angular speed of the system output (e re f (t)) were introduced to the objective function as squared ones to reduce the overshoot and oscillations. The summarized objective function has following form: with: where: T is the test duration; α = 10 −3 and β = 2 × 10 −4 are manually selected coefficients. It is worth to point out that value of α parameter is inverse proportional to fluctuation of tension in elastic part of TMS while the β parameter corresponds for limit of noise amplification. The parameters have been chosen by trial-and-error approach to achieve desired step-response characteristics and allowable tension in elastic part.

Simulation Case
The proposed auto-tuning method was implemented in Matlab/Simulink environment and the optimization last for 8 min using Acer laptop with i7-6700HQ supported by 8 GB RAM. According to information depicted in Section 2, an ideal electromagnetic torque shaping loop was established, which does not introduce additional delays. As it was mentioned earlier, proposed auto-tuning method was compared with analytical approach depicted in Section 2.3. Chosen values of design parameters are as follows: ξ r = 0.9, ω 0 = 82.3 s −1 . It is worth to point out that the damping factor and the resonance frequency were manually selected to achieve similar rise time (t r ) for both considered approaches, i.e., auto-tuning and analytical.
The objective function in iteration domain is presented in Figure 2. Values of the objective function for coefficients of SFC obtained by ABC algorithm and calculated analytically are equal to 1.407 × 10 −3 and 1.486 × 10 −3 , respectively. Values of Q and R matrices obtained for ABC algorithm are summarized in Table 3, while SFC coefficients for both considered approaches (i.e., supported by ABC optimization and calculated analytically) are listed in Table 4. The angular speed of the motor shaft and the system output, electromagnetic torque generated by the motor, and torsional torque step response obtained for both methods are presented in Figure 3. Table 5 summarizes selected step-response indicators, and one can see that difference of rise times is negligible small. The settling time (t s ) is shorter for analytical method, while the overshot (κ) is smaller for the proposed approach. The disturbance compensation is similar for both sets of coefficients. The main difference between step responses, for analytical and the proposed method, is visible in electromagnetic torque waveform. The proposed approach provides smoother control signal in comparison to the analytical one, what was expected due to smaller values of controller coefficients. On the other hand, the dynamic and disturbance compensation for both sets of coefficients are comparable.    It is worth to point out the obtained coefficients of SFC by ABC are noticeable smaller than the analytically calculated coefficients, while the dynamical properties and disturbance compensation are similar for both sets of coefficients. As it was shown in [23], it is related to application of LQR in auto-tuning process, where control effort is taken into account during synthesis process of controller.   Step response for coefficients of SFC: (a) obtained for the ABC algorithm; (b) calculated analytically. From top: angular speed of the motor's shaft and the system output, electromagnetic torque generated by the motor and torsional torque (simulation case).

Dynamic Properties Analysis
Precision, fast response and stability are the most important features of control systems. This issues take significant part of work presented in control theory, and are important for industrial applications. In this article state feedback controller with constant parameters is considered. Moreover, nonlinear elements are neglected. Thus, it can be treated as a time-invariant system. In contrast to, for example, adaptive control systems (e.g., neural adaptive structures), where the most often used methods (for stability analysis) are based on Lyapunov's theorems, in this case analysis of poles seems to be useful.
For described control structure, dependence of dynamic properties and position of poles, was analyzed. Results are presented in Figures 4-6. System has four poles (two of them have equal real parts). Independent placement of those values can be achieved using modified reference Equation (13). Firstly, constant damping factor was assumed. Higher values of resonant frequency move the poles to the left side of S-plane (Figure 4). With this tendency, shorter rise time and better reaction against load switching can be observed. Decreasing the ξ r factor causes increase in oscillations ( Figure 5). It is significant phenomenon during design of control method for two-mass system (elastic shaft leads to disturbances observed in state variables). Using the classical tuning method of the state controller, the poles are arranged by parameters ω 0 and ξ r . In this case, using the ABC method, the position of the poles can be forced using other definition of cost function or changing the waveform of reference signal. Next test presents analysis for speed control system with parameters optimized using the ABC algorithm ( Figure 6). Four poles are observed, each pair has the same imaginary part. All poles have negative real part, thus it can be assumed as the stability proof for the control system. Additionally high dynamics and precision of control should be noted.

Experimental Examination
Presented in previous sections theoretical considerations were verified on a laboratory stand. The experiment was prepared for a drive presented in Figure 7. The system consists of a two DC motors mechanically coupled using elastic connection (about 0.6 m length, 5 mm diameter, material: steel). The nominal power of both machines was 0.5 kW. The motors operate under speed control structure, with state space controller, based on cascade control strategy. For part of the calculations, related to the electromagnetic torque, threshold of sampling time was used (T s = 0.1 ms). The second part of algorithm implementation (speed controller) was done with t = 1 ms. It was assumed in order to influence of measurement noise reduction. The incremental encoders, attached to rotor of motors, generate signal (36,000 pulses per rotation) for speed calculation. The ADC converter reads information from current transducer, then processed to torque transient. The data collection, control algorithm and generation of control signals for power electronic devices (H-bridge) are processed in system for rapid prototyping based on dSPACE 1103 card. ControlDesk was used as a virtual control panel (parameters of control structure settings, data managing, preview of transients, etc.). Experimental step response for both considered sets of coefficients are shown in Figure 8, while step-response indicators are presented in Table 6. From obtained experimental results one can see that the analytically calculated coefficients dangerously amplify measurement noise. Due to this the torque load was not applied during experiment for safety reasons. It is worth pointing out that step-response indicators in simulations and experiments are similar. Coefficients obtained by the proposed auto-tuning process provide shorter rise time in experiments than analytical ones. The settling time value is higher for ABC coefficients than for calculated ones, what is consistent with simulation. The overshoot values in experimental case are the same for both sets of coefficients, and it is caused by the measurement noise. Although step responses for simulation and experimental cases slightly differs, the overall behavior as well as indicators are similar. Observed difference is mainly related to simplified model of plant used in synthesis process of SFC, where nonlinearities (e.g., friction components) and elasticities were omitted. As in a case of simulation study, control signal for automatically obtained SFC is smoother and the noise amplification does not occur, while the dynamic properties are comparable.   Step response for coefficients of SFC: (a) obtained by the ABC algorithm; (b) calculated analytically. From top: angular speed of the motor's shaft and the system output, electromagnetic torque generated by the motor and torsional torque (experimental case). Finally, the additional experiment with increased moment of inertia was made to investigate robustness of the automatically determined controller coefficients. It should be noted that moment of inertia was doubled on the laboratory stand. Recorded waveforms are presented in Figure 9, while selected step-response indicators are as follows: t r = 0.0553 s, t s = 0.2026 s and κ = 7.3563%. One can see that the rise time does not change, while the settling time and overshoot increased noticeably. Despite this, the step response is acceptable even for doubled moment of inertia value, what indicates robustness of automatically tuned controller.  Figure 9.
Step response for coefficients of SFC obtained by the ABC algorithm-additional moment of inertia element in mechanical part in the laboratory stand. From top: angular speed of the motor's shaft and the system output, electromagnetic torque generated by the motor and torsional torque (experimental case).

Conclusions
This paper presents an alternative design method applied for an electrical drive with a complex mechanical part. For this purpose a metaheuristic algorithm-Artificial Bee Colony-was applied. Special application, combining the main assumptions of the ABC and analyzed plant, was performed. The two-level structure of implementation allows easy (possible) modification of the plant parameters and configuration. Changes of parameters, nonlinearities and measurement noise can be considered during design process. Effectiveness of proposed method has been demonstrated in simulation and experimental studies. Theoretical analysis shows stable work of the control structure.
The entire controller synthesis process is described in details. The objective function components have been deeply discussed with particular emphasis on requirements related to desired step-response characteristics of complex two-mass mechanical system.
In order to show benefits of proposed approach, the analytical one was also taken into account. It was found that coefficients of SFC obtained by proposed automatic approach provides similar dynamic performance in comparison to coefficients calculated analytically, while these are noticeable smaller. The experimental examination proves that the coefficients obtained by the analytical method dangerously amplify measurement noise and provide undesirable chattering of control signal. For that reason, the proposed auto-tuning process seems to be more proper to achieve high-performance control of TMS and its safety operation.
The robustness of obtained coefficients of SFC has been examined in additional test with increased moment of inertia. Although the overshoot is observed in step response with additional moment of inertia, the overall dynamic properties are acceptable. It is worth to point out that two times higher value of inertia is usually applied for experimental evaluation of more complex control schemes, such as adaptive and iterative one. Therefore, results obtained for the proposed approach (where constant structure of controller is considered), are satisfactory and indicates its robustness.
The proposed automatic tuning method may be applied in commercial electrical drive system with elastic joints. This approach allows to reduce speed oscillations caused by difference between the the motor speed and the load one. It is worth to point out that the proposed method takes into account limitation of noise amplification. Due to above mentioned properties, the proposed auto-tuning method may find application in many industrial machines like conveyor belts, servo systems, robot arms and rolling-mill machines. It provides satisfactory product quality and extend life-time of the machine mechanical part due to reduced the coupling shaft stress.