Mirko Brentari

Paolo Bosetti

Luca Zaccarian

A Class of Hybrid Velocity Observers for Angular Measurements With Jumps

We propose a hybrid nonlinear high-gain observer to estimate the speed of rotary systems equipped with potentiometerbased, capacitive or hall-effect rotary sensors or providing angular measurements evolving in S1, exhibiting unpredictable jumps of 2π. A hybrid measurement model is proposed, based on which a hybrid high-gain observer is synthesized, which does not require the knowledge of the jump times. Asymptotic tracking of the proposed observer is proven. A sampled-data approximation of the proposed observer is developed as well, based on which an experimental validation shows suitability for real-time applications.

I. INTRODUCTION

Observers are fundamental building blocks in control when facing output feedback problems. Many strategies have been proposed in order to estimate the plant state starting from its output, such as Luenberger observers [START_REF] Andrieu | On the existence of a kazantzis-kravaris/luenberger observer[END_REF], passivity-based observers [START_REF] Ailon | An observer-based set-point controller for robot manipulators with flexible joints[END_REF], and high-gain observers [START_REF] Khalil | High-gain observers in nonlinear feedback control[END_REF]. Among these, high-gain observers are a well established tool when the process to be observed contains some unmodelled dynamics. They are also used in order to estimate the time derivative of the plant's output, making use of the high-gain scaling parameter as a tuning parameter allowing one to trade off between responsiveness and noise sensitivity of the observer [START_REF] Nicosia | Experimental results in state estimation of industrial robots[END_REF], [START_REF] Chitour | Time-varying high-gain observers for numerical differentiation[END_REF]. Recently, the hybrid dynamical system framework of [START_REF] Goebel | Hybrid Dynamical Systems: modeling, stability, and robustness[END_REF] has been exploited in order to enhance the performance or extend the use of classical continuous-time observers, both in the high-gain scheme [START_REF] Andrieu | A hybrid scheme for reducing peaking in high-gain observers for a class of nonlinear systems[END_REF], [START_REF] Cox | High-gain observers and linear output regulation for hybrid exosystems[END_REF], and in cases where hybrid dynamical system are at stake (see [START_REF] Bisoffi | Hybrid cancellation of ripple disturbances arising in AC/DC converters[END_REF] and references therein).

Systems that evolve on the unit circle are well studied under different filtering and synchronization points of view. See the filtering problem analyzed in [START_REF] Coote | Near-optimal deterministic filtering on the unit circle[END_REF], [START_REF] Zamani | Minimum-energy filtering on the unit circle[END_REF], and [START_REF] Haydar | H∞ filtering on the unit circle[END_REF], the consensus problem studied in [START_REF] Sarlette | Global synchronization on the circle[END_REF], the optimization problem faced in [START_REF] Strizic | Hybrid gradient descent for robust global optimization on the circle[END_REF], or the filtering problem on the more general special orthogonal group SO(3) considered in [START_REF] Mahony | Nonlinear complementary filters on the special orthogonal group[END_REF].

In this paper, we address state estimation for a rotational displacement process whose position evolves on S 1 starting from angular measurements that evolve in the compact set [0 • , 360 • ], whose model is developed in Section II. In technological applications, many rotary displacement sensors exist exhibiting this feature, such as potentiometric, capacitive, or halleffect based rotational sensors. For example, [START_REF] Masisi | High-resolution low-cost rotor position sensor for traction applications[END_REF] proposes the use of a low cost hall-effect rotary displacement sensor for controlling a synchronous reluctance machine, while [START_REF] Anandan | A wide-range capacitive sensor for linear and angular displacement measurement[END_REF] develops a new capacitive sensor capable of both measuring translational and rotational displacements, the latter one evolving on S 1 . In [START_REF] Ahn | A new bumpless rotor-flux position estimation scheme for vector-controlled washing machine[END_REF], [START_REF] Diaz | Permanent magnet synchronous machine drive control using analog hall-effect sensors[END_REF], and [START_REF] Stewart | Commutation of permanent-magnet synchronous ac motors for military and traction applications[END_REF], hall-effect sensors are exploited for either estimating or controlling the rotor position of permanent-magnet motors, while in [START_REF] Tibor | A robust capacitive angular speed sensor[END_REF], a capacitive angular speed sensor is proposed, along with a technological approach for estimating the rotational velocity from measurements affected by unpredictable 2π jumps.

Our solution adopts the hybrid formalism of [START_REF] Goebel | Hybrid Dynamical Systems: modeling, stability, and robustness[END_REF] in order to synthesize a class of hybrid high-gain observers with nonlinear injection, that estimates the speed (and a filtered version of the angular position) of a rotational displacement system evolving on the unit circle. An important feature of the proposed approach is that it is independent of the jump times. Both a hybrid continuous-discrete solution (developed in Section III) and a sampled-data solution (presented in Section V) are presented, each of them with a stability guarantees. Simulation and experimental results using a hall-effect-based sensor validate the proposed designs.

Notation. We represent with (x 1 , . . . , x n ) the column-stacking operation [x 1 , . . . , x n ] , and with B r (a) we refer to the n-dimensional closed ball of radius r centered at a, that is B r (a

) := {x ∈ R n | |x -a| ≤ r}.

II. HYBRID MEASUREMENTS MODEL

Consider a rotational system, with angular position x 1 and angular velocity x 2 , following the hybrid dynamics

     ẋ = Ax + d, |y| ∈ [0, π] x + = h 1 (x), y ∈ J 1 y = Cx + w = x 1 + w , (1a)
where x = (x 1 , x 2 ) ∈ X := -3 2 π, 3 2 π × R is the plant state and y = x 1 + w is the plant output. Moreover,

A := 0 1 0 0 , C := 1 0 (1b) h 1 (x) := x 1 -2πsign (x 1 ) x 2 , (1c)
J 1 := [-3 2 π, -π] ∪ [π, 3 2 π] , (1d)
w ∈ [-ρ, ρ] represents bounded measurement noise, π := π + δ π with δ π > 0, and d ∈ R 2 is an unknown process disturbance, which may arise from unmodelled dynamics. In particular, the data of the hybrid measurement model encodes the integrating structure of the rotational system and the 2π jump mechanism affecting the measurement. The (typically small) positive scalar δ π prevents persistent ineffective jumps of 2π (Zeno solutions) and the specific selection of δ π > 0 does not affect the velocity estimation because it simply produces 2π shifts of the angular estimate. Similarly, selecting X = -3 2 π, 3 2 π enables measurement jumps in a larger set than just [-π, π] so that measurement noise cannot push the state outside flow and jump sets thereby prematurely terminating solutions.

We assume that in the nominal case, i.e., w = 0 and d = 0, the hybrid measurement model in [START_REF] Ahn | A new bumpless rotor-flux position estimation scheme for vector-controlled washing machine[END_REF] is such that its state x evolves in a compact set K ⊂ X , that is at constant velocity x 2 ranging in a compact set K 2 as follows:

x ∈ K := [-3 2 π, 3 2 π] × K 2 ⊂ X . (2)
In the next section we propose an observer estimating x 2 without knowledge of the measurement jump times.

III. A FAMILY OF HIGH GAIN HYBRID OBSERVERS A. Observer Dynamics

Consider the following hybrid high-gain observer with state x := (x 1 , x2 ) ∈ X , input ϕ and output ŷ:

H ϕ :=          ẋ = Ax + Lϕ(e y ), (ŷ, y) ∈ C x+ = h 1 (x), ŷ ∈ J 1 x+ = h 2 (x, y) y -ŷ ∈ J 2 ŷ = C x = x1 (3a) h 2 (x, y) := (y, x2 ) J 2 := [-π -δ π , -π + δ π ] ∪ [π -δ π , π + δ π ] C := {(ŷ, y) | ŷ ∈ [-3 2 π, 3 2 π] \ J 1 , y -ŷ ∈ [-3π, 3π] \ J 2 } (3b)
where matrix A, the jump dynamics h 1 , and the jump set J 1 are defined in (1), ϕ : R → R is a nonlinear output injection function depending on the output estimate error e y := yŷ, L is a matrix of positive gains, and h 2 together with J 2 provides faster transients when the output error is very large.

Assumption 1: The nonlinear output injection function e y → ϕ(e y ) is such that: 1) ϕ is continuous in B π-δπ (0), 2) e y ϕ(e y ) > 0 for all e y ∈ (-π, π) \ {0}, 3) ϕ(e y ) = ϕ(e y + 2kπ) for all k ∈ {-1, 0, 1} and all e y ∈ B π-δπ (0), 4)

dϕ(ey) dey ey=0

= 1.

In Assumption 1, item 1 ensures continuity of the right hand side during flow; item 2 represents a sector condition needed for a stabilizing output injection, and ensures ϕ(e y ) = 0 if and only if e y = 0; item 3 represents a periodicity condition so that the same output injection term is applied across jumps of ±2π of e y . Without loss of generality, item 4 implies that locally the high gain observer (3) behaves as a classical linear high-gain observer with gain L for every selection of ϕ. This assumption is nonrestrictive but it is useful for the tuning of gain L, and it simplifies the analysis and the generalization of Section V. Remark 1: Items 1, 2, and 3 of Assumption 1 imply that ϕ(e 1 ) = 0 if and only if

