Position Tracking for Multi-Channel Double-Crystal Monochromator Scanning Based on Iterative Learning Control

: As a core component of the X-ray absorption ﬁne structure spectroscopy (XAFS) system, the multi-channel double-crystal monochromator (DCM) can improve the time resolution of the system signiﬁcantly. In contrast to the conventional single-channel DCM, the multi-channel DCM includes more pairs of crystals that are located separately in the master and slave motor axis with the same driving direction. However, a mismatched parallelism in the pitch direction, which can result from the manual mounting operation between the two separated crystals, directly affects the performance of the ﬂux and the angular stability of the monochromatic beam. This poses a signiﬁcant challenge to the precision position tracking of this system. In this paper, the mounting errors were translated into repetitive errors in the slave motor when the master motor was rotated at a constant velocity. Therefore, the iterative learning control (ILC) was considered in order to improve the tracking accuracy of the slave motor motion. The zero-magnitude error controller (ZMETC) was used to calculate the learning function to accelerate the convergence of the control inputs, and the convergence conditions of the control signal and error were also given. To validate the effectiveness of the proposed method, comparative experiments were performed on the motor motion platform. Experimental results indicated that the ILC effectively decreased the parallelism errors of the multi-channel DCM under various trajectories by comparing them with feedback controllers and the ZMETC, respectively.


Introduction
With the development of synchrotron light source technology, the study of the realtime structure of materials under in situ conditions has been widely applied in the fields of life and material science [1][2][3].The experimental method of time-resolved X-ray absorption fine structure (XAFS) spectroscopy is an important technical method for realizing such research [4,5].As a core component of the XAFS system, the double-crystal monochromator (DCM) plays an essential role in the stable output of the outgoing beam's position, energy, and flux.In order to reflect the dynamic process of the sample's structure in real time with more detailed test results [6], the improvement of time resolution for the monochromator spectrum is particularly important.It should be pointed out that time resolution is determined by the rotation frequency of the DCM; thus, it is necessary to improve its rotation precision and speed.
According to the Bragg diffraction formula, with a varied angle between the incident beam and the diffractive crystal plane, single-wavelength X-rays are separated from the continuous spectrum of synchrotron radiation, and the outgoing beam is diffracted into a fixed position on the sample.The parallelism in the pitch direction between the two separated crystals directly affects the performance of the flux and the angular stability of the monochromatic beam, as demonstrated in Figure 1.For a conventional DCM, the parallelism of the pair of crystals is manually adjusted by the stepping motor before actual experiments [7].However, due to the backlash in the structure of a DCM, the angular stability is destroyed significantly, and, consequently, the rotation velocity is limited during such a motion process.In addition, due to the incident beam being concentrated on the single crystal in both traditional and channel-cut DCMs, the crystals need to be cooled by costly liquid nitrogen [8,9], which increases the complexity of the system.In order to address the mentioned problems, a novel monochromator with multi-channel crystals was designed with two independent polyhedral spindles that were separately driven by master and slave motors.As the crystals were mounted on the surface of the polyhedral spindles, the parallelism of the crystals was controlled by the relative precision rotation of the motors.However, the manual mounting errors of the crystals could degrade the positioning accuracy significantly, resulting in the failure of the output of the monochromatic beam.In particular, it was worth considering that the mounting errors could be regarded as stable errors that repetitively appeared during the rotation process when the master motor was rotated at a constant velocity.Therefore, the mounting errors could be reduced by improving the reference tracking accuracy, just for the slave motor on the fly.There are some motion control methods to improve the position accuracy for single motor motion [10][11][12].Feedback controllers are usually used to implement motion control in order to improve the tracking accuracy, including proportion-integration-differentiation (PID) control, robust control, and sliding mode control (SMC), etc. [13][14][15].For example, the servo control system, combined with position-speed-current loops, is usually used to track the defined trajectory via a PID controller [16].The SMC controller is also used to decrease the tracking errors caused by external disturbances or parameter uncertainty in a dynamic motion system [17,18].Although these methods can improve precision to some extent, their performance is limited by the phase delay of the feedback controller and the achieved bandwidth [19][20][21].Some model inversion-based feedforward control methods have been proposed to improve the tracking precision, including the zero-phase error tracking controller (ZPETC) and the zero-magnitude error controller (ZMETC) [22][23][24], where the control inputs are pre-calculated with the known trajectory via the inverse of the identified system model.Nevertheless, the effectiveness of the feedforward controllers relies heavily on the accuracy of the identified model, and the variation of the plant directly reduces the tracking precision significantly when the models are not identified accurately enough [22,25,26].It is worthy of being noted that tracking errors, as well as the above-mentioned translated mounting errors, appeared repetitively.Thus, it was natural to use iterative learning control (ILC), a popular learning-based feedforward controller, to improve the repetitive reference tracking performance [27].ILC can minimize repetitive errors through updating the control input through learning the historical tracking errors and input signals [28].The combination of feedback and ILC is a promising control scheme, where unknown disturbances are decreased by the feedback controller, and the feedforward controller can compensate for the repetitive errors and known disturbances.Therefore, the design of the ILC was a crucial component for significant performance enhancement due to the existing repetitive errors in the multi-channel DCM.The ILC consists of a learning function to determine the learning method and a low-pass Q-filter to balance the robustness and precision [29][30][31].Although the proportion (P-), differentiation (D-), and proportion-differentiation (PD-) type ILC can be implemented without an accurate model, the convergence speed is lower than the model-inversion ILC [32,33].To this end, the model-inversion ILC was considered to tackle the repetitive errors along with the slave motor rotation.

