Digital Repetitive Control under Nonuniform Sampling : An LMI Stability Analysis

Digital repetitive control is a technique which allows tracking periodic references and/or rejecting periodic disturbances. Repetitive controllers are usually designed assuming a fixed fundamental frequency for the signals to be tracked/rejected and its main drawback being a dramatic performance decay when this frequency varies. A usual approach to overcome the problem consists of an adaptive change of the sampling period according to the reference/disturbance period variation. This paper presents a stability analysis of a digital repetitive controller working under time-varying sampling period by means of an LMI gridding approach. Theoretical developments are illustrated with experimental results, which are preceded by a detailed description of fundamental issues related to the implementation procedure.


Introduction
Repetitive control 1, 2 is an internal model principle-based control technique 3 that allows both the tracking and rejection of periodic signals.Essentially, this is achieved including a generator of the reference/disturbance in the control loop.Its use has reported successful results in different control areas, such as CD and disk arm actuators 4 , robotics 5 , electrohydraulics 6 , electronic rectifiers 7 , pulse-width modulated inverters 8, 9 , and shunt active power filters 10 .
It is usual to design repetitive controllers assuming a fixed period T p for the signals to be tracked/rejected.Then, a fixed sampling period T s is selected and, eventually, the value of the ratio T p /T s is structurally embedded in the control algorithm.However, it is well known that even slight changes in the frequency of the tracked/rejected signals result in a dramatic decay of the controller performance 11 .

Digital Repetitive Control under Constant Sampling Period
Recall that the trigonometric Fourier series expansion of a T p -periodic signal r t reads as

2.1
By the Internal Model Principle 3 , the inclusion of the generator of signal 2.1 in the control loop results in the tracking/rejection of any T p -periodic reference/disturbance signal.Hence, following 1 , the transfer function of a generator of 2.1 may be written as T p e −T p s/2 1 − e −T p s .

2.2
However, T p e −T p s/2 being a delay term with a gain T p , it is sufficient to include G r s 1 1 − e −T p s 2.3 inside the control loop, which can be implemented as e −T p s with a positive feedback, as depicted in Figure 1.Notice that the transfer function 2.2 has poles at s ±jk/T p , k ∈ N. Therefore, from a frequency point of view, G r s exhibits infinite gain at frequencies k/T p , for all k ∈ N.This assures zero-tracking error at these frequencies in closed loop if the closed-loop system is stable.
It is also worth mentioning that some studies relate repetitive control to control learning techniques see, e.g., 1 .This is due to the fact that the basic repetitive structure learns a signal of length T p and repeats it as a periodic signal of period T p if the input to the system is set to zero see Figure 1 .
The implementation of a time delay in continuous time is a complicated point.Fortunately, in discrete time it is an easier task; if the reference/disturbance signal period T p is a multiple of the sampling period T s , the digital implementation is reduced to a circular queue.Therefore, the discrete transfer function that should be included in the loop is where N T p /T s ∈ N.
In addition to the constraint that represents the demand of a constant ratio between T p and T s , it is important to point out that T s should be selected taking into account that discretetime implementations can only deal with those harmonics which are below the Nyquist frequency ω s /2 π/T s .
Repetitive controllers are composed of two main elements: the internal model, G r z , and the stabilizing controller, G x z .The internal model is the one in charge of guaranteeing null or small error in steady state, while the stabilizing controller assures closed-loop stability.Several types of internal models are used depending on the concrete periodic signal to deal with 19-22 .In this work the generic internal model is used, that is, G r z is indeed taken as H z plays the role of a low-pass filter in charge of introducing robustness in the high frequency range 23 .Although the internal model and the stabilizing controller can be arranged in different ways, most repetitive controllers are usually implemented in a "plugin" fashion 20 , as depicted in Figure 2: the repetitive compensator is used to augment an existing nominal controller, G c z .This nominal compensator is designed to stabilize the plant, G p s , and provides disturbance attenuation across a broad frequency spectrum.The signals R z , D z denote, respectively, the z-transforms of the input signal r t to be tracked and of the output disturbance d t to be rejected.Assume that both T p and T s are constant, which makes N also constant, and let G p z stand for the corresponding z-transform of G p s .Sufficient stability criteria are given in the next Proposition.
Proposition 2.1.The closed-loop system of Figure 2 is stable if the following conditions are fulfilled [19,20].
1 The closed-loop system without the repetitive controller, G o z , is stable, where iii a trivial structure which is often used for G x z in case that G o z is minimum phase is 24 : Otherwise, alternative techniques should be applied in order to avoid closed-RHS plane zero-pole cancellations 24 .Moreover, there is no problem with the improperness of G x z because the internal model provides the repetitive controller with a high positive relative degree.Finally, as argued in 25 , k r must be designed looking for a trade-off between robustness and transient response.