e 1 ∈ {2kπ, k ∈ {-1, 0, 1}}. Matrix L in (3a
) is designed based on a pair of positive scalar gains k 1 and k 2 and a positive high-gain scaling factor as follows:

L := ( 1 , 2 ) := k 1 / , k 2 / 2 .
The selection of k 1 and k 2 has to be such that the characteristic equation s 2 + k v s + k p = 0 has roots with negative real part, and the high-gain scaling factor represents a design parameters that can be conveniently adjusted in order to obtain a trade-off between smoothing action (larger ) and reduction of the time lag of the estimator (smaller ) [START_REF] Nicosia | Experimental results in state estimation of industrial robots[END_REF]. The high-gain structure also allows rejecting process noise when is small enough.

In this paper, we are interested in studying the stability properties of the interconnection between the measurement model ( 1) and the observer (3) with respect to the compact attractor A ⊂ K × X defined as:

A := {(x, x) | x ∈ K, x = x + [ 2kπ 0 ] , k ∈ {-1, 0, 1}} (4)
based on Assumption 1. The particular selection of A encodes the fact that we are interested in having an estimate of the position modulo 2π rotations. The following is our main result, whose proof is reported in Section III-D. Theorem 1: Under Assumption 1, attractor A in ( 4) is uniformly globally asymptotically stable (UGAS) for the interconnection dynamics between system (1) and ( 3).

π -π -3 2 π 3 2 π π -π -3 2 π 3 2 π D 1 D 2 D 3 A e 1 x 1 x1

B. The interconnected system

To the end of proving Theorem 1, we start the analysis of the interconnection between the measurement model ( 1) and the observer (3) by defining the estimation error e as the mismatch between the measurement model state x and the estimated state x:

e := (e 1 , e 2 ) := x -x ∈ E := [-3π, 3π] × R . (5)
Since an autonomous representation of the tracking error dynamics e cannot be written, we study the stability of A in (4) by writing the interconnection between plant (1) with zero inputs and observer (3) in their original coordinates (x, x) ∈ K × X , corresponding to:

( ẋ, ẋ) = [ A 0 0 A ] (x, x) + [ 0 L ] ϕ(e 1 ) (x, x) ∈ C (x + , x+ ) ∈ G(x, x) (x, x) ∈ D (6a)
where

D := j∈{1,2,3} D j , C := K × X \ D (6b) D 1 := J 1 × K 2 × X , D 2 := K × J 1 × R D 3 := {(x, x)|x 1 -x1 ∈ J 2 } (6c) G(x, x) := j∈{1,2,3}|(x,x)∈Dj g j (x, x) (6d) g 1 (x, x) := (h 1 (x), x), g 2 (x, x) := (x, h 1 (x)) g 3 (x, x) := (x, h 2 (x, x 1 )). (6e)
In [START_REF] Barden | An introduction to differential manifolds[END_REF], by construction, G is a set-valued mapping (multiple jumping conditions may be active at the same time) that possesses the useful property of having a closed graph because its graph is the union of the (closed) graphs of g i . Since the elements of the jump set D impose jump conditions only based on x 1 and x1 , in Figure 1 we have projected these elements on the (x 1 , x1 ) plane, in order to provide a graphical representation and intuition of the shape of these sets, together with the attractor A.

C. Lyapunov function and its properties

Consider the following differentiable function:

ψ(e 1 ) :=          e1 -2π ϕ(v)dv, if e 1 ∈ B π-δπ (-2π) e1 0 ϕ(v)dv, if e 1 ∈ B π-δπ (0) e1 2π ϕ(v)dv, if e 1 ∈ B π-δπ (2π) ψ p (e 1 ), otherwise , (7)
where

ψ p : [-3π, 3π] \ {B π-δπ (-2π) ∪ B π-δπ (0) ∪ B π-δπ (2π)} → R >0 represents a positive smooth continuation [6, Lem. 1.4.2]
of the three selections of ψ in the complement of the three disjoint sets at the right of [START_REF] Bisoffi | Hybrid cancellation of ripple disturbances arising in AC/DC converters[END_REF]. A prototype of ψ is depicted in Figure 2. Note that from items 2 and 3 of Assumption 1, ψ is positive definite with respect to the set {-2π, 0, 2π}.

To study the stability properties of the compact attractor A in (4) for the interconnected system (6), we construct a Lyapunov function V : K × X → R composed by a "potential" term represented by the function ψ in equation ( 7) depending on the position error e 1 , and a "kinetic" term proportional to the square of the speed error e 2 as per (5):

V (x, x) := ψ(x 1 -x1 ) + (x 2 -x2 ) 2 2 2 = ψ(e 1 ) + e 2 2 2 2 , (8)
Lemma 1: Under Assumption 1, given V in [START_REF] Chitour | Time-varying high-gain observers for numerical differentiation[END_REF] and considering the interconnected system (6), it holds that:

V (x, x) = -1 ϕ 2 (e 1 ) ≤ 0 ∀ (x, x) ∈ C , ∆V (x, x) ≤ 0 ∀ (x, x) ∈ D . (9)
Proof: The gradient of V with respect to (x, x) is

∇V (x, x) = ϕ(x 1 -x1 ), x2-x2 2 , -ϕ(x 1 -x1 ), -x2-x2
2 and then, after scalar product with the flow dynamics (6),

V (x, x) = ∇V (x, x), ( ẋ, ẋ) = -1 ϕ 2 (x 1 -x1 ) = -1 ϕ 2 (e 1 ) ≤ 0 , (10)
which is zero if e ∈ {[ 2kπ s ] | k ∈ {-1, 0, 1}
, s ∈ R} and negative otherwise (thanks to the observation in Remark 1). With regard to ∆V (x, x), the jump map G in (6d) is such that either e 1 experiences jumps of ±2π due to its elements g 1 and g 2 in (6e), leading to V (x + , x+ ) = V (x, x) (thanks to the 2π periodicity of the potential term ψ(e 1 ) in ( 7)), or

|e 1 | > |e +
1 | = 0 due to its element g 3 in (6e), resulting in zeroing out the potential term of V , thus giving

V (x + , x+ ) < V (x, x) because (x, x) ∈ D 3 ⇒ ψ(e 1 ) > 0.

D. Proof of Theorem 1

To the end of proving Theorem 1, consider the candidate Lyapunov function in [START_REF] Chitour | Time-varying high-gain observers for numerical differentiation[END_REF]. It holds that V (x, x) = 0 , ∀ (x, x) ∈ A. Indeed, both the potential and the kinetic term zero out when (x, x) ∈ A, that is when e 1 = 2kπ, k ∈ {-1, 0, 1} and e 2 = 0. Moreover, from item 2 of Assumption 1 it is immediate to see that V (x, x) > 0, ∀ (x, x) ∈ (K × X ) \ A. Furthermore, V is radially unbounded. Indeed, the kinetic term tends to infinity as the distance from the attractor tends to infinity (recall that x 2 ∈ K 2 , which is bounded), whereas the potential term has an argument evolving on a compact set, because both x 1 and x1 evolve in a compact set. From Lemma 1, V (x, x) = -1 ϕ 2 (e 1 ) ≤ 0 and ∆V (x, x) ≤ 0 for (6) under Assumption 1. Since we do not have strict decrease of the Lyapunov function in equation ( 8), we conclude the proof applying an invariance principle [START_REF] Seuret | A nonsmooth hybrid invariance principle applied to robust event-triggered design[END_REF]Thm 1]. Consider any solution ζ to (6) such that V (ζ(0, 0)) = 0. If ζ(0, 0) ∈ C, either ϕ(e 1 (0, 0)) = 0, and then V (ζ(0, 0)) < 0 thanks to Lemma 1, or ϕ(e 1 (0, 0)) = 0. In the latter case, the flow dynamics of interconnection [START_REF] Barden | An introduction to differential manifolds[END_REF] leads to ė1 = e 2 , which implies that there exists a arbitrary small time τ such that ϕ(e 1 (τ, 0)) = 0, leading to decreasing of the Lyapunov function. Consider now the case of ζ(0, 0) ∈ D. Jumps due to g 3 in (6e) leads to decreasing of V , as discussed in the proof of Lemma

1. If ζ(0, 0) ∈ D 1 \ D 2 , either ζ(0, 1) ∈ C or ζ(0, 1) ∈ D 3 , leading in both cases to a decrease of V . A similar reasoning holds if ζ(0, 0) ∈ D 2 \ D 1 . If ζ(0, 0) ∈ D 1 ∩ D 2 ,
a jump forces the solution to evolve in one of the above analyzed cases. Therefore, there is no complete solution ζ of [START_REF] Barden | An introduction to differential manifolds[END_REF]

such that V (ζ(t, j)) = V (ζ(0, 0)) = 0, ∀(t, j) ∈ dom(ζ),
that is V cannot be constant (and nonzero), completing the proof.

IV. SIMULATIONS

In this section we illustrate the proposed hybrid observer with four different selections of the output injection nonlinearity ϕ, all satisfying Assumption 1. In particular, the following case studies are analyzed:

1) ϕ(e y ) = sin(e y ) [blue curves] 2) ϕ(e y ) = 2 tan( where with saw : R → R we refer to the following piecewise linear function (a sawtooth selection) saw(s) := mod (s + π, 2π)π, and with sat M : R → R to the classical saturation function sat M (s) := max(-M, min(s, M )). The shape of the function is reported in Figure 3, which reveals similar small signal behaviors but different behaviors with larger errors. It easy to check that all the four case studies respect the four items of Assumption 1. In the following simulations, the same gains k p = 5, k v = 6, the same high-gain scaling factor , and the same initial state x0 = (0, 0) are used on all of the case studies. Scalar δ π is set to 5 • . The first simulation, depicted in Figure 4, is a noise free simulation (w = 0), where the measurement model's initial condition is x = (0, 10). The initial angular velocity of x 2 = 10 rad s is sustained for the first 2s. Then the process disturbance d quickly pushes it to x 2 = -20 rad s . In this simulation = 0.7 and parameter M of function sat M is 1. It is possible to notice from the first 2s of simulation that when the output tracking error e y is small with respect to the current selection of , all the considered output-injection functions ϕ produce similar responses. This is expected, since they share the same local behavior thanks to item 4 of Assumption 1 (see also Figure 3). In the second part of the simulation, the sudden variation of the angular speed x 2 produces a larger tracking error, resulting in different responses for the different selections. In particular, the best performances are the ones produced by the "tan" and "saw" output injection functions, with a slight advantage for the "tan" selection. This can be explained by the fact that the "tan" selection represents a barrier-like function with respect to the jump set D 3 , that is, this selection prevents the output error e y to become larger than πδ π in magnitude. It is not surprising that the worst response is the one produced by the "sin" and "sat" output injection functions, due to their limited action for large output errors e y . Moreover, looking at the bottom plot of Figure 4, it is possible to observe the decrease of the Lyapunov function after jumps from D 3 , i.e., when e 1 approaches ±π.

The second simulation, depicted in Figure 5, takes into account a noise signal w ∈ [-15 • , 15 • ], a scaling factor = 0.1 and the saturation level of function sat M selected as M = 0.03. Conclusions similar to those of the first simulation can be drawn.

V. SAMPLED-DATA APPROXIMATION AND EXPERIMENTAL RESULTS

For real-time implementation, in this section we propose a discretized version of the observer introduced in equation ( 3) with periodic sampling time T > 0.

A. An equivalent sampled-data system Introduce a timer τ triggering the T -periodic sampling, and sampled versions x and x of the measurement state x and the observer state x, resulting in the following extended version of dynamics [START_REF] Barden | An introduction to differential manifolds[END_REF], where we denote ξ := (x, x, x, x, τ ), and where trivial jumps (namely jumps leaving the corresponding states unchanged) are omitted for conciseness: Above, the jump set is the union D ξ := D ξ 1 ∪ D ξ T , and the jump map G ξ is selected, similarly to (6d), as the outer semicontinuous hull G ξ (ξ) := j∈{1,T }|ξ∈D ξ j g ξ j (ξ) of the measurement jump rule1 inherited from (6c),

( ẋ, ẋ) = [ A 0 0 A ] (x, x) + [ 0 L ] ϕ(e 1 ) ( ẋ, ẋ, τ ) = (0, 0, 1) ξ ∈ C ξ ξ + ∈ G ξ (ξ) ξ ∈ D ξ . (11a)
x + = h 1 (x), ξ ∈ D ξ 1 := {ξ : x ∈ D 1 }, (11b)
and the sampling-related jump, resetting the timer to zero, implementing the jumps of x from (6c), and updating the sampled states (x, x),

x+ = x+ ∈ h1 ( h2 (x, y)), (x, τ ) + = (x, 0), ξ ∈ D ξ T := {ξ : τ = T }. (11c)
where h1 and h2 are the following outer semicontinuous extensions of function h 1 and h 2 in (1c) and (3b):

h1 (x) :=      h 1 (x), if x 1 ∈ J 1 \ ∂J 1 x, if x 1 / ∈ J 1 {x} ∪ {h 1 (x)}, if x 1 ∈ ∂J 1 . (11d) h2 (x, y) :=      h 2 (x, y), if y -x1 ∈ J 2 \ ∂J 2 x, if y -x1 / ∈ J 2 {x} ∪ {h 2 (x, y)}, if y -x1 ∈ ∂J 2 . ( 11e
)
The model is completed by the selection of the flow set:

C ξ := {ξ : (x, x) ∈ (K × X ) \ D 1 , τ ∈ [0, T ]}, (11f)
which enforces flowing in the interior of the sampling interval τ ∈ (0, T ) unless the measurement model jumps (from D ξ 1 ). The following proposition is a key step towards our sampled-data implementation of the next section.

Proposition 1: There exists a small enough T * such that for any T ∈ (0, T * ], the following compact set

A ξ := {ξ : τ ∈ [0, T ], x -x ∈ P, x -x ∈ P, x -(I + Aτ )x ∈ P}, (12)
(where

P := {[ 2kπ 0 ] | k ∈ {-1, 0, 1}}
represents the 2π shifted origin) is UGAS for system [START_REF] Diaz | Permanent magnet synchronous machine drive control using analog hall-effect sensors[END_REF]. Proof: First note that after at most T ordinary time, any solution jumps from D ξ T and then evolves forever in the forward invariant manifold M := {ξ : x -(I + Aτ )x ∈ P}. From this manifold, since the flow dynamics of (11) coincide with those of (6) the Lyapunov flow condition established in the proof of Theorem 1 still holds. Similar to the proof of Theorem 1, jumps from both D ξ 1 and D ξ T cause no increase of the Lyapunov function and the result is implied by persistent flowing and the invariance principle.

B. Approximated sampled-data system

Let us consider a solution of the sampled-data model [START_REF] Diaz | Permanent magnet synchronous machine drive control using analog hall-effect sensors[END_REF] and denote by (t j , j-1) any jump time such that τ (t j , j-1) = T and τ (t j , j) = 0. Exploiting the specific structure of matrix A, we have for all t before the next jump, x(t, j) = (I + Aτ (t, j))x(t, j) = (I + Aτ (t, j))x(t j , j).

(

) 13
Then we may write an autonomous version of the dynamics of x and of a sampled version ȳ of output y = Cx, by replacing the update of x in (11c) by

x+ = (I + AT )x, ȳ := C x+ = C(I + AT )x, (14)
where we emphasize that output y at sampling times depends on the current continuous state x, which is the future sample x+ of the sampled state x. Inspired by [START_REF] Khalil | High-gain observers in nonlinear feedback control[END_REF] we propose the following sampled-data approximation of the jumps of x in (11c)

x+ = h 1 h2 (I + AT ) x + T Lϕ(ȳ -ȳ), ȳ ȳ := C(I + AT ) x, (15)
which enjoys the property in the next theorem. Theorem 2: For any Lipschitz function ϕ satisfying Assumption 1 and some bounded set of initial conditions x(0, 0), the sampled-data observer ( 15), ( 14) guarantees practical estimation of the sampled version x of state x with respect to parameter T .

Proof: The UGAS of [START_REF] Goebel | Hybrid Dynamical Systems: modeling, stability, and robustness[END_REF] established in Proposition 1 is semiglobally practically robust in the sense of [START_REF] Goebel | Hybrid Dynamical Systems: modeling, stability, and robustness[END_REF]Lemma 7.20]. We may then consider a perturbed version of dynamics [START_REF] Diaz | Permanent magnet synchronous machine drive control using analog hall-effect sensors[END_REF] where the upper equation in (11a) is replaced by

( ẋ, ẋ) = [ A 0 0 A ] (x, x) + [ 0 L ] ϕ(C(I + AT )(x -x)), (16)
which we denote by (( 11)←( 16)) for simplicity of notation. We may well interpret (( 11)←( 16))) as a perturbed version of [START_REF] Diaz | Permanent magnet synchronous machine drive control using analog hall-effect sensors[END_REF] where the right hand side of (11a) is affected by disturbance

Ld := L(ϕ(C(I + AT )(x -x)) -ϕ(C(x -x))). (17)
For the ensuing system, intersecting the flow and jump sets with any arbitrarily large set {x 2 ∈ [-x 2M , x2M ]}, we obtain the uniform bound (where L ϕ represents a Lipschitz bound and ϕ M represents a global bound for ϕ(•)): The proof is then completed by noticing that the term ϕ(C(I + AT )(x -x)) forcing the right hand side of ( 16) is constant and equal to ϕ(ȳ -ȳ). Therefore the value of x+ in [START_REF] Mahony | Nonlinear complementary filters on the special orthogonal group[END_REF] coincides with that of x+ in (11c). Practical convergence of x to x then follows from practical UGAS of A ξ in [START_REF] Goebel | Hybrid Dynamical Systems: modeling, stability, and robustness[END_REF] and the fact that x = x in A ξ .

|d| ≤ |ϕ(C(I + AT )(x -x)) -ϕ(C(x -x))| + |ϕ(C(x -x)) -ϕ(C(x -x))| ≤ L ϕ (T (x 2M + x2M ) + T |x 1 -x1 | + T |x 1 -x1 |),

C. Real-time implementation and experiments