Momochromator IC 1 IC 2 Sample Slits
Motivated by the aforementioned essential issues, the objective of this paper was to compensate for the repetitive errors, followed by the slave motor on the fly, for a multichannel DCM, which has rarely been researched in the field of control for DCM equipment.According to the repetitive property, ILC was adopted to guarantee the parallelism between a pair of crystals.In order to accelerate the convergence speed, the method named ZMETC was used as the learning function, and a Q-filter was delicately designed to improve the robustness of the whole system.Furthermore, a single-axis motor motion platform was built to verify the tracking performance of the references for tracking triangular waves and fourth-order trajectories, respectively, and comparative results using PID control and ZPETC were demonstrated to evaluate the effectiveness of the used method in the improvement of parallelism accuracy in the application of a multi-channel DCM.
The rest of the paper is organized as follows.In Section 2, the principle of a multichannel monochromator is described, and the tracking problem is analyzed.The design of an ILC and learning function are described in Section 3. The experiment using the singleaxis motor motion platform and a comparison of the results are discussed in Section 4. The thesis summary and subsequent research plans are included in Section 5.

System Description
The comparisons of the principles between the conventional single-channel and multichannel DCMs are illustrated in Figure 2, where it is obvious that the scanning frequency of the single-channel DCM was determined by the velocity of the reciprocal rotation.However, the backlash problem seriously limited the accuracy of the scanning angle with high velocity due to the driven principle, i.e., the direction needed to be switched frequently at the corners.Moreover, the same working area of the crystal plane was always exposed on the incident beam during the reciprocal rotation so that the temperature was varied, which might lead to an uneven crystal surface along with undesired outcomes of the DCM.
In contrast to the conventional single-channel DCM, the multi-channel DCM included more pairs of crystals located at a separate motor axis driven in the same direction to ensure the parallelism of the crystals on the fly.As illustrated in Figure 2b, the scanning frequency could be improved through more crystal pairs and a high rotation speed, and the working crystals varied during the rotation process, which was particularly important for the improvement of the thermal stability of the multi-channel DCM.
As multiple pairs of crystals were manually mounted on the surface of the polyhedral spindles, the parallelism errors were the main concern that hindered the desired performance.Thus, for the multi-channel DCM, the master motor needed to be controlled at a constant velocity, while the slave motor was conducted with a varied velocity to follow the master motor, as displayed by the different trajectories in Figure 2c.Therefore, a single-axis motor motion platform was designed to verify the ILC performance for the slave motor, which could be further applied to the multi-channel DCM scanning process.

Iterative Learning Control
ILC is an efficient algorithm to improve the performance of a system by learning from previous information, i.e., errors and control inputs.In this paper, the ILC method was utilized to improve the performance of a multi-channel DCM system.The block diagram of the controller is demonstrated in Figure 3. r(k) represents the repeat reference, C f b1 (z) and C f b2 (z) are respectively represented as the position feedback controller and velocity feedback controller, P(z) refers to the combination of the motor driver and the DCM stage, u f f ,i+1 (k) is the feedforward control input based on the previous (i)-th iteration with i indicating the number of iteration, and the external disturbance is represented by d i (k).It should be noted that d i (k) includes repetitive and random interference.According to the configuration of the multi-channel DCM system, the repetitive disturbance comes from the mounting errors of the crystals and torque ripple caused by brushless motor pole stitching, and the environmental vibrations, such as mounting base or coolant flow, results in random interference.