Digital Repetitive Control under Variable Sampling Period
The repetitive controller introduced in the previous section contains the ratio N T p /T s , which is embedded in the controller implementation.This is not a problem if the reference or disturbance periodic signal has a known constant period.However, the controller performance decays dramatically when a variation of T p appears 11 .This paper propounds to adapt the controller sampling period T s following the reference/disturbance period T p t , with the aim of maintaining a constant value for N. Hence, on the one hand, G r z , G x z , and G c z are designed and implemented to provide closed-loop stability for a nominal sampling period T s T N s , in accordance with Proposition 2.1 and Remark 2.2.Their structure remains always invariant; that is, it undergoes no further structural changes.On the other hand, the period of the sampler device that precedes the plant G p s is accommodated to the variation of T p t ; therefore, its discrete-time representation is that of a LTV system.
Remark 3.1.The above described operation may yield major changes in the dynamic response of the system.As an example, consider that the plant G p s in Figure 2  Let the repetitive controller be constructed assuming N 25 and a reference/disturbance nominal period T p 0.125 s, this yielding a nominal sampling period of T N s T p /N 0.005 s.Let also G c z , H z , and G x z be selected as indicated in Section 4.2.Then, the sufficient stability conditions established in Proposition 2.1 for the nominal sampling period T N s are fulfilled.Figure 3 depicts the maximum modulus eigenvalue of the closed-loop system matrix as a function of T s in a neighborhood of T N s .This information allows stating that instability is ensured for T s / ∈ 4.461, 5.543 ms.
The above discussion indicates that, although the proposed technique allows adapting the system to the specific signal frequency to be tracked/rejected without changing the digital controller, the sampling rate change may affect closed-loop stability.In what follows, an LMI-based approach to study closed-loop stability under varying sampling rate condition is developed.
Regarding the time-varying nature of the sampling period of the plant, the stability analysis is carried out in the state-space formalism.Let A, B, C, D represent the continuoustime plant state-space representation, that is, Assume that G p s is sampled at {t 0 , t 1 , . . ., t k , . ..}, with t 0 0 and t k 1 > t k , the sampling periods being Therefore, the plant evolution at the sampling instants is given by the discrete-time LTV system:

3.4
In case that T k remains constant, i.e., T i T j , for all i / j, system 3.4 corresponds to a discrete- Similarly, under varying sampling period, the closed-loop system depicted in Figure 2 can be described in state space by a quadruple A k , B k , C, D , which may be constructed combining A k , B k , C, D and the state-space representations of G r z , G x z , and G c z .Thus, C and D are constant matrices, while A k and B k depend continuously on T k .A methodology for studying the closed-loop system under time-varying sampling conditions will be introduced in the rest of this section.
Let the sampling period, T k , take values in a known compact subset T T 0 , T F ⊂ R .Proof.It follows from the stability hypothesis that all the eigenvalues of A N have modulus less than 1, which yields immediately item 1 26 .Item 2 stems from the fact that the sufficient condition for uniform exponential stability established in Proposition 3.3 is also necessary for a discrete-time LTI system.Finally, item 3 follows immediately from Propositions 3.2 and 3.3 once the continuity of the matrix elements of A k with respect to T k is taken into account.
Assume that we are interested in analyzing the stability of A k , B k , C, D for all sampling periods T k ∈ T. Let then P P N be a feasible solution of the LMI problem 3.7 for a fixed α ∈ R ; its existence is guaranteed by Proposition 3.4.Let also {τ 0 , . . ., τ q }, with τ i 1 > τ i , be a sufficiently fine grid of T. If L τ i P N < 0, for all i 0, . . ., q, stability for all T k ∈ T may be probably inferred.
Otherwise, in case that there exists at least a single τ i such that L τ i P N > −αI, the gridding procedure proposed in 18 may be carried out as follows.Let {τ 0 , . . ., τ r } be a sorted set of candidate sampling periods suitably distributed in T.Then, one may solve the following finite set of LMIs:

Mathematical Problems in Engineering
Remark 3.5.The application of the procedures to the plant introduced in Remark 3.1 yields the following results.The evolution of the maximum modulus eigenvalue of L T k P N , P N being the solution of 3.7 for α 100, is depicted in Figure 4. Hence, BIBO stability is ensured in I N 4.996, 5.004 ms.Alternatively, the approach that stems from 3.8 guarantees stability in T 4.60, 5.45 ms; this interval is computed by successive extensions of an initial T 0 containing T N s until 3.8 , with α 100, becomes definitely unfeasible.
Remark 3.6.Notice that i comparatively, in the first approach a shorter stability radius may be reasonably expected; ii the main drawback of both analysis paths is associated with the fact that stability is rigorously guaranteed just in open neighborhoods of each sampling period τ i where either L τ i P N < 0 or L τ i P G < 0 are satisfied; iii the applicability of the above developed method to large scale or very high order systems is subject to the limitations of the numerical algorithms used to solve the LMI problems 3.7 or 3.8 ; iv a faulty estimation of T p and/or an error in the implementation of T s may yield important performance degradation 11 .However, closed-loop BIBO stability is not threatened unless the plant is actually sampled with T s values lying outside the region T where stability is guaranteed.

Plant Description
Systems with rotary elements are usually affected by periodic disturbances due to the movement of these parts e.g., electrical machines, CD players. . . .This kind of system is supposed to be moving, in some cases, at a fixed angular speed.Under these working conditions any friction, unbalance, or asymmetry appearing on the system generates a periodic disturbance that affects its dynamical behavior.Reference 19 contains a description of a mechatronic plant designed to reproduce this working conditions.This device is composed of a bar holding a permanent magnet in each end, each magnet being magnetically oriented in the opposite way, and attached to a DC motor and two fixed permanent magnets see a sketch in Figure 5 .The rotation of the DC motor causes a pulsating load torque Γ p that depends on the mechanical angle θ of the motor axis.When the motor axis angular speed ω is constant θ ω 0 , the pulsating torque is a periodic signal with a fundamental period directly related to the axis speed: T p ω −1 , with ω expressed in rev/s.The control goal for this plant is maintaining the motor axis angular speed constant at a desired value.However, this type of disturbances may not be completely rejected by a regular controller, so a repetitive controller is designed in next subsection.
Figure 6 also shows the open-loop time response of the plant containing the fixed magnets.It is important to note that the speed describes an almost periodic signal.This type of disturbances may not be completely rejected by a regular controller, so a repetitive controller is designed in next subsection.
Finally, it is worth mentioning that in this experimental setup the disturbance could be written as a nonlinear part of the system, and therefore nonlinear control techniques should be used instead of repetitive control.An interesting application of this procedure to  speed control of mechatronic systems is reported in 27 .However, for the present case this would require the use of complex models and, consequently, of complex nonlinear controllers which in general might not provide the same performance.Hence, we proceed assuming unmodeled or uncertainty components as disturbances, which is quite common in control theory and, at the same time, allows the use of repetitive control in this problem.

Control Design
A first-order model for the plant is experimentally derived from its open-loop time response without the fixed magnets, namely, The controller is constructed from 4.1 , for a speed of ω 8 rev/s and obtaining 25 samples per period, that is, N 25.These conditions imply a nominal sampling period of T N s T p /N 1 ωN 5 ms.Under these assumptions the nominal discrete time plant is According to Remark 2.2, the following design issues have been taken into account: i G c z 0.25 provides a very robust inner loop, ii the first order null-phase FIR filter H z 0.02 z 0.96 0.02 z −1 provides good performance in this case, iii the fact that G p z is minimum phase allows G x z k r G −1 o z , with k r 0.3.These settings yield the control law

4.3
with e k r k − y k , where y k is the system output speed and r k is the reference.