A ready-to-code algorithm implementing the sampled-data observer (15) can be found in Algorithm 1. Four realizations of Algorithm 1 have been coded in C++ in a 32bit 120MHz ARM Cortex-M4 microprocessor. Each one of the four realization represents one of the case studies of output injection function ϕ presented in Section IV. The microprocessor reads out the angular measurements via an I2C bus from an hall-effect AMS AS5048 encoder, which is an easy-to-use 14bit resolution absolute angular sensor for industrial applications. In our experiments the encoder measures the angular displacement of the shaft of a small DC brushed motor that is open-loop voltage controlled. The algorithms run in real time at 100Hz and the observer parameters k p and k v are set as in the simulations to respectively 5 and 6, while δ π = 5 • , and M = 1. The results of one of the experiments are depicted in Figure 6. In the plots relative to the angular velocity estimation we added in light gray a dirty derivative of a rectified version of the sampled measurement y, which was computed off-line. The DC motor is supplied with a voltage inducing a rotation with approximate speed of 150 rad s . In the acceleration phase the motor reaches the steady state in about 2s, and the high-gain scaling factor is such that all the case studies behave similarly, confirming the simulation results. Similar behaviors are produced at the steady state as well, where the dirty derivative curve confirms that the angular velocity estimated by the real-time observer implementation is correct and well filtered. In the deceleration phase the motor slows down more promptly, making the differences among the four considered case studies more evident. The experimental results confirm that the increased aggressiveness of the "tan" and "saw" output injection functions produce a faster transient, while the limited forcing actions of the "sin" and "sat" selections produce a slower transient.

VI. CONCLUSIONS

In this paper, we proposed a nonlinear hybrid speed observer structure for angular measurements affected by jumps. Stability properties of the proposed observer have been established with a Lyapunov-based argument under some natural assumptions on the nonlinear injection function. After illustrating some continuous-time simulation, a sampled-data approximated version of the proposed observer was developed for real time implementation. Experimental results of the discretized observer have been reported, showing that the proposed algorithm is suitable for mechatronic applications.

Fig. 1 .π 2π 3π e 1 ψ(e 1 )Fig. 2 .

 1112 Fig. 1. Projection of the jump sets and the attractor on the (x 1 , x1 ) plane.

ey 2 )

 2 [red curves] 3) ϕ(e y ) = saw(e y ) [green curves] 4) ϕ(e y ) = sat M (saw(e y )) [purple curves]

Fig. 3 .Fig. 4 .

 34 Fig. 3. The four selections of ϕ proposed in Section IV.

Fig. 5 .

 5 Fig. 5. Continuous-time simulation with measurement noise using the four injection functions of Section IV and = 0.1.

  which shrinks to zero as T is reduced because | ẋ1 | ≤ x2M + 1 ϕ M and | ẋ1 | ≤ x 2 , which belongs to compact set K 2 . The possibility of shrinking d to zero by reducing T enables applying [12, Lemma 7.20] and establishing semiglobal practical UGAS of A ξ in (12).

Algorithm 1 : 2 y = y update the angular measurement 3 x

 123 Real-time implementation of (15). Input: y sampled angle measurement Parameters: 1 , 2 , δ π , T 1 while true do ← (I + AT ) x + T Lϕ(y -( x1 + T x2 ))

Fig. 6 .

 6 Fig. 6. Experimental results using the four injection functions. = 0.1.

For compact notation, we don't define explicitly maps g ξ j (ξ), j = 1, T , we only report in (11b)-(11c) the quantities that perform nontrivial jumps.

Research supported in part by grant PowerLyap funded by CaRiTRo.


Andrea Bisoffi

Luca Zaccarian

Mauro Da Lio
email: mauro.dalio@unitn.it.

Daniele Carnevale
email: daniele.carnevale@uniroma2.it

Jet Contributors

Hybrid cancellation of ripple disturbances arising in AC/DC converters

Keywords: hybrid dynamical system, hybrid observer, power system, tokamak plasma, ripple {andrea.bisoffi

In AC/DC converters, a peculiar periodic nonsmooth waveform arises, the so-called ripple. In this paper we propose a novel model that captures this nonsmoothness by means of a hybrid dynamical system performing state jumps at certain switching instants, and we illustrate its properties with reference to a three phase diode bridge rectifier. As the ripple corrupts an underlying desirable signal, we propound two observer schemes ensuring asymptotic estimation of the ripple, the first with and the second without knowledge of the switching instants. Our theoretical developments are well placed in the context of recent techniques for hybrid regulation and constitutes a contribution especially for our second observer, where the switching instants are estimated. Once asymptotic estimation of the ripple is achieved, the ripple can be conveniently canceled from the desirable signal, and thanks to the inherent robustness properties of the proposed hybrid formulation, the two observer schemes require only that the desirable signal is slowly time varying compared to the ripple. Exploiting this fact, we illustrate the effectiveness of our second hybrid observation law on experimental data collected from the Joint European Torus tokamak.

Introduction

Many engineering applications require power electronics in their actuators and often these power electronics are equipped with AC/DC converters whose switching nature produces a peculiar ripple disturbance. A similar disturbance on the torque arises in the presence of split ring commutators on the shaft of DC motors. Ripple disturbances may have damaging effects on control design, not only because they affect the actuation signal (like in a DC motor), but also because they often affect the power supply, thus possibly affecting all sensor measurements due to the magnetic coupling. This phenomenon is especially noticed in high-power applications such as tokamaks and plasma control [START_REF] Pironti | Fusion, tokamaks, and plasma control: an introduction and tutorial[END_REF]. One of the important features of the ripple is that its frequency is typically a known parameter with little uncertainty, because it is a multiple of the utility frequency in the electrical power grid, which is in turn tuned very finely to the values of either 50 or 60 Hz. Due to this fact, it appears natural to address the problem of ripple estimation and rejection using linear [START_REF] Francis | The internal model principle of control theory[END_REF] or nonlinear [START_REF] Isidori | Nonlinear Control Systems[END_REF]Ch. 8] regulation theory.

However, the peculiar non-smoothness of ripple disturbances makes them less prone to be addressed with classical continuous-time approaches and makes it an interesting problem to be tackled using hybrid regulation theory (see, e.g., the preliminary work in [START_REF] Marconi | A note about hybrid linear regulation[END_REF] and the more recent results in [START_REF] Carnevale | Output regulation for a class of linear hybrid systems. Parts 1 & 2[END_REF][START_REF] Carnevale | Necessary and sufficient conditions for output regulation in a class of hybrid linear systems[END_REF][START_REF] Cox | High-gain observers and linear output regulation for hybrid exosystems[END_REF][START_REF] Marconi | Internal model principle for linear systems with periodic state jumps[END_REF] and references therein). These works, as well as the approach adopted here, are based on the novel framework for the description of nonlinear hybrid dynamical systems in [START_REF] Goebel | Hybrid dynamical systems[END_REF][START_REF] Goebel | Hybrid Dynamical Systems: modeling, stability, and robustness[END_REF]. In particular, the advantage of adopting that framework will be evident here because it enables us to exploit important robustness properties following from suitable regularity of the dynamics. We make large use of the robustness results established in [START_REF] Goebel | Hybrid Dynamical Systems: modeling, stability, and robustness[END_REF]Chap. 7] to specifically address a "ripple cancellation" problem, wherein the ripple corresponds to a high-frequency perturbation affecting a slowly varying signal within an available measurement. Then the goal of our design is to estimate the ripple component that can be suitably subtracted from the measurement signal. To this end, we consider a general context where an unknown constant bias affects the measurement, we take care of this constant bias by incorporating a bandpass filter in our ripple observer, and then rely on the robustness results in [START_REF] Goebel | Hybrid Dynamical Systems: modeling, stability, and robustness[END_REF]Cor. 7.27] to apply the scheme in the presence of slowly varying signals.

Our approach is much inspired by the recent results in [START_REF] Forni | Follow the bouncing ball: global results on tracking and state estimation with impacts[END_REF] and the machinery given in [START_REF] Teel | Lyapunovbased sufficient conditions for exponential stability in hybrid systems[END_REF]Thm. 2] (also reported in [7, Lemma 1] with a notation that resembles more closely the situation addressed here). We would also like to emphasize that a hybrid approach to tackle this problem does not seem to be the only viable one, because the ripple disturbance is indeed an absolutely continuous function and one may find ways to generate it with a nonsmooth continuous time approach (see, e.g., the results in [START_REF] Marconi | Uniform practical nonlinear output regulation[END_REF] where a continuous-time exosystem is built that generates the absolute value of a cosine waveform). However, it remains unclear how to do this for the specific waveform characterized in here. Our results are also close in nature to those reported in [START_REF] Cox | High-gain observers and linear output regulation for hybrid exosystems[END_REF]Sec. 4.2], where a hybrid exosystem also generates the absolute value of a cosine waveform. However, as compared to that result, we focus here on ripple signals that perform commutations at phases different from ±π/2 (see also Remark 1). Alternative methods that are relevant in the proposed context pertain to the scientific area of observer design for switched systems, because one may think of the ripple as being generated by a suitable switching system. Then, one may follow the approaches in [START_REF] Pettersson | Observer design for switched systems using multiple quadratic Lyapunov functions[END_REF] if the active mode (or, equivalently, the jump times among modes) is known, or rely on the approaches of [START_REF] Barbot | Nonlinear observer for autonomous switching systems with jumps[END_REF][START_REF] Petterson | Switched state jump observers for switched systems[END_REF][START_REF] Pettersson | Designing switched observers for switched systems using multiple Lyapunov functions and dwell-time switching[END_REF] and references therein, where the active mode is estimated online. In addition to requiring a reformulation of our model as a switched system (which seems to be possible due to the continuity of the ripple output), the problem with applying these switched observation laws is that it is unclear how to take into account the slowly varying signal affecting the output measurement. In our work we incorporate a band-pass filter to remove that component from our ripple observer, and then we use the robustness of our formulation to prove rigorous properties of our scheme under a reasonable timescale separation assumption. Conversely, within the active mode detection of the above works, this seems to be a nontrivial goal.

