4.1. Laboratory Bench
The mechanical system of the bench where the tests were carried out is shown in
Figure 5. The visible drive units (
1,
1’) are permanent synchronous motors (PMSMs) powered and controlled by independent inverters. For each of them, it is possible to attach discs that allow for modifications of the moment of inertia of the outer rotating masses
and
. The motors (
1,
1’) are connected by shafts (
2,
2’) to the central rotating mass (
3). Also, in the case of the central rotating mass, it is possible to change the value of the moment of inertia by attaching or detaching the discs. The possibility of replacing the entire shafts enables one to change the values of the parameters
,
,
, and
relatively easily.
The eddy current brake marked in
Figure 5 with the number 4 is responsible for generating the disturbance torque
. It was implemented in the form of two stationary discs, moved for the time of applying the loading torque (
Figure 6, letter A), and equipped with a set of permanent magnets, and two movable discs, rotating together with the mass
, made of aluminum (
Figure 6, letter B). The disc with permanent magnets is approached by means of a pneumatic actuator (
Figure 6, letter C).
The PMSM motors were Estun EMJ-08-AFB units characterized by 0.75 kW of rated power output. One of the motors is equipped with a mechanical brake activated by 24 VDC. The mechanical brake was utilized in the identification of shaft elasticity identification. The shaft displacement was measured when one of the motors was locked and the other produced an active torque. The measurements of speed that were crucial in the research presented in this paper were performed using encoders originally attached to the motors. This instrumentation was the absolute single-turn 20-bit encoders with a digital interface operating at a fixed bitrate of 2.5 Mbit. The position signal obtained from the encoders was differentiated and filtered to have a reliable speed feedback.
The encoder of the intermediate part of the three-mass system was an incremental magnetic sensor Lika SMRI2-YC-2-400-R-L3-CJ reading magnetic ring MRI/57Z-90-2-43. The resolution of this configuration was 9000 pulses per rotation with the limitation on the maximum speed of 2300 rpm (ca. 241 rad/s). This sensor measurement signal was not delivered to the speed controller in any of the presented approaches, but was registered in order to evaluate the control quality of the speed in the intermediate part of the system. This point of view relates to the features of real systems, where an important element of the kinematic chain is often unavailable for any direct measurement.
The motors included in the bench were powered by separate Texas Instruments TMDSHVTRINSPIN inverters with a maximum output power of 1.5 kW each. These are connected by a common 300 V DC voltage bus supplied from a regulated power supply with adjustable current limitation. The inverters are controlled by dedicated cards with Texas Instruments Piccolo F2806M(ISO) microcontrollers. It is a 32-bit microcontroller with a Harvard architecture, operating at 90 MHz. The microcontroller is equipped with a 16-channel, 12-bit analog-to-digital converter and a set of digital interfaces: CAN (with an isolated driver on the board), SPI, UART, I2C. A characteristic feature of the Texas Instruments platform is the presence of a FAST (flux, angle, speed, and torque) observer with closed source code, the functionality of which can be used in the presented drive solution. The aforementioned inverters with their control cards were responsible for the torque control of the PMSM motors. Due to this fact, their software were based on the default InstaSPIN-FOC firmware with little modification of the code responsible for the data interchange with the other modules of the system, i.e., the introduction of SPI interface service routines.
The higher level of the control system, i.e., the speed control, which is the main focus of this paper, was implemented in a Dual-Core 480 MHz STM32H755 microcontroller. The timing efficiency of the ANN speed controller solution was critical, since the ANN calculation and training, which are relatively time-consuming algorithms, especially for an embedded system, were the main tasks of this device program. Therefore, the STM32H755 microcontroller code was based on interrupts served by the HAL library, with no utilization of the operating system such FreeRTOS. The resulting torque commands calculated by the ANN speed controller were sent to the secondary controllers inside the inverters. The ANN speed controller inputs were measurements taken by the encoders attached to the PMSMs. The converter between the original encoder signals and the actual microcontroller inputs was implemented in an auxiliary FPGA chip. This converter is responsible for the transmission of a device-specific serial protocol of the encoders into conventional SPI communication legible for STM32H7 microcontroller. In total, the STM32H7 microcontroller utilizes six of its SPI interfaces in order to communicate with the torque controllers running on Piccolo control cards and two PMSM encoders. The encoder utilized to measure the position and speed of the intermediate mass (related with moment of inertia
) was an incremental sensor with a common AB0 quadrature interface; therefore, no additional conversion was necessary for that case. The overall signal flow in the laboratory bench is presented in
Figure 7.
4.2. Test Configuration
The described laboratory bench allows for a large but finite set of discrete configurations. The total number of discs that define the values of the moments of inertia is 15. These may be easily connected in different configurations—on each of the three parts of the mechanism, a different number of discs may be attached. In the laboratory bench, three different shafts could be applied—this way, the different values of the elasticity coefficients and shaft dampings were established.
The results presented below were aggregated for four experiment bench configurations. The parameter values are presented in
Table 1. As it is visible, the first configuration represents the lowest set of resonances that was accessible in the laboratory bench. The second configuration represents the intermediate values of the resonant frequencies available in the laboratory bench. In the third configuration, the sum of moments of inertia is equal to the one in the previous setting, but due to the different allocations of elementary inertia components, resonance frequencies are higher. The last configuration represents a minimum moment of inertia and maximum values of mechanical resonant frequencies that were available in the bench—no additional disks were attached to the system.
In summary, the configurations no. 1 and 4 represent borderline cases available in the laboratory bench from the point of view of accessible dynamics of the system: the highest and lowest total moments of inertia , respectively, and the extreme localization of the mechanical resonance frequencies, respectively. The intermediate configurations 3 and 4 were selected to determine the influence of asymmetry in the distribution of moments of inertia along the parts of the three-mass system.
In the results graphs, for each mechanical configuration, the two controllers described in
Section 3 are presented. For the reference control structure, i.e., the PI controller (velocity equation) and the test scenario are as follows:
motor startup with = 10 rad/s;
application of disturbance: load torque = 1 Nm;
removal of disturbance: = 0 Nm;
motor reverse, = 10 rad/s;
application of disturbance: load torque = 1 Nm;
removal of disturbance: = 0 Nm;
end of test.
For the neural control structure, the aforementioned scenario was repeated eight times. The whole ANN learning process is presented in macro scale, as well as the final sequence that was zoomed, so that it may be easily compared with the reference PI structure. In most cases, the ANN weights stabilized even faster, but this broader scope documents that there are no symptoms of network being excessively trained.
The location of the resonant frequencies and the shape of the complete frequency characteristics are detailed in
Figure 8 for all four configurations. This graph concerns the
transfer function; however, the resonant properties are common for all nine transfer functions of the system model, which were signaled in
Section 2 and also mentioned in
Appendix A.
Both controllers operated at an equal time step of 100
. For the ANN controller, each step of network execution was also a training step performed according to Equations (
19)–(
22). The initial weights of the ANN were set randomly in each of the cases presented in
Section 4.3.
4.3. Comparison of Control Structures
For the first configuration, that represents the highest total moment of inertia
applicable in the laboratory bench, the results are presented so as to compare the reference PI control structure and proposed adaptive ANN solution. In
Figure 9, the overview of the scenario listed in
Section 4.2 is presented, while in
Figure 10, the range of the first three seconds is zoomed. The corresponding
Figure 11 traces of reference torques
and
calculated as the outputs of speed controllers are presented. For the results in
Figure 12, a set of eight scenarios with the same series of changes of the reference input of speed controllers and disturbance torques applied to an intermediate part of the system was repeated. The final part of the training process, which was 48 s long, is zoomed upon in
Figure 13. This way, it may be easily compared with the content of
Figure 10. In both of these figures, the first part of the scenario is presented: the final part of the response to the change in the reference input signal
, the application of the disturbance torque
to the intermediate mass, and its further removal in the next second. Similarly to
Figure 11, for the ANN speed controller, the traces of the reference torques
and
are presented in
Figure 14.
As it is most clearly visible in
Figure 10 and
Figure 13, the responses of both of the control structures are characterized by the occurrence of oscillations. The highest observed amplitude occurred in the transient processes of the speed
. Within this scope, the speed
have significantly more smooth, but still oscillatory transient process. The most demanded shape of these three angular speed signals is observed for
. For the ANN speed controller, the most moderate transient process was registered for the speed
. The oscillations amplitude, overshoot, and undershoot parameters of
related to the application and removal of disturbance torque
are much better than those for any of the speed signals in the two PI controllers solution. However, the damping factor for the oscillations in the closed control system is worse for an ANN approach. Also, the process of the control error elimination is significantly longer. On the other hand, the maximum oscillations for the intermediate mass speed
are comparable for both solutions. The maximum oscillation of the
speed in the ANN solution is comparable with such parameters determined for the
speed in the reference PI controller solution.
The second configuration considered herein represents the selection of intermediate values of resonant frequencies set by limiting the amount of mounted discs from 16 to 9, as well as the application of a shaft of a higher diameter (8 mm instead of 6 mm in configuration no. 1), which resulted in the higher stiffness factor.
Figure 15,
Figure 16,
Figure 17,
Figure 18,
Figure 19 and
Figure 20 are organized in the same manner as
Figure 9,
Figure 10,
Figure 11,
Figure 12,
Figure 13 and
Figure 14. The results for the two PI controller approach are depicted in
Figure 15,
Figure 16 and
Figure 17. The solution with one common speed control operating as ANN is presented in
Figure 18,
Figure 19 and
Figure 20.
Figure 18 is shown in order to present the complete process of the ANN network training. For a detailed comparison of the control quality,
Figure 16 and
Figure 19 should be considered, wherein the transient processes of the reference control structure and the final part of ANN training are depicted in detail.
The operation of the reference control structure with two independent PI controllers presented in
Figure 16 reveals significant differences in comparison with the corresponding registration of the first configuration in
Figure 10. The transient process related to the step change of the reference input signal
is herein characterized by significantly smaller overshoot with no further oscillations. On the other hand, the oscillations characteristic for multi-mass systems occurred for the changes in the disturbance torque
. The transient process is more smooth than for configuration no. 1, and the maximum oscillation is significantly reduced. What is also symptomatic is the transient processes of each of the three angular speeds, and
,
, and
are very similar. There are no significant differences between these signals: namely in terms of what was observed in
Figure 16 for the first configuration.
In
Figure 19, one may find that the ANN controller causes significantly higher oscillations in the step change of the reference input signal
for all of the registered feedback signals. This response has a definitely poorer quality than the PI solution. The oscillations are much smaller in the responses of disturbance and are kept at a reasonable level. Furthermore, the maximum amplitude for the
and
signals is slightly lower than that for the PI solution in
Figure 16. The oscillations in the
signal are significantly reduced (almost totally removed). However, the control error reduction is still slower than in the PI solution, similarly to the observations for the first configuration. Careful observation indicates that the response for the removal of disturbance is more dynamic than for its application. The possible explanation is that, in the latter phase, the training process was more focused on the elimination of the control error changes in the network weights. What is different in the observation of the first two configurations is that the ANN controller responses for the second configuration are characterized by much better damping.
The third configuration is very similar to the second one—both the total moment of inertia
and the stiffness coefficient of the shaft are equal in both cases. However, the unique feature is the asymmetric distribution of the moments of inertia, so that, in this case,
. The approach of the comparison of the two solutions is conserved in this case, so that
Figure 21,
Figure 22 and
Figure 23 depict the reference control structure, while
Figure 24,
Figure 25 and
Figure 26 refer to the ANN speed controller.
The reference speed control structure with the control quality of two PI controllers is even better for configuration no. 3 than configuration no. 2. In the reference speed signal , no oscillations are observed, and all of the speed signals , , overlap. Also, the response to the disturbance occurrence revealed better characteristics and may be described by good damping and acceptable values of overshoot and undershoot equal to approximately 10% of the reference value.
For the solution with a single ANN speed controller, the resulting
Figure 24,
Figure 25 and
Figure 26 are similar to those describing a closed control system with mechanical configuration no. 2 (
Figure 18,
Figure 19 and
Figure 20). However, some important differences should be noted here. Firstly, the initial part of the training process presented in
Figure 24 took more time to reach the final state. The amplitudes of the speed feedback signals are also outside the accepted range in the second repetition of the test/training scenario, while in the corresponding
Figure 18, the system response was more moderate and the system was characterized by better adaptation. On the other hand, in the final part of training presented in
Figure 25, the overall system performance is much better than it was previously. In the response to the change in reference speed signal
, the lower values of the transient oscillations are especially observed among all the speed signals
,
, and
, in comparison to the data presented in
Figure 25. The response to the disturbance signal change is very similar; however, in the trace of
that was the signal with best quality parameters, the existing oscillations are slightly larger.
The last configuration is a boundary case of the laboratory setup with the minimum values of the moments of inertia since no additional discs were attached. The shaft with the maximum available diameter of 10 mm was applied, which assured that the highest values of the resonant frequencies described the system operation.
The last set of test results presents significantly different observations. The reference control structure operation is now characterized by very smooth shapes of the
,
, and
signals, which is visible in
Figure 27 and
Figure 28. There is no overshoot in the response to the reference input signal
, as well as no oscillations observed. Also, the reaction to changes in the disturbance torque
possesses smaller oscillations than any of the previous configurations. The weak side of this control structure at the applied parameters of the PI controllers is a long setting time of the input command response. The utilized reference torques values
and
visible in
Figure 29 are much lower in the transient state than in
Figure 11,
Figure 17, and
Figure 23. Although no resonant phenomena were excited, this feature may be considered as a disadvantage.
In
Figure 30,
Figure 31 and
Figure 32, one may observe the operation of the proposed ANN control structure for the configuration with the lowest value of the total moment of inertia
. In contrast to the registrations depicted in
Figure 14,
Figure 20 and
Figure 26, where the final state of ANN training was reached within one or two training cycles, it is visible in
Figure 32 that until the fifth training cycle, the learning process was uncompleted. The significant amplitude of the oscillations—especially in
—reveal that the training process consumed more time in this case. In the final stage presented in
Figure 31, it is visible that, although the maximum amplitude of the oscillations is similar to that in the third mechanical configuration, its damping is more effective, which is a positive feature. Better dynamics of this damping is related with the smaller inertia of the mechanical system in this case. It is worth indicating that the ANN controller utilizes the greater values of reference torque signal values
and
than the solution with two PI controllers. Therefore, the timings related with the response to the changes in the reference speed and disturbance torques are better for the ANN solution for the fourth configuration.
Information about what was happening inside the ANN during the training and speed control process is presented in
Figure 33, where the exemplary weights of the output layer neurons are depicted. The general trends in the dynamics of these changes are similar in another 16 neurons of the perceptron.
As can be seen in
Figure 33, the initial values of the weights, which were randomly selected, stabilized during the first cycle of the training scenario. After this period, the changes in the ANN coefficients are very slight, but assure the continuous improvement in the control quality. It is especially visible in
Figure 30 where, at about the 25th second of the training process, extensive oscillations following the removal of the disturbance signal finally disappear.
In
Table 2,
Table 3,
Table 4 and
Table 5, the classic indicators of the control quality are aggregated for subsequent mechanical configurations. The considered values are integral of the absolute error (
), integral of the time of the absolute error (
), integral of the squared time by absolute error (
), integral of the squared error (
), integral of the time by squared error (
), and integral of the squared time by squared error (
)—whilst the settling time (
) has a reference value threshold of 2% and the percentage values of overshoot and undershoot. This set of indicators was calculated for each of the angular speeds—separately for the response to change in the reference speed (Comm. in the table) and the response to the disturbance application. For the easiness of comparison, the control quality indicators for the two output ANN speed controller and reference solution with the two independent PI speed controllers were placed in the neighboring rows.
In general, one may observe that the ANN speed controller is characterized by more significant oscillations in the transient states than the reference solution. This remark given in the comments to
Figure 9,
Figure 10,
Figure 11,
Figure 12,
Figure 13,
Figure 14,
Figure 15,
Figure 16,
Figure 17,
Figure 18,
Figure 19,
Figure 20,
Figure 21,
Figure 22,
Figure 23,
Figure 24,
Figure 25,
Figure 26,
Figure 27,
Figure 28,
Figure 29,
Figure 30,
Figure 31 and
Figure 32 is also reflected in the values of the control quality indicators included in the
Table 2,
Table 3,
Table 4 and
Table 5. Due to this fact, the integral indicators generally have higher values for the ANN structure. It is directly related to the higher values of the output signal (reference torque command) that cause the reaching limitation of the torque controller. The entrance into this nonlinearity causes the occurrence of oscillations also in the reference control structure with the PI controller, which is visible in
Figure 10 and
Figure 11.
The parameter of the settling time has generally higher values for the ANN speed controller due to its weaker properties eliminating the control error, which consumes more time than the two PI speed controller solutions. However, the settling time for the fourth configuration is significantly shorter, and the ANN controller responds to the change in reference speed. Also, the parameters of the percentage overshoot and undershoot are often better for the ANN solution than for the PI structure, which is visible, e.g., for the response to the disturbance in
Table 4 and
Table 5.