Parameter Estimation of Nonsmooth Frictionless Impacts Through a Hybrid Observer

Estimating the velocity of a mass involved in nonsmooth impacts is a challenging problem because of their hybrid nature, especially when the restitution coefficient and the orientation of the tangent line at the point of impact are unknown. In this article, various hybrid observers are proposed for some families of mechanical systems to estimate the velocities, the restitution coefficient, and the orientation of the constraint, under the assumption that only the positions are measured. The stability properties of the corresponding error dynamics are proved, showing semiglobal exponential convergence to zero. First, the performance of the proposed observer is tested in some simulation runs. Second, the analysis is carried out in experimental tests, by measuring the position of the impacting body through slow and fast camcorders, with a post-processing of the recorded video. A final experimental evaluation is done in real-time with a hardware architecture based on a Raspberry Pi.


Parameter Estimation of Nonsmooth Frictionless
Impacts Through a Hybrid Observer Sergio Galeani , Laura Menini , Member, IEEE, Corrado Possieri , and Antonio Tornambe Abstract-Estimating the velocity of a mass involved in nonsmooth impacts is a challenging problem because of their hybrid nature, especially when the restitution coefficient and the orientation of the tangent line at the point of impact are unknown.In this article, various hybrid observers are proposed for some families of mechanical systems to estimate the velocities, the restitution coefficient, and the orientation of the constraint, under the assumption that only the positions are measured.The stability properties of the corresponding error dynamics are proved, showing semiglobal exponential convergence to zero.First, the performance of the proposed observer is tested in some simulation runs.Second, the analysis is carried out in experimental tests, by measuring the position of the impacting body through slow and fast camcorders, with a post-processing of the recorded video.A final experimental evaluation is done in real-time with a hardware architecture based on a Raspberry Pi.
In particular, the research in observer design for mechanical systems subject to impacts can be directed to avoid the problems caused in the error dynamics by either the jumps in the velocity variables or the transitions among different operating modes, in the hybrid systems setting, such as, e.g., in [32], [33], [34].As an example, in [35], a technique is proposed to update the state belief when the robot is in contact with an uncertain surface and how to apply such an update to a Kalman filter.On the other hand, some challenging estimation problems require the presence of impacts and contacts, since it is only through the interaction among different parts of the system that relevant information can be extracted, see, e.g., [32], [36], [37], [38].
In this article, starting from the results proposed in [39], hybrid observers are proposed to estimate jointly the complete state vector and some unknown parameters of the impact model (both the coefficient of restitution and the orientation of the tangent at the impact point of the boundary of the plane domain), for classes of mechanical systems whose continuous-time dynamics, that is, the flow dynamics using the terminology in the hybrid systems setting, is linear.Note that, due to the fact that the discrete-time dynamics (the jump dynamics) is due to constraints in the state space, the overall system is a highly nonlinear dynamical system.Nevertheless, due to the special characteristics of the interaction between continuous-time and discrete-time dynamics, it is possible to derive formal results guaranteeing that, under mild assumptions, the proposed hybrid observers obtain semiglobal exponential convergence to zero of the estimation errors, thus allowing to estimate exactly, in ideal conditions, both the velocity variables and the unknown parameters of the impact model, on the basis of position measurements.Therefore, differently from [35], the observer proposed in this article is purely deterministic since it does not rely on stochastic estimates of the system subject to impacts.In particular, the observer proposed in [35] exploits known guard conditions and reset maps to obtain accurate estimations in the presence of noise and unknown jump times, whereas, on the contrary, the approach proposed in this article exploits known jump times to identify the unknown parameters of the guard and of the reset map.Although there is already some research available on the problem of impact detection [40], [41], for simplicity in this article it is assumed that the observer knows the impact times in real time, since in many applications this is indeed possible by making use of relatively low cost sensors, and this is the case for the experimental results that are reported in Section V.
The organization of the article is as follows: in Section II, the notation and the class of mechanical systems considered for the main results are reported, preferring, for the ease of exposition, the relatively simple case of two degrees of freedom; then, in Section III, some crucial technical results are derived, so that the main results are reported in Section IV, together with a numerical simulation.In Section V, more realistic simulations and experimental results are reported, organized in sections in order to show completely the different deviations from ideal conditions that can occur in practice.Finally, in Section VI, the theory is completed by reporting some extensions of the main results, to allow a more efficient implementation when only the coefficient of restitution is unknown, the case of more than two degrees of freedom, and the case of more surfaces of contact in the position space.