A preliminary version of this paper was presented in [START_REF] Bisoffi | A hybrid ripple model and two hybrid observers for its estimation[END_REF].

Here, as compared to [START_REF] Bisoffi | A hybrid ripple model and two hybrid observers for its estimation[END_REF], we give the proofs of our two main theorems, and we discuss the application of the proposed scheme to experimental signals from the Joint European Torus (JET) tokamak, whereas only simulation results were given in [START_REF] Bisoffi | A hybrid ripple model and two hybrid observers for its estimation[END_REF].

The paper is organized as follows: in Section 2 we introduce the hybrid model for the ripple generation and present the cancellation problem under consideration. In Sections 3 and 4 we illustrate the two proposed estimation schemes, and state and prove their desirable properties. Finally, in Section 5 we illustrate the effectiveness of the more general scheme on the experimental measurements from the JET tokamak. The notation used throughout the paper is that of [START_REF] Goebel | Hybrid Dynamical Systems: modeling, stability, and robustness[END_REF]. An illustrative survey of this approach can be found in [START_REF] Goebel | Hybrid dynamical systems[END_REF] and a brief review in [START_REF] Nešić | Stability and performance of SISO control systems with first-order reset elements[END_REF]Sec. 2].

A hybrid model for the ripple-induced noise in measurement signals

Let us consider a simple physical example where a ripple disturbance arises, i.e., the three phase diode bridge rectifier depicted in Figure 1, where the valves are ideal diodes. This device converts a three-phase voltage to a mono-phase almost direct voltage, which is applied to a load, for example a resistor. The resulting voltage is almost direct because, due to the logic of conversion, a non smooth waveform, the ripple, is superposed to the ideal direct voltage. Indeed, by denoting ground by G, the three phase voltages have the form:

v AG = v A -v G = V f sin (ωt + θ 0 ) v BG = v B -v G = V f sin ωt + θ 0 -2π 3 v CG = v C -v G = V f sin ωt + θ 0 -4π 3 , (1)
and given the power supply in (1), the output voltage v o of the converter in Figure 1 can be shown to be

v o = v P -v N = √ 3V f max i∈Z cos ωt + θ 0 -i π 3 . (2)
This result follows easily from well-known circuit theory rules that establish the conducting diode, when more than one are connected at cathode or anode. Over an interval [0, T ] = [0, 2π/ω], (2) can be equivalently obtained by taking at each time the maximum among the three line-to-line voltages and their opposites in sign, as depicted in Figure 2. Based on the hybrid system formalism in [START_REF] Goebel | Hybrid Dynamical Systems: modeling, stability, and robustness[END_REF], we propose a different characterization of the ripple and we show in Proposition 1 how it represents equivalently the physical example we have just introduced. The flow and jump dynamics read

0 T/6 T/3 T/2 2T/3 5T/6 T 0 Time [s] Voltage [V] √ 3Vf √ 3Vf √ 3/2 - √ 3Vf v AG -v BG v AG -v CG v BG -v CG v BG -v AG v CG -v AG v CG -v BG v O
       ẋr = 0 -ω ω 0 x r1 x r2 =: A r x r ḃ = 0 , (x r , b) ∈ C (3a)        x + r = 1 0 0 -1 x r1 x r2 =: J r x r b+ = b , (x r , b) ∈ D, (3b)
meaning that a solution can evolve according to the given differential or difference equation whenever the state belongs to C or to D, respectively. The sets C and D are called intuitively flow and jump sets and are specified below. We use the following output equations:

y r = x r1 + b = 1 0 x r + b =: C r x r + b (3c) θ = ∠(x r ). (3d)
Output y r in (3c) is the measured signal comprising a constant bias signal b, whereas θ is not available for measurement (even though we may assume knowledge of its transition times, see Section 3). Function ∠(•) returns the phase of the vector at the argument, namely for each x r = 0 it is the only angle θ ∈ [-π, π) satisfying

x r = |x r | cos(θ)
sin(θ) , which is well defined for all x r satisfying |x r | = 0. Note that function ∠(•) resembles the well known function atan2(•, •) used in the robotics context.

The jump and flow sets in (3a)-(3b) are defined as

K := {(x r , b) : δ ≤ |x r | ≤ ∆, | b| ≤ ∆ with ∆ ≥ δ > 0} (3e) C := {(x r , b) : -π/6 ≤ θ ≤ π/6} ∩ K (3f) D := {(x r , b) : θ = π/6} ∩ K (3g)
and are depicted in Figure 3, where we added a possible solution to (3) flowing in C and jumping when it reaches D. In C and D, the intersection with the set K assumes that a nonzero ripple is actually present (δ strictly positive) but is bounded (existence of ∆). Indeed, δ = 0 only excludes |x r | = 0, corresponding to no ripple at all, and ensures that ∠(•) in (3d) is well defined. However, δ and ∆ can be arbitrarily small and large, respectively, and nowhere in our design the knowledge of their values is required. Moreover, this choice enables us to deal with compact C and D, so that (3) satisfies the so-called hybrid basic conditions [10, Assumption 6.5], and thus we can rely on useful results from [START_REF] Goebel | Hybrid Dynamical Systems: modeling, stability, and robustness[END_REF]Chap. 7]. In particular, this allows us to derive our main result, Theorem 2, for the case of constant b, but apply the corresponding scheme to the case of a slowly time varying signal b [10, Cor. 7.27].

x r2

x r1 Remark 1 If the ripple was not generated by a threephase system, we would consider a different angle in (3f) and (3g) instead of π/6. For example, for a 6-phase or a 12-phase system the angle would be respectively π/12 or π/24.

The following straightforward Proposition 1 motivates the study of ripple disturbances through the hybrid model [START_REF] Carnevale | Output regulation for a class of linear hybrid systems. Parts 1 & 2[END_REF]. For its solutions we use hybrid time domains parametrized by two directions (t, j), where t denotes elapsed continuous time and j denotes elapsed discrete jumps (see [START_REF] Goebel | Hybrid Dynamical Systems: modeling, stability, and robustness[END_REF]Chap. 2] and also [START_REF] Nešić | Stability and performance of SISO control systems with first-order reset elements[END_REF]Sec. 2]). We constrain θ 0 to be in the set [-π/6, π/6] because any other value of θ 0 could be shifted to this interval without changing the resulting value of v o in [START_REF] Bisoffi | A hybrid ripple model and two hybrid observers for its estimation[END_REF]. A relevant fact that we also establish below is that all solutions to (3) can be continued forward in time and have unbounded domain in the t direction of hybrid time (t, j) (this implies that all maximal solutions are complete [10, Sec. 2.3]).

Proposition 1 For any value of θ 0 and

V f > 0 in (2), there exist initial conditions x r (0, 0) = √ 3V f cos θ0 sin θ0
and b(0, 0) = 0 such that the unique solution to (3) has unbounded domain in the ordinary time direction and satisfies y r (t, j) = v o (t), for all (t, j) ∈ dom(y r ).

Proof. First notice that (2) provides the same output for shifts of π/3 in θ 0 (due to the max). Therefore we consider without loss of generality θ 0 ∈ [-π/6, π/6] and θ0 = θ 0 . We carry out the proof in polar coordinates that are globally defined in C ∪ D. In particular, for a linear oscillator like (3a), the coordinate θ in (3d) evolves along flows according to θ = ω. Moreover, by the definition of jump set (3g), as soon as θ = π/6, (3b) in polar coordinates reads

|x r | cos( π 6 ) sin( π 6 ) + = J r |x r | cos( π 6 ) sin( π 6 ) = |x r | cos(-π 6 ) sin(-π 6 )
,

showing that |x r | remains constant and θ changes sign across jumps. Therefore, each pair of consecutive jumps witnesses a dwell time of exactly π/(3ω) which is the time for θ to flow again from -π/6 to π/6. This shows dwell time of all solutions and proves that the domain of all solutions is unbounded in the ordinary time direction. Indeed, the flow and jump maps are Lipschitz singlevalued functions and no flow is possible from the jump set, because the flow map θ = ω points out of C∪D (more rigorously, its intersection with the tangent cone to C ∪D is empty -see [START_REF] Goebel | Hybrid Dynamical Systems: modeling, stability, and robustness[END_REF]Prop. 6.10]). Therefore, the solution to (3) is unique. From (3a), d dt |x r | = 0 along flows and θ keeps revolving in the set [-π/6, π/6], where cos(θ) assumes its maximum. Therefore, all solutions starting from b(0, 0) = 0 satisfy

y r (t, j)= x r1 (t, j) = |x r (t, j)| cos(θ(t, j)) = |x r (0, 0)| max i∈Z cos θ(0, 0) + ωt -i π 3 , (4)
and then for x r (0, 0) = √ 3V f cos θ0 sin θ0 and θ(0, 0) = θ 0 in (4), the (unique) solution to (3) satisfies the claim.