Stability Analysis
Although the controller is designed to regulate the speed at 8 rev/s, in practice it will be necessary to move from this design point.Let us assume that we are interested in varying the speed reference in the interval 6, 11 rev/s; this entails a sampling period variation in the interval T 0.00363, 0.00666 s.The stability analysis that stems from Proposition 3.4 includes the solution of the LMI 3.7 , which is known to be feasible, and the checking of the negative definite character of L T k P N .Figure 7 shows the evolution of the maximum modulus eigenvalue of L T k P N when solving for α 100 and also for 50000 uniformly distributed values of T k .Therefore, it can be presumed that the closed-loop system may operate in a speed range of 7.32, 8.77 rev/s with dynamically preserved stability.This speed interval is obviously very narrow and operation conditions are limited to a sampling period interval I N such that T/ ⊆I N .However, it is important to recall that this test comes not from a necessary condition but from a sufficient condition, so moving out of this interval does not necessarily imply instability although this step can be avoidable in most cases, its results are very useful to tune the LMI solver regarding next step .
In order to guarantee a broader stability interval, the second method described in Section 3 may be applied.Therefore, 50 uniformly distributed points are selected in T 0.00363, 0.00666 s.These points are used to construct the set of LMIs 3.8 , and a feasible solution P P G with α 100 is obtained.Figure 7 depicts the maximum modulus eigenvalue of L T k P G , designating with a star the 50 points leading to the LMI formulation.The maximum modulus eigenvalue of L T k P G corresponding to a finer grid consisting of 50000 uniformly distributed point are also drawn in Figure 7.These points are used to check the sign of L T k P G in the intervals between the points defining the LMI set.It can be seen that L T k P G < 0 for every point in this finer grid of the interval T; hence, stability is dynamically preserved therein.This method extends the previously obtained stability interval 7.32, 8.77 rev/s, thus providing less conservative results.Further extensions of the new interval could also be feasible.

Implementation Issues
The first issue to deal with in the implementation of the control action is the measurement of the uncertain or time-varying period T p of the signal to be tracked/rejected.In the general case an adaptive scheme similar to those in 13, 15, 16 is used for this task; the complete controller architecture is depicted in Figure 8.The frequency values, T −1 p t , are obtained by means of a frequency observer using information from different sources, namely, reference profile, output signal, and control action.Then, the sampling rate is calculated as T s t T p t /N.
Nevertheless, as it has been previously stated, in mechanical turning systems the frequency to be tracked/rejected is directly related to the turning speed.Hence, for the analyzed mechatronic plant the disturbance frequency is straightforwardly computed from the turning speed reference.This allows us to study the effect of the adaptive approach on the closed-loop system decoupled from the frequency observer dynamics.
For the general case, the study of the effect of the frequency observer dynamics on the global system stability is out of the scope of this paper.However, it is also worth recalling that any fault in the estimation and/or implementation of T s causes a difference between the experimental ratio T p /T s and the implemented value for N which, in turn, may yield a performance degradation.As an example, Figure 9 shows the first harmonic gain factor evolution of the internal model against a relative deviation of the real sampling period T real s with respect to the nominal T N s 5 ms, namely, where G r • is defined in 2.5 and

4.5
Notice that even small deviations of T real s entail important gain reductions.However, as stated in Remark 3.6 iv , closed-loop stability is not threatened unless T real s / ∈ T. Finally, and also in accordance with Remark 3.6 iv , the frequency observer output has to be saturated so as to guarantee that T s ∈ T.
The controllers have been implemented using RTLinuxFree-3.1, a real-time operating system RTOS .This RTOS allows programing using standard POSIX system calls 28 with the user interface of a GNU/Linux Operating System kernel 2.6.9 .The controllers are encoded in C language, while periodic task handling has been implemented using RTLinuxFree capabilities.
The actuator is composed of a Johnson Electric HC615L 20 W, 5 A DC motor, a fullbridge inverter LMD18200, 3 A full-bridge and pulse width modulation PWM hardware, included in a NuDQ PCI8133 board.The speed sensor is composed of a 500 pulse-perrevolution optical encoder Hewlett-Packard H9730A, a quadrature decoder and a counter, all of them are included in a NuDQ PCI8133 board.The interface between the controller realtime task and the NuDQ PCI8133 board has been implemented using low level commands.

Experimental Results
The reference profile used in the experimentation is the following.During the time interval 0, 10 s, the reference is maintained constant at the nominal value of ω 8 rev/s.At t 10 s a ramp reference change, from ω 8 rev/s to ω 6.25 rev/s, is introduced in the system; then, the speed is kept constant for 10 s and finally at t 25 s the speed is gradually augmented at a constant acceleration until it reaches the value ω 10.81 rev/s at t 32 s.The experiment has been carried out for three different settings of the sampling time.In Figure 10 a the sampling period is kept constant at the nominal value T N s 5 ms, for all t; it is important to realize that, in comparison to the uncompensated speed profile depicted in Figure 6, now disturbances are almost rejected in 0, 10 , that is, when both reference and sampling are at the nominal values.However, for t > 10 s disturbances cannot be properly compensated, and performance is strongly degraded.Figure 10 b depicts the output behavior when the sampling period is varied adaptively assuming that the estimation of T p uses a 2nd order frequency observer; the profile of the actually used T s is in Figure 11.Notice that the performance gets worse in the regions where there is estimation error.Finally, Figure 10 c portrays the response under adaptive variation of T s from an exact estimation of T p .According to Sections 4.3 and 4.4, stability is preserved in the three situations because T s always belongs to T. Performance in the steady-state depends on the accuracy of the estimation of T p , while performance during transients, although not guaranteed by repetitive   control theory, follows here the same pattern as that observed for the steady state; that is, it improves with better estimations of T p .