Delay
Based on Figure 3, the output y i+1 (k) is given by where T(z), J(z) are separately represented as the transfer functions of complementary sensitivity and process sensitivity, which are given as where G p (z) is the closed-loop transfer function of the velocity loop with an integrator, which is calculated as The output of error is defined as follows: The loop of the ILC algorithm is made up of a learning function L(z) and a lowpass filter Q ILC (z).According to the control law of ILC, the (i + 1)-th control input is calculated by where Q ILC is the low-pass filter that is used to reduce the influence of high-frequency noise, L(z) is the learning function.
With the combination of Equations ( 1), ( 5), and ( 6), the output of error at the (i + 1)-th iteration is calculated by To ensure the convergence of the control inputs in ILC when the number of iterations tends to infinity, the convergence condition is given by Equation ( 8): where || • || ∞ represents the infinite norm of the above transfer function.
The control input u f f (k) ∞ is calculated based on Equation ( 7): After the (i + 1)-th iteration, the output of error e i+1 (k) is given by According to the Equations ( 8) and ( 10), the error converges to zero with L(z) = J −1 (z) and d i (k) = d i+1 (k), which indicates that ILC could compensate for the repetitive errors.On the other hand, the set value of Q ILC significantly influences the convergence of the control input.If the cut-off frequency was set too high, the high-frequency noise would lead to divergence during the iteration process; otherwise, if the value was set too low, it would spend more time trying to achieve the convergence goal, and the precision of the tracking trajectory was also limited.Hence, it was essential to delicately design the cut-off frequency during the implementation of the iterative controller.

Learning Function
According to inequality (8), restrictions were easy to meet when the learning function was designed by the inverse of the process sensitivity transfer function J(z).However, because the platform was a non-minimum-phase system, the model inversion was difficult to solve due to the presence of the unstable zeros.In this paper, the zero-magnitude error tracking controller (ZMETC) method was used to obtain the approximate inverse model of J(z).The equivalent representation of J(z) is given by where B s (z) and B u (z) respectively include the stable and unstable zeros, and A s (z) includes all the stable poles.B u (z) can also be translated to the expression of n-th order polynomial with n non-minimal phase zeros which is given by According to the law of ZMETC, the approximate inverse model of J(z) is given by where d changes the symbol d such that n represents the relative orders of the model.The expression of B f u (z) is solved by reversing the order of the coefficients in Equation ( 12) as

Experimental Setup
A single-axis motor motion system was used for the experiments, and the experimental setup is shown in Figure 4, which included a Maxon EC-Flat brushless motor, Elmo's motor driver, a 29-bit Heidenhain absolute value encoder, and an aluminum metal shaft.The motor driver was driven by the input current signal generated by the 16-bit digital to analog converters (DAC) on the dSPACE-MicroLabBox platform.The real-time positions were acquired by the absolute value encoder and transferred via the Endat 2.2 protocol port.The control system was established in the Simulink software environment and executed in a real-time application on the dSPACE-MicroLabBox platform.Meanwhile, the sampling frequency of the controller system was set to 5 kHz.In order to identify the linear dynamic model of the experiment platform, a set of the sin-sweep current signal was applied to the motor driver.To avoid the backlash of the motor, the direction of the motor motion was set to be same, and the current driven signal was expressed as u(t) = 1.5 + 0.5 × sin(2π f t) where u(t) represents the input current signal, and the frequency of the current signal was expressed as f , which varied between 0.01 and 500 Hz for the system identification.
A continuous-time transfer function model was identified by the system identification toolbox in the MATLAB software and was subsequently discretized via the zero-order holder (ZOH) method to facilitate the controller design, given as Figure 5 shows the match between the measured and identified open-loop frequency responses.It was clear that the first-order resonance point existed at 300 Hz for the experimental platform.

Tracking Results
A set of triangular waves and fourth-order reference trajectories were applied to verify the performance of ILC in its application to multi-channel DCM scanning [34].The example of the defined references for experiments is illustrated in Figure 6.In order to evaluate the performance of the designed controller, the following controllers were also used for comparison: 1.
C 3 : ILC which is illustrated in Figure 3.
For the PID controller, the parameters were set as follow: K p = 53.0469,K i = 3633.5934,K d = 1.9348 for the position loop, and K p = 0.0034, K i = 0.1703 for the velocity loop.
As shown in Figure 7, the inversion of model G −1 p (z) used in the ZMETC controller is expressed as Figure 8 shows the frequency spectrum of tracking errors that were measured before the ILC algorithm was loaded, and it was obvious that the errors were mainly located in the region of 30-50 Hz.It should be noted that high-frequency interference might result in the divergence of the control inputs, and thus the bandwidth of the low-pass filter could be set at three to five times the central frequency regions of the errors [32].Therefore, the cut-off frequency of the Q-filter was set to 100 Hz and realized by the butter function in MATLAB software in this paper.In order to further improve the convergence speed, the learning function L(z) was designed by utilizing the inversion of J(z), and here ZMETC was adopted to obtain the approximated inversion as