Using Proposition 1, it is evident that in our motivating example we would like to track the zero-mean nonsmooth ripple disturbance

d(t) := v o (t) - ω 2π 2π ω 0 v o (τ )dτ = v o (t) - 3 √ 3V f π ,
to get from y r (t) the direct voltage simply as y r (t)-d(t).

Identity

ω 2π 2π ω 0 v o (τ )dτ = 6ω 2π 2π 12ω - θ 0 ω -2π 12ω - θ 0 ω √ 3V f cos(ωτ + θ 0 )dτ = 3 √ 3V f π
was used in the integral.

More generally, the goal of the paper can be formulated as follows.

Problem 1 In a measurement y r , a desirable signal σ is affected by a (nonsmooth, zero-mean) ripple disturbance d, i.e., y r = σ + d.

(

) 5
Our objective is to estimate asymptotically d only from y r , so that we recover σ by trivial subtraction. We assume σ slowly varying compared to the timescale of d.

When the hybrid basic conditions are satisfied, [START_REF] Goebel | Hybrid Dynamical Systems: modeling, stability, and robustness[END_REF]Cor. 7.27] establishes notably that if stability and convergence of an estimate d of d hold for a constant σ, then they are preserved also for a slowly varying σ thanks to inherent robustness properties, therefore in our design we will assume that σ be constant. Making explicit the setting of Problem 1 for model (3), we have

d(t, j) := y r (t, j) -b(t, j) -3 π |x r (t, j)| = x r1 (t, j) -3 π |x r (t, j)| (6a) σ(t, j) := b(t, j) + 3 π |x r (t, j)| (6b) d(t, j) := xr1 (t, j) -3 π |x r (t, j)|, (6c)
which are respectively the zero-mean ripple disturbance, the (constant) desirable signal and the disturbance estimate.

Ripple estimation with knowledge of switching instants

If the switching instants of the ripple generator in (3) are known, it is possible to design an estimator consisting in a suitable Luenberger observer during flows and performing simultaneous jumps with the ripple generator (namely, the jump and flow sets remain unchanged and do not depend on the observer states). This corresponds to a simplified setting for the observer design. The assumption that the switching instants of the hybrid ripple generator are available to the ripple observer may be verified, for example, if the observation algorithm is connected to the circuitry commanding the switches of the rectifier in Figure 1, so that the switching times are known. Another case is that of a torque ripple generated by a DC motor where one may assume to measure the shaft angle and then compute the switching times based on the position of the split ring commutator. The architecture of the proposed solution is sketched in Figure 4. The block "Signal with ripple disturbance" corresponds to hybrid system (3), whereas the block "Band-pass filter" corresponds to

F (s) := s ω 1 + s ω 2 , (7)
with a double pole at the ripple frequency ω that isolates the dominant mode of the (nonsmooth) signal d from the constant bias and the high-frequency noise. The specific form of F (s) is crucial to obtaining the structure below in [START_REF] Goebel | Hybrid dynamical systems[END_REF] and the result of Lemma 1. The state-space representation of ( 7) is

  A f B f C f   :=     0 1 0 -ω 2 -2ω 1 0 ω     . (8a)
For the observer (block "Estimation of x r ") and filter dynamics, we add to (3) the following flow and jump equations

ẋf = A f x f + B f (y r -ŷr ) ẋr = A r xr + Le f , (x r , b) ∈ C (8b) x + f = x f x+ r = J r xr , (x r , b) ∈ D, (8c)
and the following output equations

e f = C f x f ŷr = C r xr (8d)
where L := [ 0 ] is the Luenberger gain and the scalar > 0 is a design parameter. The flow and jump sets are the same as in (3) and depend only on output θ in (3d). We emphasize that to implement the hybrid observer (8) it is not necessary to measure θ, but only to know its switching times, that is, the times when the observer state xr should jump.