Conclusions
This paper analyzed the BIBO stability of a closed-loop system containing a digital repetitive controller working under time-varying sampling period.The analysis was carried out using an LMI gridding approach that allows a stability assessment in a known, bounded interval where the reference/disturbance period is assumed to vary.The theoretically predicted results have been experimentally validated through a mechatronic plant in which rejection of periodic disturbances with time-varying period is successfully achieved.A detailed description of fundamental issues related to the implementation procedure has been provided.
Current research is being devoted to develop redesign methodologies to address the situations in which the sampling period T s falls out of the stability interval T.

Figure 1 :
Figure 1: Basic structure for a continuous-time repetitive controller.

Figure 2 :
Figure 2: Discrete-time block-diagram of the proposed repetitive transfer function.

Figure 3 :
Figure 3: Maximum modulus eigenvalue of the closed-loop system matrix.

1 B
time LTI system with z-transform transfer function G p z C zI − A −D.In an aperiodic sampling framework A k and B k vary with k, and the z-transform representation is no longer valid.

Figure 4 :
Figure 4: Maximum eigenvalue of 1 L Tk P N with α 100 and T N s 0.005 s; 2 L Tk P G with 50 points in the range 4.60, 5.45 ms.The plots have been rescaled to allow a better comparison between 1 and 2 .

Figure 5 :
Figure 5: Mechanical load: fixed and moving permanent magnets sketch ω and Γ p stand for the angular speed and the disturbance torque, resp. .

Figure 6 :
Figure 6: Open-loop time response of the plant with the fixed magnets.

Figure 7 :
Figure 7: Maximum eigenvalue of 1 L Tk P N with α 100 and T N s 0.005 s; 2 L Tk P G with 50 points in the range 6, 11 rev/s.The plots have been rescaled to allow a better comparison between 1 and 2 .

Figure 9 :
Figure 9: First harmonic gain factor evolution at harmonic frequencies.

Figure 10 :
Figure 10: Closed-loop system behavior using a repetitive controller and with sampling period T s .a Fixed at the nominal value T N s 5 ms ; b obtained from a 2nd order frequency observer for T p ; c obtained from an exact estimation of T p .

Figure 11 :
Figure11: Sampling period T s corresponding to an exact blue and a 2nd order green observer for T p .
where G x z is a design filter to be chosen.
According to 26 , the result follows if B k , C, and D are uniformly bounded matrices, for all k, and this is indeed true: B k depends continuously on T k , which belongs to a compact set T, while C, D are constant matrices.At this point, it is immediate to realize that relation 3.6 in Proposition 3.3 yields an infinite set of LMIs.The gridding approach introduced in 17, 18 allows a simplified stability analysis that may be performed in two stages, if necessary.In a first stage, advantage is taken from the fact that A N , B N , C, D , corresponding to A k , B k , C, D evaluated in T k T N s , is stable by construction, because recall that G r z , G x z , and G c z are designed with such purpose.
Proposition 3.2.The uniform exponential stability of the zero state ε 0 of ε k 1 A k ε k implies the uniform BIBO stability of the system A k , B k , C, D .Proof.k − P. 3.5 Proposition 3.3 see 26 .If there exists a matrix P such that L T k P ≤ −αI, ∀T k ∈ T, s.t.P > 0, P P , 3.6 where α ∈ R , then the zero state of ε k 1 A k ε k is uniformly exponentially stable.s ∈ T.Then, 1 the zero state of the LTI system ε k 1 A N ε k is uniformly exponentially stable, s P ≤ −αI, s.t.P > 0, P P , 3.7 with α ∈ R , is feasible, 3 let P P N be a solution of the LMI problem 3.7 for a fixed α ∈ R .Then, there exists an open neighborhood of T N s , say I N , such that A k , B k , C, D is BIBO stable in I N .
r, s.t.P > 0, P P , 3.8 for a fixed α ∈ R .In case that the problem is feasible and a solution, P P G , is encountered, the negative semidefinite character of L T k P G is to be checked for intermediate values of T k in each open subinterval τ i , τ i 1 .If this fails to be accomplished, 3.8 has to be solved again for a finer grid of T.