II. CONSIDERED CLASS OF MECHANICAL SYSTEMS SUBJECT TO IMPACTS
A nonsmooth impact is an instantaneous interaction between two rigid bodies such that the positions of the colliding bodies do not change at the times of impact, whereas their velocities are subject to finite instantaneous jumps at such times.In the considered case, one of the two masses is assumed to be infinitely massive, and represents the boundary of the plane domain where the other mass is constrained to move.Hence, in the simplified case considered, one has a plane domain and a ball (a point mass).The point mass moves within the plane domain with phases of flow motion (i.e., without velocity jumps) and with phases of discrete-time motion (i.e., with velocity jumps at the times of impact between the ball and the boundary of the plane domain); therefore, the mechanical systems considered are hybrid in the sense that they exhibit continuous and instantaneous changes, with characteristics of continuous-time and discrete-time dynamical systems.For simplicity, it is assumed that the ball is not subject to velocity-proportional frictional forces; so, there is no loss of energy during flow motion.As a result, when there are no external forces acting on the ball, it moves along a straight line with constant velocity until it hits the boundary of the plane domain, when it undergoes a jump in velocity such that the ball does not leave the plane domain.The angle of reflection is assumed to be a known function of the angle of incidence and of the restitution coefficient r ∈ [0, 1] (in particular, so that the angle of restitution is equal to the angle of incidence when r = 1).This corresponds to decompose, at the impact point, the preimpact velocity of the ball into its normal and tangential components with respect to the tangent at the impact point of the boundary of the plane domain and in assuming that the tangential component is a continuous function of time (only the normal component is subject to jumps).If the velocity of the point mass were measurable, then both the angle of incidence and the angle of reflection could be easily reconstructed and, therefore, the restitution coefficient could be calculated by algebraic computations.In this article, only the position of the mass is assumed "measurable" by a camcorder with a certain sampling period, and this makes the problem of estimating the restitution coefficient very challenging.
Let t 0 be the initial time and let q(t) = [q 1 (t) q 2 (t)] be the vector of the Cartesian coordinates of the mass, which are assumed to uniquely represent the configuration of the mechanical system at time t ∈ R, t t 0 ; let v(t) = [v 1 (t) v 2 (t)] = q(t) be the Cartesian velocity of the mass.The Cartesian coordinates q(t) are assumed to have piecewise continuous second-order time derivatives.To simplify the notation, given a function φ(t), let φ(t + ) = lim τ →t + φ(τ ) and φ(t − ) = lim τ →t − φ(τ ), when such limits exist (are uniquely determined) and are finite.Assume that (at each time t ∈ R, t t 0 ) the vector q(t) must belong to the plane domain where f is a differentiable function for all q ∈ R 2 .Assume that D is nonempty and that, in addition, there exists at least an interior point q • such that the constraint is satisfied with the strict < sign (i.e., f (q • ) < 0).Although for simplicity only one constraint is considered, the results of this article can be easily extended to the case where more constraints are used to describe D, with the only requirement that there are no "multiple" impacts (which could occur at the points where the boundary of D is not differentiable, due to the simultaneous fulfillment of two or more constraints).The curve described by f (q) = 0 represents the contact condition between the ball and the boundary of the plane domain.Let J(q) = ∂f (q) ∂q be the gradient vector of f (q).Assume that J(q) = 0, ∀q ∈ R 2 .Let T (v(t)) and U T (q(t), u(t)) be the kinetic energy and the total potential energy of the mechanical system at time t ∈ R, t t 0 , respectively.Assume that the kinetic energy can be expressed as T (v(t)) = 1  2 v (t) B v(t), where B = m I 2 is the generalized inertia matrix (I 2 is the 2 × 2 identity matrix and m is the mass of the ball).Let the total potential energy U T (q(t), u(t)) be decomposed into two parts, U T (q(t), u(t)) = U (q(t)) − q (t)u(t), where U (q(t)) is the potential energy at time t ∈ R, t t 0 , due to conservative forces (e.g., gravitational and/or elastic forces, if any), u(t) = [u 1 (t) u 2 (t)] is the vector of the control forces acting on the ball, assumed to be continuous, and −q (t)u(t) is the pseudo potential energy that can be associated with u(t).Following [8], the Euler-Lagrange equations of motion are where L is the Lagrange function of the system, L = T − U , γ is a Valentine variable such that f (q) + γ 2 = 0, and λ is a Lagrange multiplier.Note that the term−J(q) λ in (1a) models the reaction forces, which enforce the fulfillment of the constraint f (q) ≤ 0. In particular, for all t ≥ t 0 such that f (q(t)) < 0, one has −J(q(t)) λ(t) = 0. Equations ( 1) hold for all t ≥ t 0 such that q is twice continuously differentiable with respect to time, whereas, in the case of no kinetic energy loss due to impacts, the following Erdmann-Weierstrass corner conditions hold for all times t c ≥ t 0 such that q is not twice continuously differentiable.When at t c there is a loss of energy, the corner conditions (2) need to be suitably modified to account for such a loss, as in the subsequent (3) by means of the introduction of the restitution coefficient r.The times t i ≥ t 0 such that the function q is not differentiable are referred to as impact times.A nonsmooth impact can occur at a certain time t i ∈ R, t i > t 0 , only if, at such a time, one has f (q(t i )) = 0.A time t i ∈ R, t i > t 0 , is an impact time if f (q(t i )) = 0 and J(q(t i ))v(t − i ) > 0 (i.e., the inequality constraint would be violated in the absence of impulsive forces that are generated as a reaction to the nonsmooth impact); the impact is degenerate if J(q(t i ))v(t − i ) = 0 (this case is ruled out by the subsequent Assumption 1).
Define the set of admissible initial conditions: For each initial condition in A, the inequality constraint is not violated at the initial time and cannot be violated at times immediately after the initial one.
In absence of persistent contact (as guaranteed by the subsequent Assumption 1), the term −J(q) λ vanishes for t ∈ (t i , t i+1 ) and the motion of the system is described by B q(t) + F g (q(t)) = u(t), where F g (q) = ∂U (q)  ∂q .The restitution coefficient r characterizes the nonsmooth impacts; in particular, one has r = 1 for nonsmooth elastic impacts, that is, when there is no loss of kinetic energy due to the nonsmooth impacts, and r ∈ [0, 1) for nonsmooth inelastic impacts, that is, when a fraction of the kinetic energy is lost at each impact time.In the following, the case r = 0 is excluded to avoid persistent contacts.For each impact time t i , the kinetic metric approach reported in [1, Sec.2.4.2] is used to express the postimpact velocity v(t + i ) as a function of the preimpact velocity v(t − i ).Namely, the postimpact velocity is given by (see [42, eq. (44)]) and r is called the Poisson coefficient in [42].
In particular, as is assumed hereafter, if ) and f 0 ∈ R are fixed constants, taking into account that B = mI 2 , one has that Z is independent of q and given by Z = E(sin(α), cos(α), r), where Note that, the expression for E(s, c, r) only contains the monomials s 2 , c 2 , sc, and r.Further, since r ∈ (0, 1], all entries in the matrix E given in (4) are in the interval the motion of the point mass is described by the following continuous-time dynamics: for all t ∈ (t i , t i+1 ), and is subject to the following discrete-time dynamics at the ith impact time t i : where the restitution coefficient r ∈ (0, 1] is assumed to be constant, which is a reasonable assumption whether the materials of the two bodies involved in the impact have been work-hardened by previous impacts. The following assumption is made to design a hybrid observer for system (5) (namely, an observer for both the velocity of the mass and the coefficient of restitution, showing continuous and instantaneous dynamics, with characteristics of continuous-time and discrete-time dynamical systems).
Assumption 1: The impact times t i are known and available in real time.The initial conditions and the control input of system (5) are such that i) iii) the solution of system (5) experiences an infinite sequence of jumps with a minimum dwell-time Δ T > 0. Since r > 0, Assumption 1 guarantees that there are no intervals during which the point mass is in persistent contact with the obstacle, there are no degenerate impacts (i.e., times t i at which f (q(t i )) = 0 and J v(t − i ) = 0), and the sequence of impact times satisfies lim i→∞ t i = ∞, and t i+1 − t i > Δ T .Roughly speaking, it is assumed that the initial condition and the control input are such that there are no finite accumulation points of impact times, and there are no intervals during which the mechanical system is in a situation of permanent contact, that is, degenerate impacts cannot occur.