To suitably analyze the overall system (3) and ( 8

x f + A -1 f B f b , ( 9a
)
where xr is the error related to the ripple generation and xf is a coordinate transformation of the filter state variables chosen to satisfy -P e = 0 proves (11b), given that J T r J r = I 2 .

A f xf = A f x f + B f b. Thanks to ḃ = 0 and C f A -1 f B f = 0, the (

Remark 2

The proof of Lemma 1 applies for any selection of the jump instants. Therefore the scheme in Figure 4 is effective at estimating the ripple y r also when the jump set D is empty, which boils down to a standard linear disturbance rejection problem with an internal model. Due to this fact, our scheme can be seen as a generalization of the last one, much related to the recent works in [START_REF] Carnevale | Output regulation for a class of linear hybrid systems. Parts 1 & 2[END_REF][START_REF] Carnevale | Necessary and sufficient conditions for output regulation in a class of hybrid linear systems[END_REF][START_REF] Cox | High-gain observers and linear output regulation for hybrid exosystems[END_REF][START_REF] Marconi | Internal model principle for linear systems with periodic state jumps[END_REF] and references therein.

Based on the Lyapunov construction of Lemma 1 we state next our first main result establishing asymptotic estimation of the ripple signal.

Theorem 1 For every > 0, the selection L = [ 0 ] in (8b) and in (9b) guarantees that the compact attractor

A := {(x r , b, xr , x f ) : e = 0 and (x r , b) ∈ K}, (12)
is uniformly globally exponentially stable for the closedloop dynamics (3) and (8).

Proof. With Lyapunov function [START_REF] Goebel | Hybrid Dynamical Systems: modeling, stability, and robustness[END_REF], the result is a direct consequence of [24, Thm. 2] (see also [START_REF] Forni | Reference mirroring for control with impacts[END_REF]Lemma 1] where a parallel formulation to this one is used).

From (6a) and (6c) and (9a), the disturbance estimation error is

d -d = 1 0 0 0 e + 3 π (|x r | -|x r |),
so that Theorem 1 implies that for any positive choice of the scalar parameter , the estimate d converges uniformly and exponentially to the ripple disturbance d. Smaller selections of lead to slower convergence but are less sensitive to noise, whereas larger selections of lead to faster convergence but larger noise sensitivity should be expected.

Ripple estimation without knowledge of switching instants

In most practical cases it is difficult if not impossible to know the switching instants, and the scheme of the previous section cannot be implemented. This calls for the enhanced estimation scheme in Figure 5, where we estimate the switching instants by building an estimate θ of the unavailable output θ in (3d). Remark 3 In the sequel, to keep the notation simple, we will introduce several coupled dynamical systems representing different components of the scheme in Figure 5 and having different jump and flow sets. These jump and flow sets will be specified in terms of only some state variables, implicitly meaning that the other state variables may assume any value within their respective domains. With this simplified notation we refer to the hybrid system constructed having flow set corresponding to the intersection of all the specified flow sets, flow map arising from stacking up all the specified flow equations (no flow equations will be repeated thus generating no ambiguity), jump set corresponding to the union of all the jump sets and jump map corresponding to the stack of all the specified jump maps.

Using the simplified notation mentioned in Remark 3, we preserve the main dynamics in (8) using a jump rule now triggered by the new state θ

     ẋf = A f x f + B f (y r -ŷr ) ẋr = A r xr + Le f θ = ω, θ ∈ - π 3 , π 6 (13a)      x + f = x f x+ r = J r xr θ+ = θ -π/3, θ ∈ π 6 , π 3 , (13b)
with the same output equations (8d). Note that the lower bound on θ in (13a) and the upper bound in (13b) are coarser than those in (8b) and (8c), because we want to leave some margin for suitable adaptation of θ.

Clearly, dynamics (13) converges to the right estimate when θ = θ. The scheme is then completed by an additional action that updates periodically θ in such a way that it converges to θ. Such convergence will be established based on the Lyapunov function:

V θ (θ, θ) := min i∈Z θ -θ + i π 3 2 = θ2 , (14a) θ
:= θ -θ + i * π 3 , (14b) i
* := argmin i∈Z θ -θ + i π 3 2 . ( 14c
)
In particular, the following lemma is fundamental to achieve this convergence property.

Lemma 2 Consider any hybrid solution to solely (3) and (13). The output θ defined in (14b) and the Lyapunov function V θ in (14a) both remain constant along flows and across jumps. Moreover, defining 4 for each t ≥ 0 the function j * (t) := max (t,j)∈domθ j, the next identity holds:

t+ π 3ω t θ τ, j * (τ ) d τ, j * (τ ) dτ = -|x r (0, 0)|ρ( θ), ( 15
)
where ρ is such that θ → ρ( θ) θ is a positive definite function in the interval θ ∈ (-π/6, π/6) and d is in (6a), Proof. When one considers solely (3) and ( 13), θ and V θ remain constant along solutions because θθ = ωω = 0 along flows and θ + = θ -π 3 (similarly for θ+ ) so that across jumps quantity i * in (14c) changes but the minimum in (14a) does not.

corresponding to d = |x r | cos(θ) -3 π |x r |.
Regarding integral [START_REF] Mayhew | Quaternionbased hybrid control for robust global attitude tracking[END_REF], we compute it by dividing the analysis in the two cases shown in Figure 6. After some calculations, essentially splitting each integral in two parts, ρ in (15) can be found to be

ρ( θ) := -1 6ω π -6 θ -2π sin π 6 -θ =: ρ p ( θ) θ ≥ 0 -ρ p (-θ)
θ < 0 so that θ → ρ( θ) θ is positive definite in (-π/6, π/6).

Remark 4 As graphically illustrated in Figure 6, scalar θ characterized in Lemma 2 is the difference between θ and θ modulo π/3, that is, by θ one measures their distance in a way that remains constant across jumps.

Based on the preliminary result of Lemma 2, we complete now the hybrid observer ( 13) with an additional dynamics implementing integral [START_REF] Mayhew | Quaternionbased hybrid control for robust global attitude tracking[END_REF] and imposing suitable jump rules on θ to ensure its convergence to θ. Consider

         ẏr = 0 ẏrI = y r -ȳr η = θ(y r -ȳr ) τ = 1, τ ≤ π 3ω (16a)                  ȳ+ r = ȳr + k av 3ω π ȳrI ȳ+ rI = 0 η + = 0 τ + = 0 θ+ = θ -sat π 6 (k θ η), τ = π 3ω , (16b)
where k av ∈ (0, 1] and k θ > 0 are two positive gains to be tuned, and function sat π 6 (•) is the scalar symmetric saturation function whose output is limited within [-π/6, π/6]. Note that this limitation ensures that θ+ always belongs to the union of the flow and jump sets in [START_REF] Marconi | A note about hybrid linear regulation[END_REF], which guarantees existence of solutions. In ( 16), state τ is a periodic timer ensuring that integral ( 15) is computed periodically; over this period state ȳrI integrates the difference between output y r and its average value, so that ȳr can converge to the average value of y r . Finally, η implements left-hand side of ( 15) by subtracting the (estimated) average value ȳr from measurement y r and multiplying it by θ.

The overall ripple estimation scheme corresponds to the plant (3), the estimator dynamics in [START_REF] Marconi | A note about hybrid linear regulation[END_REF], and the extra flow and jump rules in [START_REF] Moraal | Observer design for nonlinear systems with discrete-time measurements[END_REF], where the role of the different jump and flow sets should be intended as explained in Remark 3. The overall state is then given by

ξ := (x r , b, x f , xr , θ, ȳr , ȳrI , η, τ ),
where we note that because (x r , b) belongs to the compact set K and τ ∈ [0, π/(3ω)], then there exists a large enough scalar M such that (ȳ r , ȳrI , η, τ ) ∈ M B 4 , where B 4 is the four-dimensional closed unit ball. In the next theorem we establish parallel results to those of Theorem 1 in terms of stability properties of the attractor

A e := A × [-π/3, π/3] × M B 4 , ( 17
)
where A is defined in [START_REF] Marconi | Uniform practical nonlinear output regulation[END_REF] and corresponds to the set where the estimate θ is correct. Note that Theorem 2 only establishes local properties of the scheme although its results could be strengthened by relying on a more sophisticated update law for θ (see, e.g., [START_REF] Mayhew | Quaternionbased hybrid control for robust global attitude tracking[END_REF] for global asymptotic stabilization of dynamics on bounded manifolds like our angles θ and θ) and on global results on cascaded hybrid systems.

Theorem 2 For every > 0, every k av ∈ (0, 1] and a small enough value of k θ > 0, the selection L := [ 0 ] in (13a) guarantees that the compact attractor A e is uniformly locally asymptotically stable for the closed-loop dynamics (3), ( 13), [START_REF] Moraal | Observer design for nonlinear systems with discrete-time measurements[END_REF].

Proof. The scheme can be represented as the cascade of three hybrid dynamical systems.

The lowermost system corresponds to the dynamics restricted to the set

A θ := {ξ : θ = θ},
which is clearly forward invariant because the dynamics of θ coincide with that of θ. Using the result of Theorem 1 it is readily seen that the dynamics restricted to A θ is UAS (actually UES) to A e .

The intermediate system corresponds to the dynamics restricted to the set

A ȳ := {ξ : ȳr = b(0, 0) + 3 π |x r (0, 0)|}, (18)
which is again forward invariant because, from (6a) and ( 3), the scalar b(0, 0) + 3 π |x r (0, 0)| is the average value of y r (t, j * (t)), and b and |x r | remain constant along flows and across jumps. Also, the set A θ is uniformly (locally) asymptotically stable for the dynamics restricted to A ȳ . To establish this fact we use the Lyapunov function V θ in (14a), which remains constant along flows (as established in Lemma 2). To analyze the change of V θ across jumps, first note that in A ȳ we have that d = y rȳr . Then, due to periodicity of timer τ in ( 16) and due to the results of Lemma 2, we have before each jump in (16b) that η = -|x r (0, 0)|ρ( θ). Therefore, across all such jumps, the quantity in (14b) satisfies

( θ+ ) 2 = θ -θ+ + (i * ) + π 3 2 ≤ θ -θ+ + i * π 3 2 = = θ -sat π 6 k θ |x r (0, 0)|ρ( θ) 2 ,
where the inequality follows from the fact that i * in (14c) is a minimizer. Then from uniform boundedness of |x r (0, 0)| and positive definiteness of θ → ρ( θ) θ in the set (-π/6, π/6), it is ensured that the function V θ is (locally) strictly decreasing as long as k θ > 0 is sufficiently small. For all other jumps triggered by the jump sets in (3b) and (13b), function V θ remains constant as established in Lemma 2. Since jumps in (16b) are periodic from periodicity of τ , then the asymptotic stability of A θ relative to initial conditions from A ȳ follows from persistent jumping and [10, Prop. 3.24].

The uppermost system corresponds to the dynamics starting anywhere in the allowable set of initial conditions, which clearly converge to the attractor in [START_REF] Neto | Exploitation of modularity in the JET tokamak vertical stabilization system[END_REF]. Indeed, at each jump triggered by (16b) it holds that 3ω π y rI is the difference between the average of y r , b(0, 0) + 3 π |x r (0, 0)|, and its estimate ȳr , so that the update law in the first equation in (16b) leads to uniform convergence to zero of the Lyapunov function V y := ( b + 3 π |x r |ȳr ) 2 (once again we apply [START_REF] Goebel | Hybrid Dynamical Systems: modeling, stability, and robustness[END_REF]Prop. 3.24] and persistent jumping to establish this fact). Recall that b and |x r | remain constant along solutions, while ȳr remains constant during flowing, so that V y remains constant along flows and decreases across jumps thanks to k av ∈ (0, 1].

Once the three above nested (or cascade-like) results are established, the uniform (local) asymptotic stability of the innermost attractor given by A e in ( 17) can be established applying iteratively the reasoning in [9, Corollary 19] by intersecting the flow and jump sets with sufficiently large compact sets.

Remark 5 Small choices of k av may be desired to suitably filter possible noise affecting the measurement. Similarly, k θ should be selected small in such a way to ensure that Theorem 2 applies and that suitable noise rejection is obtained. In general, the tuning of the three parameters k av , k θ and should be carried out based on the cascaded structure of the proof. Indeed, to experience a graceful transient performance, it is reasonable to pick gain k av as the most aggressive one, k θ in such a way to induce an intermediate speed of convergence, and as the one that induces the slowest transient. This type of tuning procedure was adopted in Section 5.

JET experimental measurements

In this Section we apply the scheme in Figure 5 to experimental data collected from the JET tokamak [START_REF] Neto | Exploitation of modularity in the JET tokamak vertical stabilization system[END_REF]. For simulations confirming the effectiveness of the method presented in Section 4 in the case of ideal nonsmooth signals, we refer the reader to [2, Sec. V] while here we focus on the application of the scheme to experimental signals. The stabilization of the unstable plasma vertical position at JET facilities is achieved by changing the radial magnetic field produced by current flow on dedicated coils. Such a current is regulated by the Vertical Stabilization (VS) system by means of a current amplifier named ERFA. At the time of experiment 78000 (used here) a previous amplifier FRFA (Fast Radial Field Amplifier) was in place. The VS system acts on FRFA requesting a desired current I FRFA,des that is obtained as the sum of two terms: the "fast" velocity loop that reacts promptly to plasma vertical displacements and the "slow" current loop that aims at regulating I FRFA to zero. The ripple generated by the power electronics present in the experiment affects the feedback signal Z PD , which is obtained by combining suitable magnetic measurements (from the Mirnov coils). For the current application we have y r (t) = α I FRFA (t) + Z PD (t) [START_REF] Petterson | Switched state jump observers for switched systems[END_REF] where I FRFA (t) is the current flowing within the poloidal coil and the scaling factor α = 4 • 10 4 m/s/A. All these quantities are depicted in Figure 7, where it is evident that the specific value of α in the linear combination [START_REF] Petterson | Switched state jump observers for switched systems[END_REF] is selected to eliminate the current bursts around time 17.72 (to be found whenever a nonzero voltage is applied to FRFA) and to let the ripple signal emerge in y r . The resulting signal y r is of clear graphical significance (the ripple effect was hidden in the oscillations within I FRFA and Z PD ) but its experimental meaning is a subject of future work and goes beyond the goal of this paper. The experimental data on which we tested our hybrid observer are the useful 20-second portion of pulse 78000. To obtain a ripple-free signal, we apply the scheme in Figure 5 where we discard completely the "Signal with ripple disturbance" block and we inject directly into the "Ripple observer" block the signal y r in [START_REF] Petterson | Switched state jump observers for switched systems[END_REF]. As a matter of fact, we have no longer a constant signal on which the ripple disturbance is superposed, but a signal that varies slowly with respect to the frequency of the ripple, as one can see from the bottom of Figure 7. As clarified after Problem 1, our solution also applies to this case, as long as the signal b is sufficiently slowly varying.