Tracking Triangular Wave
The results of fifty iterations are illustrated in Figure 9 for the reference tracking with 30 Hz triangular waves, and the statistical results for different tracking frequencies are listed in Table 1.The results showed that the tracking errors decreased with the increment of iterations, indicating the ILC's ability to compensate for the repetitive errors during the iteration process, as demonstrated in Figure 9a,b.It was clear that the errors tended to converge after 20 iterations, and the RMS error was much smaller than other controllers.Figure 9d shows the comparison between the reference and actual motion tracking at the 20th iteration.It was evident that the ILC achieved the best tracking performance among the three controllers, with an RMS error of 80.02 .The performance was worst for the feedback PID controller with RMS errors of 545.27 for the phase delay and no ability to compensate for repetitive errors along with the reference tracking.Although the performance of feedforward ZMETC was improved significantly in comparison with PID control, the tracking precision depended on accurate model identification, and no learning mechanism was integrated to handle the repetitive errors.

Tracking Fourth-Order Motion Reference Trajectory
In this paper, the fourth-order reference was used for trajectory planning for the difference in trajectories between the master and slave motors, which could significantly decrease the impact of the variable acceleration speed.The results of the 50th iteration are illustrated in Figure 10 for the reference tracking with a 36 Hz fourth-order motion reference, and the statistical results for variable frequency tracking are listed in Table 2.The tracking errors decreased with an increase in the iterations, as shown in Figure 10a, which proved the ability of the ILC to track the fourth-order reference.It was clear that the ILC achieved the best performance with RMS errors of 127.89 , compared with 758.09 for the PID controller, and 220.98 for the ZMETC controller.The PID controller achieved the worst performance due to phase delay, which was difficult to eliminate.
In addition, the operating interval during the crystal rotation was particularly displayed as the red shaded area in Figure 10c, and the errors were controlled within the limits of 36 for the ILC, which indicated that the ILC could contribute to decreasing the parallelism errors in the area for the working crystals.

Conclusions
In this paper, the tracking controller design for a multi-channel DCM was researched to improve the parallelism between the pairs of crystals.As the mounting errors could be translated into the repetitive errors in the slave motor when the master motor was rotated at a constant velocity, ILC was designed to improve the tracking precision by dealing with the repetitive trajectories and disturbances.The control law, as well as the convergence condition, was also given and discussed.To accelerate the convergence of control inputs, the learning function chosen as the inverse of the model was calculated by the method of ZMETC, and the bandwidth of the Q-filter was delicately designed through the frequency spectrum analysis of the measured errors.A set of controllers (PID, ZMETC, and ILC) were tested on the developed single-axis motion platform to evaluate the performance.

Figure 1 .
Figure 1.The structure of the XAFS.

Figure 2 .
Figure 2. The comparison between the single-channel and multi-channel DCMs.The working principles of single-channel and multi-channel DCMs are separately represented by (a,b), the different trajectories between the master and slave motor are displayed in (c).

Figure 3 .
Figure 3.The controller framework of ILC.

Figure 4 .
Figure 4.The experimental setup of the single axis motion platform.

Figure 5 .
Figure 5. Frequency responses of the single axis motion platform, amplitude and phase frequency responses are separately represented by (a,b).

Figure 6 .
Figure 6.The example of reference trajectory.

Figure 7 .
Figure 7. Amplitude frequency responses for the inverse model of the plant and the learning function.

Figure 8 .
Figure 8.The FFT spectrum of tracking errors.
Tracking errors at different iterations.
Tracking errors at the 20th iteration.

Figure 9 .
Figure 9. Triangular wave reference tracking performance compared with existing methods.
Tracking errors at different iterations.
Tracking errors at the 20th iteration.

Figure 10 .
Figure 10.Fourth-order motion reference tracking performance compared with existing methods.

Table 1 .
Error results of triangular reference tracking.

Table 2 .
Error results of fourth-order motion reference tracking.