III. PRELIMINARY RESULTS
Consider the following equation: where E(s, c, r) is given in (4), and s and c are two single variables that satisfy the constraint Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply. Proof: 2 are single variables.Consider the three polynomials on the left-hand side of the following equations: Following the construction given in [43,Ch. 6], one has that such a system of equations admits a unique solution in r, s 2 , c 2 , and sc, that is the one given in (7).
By the proof of Lemma 1, under the assumption that v − = 0 and v − = v + , if (6) holds, then the restitution coefficient is uniquely determined by v + and v − as whereas there are two admissible values for the angle α, where atan2 is the arc-tangent function with two arguments.
Since the postimpact velocity depends on α, one might mistakenly think that it cannot be determined uniquely due to the ambiguity in the value of α.Fortunately, this is not the case, since by (7), under the assumption that v − = 0 and v ) can be easily estimated, together with an estimate q(t − i−1 ) of q(t − i−1 ), by a classical high-gain continuous-time observer.Therefore, the problem is to properly estimate the postimpact velocity v(t + i−1 ), by an additional vector variable ν(t).In particular, the objective is to obtain an "accurate" estimate ν(t − i ) of v(t + i−1 ), using measurements of q(t) in the interval (t i−1 , t i ).To better illustrate the reasoning used to achieve this objective, consider the following continuous-time dynamics for t ∈ (t i−1 , t i ): where ε > 0 is a small parameter.
Remark 1: The dynamics (9c), (9d) are those of a high-gain observer [44], whereas the dynamics (9e) are designed in order to estimate the post impact velocities v(t + i ) from measurements of the position q, as detailed in the following.
Lemma 2: Consider the system (9 Proof: Define the errors q(t) = q(t) − q(t) and ṽ(t) = v(t) − v(t), which yield the error dynamics for t ∈ (t i−1 , t i ) For any q(t + i−1 ), ṽ(t + i−1 ) and ν(t that is, under the assumption ).Thus, by (10), one has . Therefore, the statement follows by the continuous dependence of q(t − i ), v(t − i ), and ν(t − i ) on ε and the fact that, in the limiting case In view of Lemma 2, letting v(t − i−1 ) be an estimate of v(t − i−1 ), which can be obtained using a classical high-gain observer in the interval (t i−2 , t i−1 ), and letting ν(t − i ) be an estimate of v(t + i−1 ), which can be obtained using the hybrid observer (9) in the interval (t i−1 , t i ), one finds that the matrix Z can be estimated as

IV. PROPOSED HYBRID OBSERVER
Using the reasoning outlined in Section III, a hybrid observer is now proposed that is capable of computing exponentially convergent estimates of v(t) and r, without knowing the angle α, on the basis of the only measurements of q(t).
Letting Assumption 1 hold, consider the hybrid observer with the following continuous-time dynamics for all t and the next discrete-time dynamics at the impact times t = t i , where q(t), v(t), and r(t) are estimates of q(t), v(t), and r, respectively, ν(t − i ) is an estimate of the post-jump velocity v(t + i−1 ), Ê(t − i ) is the estimate of Z at the ith impact time, and ε > 0 is a sufficiently small tuning parameter.Since under Assumption 1, the impact times are known, the jumps of the state of the hybrid observer (11) are assumed to be synchronous with the ones of the mechanical system (5).Note that, although the estimates r(t) and Ê(t) have been defined at all times t, their values are relevant for the discrete-time dynamics (11b) only at the preimpact times t − i .Remark 2: To implement the hybrid observer (11), one needs that As shown in the subsequent Proposition 1, such a requirement is met provided that ε is sufficiently small and that Assumption 1 holds.
Remark 3: , where is not defined, the estimates provided by the hybrid observer make sense just after the first impact occurred at time t = t 1 .Therefore, in all simulative and experimental tests reported hereafter, the expression Ê(t − 1 ) = 1 0 0 −1 is arbitrarily chosen (it corresponds to α = 0 and r = 1).
Proposition 1: Let Assumption 1 hold.For any Δ q , Δ v > 0, there exists ε > 0 such that if q(0) − q(0) < Δ q , v(0) − v(0) < Δ v , and ε ∈ (0, ε ), then the estimation errors q(t) = q(t) − q(t) and ṽ(t) = v(t) − v(t) converge exponentially to zero as t → +∞, as well as r(t Note that the dynamics (12a) is linear, with a dynamic matrix On the other hand, the (nonlinear) discrete-time error dynamics at the ith impact time is given by where the arguments of E have been omitted for brevity.Inspecting the error dynamics (12a), one finds that if q(t + i−1 ) = 0, ṽ(t + i−1 ) = 0, and ν(t + i−1 ) = 0, then q(t) = 0, ṽ(t) = 0, and ν(t) = 0, for all t ∈ (t i−1 , t i ).Similarly, inspecting the dynamics (12b) and considering the reasoning given in Section III, one has that if q(t − i ) = 0, ṽ(t − i ) = 0, and ν(t − i ) = 0, then q(t + i ) = 0, ṽ(t + i ) = 0, and ν(t + i ) = 0. Therefore, q = 0, ṽ = 0, and ν = 0 is an equilibrium of the error dynamics.Letting F d,i be the function defined in (12a) and x = [q ṽ ν ], so that x(t Under Assumption 1, one has that Hence, noticing that ṽ(t ) is bounded by Assumption 1 and that the entries of E and Ê(t ) by Lemma 2. In the limiting case ε → 0 + , it results that Ê(t − i ) = E, that is, the error dynamics are deadbeat stable (one has convergence to zero in at most two time steps for ε → 0 + ).Hence, the statement follows by the Remark 4: Despite in the limiting case ε → 0 + , the error dynamics ( 13) is deadbeat stable, the actual convergence of the estimation error to zero is only exponential due to the fact that ε has to be chosen strictly greater than 0. Furthermore, as already pointed out in the proof of Proposition 1, the dynamics (12aa), (12ab) is that of an exponentially stable, linear, continuous-time system.Hence, if there is no impact, the hybrid observer (11) exponentially estimates both q and v, but not the restitution coefficient.
Remark 5: Based on the analysis carried out in Remark 4, an infinite sequence of impacts is required to allow the estimation error to go to zero.However, in most practical scenarios, a sufficiently accurate estimate of Z (or, equivalently, of α and r) is enough.In that case, Assumption 1 can be relaxed and a finite (not necessarily long) sequence of impacts is enough to obtain an accurate estimate of Z.
Remark 6: Note that the hybrid observer ( 11) can be implemented even without having any knowledge about the location and orientation of the boundary of the plane domain.In fact, knowledge of the parameters α and f 0 is not required to implement such an observer.
Remark 7: In order to implement the observer (11) in practice, the impact times t i have to be known in real time.This is due to the structure of the observer itself, which estimates the impact matrix Z using the formulas given in Lemma 1.These expressions can be used to reconstruct the matrix Z just in the case that v − and v + are the velocity vectors across a nondegenerate impact event, i.e., with v − = v + , v − = 0.
The next example illustrates the application of the hybrid observer (11) through a numerical simulation.
As shown by such a figure, two impacts are sufficient to estimate the value of α and r with a negligible error.

V. EXPERIMENTAL RESULTS
The main goal of this section is to show the effectiveness of the hybrid observer (11) in real-world scenarios.First, in Section V-A, the results of some "simulated tests," which evaluate the effectiveness of the proposed hybrid observer in different conditions ranging from poor setups (i.e., in the presence of large quantization errors and low sampling rates) to ideal ones (i.e., continuous measurements without quantization), are reported.Second, in Section V-B and V-C, the results of two "experimental tests" carried out through a postprocessing of a recorded video of a bouncing ball with both a fast and a regular camcorder are reported.Finally, in Section V-D, the results of one "experimental test" carried out analyzing in real time (with the processing realized simultaneously with the data acquisition) on a low-cost hardware are reported.

A. Simulated Experiment
The main goal of this section is to evaluate the effectiveness of the hybrid observer (11) when the continuous-time measurements of the position q are replaced by sampled and quantized measurements.To achieve this objective, the data have been generated by simulating the time-behavior of system (5) with r = 0.9, α = 0 rad, and f 0 = 0 m.These data have been sampled with sampling frequency F s ∈ {30, 60, 120, 240}Hz and these samples have been fed to the hybrid observer (11) with ε = 0.1, q(0) = [0.76430.9650] m Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
and v(0) = [−0.50500.2014] m s −1 , whose continuoustime dynamics has been discretized using the forward Euler method.Fig. 3 shows the results of such simulations.
As shown in such a figure, the proposed hybrid observer presents good performance even when used with very low sampling frequencies.To further analyze the effects of imperfect measurements, the data sampled with f s = 240 Hz have been further quantized, assuming that the position of the point mass can be measured with a resolution equal to ρ ∈ {0.01, 0.05, 0.1, 0.2} m, i.e., the positions q 1 and q 2 fed to the hybrid observer (11), with the same parameters as above, have been set to qi = ρ q i ρ , i = 1, 2, where x denotes the integer closest to x. Fig. 4 shows the results of such simulations.As shown in such a figure, the proposed hybrid observer presents good performance even when used with very low resolutions.

B. Offline Experiment With a Fast Camcorder
An experiment has been carried out to test the effectiveness of the hybrid observer (11) using the data acquired using a fast camcorder.The camcorder of a commercial mobile phone has been used to make a movie of an orange tennis table ball falling under the action of gravity and bouncing on the floor.The video and audio recording were acquired at 240 fps, with a resolution of 1080 × 1920 pixels, and 352.8 KHz, respectively.Peak detection has been carried out by using the audio track to detect the impact times of the ball with the floor through the sound produced by the impact, and by using OpenCV [45] to determine the position of the ball in the video frame.
In the experimental results reported hereafter, the input u 1 is assumed to be null, whereas the input u 2 has been estimated using the dimension of the ball in the acquired frame.In particular, taking into account that the dimension of the table tennis ball is 0.04 m and that the gravity acceleration is 9.81 m s −2 , the input u 2 has been estimated as u 2 (t) = − is the dimension of the ball in the frame at time t.Fig. 5 shows the results of this experiment, where the continuous-time dynamics of the hybrid observer (11), with ε = 0.1, q(0) = [0.5 0.5] m and v(0) = [0 −5] m s −1 , has been discretized using the forward Euler method.
As shown in such a figure, after few bounces, the estimates q are close to the measured position q, up to a small delay due to the implementation of the continuous-time dynamics via the Euler method and to quantization errors.Furthermore, note that Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.the estimates α and r present small oscillations because of an imperfect estimation of the forces applied to the ball and of the fact that the plane of motion is not perfectly orthogonal to the optical axis of the camcorder.

C. Offline Experiment With a Slow Camcorder
Another experiment has been carried out to evaluate the effectiveness of the hybrid observer (11) when the data are available at a lower In particular, the experiment reported in Section V-B has been repeated by using a slow camcorder that acquires the video and the audio at 60 fps and 44.1 KHz, respectively.The results of such an experiment are reported in Fig. 6.
As shown in such a figure, despite the lower acquisition rate, the estimates of q obtained using the proposed hybrid observer agree with the measured values.However, the lower acquisition rate leads to a greater ripple of the estimates α and r within impacts, as expected from the numerical simulations reported in Section V-A.

D. Real-Time Experiment
Motivated by the results of the offline experiments reported in Section V-B and V-C, the setup has been implemented using a Raspberry Pi Model 3B+ running Raspberry Pi OS (Legacy) at 32 bits, a Raspberry Pi Camera Module V2.1, and a KY-037 microphone sound sensor module to implement the hybrid observer (11) in real time; see Fig. 7.
Due to the limited computational power of the Raspberry Pi, for all the computations to be carried out in real time, the video has been acquired at 30 fps, with a resolution of 320 × 240 pixels.The position of the ball in the acquired frames has been determined using OpenCV.The potentiometer of the KY-037 module has been calibrated so that its D0 pin raises to a high voltage level when an impact occurs between the ball and the floor.This pin has been connected to the Raspberry Pi GPIO pin 4, which triggers a jump in the state of the hybrid observer according to (11b) when an increase in the voltage level is detected through the add_event_callback function of the Raspberry GPIO library, with a bouncetime equal to 300 ms, which accounts for the time resolution of the KY-037 sensor.On the other hand, the continuous-time dynamics (11a) of the hybrid observer has been implemented using forward Euler discretization taking the measurements returned by OpenCV.The experiment has been carried out letting ε = 0.1, q(0) = [0.5 0.5] m and v(0) = [0 −1] m s −1 , and estimating the forces applied to the ball as detailed in Section V-B.Fig. 8 shows the results of this experiment, which has been interrupted as soon as the dwell-time between two impact times is lower than 0.3 s.
As shown in such a figure, the estimated position obtained using the hybrid observer (11) essentially matches the one estimated using OpenCV.Furthermore, after few bounces, the estimates α and r practically converge, with a small ripple, which is possibly due to the discrete-time implementation of the dynamics (11a) with a large sampling time, to the quantization errors due to the low resolution of the camcorder, or to the imperfect estimation of the forces applied to the ball.Despite these nonidealities in the setup, the proposed hybrid observer practically estimates the position, the velocity, and the restitution coefficient of the considered mechanical system.

VI. EXTENSIONS OF THE PROPOSED HYBRID OBSERVER
The main goal of this section is to show how to extend the hybrid observer (11) along different directions: in Section VI-A, it is shown how to simplify the dynamics of the hybrid observer (11) when parameter α is known; in Section VI-B, it is shown how to extend the hybrid observer (11) to a class of linear mechanical systems with 2 N degrees of freedom (DOF); finally, in Section VI-C, it is shown how to modify the hybrid observer (11) in the case there are multiple impact lines in the plane of motion.

A. Case of Known α
If the parameter α is known, then the dynamics of the hybrid observer (11) can be simplified; this case has already been considered by Galeani et al. [39] and, now, a simplification of the observer given in [39] is proposed in the following (see the subsequent Remark 9).First, define the rotation matrix and note that the continuous-time dynamics of system ( 5), expressed with the coordinates (14), is given by for all t ∈ (t i−1 , t i ), whereas the discrete-time dynamics at the ith impact time t i is given by where r ∈ (0, 1] is the restitution coefficient and W (r) = diag(1, −r).Assumption 2: The impact times t i are known, and the initial conditions and the control input are such that i) there exists ii) the solution to system (5) experiences an infinite sequence of jumps with a minimum dwell-time Δ T > 0. If angle α is known, then ( 14) can be used; hence, consider the hybrid observer with continuous-time dynamics for t ∈ (t i−1 , t i ), and subject to the following discrete-time dynamics at the ith impact time t i : Note that the estimates q, and v of the state of the system in the original coordinates can be obtained from q∠ and v∠ as Remark 8: As for the hybrid observer (11), since for t ∈ (t 0 , t 1 ) the estimate v⊥ (t − 0 ) is not available, the estimate obtained using (16ac) makes sense just after that the first impact occurred at time t = t 1 .Furthermore, in order to implement such a dynamical equation, it is necessary to require that v⊥ (t − i ) = 0, for i ∈ N. As for the hybrid observer (11), this condition holds under (i) of Assumption 2, provided that ε is sufficiently small.Remark 9: Comparing the hybrid observer (16) with the (monodimensional) hybrid observer given in [39], note that both hybrid observers estimate the position, the velocity, and the restitution coefficient of the point mass using a high-gain structure.However, whereas the hybrid observer given in [39] imposes jumps on the estimated position of the point mass, the position estimates obtained using the hybrid observer (11) are continuous with respect to time.Furthermore, the hybrid observer given in [39] assumes that f 0 = 0, whereas the hybrid observer ( 16) can be used for any (possibly unknown) f 0 ∈ R. Therefore, the hybrid observer (16) generalizes that given in [39] when α is known.
Proof: Define the estimation errors q∠ = q ∠ − q∠ , ṽ∠ = v ∠ − v∠ , and r = r − r, whose continuous-time dynamics are for all t ∈ (t i−1 , t i ), and that are subject to the following discrete-time dynamics at the ith impact time: Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
The example illustrates the application of the observer (16) via a numerical simulation.
Example 2: Assuming that α is known so that q ∠ can be computed from q using (14), a numerical simulation has been carried out to test the effectiveness of the hybrid observer ( 16) letting ε = 0.4 and initializing its state at random.Fig. 9 shows the results of this simulation.
As shown in such a figure, two impacts are sufficient to estimate the value of the restitution coefficient r with a negligible error.

B. Class of 2 N -DOF Linear Mechanical Systems
The main goal of this section is to show how to extend the hybrid observer (11) to linear mechanical systems constituted by N point masses, whose continuous-time dynamics are where q(t) = [q 1 (t) • • • q N (t)] , q j (t) denotes the Cartesian position of the jth point mass, v j (t) denotes the Cartesian velocity of the jth point mass, the matrix K denote the elastic matrix of the system so that U (q) = 1 2 q Kq, B = blkdiag(m 1 I 2 , . . ., m N I 2 ) denotes the generalized inertia matrix of the system, and m 1 , . . ., m N denote the masses.Assuming that all point masses are subject to impacts with the boundary of the plain domain, letting t j,i be the ith time when an impact between the jth point mass and the boundary of D occurs, the discrete-time dynamics of the state of the mechanical system is  given by where r j ∈ (0, 1] is the restitution coefficient of the impact between the jth point mass and the obstacle. The following assumption is made throughout this section.Assumption 3: The impact times t j,i are known and at each of these times just one of the masses impacts the boundary of D. The initial conditions and the inputs of the system (18) are such that i) iii) the solution of system (18) experiences an infinite sequence of jumps with a minimum dwell-time Δ T > 0; iv) there exists a maximum dwell time Δ max > 0 between the impact times t j,i and t i+1,j .Under Assumption 3 and assuming that the positions of all point masses are measured, consider the following modification of the hybrid observer (11), whose continuous-time dynamics are given by j = 1, . . ., N, and subject to jumps at the impact time t = t j,i according to the following discrete-time dynamics: Note that q is an estimate of the position q of the point masses, v is an estimate of their velocity v, Êj (t − j,i ) and rj (t − j,i ) are estimates of Z(r j ) and r j at the impact time t − j,i , respectively.The following theorem shows that system ( 19) is a semiglobal hybrid observer for the mechanical system (18).
Remark 10: If the jth point mass is not subject to impacts with the boundary of the plane domain D, as already detailed in Remark 4 for the case of a single mass, the hybrid observer (19) estimates exponentially q j and v j , but not Z(r j ).
The next two examples illustrate the implementation of the observer (19) through numerical simulations.
Example 3: Consider the mechanical system depicted in Fig. 10.
Assuming that the springs have unitary stiffness and zero rest length and that the masses are unitary, one has that B = I 6 and Assuming that all the point masses are only subject to impacts with the boundary of D, Fig. 11 shows a numerical simulation of such a mechanical system, letting r 1 = 0.9, r 2 = 0.95, r 3 = 0.97, α = π 12 rad, ] m, and imposing zero initial velocities.(19) in Example 3: Time histories of qi,j (t) [m], vi,j (t) [m s −1 ], and ri (t) versus time t [s], i = 1, 2, 3, j = 1, 2, compared with their actual time histories q i,j (t) [m], v i,j (t) [m s −1 ], i = 1, 2, 3, j = 1, 2, and r.A numerical simulation has been carried out to test the effectiveness of the observer (19) letting ε = 0.1 and initializing its state at random.Fig. 12 shows that, after few impacts, the observer (19) reconstructs the velocity and the restitution coefficients r 1 , r 2 , and r 3 with a negligible error.
Example 4: Consider the simplified model of a hopping robot [46] depicted in Fig. 13, which can be modeled as system (18a) with Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.Assuming that just the mass m 2 is subject to impacts with the boundary of the plane domain D, by the results given in Theorems 1 and 2, one has that the hybrid observer with the following continuous-time dynamics for t and subject to the following discrete-time dynamics:

C. Multiple Impact Straight Lines
In Section IV, it is assumed that the boundary of the plane domain D is described by a single constraint f (q) 0, where f (q) = 0 is the equation of a straight line.The main goal of this section is to show how to extend the hybrid observer (11) to the case, where the plane domain D is described by multiple constraints f k (q) 0, where f k (q) = 0 is the equation of a straight line, k = 1, . . ., M. To simplify the exposition, the case of only two constraints is considered in detail (i.e., M = 2), but the hybrid observer can be extended to deal with any finite number of constraints (see the subsequent Remark 11).The only required assumption is that there are no impacts at the points, where the two constraints are simultaneous satisfied with the = sign, because if there is an impact at a point q such that f 1 (q ) = 0, f 2 (q ) = 0 and J 1 (q ) = J 2 (q ) (where J k (q) = ∂f k (q) ∂q ), then the postimpact velocity is not determined uniquely by the preimpact velocity and the restitution coefficient.
Assume that the plane domain D within which the point mass moves is given by where α k ∈ [0, 2π) and f k,0 ∈ R are fixed constants, assumed unknown for the observer design, k = 1, 2. Let ∂D k denote the boundary of D k , k = 1, 2. Following the construction given in Section II, let , where r k ∈ (0, 1] is the restitution coefficient characterizing the nonsmooth impacts between the point mass and ∂D k , k = 1, 2, and let t i denote the ith time at which the point mass collides with the boundary of D. Following the same construction used in Section II, under the assumption U (q) = 0, the motion of the point mass is described by the continuous-time dynamics and is subject to the discrete-time dynamics , the following assumption is made throughout this section.Assumption 4: The impact times are known, and it is known whether the impact occurred with ∂D 1 or with ∂D 2 .Furthermore, the initial conditions and the control input of the system (5) are such that i) ∃v min > 0 such that J 1 v(t − i ) ≥ v min if the impact at time t i occurs with ∂D 1 and J 2 v(t − i ) ≥ v min if the impact at time t i occurs with ∂D 2 ; ii) ∃v max > 0 such that v(t − i ) ≤ v max ; iii) the solution of system (5) experiences an infinite sequence of jumps with a minimum dwell-time Δ T > 0; iv) each impact occurs either with ∂D 1 or with ∂D 2 (but not with both simultaneously); v) the sequences of consecutive impacts with ∂D 1 and with ∂D 2 are bounded.
Under Assumption 4, consider the hybrid observer whose continuous-time dynamics are given for all t ∈ (t i−1 , t i ) by update the estimates Ê1 , r1 , Ê2 , r2 of Z 1 , r 1 , Z 2 , and r 2 , respectively, according to if the current impact occurs with ∂D 1 , or according to if the current impact occurs with ∂D 2 .Note that the estimates Ê2 and r2 are not updated if the current impact occurs with ∂D 1 , whereas the estimates Ê1 and r1 are not updated if the current impact occurs with ∂D 2 .Let the state of the hybrid observer jump according to if the impact at time t i occurs with ∂D 1 , and according to if the impact at time t i occurs with ∂D 2 .Thus, consider the following theorem.Theorem 3: Let Assumption 4 hold.For any Δ q , Δ v > 0, there exists ε > 0 such that if q(0) − q(0) < Δ q , v(0) − v(0) < Δ v , and ε ∈ (0, ε ), then the estimation errors q(t) = q(t) − q(t), ṽ(t) = v(t) − v(t), and rj (t) = rj (t) − r, j = 1, 2, converge exponentially to zero as t → +∞.
Proof: Inspecting the proof of Proposition 1, under Assumption 1, in the limiting case ε → 0 + , one has that v(t . Taking into account the definitions of Ē and the expression used to obtain the estimate r, if the last impact occurred with ∂D 1 , then the estimates Ê1 and r1 obtained in (22b) converge to Z 1 and r 1 , respectively.Similarly, if the last impact occurred with ∂D 2 , then the estimates Ê2 and r2 obtained in (22c) converge to Z 2 and r 2 , respectively.Therefore, the statement follows as in Proposition 1.
Example 5: shows a simulation of system (21) with q(0) = 0 m and v(0) = A numerical simulation has been carried out to test the effectiveness of the hybrid observer (22) letting ε = 0.1 and initializing its state at random.The outcome of this simulation is shown in Fig. 16.As shown in such a figure, after few impacts, such a hybrid observer estimates both the state of the point Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
mass, the angles α 1 and α 2 , and the corresponding restitution coefficients.
Remark 11: If there are M > 2 constraints, the hybrid observer (22) can be modified as follows: introduce the estimates Êk and rk for each impact line i ∈ {1, . . ., M}.Then, for t ∈ (t i−1 , t i ), compute q, v, and ν as in (22a) and update the above estimates as where k is the constraint that originates the current impact.If the impact time t i is due to the kth constraint, update the state of the hybrid observer according to the discrete-time dynamics Using a reasoning wholly similar to the one used in the proof of Theorem 3, it can be easily deduced that if the sequence of impacts that do not occur with the kth line is bounded, then such a system is a semiglobal hybrid observer for the mechanical system.
A numerical simulation has been carried out to test the effectiveness of the hybrid observer given in Remark 11, letting ε = 0.1 and initializing its state at random.
As shown in Fig. 18 , after few impacts, such a hybrid observer estimates both the state of the point mass, the orientation of the boundaries of the plain domain D, and the corresponding restitution coefficients.

VII. CONCLUDING REMARKS
In this article, several hybrid observers have been proposed for the simultaneous estimation of the Cartesian velocity of the restitution coefficient, and of the orientation of the boundary for mechanical systems subject to nonsmooth impacts.Although during the flow motion the system dynamics are linear, the overall dynamics (including the discrete one at the impact times) are highly nonlinear (in particular, the superposition principle is not applicable); nevertheless, the performance of the proposed observers, shown in simulation and by experimental runs, is satisfactory.
The hybrid observers proposed in this work can be used directly to estimate the velocity and restitution coefficient for a class of hopping robots, such as the ones considered in [46] and [47], and for robotic jugglers, such as the ones considered in [48] and [49].On the other hand, since the scope of this article is limited to point masses that collide without rotation, the techniques proposed in this article cannot be directly applied to deal with more complex robotic systems, such as the biped robots considered in [3], [50], the snake robots analyzed in [51], and the quadruped robot studied in [52].
Possible future extensions are as follows: 1) Extend the analysis carried out in this article to the case of impacts with friction and rotation.Namely, by using tools wholly similar to those employed in the proof of Lemma 1, future work will address the problem of relating preimpact and postimpact velocities, thus enabling the application of tools similar to those given in this article to the robots considered in [3], [50], and [52].2) If the impacts are plastic [53], then the parameters r, α and f 0 are constant during the flow motion, but possibly subject to instantaneous jumps at the impact times.Since the proposed hybrid observer does not need the knowledge of these parameters, its use in case of plastic deformations seems to be promising.3) While for linear time-invariant systems, it is well known that the stabilization of equilibrium points can be based on independent design of a state feedback control law and of a state observer, in view of the separation principle, the extension of this concept to the nonlinear case has been proposed in case of particular nonlinearities (see, e.g., [54]); the peculiarities of the nonlinearities presented by an impacting system suggest that proving a sort of "separation principle" for impacting mechanical systems could be a fertile path for further research, also in view of possible extensions to other classes of hybrid nonsmooth dynamical systems.4) So far, experiments with multiple masses and multiple impact surfaces have not been carried out; the simulation results are encouraging and, therefore, we are planning to conduct such experiments in the future.The observers proposed in ( 9), ( 11), ( 16), (19), and ( 22) were designed assuming that the impact times are exactly measured in real time, although not known a priori.The experimental test reported in Section V showed that elementary experimental expedients (such as detecting impacts by the sound produced at collision times) may be sufficient in practice.Clearly, this is a strong hypothesis, and the study of how the performance of proposed observers is affected by measurement errors of the impact times is clearly important and deserves further study.A contribution on this particular aspect is provided in [55], where the design of observers for hybrid dynamical systems with approximately known jump times is considered.The approach proposed in [55] does not seem to be applicable to the case considered in this article, because Bernard and Sanfelice [55] assumed that the jump map is perfectly known, whereas in our case, although the structure of the jump map is known, there is a relevant uncertainty, due to the fact that the coefficient of restitution is not known.

Fig. 7 .
Fig. 7. Hardware used to carry out the real-time experiment.
)at the ith impact time is able to reconstruct v 1 , v 2 , and r.A numerical simulation has been carried out to test the observer(20), letting m 1 = 2 kg, m 2 = 0.2 kg, κ = 500 N m −1 , r = 0.8, ε = 0.01, and u = [m 1 g m 2 g] , with g = 9.81 m s −2 .The results of such a simulation are shown in Fig.14.As shown by such a figure, the observer (20) reconstructs the velocities of the two masses and the restitution coefficient after two impacts of the mass m 2 with the boundary of the plane domain D.