In particular, the following Corollary of Theorem 2 follows from [10, Corollary 7.27], the fact that A e in ( 17) is compact, and that dynamics (3), ( 13), ( 16) satisfy the hybrid basic conditions of [10, Assumption 6.5].

Corollary 1 For every > 0, every k av ∈ (0, 1] and a small enough value of k θ > 0, the selection L := [ 0 ] in (13a) guarantees that the compact attractor A e in (17) is uniformly locally asymptotically stable for the closedloop dynamics (3), ( 13), ( 16), with the second equation in (3a) replaced by ḃ ∈ [-ρ b , ρ b ], where ρ b is a sufficiently small positive constant.

Note that the modified dynamics for b in the above statement enables considering "biases" that are varying at sufficiently small rate ρ b . According to the discussion after Problem 1 (see Eqs. 13) and ( 16): = 7.5, k av = 0.9, k θ = 1, ȳr (0, 0) = -0.5 • 10 6 , ȳrI (0, 0) = 0, η(0, 0) = 0, τ (0, 0) = 0, θ(0, 0) = 0, x f (0, 0) = [ 0 0 ], xr (0, 0) = 9.6•10 6 0 (leading to a phase shift of roughly 90 • ). Following the discussion in [2, Sec. V-A] about implementing slightly inflated versions of flow and jump sets, in the current case of JET measurements we used only {ξ : π 3ω ≤ τ ≤ 1.005 π 3ω } instead of {ξ : τ = π 3ω } since we have no longer a ripple generator. This forces the maximal hybrid solutions to be also complete [10, Chap. 2.2 and 2.3] and prevents numerical perturbations from bringing solutions out of C ∪ D, leading to premature termination of complete solutions. At the bottom of Figure 8 we have both y r and σ on the full timescale. In the upper part, the beginning of the time history is zoomed on the left, and the end on the right (same zoom as in Figure 7). The red vertical lines correspond to the instants when the estimate θ jumps: at the beginning they are not in phase with the original signal y r while at the end they are, so that after convergence the hybrid observer effectively removes from y r the ripple disturbance d in the right central part of Figure 8.

We compare our hybrid approach with one based on the internal model (IM) principle for linear systems [START_REF] Francis | The internal model principle of control theory[END_REF]. According to the latter, we may approximate the ripple disturbance d in y r by a pure sinusoid with frequency 6ω, deliberately neglecting its nonsmoothness and thereby accepting a steady-state residual error. Then a standard unity-feedback system as in Figure 10 guarantees that dIM approximately manages to converge to the main linear harmonic in d, and by subtracting dIM from y r one gets asymptotically some linear estimate σIM of the desirable signal σ. We note that the coefficients κ 1 and κ 2 in IM (s) affect mainly the transient, and are less relevant for the (approximately) asymptotic tracking we want to show in Figure 9. The resulting σIM from this approach is plotted in Figure 9 together with σ from our hybrid approach, which provides an improved estimation because it is based on a more accurate model of the specific ripple waveform. In particular, note that the linear cancellation scheme exhibits noticeable errors where the ripple waveform is not differentiable.

We also compare our approach with the solution of a (nonlinear) optimization problem exploiting numerical tools. Consider as cost function the squared error between the (sampled) output y r and the estimated signal ŷr over a window of N past samples, that is,

J N (k) := N -1 i=0 y r (t k-i ) -ŷr (t k-i ) 2 (21)
ŷr (t j ) = σJ j + √ 3V f max i∈Z cos ωt j + θ ji π 3

- 3 √ 3 π V f ,
The minimization variables (in ŷr ) are θ k and σJ k , and their optimal values are found iterating a numerical gradient descent algorithm on J N (fmincon() of the optimization toolbox of Matlab R ). In our case we have V f = 1.8 • 10 6 and we take N = 30 samples, and the result is shown in Figure 9. This approach is similar to the one proposed in [START_REF] Moraal | Observer design for nonlinear systems with discrete-time measurements[END_REF][START_REF] Sassano | Extremum seeking-like observer for nonlinear systems[END_REF] where Newton and extremumseeking techniques have been exploited to minimize J N . With this approach the computational complexity is much higher, the time spent by iterations at each new sample to provide the new value of θ k and σJ k is not known a priori, and the resulting σJ k can be nonsmooth. Important high frequency information could be canceled out by this approach, whose proof of convergence is in general a difficult problem and has not been addressed for the considered example.

Although our hybrid observer scheme is presented for offline experimental data, we finally emphasize that it can be used for estimating and removing the ripple on line, so that an estimate of the desirable signal σ in [START_REF] Pettersson | Observer design for switched systems using multiple quadratic Lyapunov functions[END_REF] is available for feedback purposes.

Conclusions

We proposed a hybrid dynamical system to model the ripple phenomenon arising in the context of power electronics. In particular, we discussed its effectiveness illustrating its (hybrid) solutions, flow/jump dynamics and sets with a three phase diode bridge rectifier. We proposed two hybrid schemes capable of asymptotically estimating the state of the hybrid model that generates the ripple waveform both when the switching instants are known and unknown. The proposed methodology was applied to reconstruct the ripple disturbance affecting experimental data of the vertical stabilization system at the JET facilities.

Figure 1 .

 1 Figure 1. A three phase diode bridge rectifier for AC/DC conversion, which results in a waveform affected by a ripple.

Figure 2 .

 2 Figure 2. Line-to-line voltages in a three-phase diode bridge rectifier.

Figure 3 .

 3 Figure 3. Sets K, C, D (projected on the plane (xr1, xr2)) together with a possible trajectory (solid arrow for the flow and dashed arrow for a jump).

Figure 4 .

 4 Figure 4. Scheme with generator, filter and hybrid observer of xr when the switching instants are known.

Lemma 1 2 =

 12 hybrid) error dynamics corresponds then to ė = A r -LC f B f C r A f e =: A e e, (x r , b) ∈ C (9b) e + = J r 0 0 I 2 e =: J e e, (x r , b) ∈ D, (9c) for which Lemma 1 holds. Given dynamics (3) and (8) and the error dynamics (9), for every > 0, the selection L := [ 0 ] in (8b) and (9b) ensures the existence of P = P T > 0 and H ∈ R 1×4 such that (H, A e ) is an observable pair and the function V (e) := e T P e (10) satisfies ∇V (e), A e e = -e T H T He, (x r , b) ∈ C (11a) V (J e e) -V (e) = 0, (x r , b) ∈ D. (11b) Proof. Consider the diagonal P := it follows P = P T > 0. Moreover, using A e in (9b), one obtains P A e + A T e P = -H T H, and H := [ 0 0 0 2ω √ ]. Then (11a) follows. As for H, the observability of the pair (H, A e ) is verified through the observability matrix [ H T (HAe) T (HA 2 e ) T (HA 3 e ) T ]T , whose determinant is -16ω 9 2 = 0. Finally, V (e + ) -V (e) = V (J e e) -V (e) = e T J T e P J e -

Figure 5 .

 5 Figure 5. Scheme with generator, estimation of the switching instants, filter and hybrid observer of xr when the switching instants are not known.

Figure 6 .

 6 Figure 6. Proof for θ > 0 (left) and θ < 0 (right).

Figure 7 .

 7 Figure 7. Experiment data from the JET tokamak: current IFRFA, measurement ZPD and their combination yr.

( 5 )Figure 8 .

 58 Figure 8. Original signal yr, desirable signal σ and ripple estimate d in different timescales.

Figure 8

 8 Figure8is obtained for the following parameters and initial values of the hybrid observer in (13) and (16): = 7.5, k av = 0.9, k θ = 1, ȳr (0, 0) = -0.5 • 10 6 , ȳrI (0, 0) = 0, η(0, 0) = 0, τ (0, 0) = 0, θ(0, 0) = 0, x f (0, 0) = [ 0 0 ], xr (0, 0) = 9.6•10 6

Figure 9 . 5 s 2 +3Figure 10 .

 95210 Figure 9. Original signal yr and signals deprived of ripple: σ with our approach, σIM with internal model scheme, σJ by solving an estimation problem.

Preprint submitted to Automatica

Note that the definition of j * (t) is valid for all t ≥ 0 because all solutions have unbounded domain in the ordinary time direction, as established in Proposition 1.

Acknowledgements. The authors would like to thank Fulvio Forni for useful discussions.

2 Work supported in part by the ANR project LimICoS contract number 12 BS03 005 01, by the iCODE institute, research project of the Idex Paris-Saclay, and by the University of Trento, grant OptHySYS. Email: zaccarian3 Work supported by ENEA-EUROFUSION. This work has been carried out within the framework of the EUROfusion Consortium and has received funding from the Euratom research and training programme 2014-2018 under grant agreement No 633053. The views and opinions expressed herein do not necessarily reflect those of the European Commission.