Implementation Issues for the Virtual Spring · 2017. 9. 20. · Implementation Issues for the...

14
Implementation Issues for the Virtual Spring * J. S. Freudenberg EECS 461 Embedded Control Systems 1 Introduction One of the tasks in Lab 4 is to attach the haptic wheel to a virtual reference position with a virtual spring, as depicted in Figure 1, where θ z denotes the angle of the haptic wheel, θ * z the angle of the reference position, k the torsional spring constant, and J the inertia of the combined haptic wheel/DC motor system. Students are asked to turn the wheel away from its reference position to an initial angle θ z (0), release it, and then observe the resulting behavior. Ideally, the released wheel should exhibit sustained oscillations of amplitude equal to θ z (0) and natural frequency determined by the values of k and J . In fact, the oscillations may die out or increase with time, and the observed frequency and amplitude may differ from their ideal values. In Lab 6 a virtual damper is added to the virtual spring, with the intention of making the system critically damped. Once again, the computed value of damping needed to achieve a monotonic response may differ from that found in the lab. It is the purpose of this set of notes to explore the difference between predicted and observed behavior by adopting more accurate models of the haptic wheel/virtual spring system than that depicted in Figure 1. θ z θ * z k J Figure 1: Haptic wheel with inertia J attached to reference position with virtual spring k. We shall use both common engineering units as well as SI units in these notes. For example, the spring constant k will be specified in units of N-mm/degree. However, the inertia of the wheel/motor will be given in terms of N-m/(radians/sec 2 ) = kg-m 2 /radian. 1 The units of these variables must be converted into consistent values before using them in mathematical formulas. * Revised September 20, 2017. 1 Because a radian is a dimensionless quantity, documentation sometimes refers to the units of inertia simply as kg-m 2 . An excellent description of a radian is found in https://en.wikipedia.org/wiki/Radian. 1

Transcript of Implementation Issues for the Virtual Spring · 2017. 9. 20. · Implementation Issues for the...

Page 1: Implementation Issues for the Virtual Spring · 2017. 9. 20. · Implementation Issues for the Virtual Spring J. S. Freudenberg EECS 461 Embedded Control Systems 1 Introduction One

Implementation Issues for the Virtual Spring∗

J. S. Freudenberg

EECS 461Embedded Control Systems

1 Introduction

One of the tasks in Lab 4 is to attach the haptic wheel to a virtual reference position with a virtual spring, asdepicted in Figure 1, where θz denotes the angle of the haptic wheel, θ∗z the angle of the reference position,k the torsional spring constant, and J the inertia of the combined haptic wheel/DC motor system. Studentsare asked to turn the wheel away from its reference position to an initial angle θz(0), release it, and thenobserve the resulting behavior. Ideally, the released wheel should exhibit sustained oscillations of amplitudeequal to θz(0) and natural frequency determined by the values of k and J . In fact, the oscillations may dieout or increase with time, and the observed frequency and amplitude may differ from their ideal values. InLab 6 a virtual damper is added to the virtual spring, with the intention of making the system criticallydamped. Once again, the computed value of damping needed to achieve a monotonic response may differfrom that found in the lab.

It is the purpose of this set of notes to explore the difference between predicted and observed behaviorby adopting more accurate models of the haptic wheel/virtual spring system than that depicted in Figure 1.

θz

θ∗z

k

J

Figure 1: Haptic wheel with inertia J attached to reference position with virtual spring k.

We shall use both common engineering units as well as SI units in these notes. For example, the springconstant k will be specified in units of N-mm/degree. However, the inertia of the wheel/motor will begiven in terms of N-m/(radians/sec2) = kg-m2/radian.1 The units of these variables must be converted intoconsistent values before using them in mathematical formulas.

∗Revised September 20, 2017.1Because a radian is a dimensionless quantity, documentation sometimes refers to the units of inertia simply as kg-m2. An

excellent description of a radian is found in https://en.wikipedia.org/wiki/Radian.

1

Page 2: Implementation Issues for the Virtual Spring · 2017. 9. 20. · Implementation Issues for the Virtual Spring J. S. Freudenberg EECS 461 Embedded Control Systems 1 Introduction One

2 Models of the Haptic Wheel

We now study three models of the haptic wheel/DC motor system. Each of these will be useful to ouranalysis: the simpler models more readily lend themselves to analysis, and the more complex models bettercapture system behavior. Which model we use in a given situation will depend on the phenomenon we aretrying to describe.

2.1 Double Integrator Model

In principle, attaching the wheel to a reference using a spring will result in a harmonic oscillator having botha physical component (the haptic wheel), and a virtual component (the spring). Indeed, Newton’s laws forrotary motion imply that the haptic wheel will accelerate in response to applied torque τ

Jθ̈z = τ, (1)

and thus the transfer function from torque τ to wheel angle θz is a double integrator:

G(s) = 1/Js2. (2)

Hooke’s law for an ideal spring states that the reaction torque is given by

τ = −k(θz − θ∗z). (3)

Together (1) and (3) imply thatJθ̈z + kθz = kθ∗z . (4)

Students will recognize (4) as the differential equation of an undamped harmonic oscillator. Hence thecombination of the haptic wheel and virtual spring is a harmonic oscillator with natural frequency ωn =

√k/J

radians/second, or fn = ωn/2π Hz2. According to this model, if we turn the haptic wheel to an initial angle,and then release it, it will oscillate indefinitely.

The differential equation (4) can be expressed as the block diagram in Figure 2, showing that the hapticwheel/virtual spring may be viewed as a feedback system with input equal to the reference position θ∗z . Thetransfer function from θ∗z(s) to θz(s) is given by θz(s) = GCL(s)θ∗z(s), where

GCL(s) =kG(s)

1 + kG(s)

=k

Js2 + k. (5)

1/s 1/s

θz

θz

.

Σ k 1/J

-

θz* τ

G(s)

Figure 2: Block diagram showing haptic wheel/virtual spring as a feedback system.

Example 1 (ETH Zurich) The value of inertia for the haptic wheel has two contributions, one from thewheel itself, given by Jz = 2.8 × 10−4 N-m/(rad/sec2), and one from the motor driving the wheel, givenby Jm = 1.7 × 10−4 N-m/(rad/sec2), for a total inertia of J = 4.5 × 10−4 N-m/(rad/sec2). In Lab 4 youare asked to implement a virtual spring with a spring constant of k = 50 N-mm/degree, and compute thenatural frequency, fn Hz, of the resulting harmonic oscillator. �

2For an excellent discussion of the difference between radians/second and Hz, seehttps://en.wikipedia.org/wiki/Radian per second

2

Page 3: Implementation Issues for the Virtual Spring · 2017. 9. 20. · Implementation Issues for the Virtual Spring J. S. Freudenberg EECS 461 Embedded Control Systems 1 Introduction One

2.2 Second Order Model with Damping

In reality, the model of the haptic wheel/virtual spring described in Section 2.1 is too simplistic because themotor has a significant amount of inherent damping that will cause the oscillations to decay to zero. A morerealistic model that includes the damping is depicted in Figure 3, and described by the differential equation

Jθ̈z + bmθ̇z = τ, (6)

where bm denotes damping inherent in the DC motor. The transfer function from torque to wheel anglecorresponding to (6) is given by

G2(s) =1

s(Js+ bm). (7)

1/s 1/sθz

θz

.

Σ k 1/J

-

θz*

τΣ

-

bm

Figure 3: Haptic wheel with inertia J attached to reference position with virtual spring k and damping bm.

With reaction torque given by (3), the closed loop response in Figure 3 has transfer function

GCL2 (s) =kG2(s)

1 + kG2(s)

=k/J

s2 + bms/J + k/J. (8)

If the damping term in Figure 3 is sufficiently small, then one would expect the resulting closed loop system(8) to possess a pair of lightly damped poles near the frequency of the resonant poles whose locations werecomputed in Section 2.1. Denote these poles by

p± = −ζωn ± ωnj√

1− ζ2. (9)

The time responses associated with the poles p± are given by

e−ζωnte±jωn

√1−ζ2t, (10)

and with thus decay with time constant 1/ζωn, and oscillate with damped natural frequency given by (inHz)

fd = fn√

1− ζ2. (11)

Note that, for ζ sufficiently small, the closed loop system will exhibit lightly damped oscillations withfrequency fd ≈ fn.

Example 2 (ETH Zurich) The value of motor damping is bm = 0.0013 N-m/(radians/sec). The value ofdamping coefficient may be determined from the equation 2ζωn = bm/J , where ωn =

√k/J radians/second,

yielding ζ = 0.0181. It follows that the the damped natural frequency is only slightly less than that for theundamped system. �

3

Page 4: Implementation Issues for the Virtual Spring · 2017. 9. 20. · Implementation Issues for the Virtual Spring J. S. Freudenberg EECS 461 Embedded Control Systems 1 Introduction One

2.3 Fourth Order Model with Shaft Compliance

The model of the haptic wheel discussed in Section 2.2 is overly simplistic because it ignores the fact thatthe shaft to which the wheel is mounted is compliant and has a resonance, or lightly damped pair of complexpoles. To explain, denote the angle measured by the encoder by θe, and note that θe will generally differfrom θz due to shaft compliance with spring constant kc and damping bc. Then the wheel/motor system isfourth order, and satisfies the differential equations

Jmθ̈e + bmθ̇e + kc(θe − θz) + bc(θ̇e − θ̇z) = τ (12)

Jz θ̈z + kc(θz − θe) + bc(θ̇z − θ̇e) = 0, (13)

with transfer function from torque τ to encoder angle θe given by

G4(s) =Jzs

2 + bcs+ kc(Jms2 + (bm + bc)s+ kc) (Jzs2 + bcs+ kc)− (bcs+ kc)2

. (14)

Consider the feedback system obtained by replacing G(s) in Figure 2 by G4(s), and applying the reactiontorque

τ = −k(θe − θ∗z). (15)

Denote the resulting closed loop transfer function form θ∗z to θe by

GCL4 (s) =kG4(s)

1 + kG4(s). (16)

Example 3 (ETH Zurich) The damping and spring constant for the shaft compliance are given by bc =0.01 N-m/(radian/sec) and kc = 500 N-m/sec, respectively.

Bode plots of the three open loop models (2), (7), and (14) are found in Figure 4. Note that the effectof the neglected damping on the Bode plot occurs at low frequencies, while that of the neglected resonanceis at a much higher frequency, approximately 350 Hz. Hence if the target frequency of oscillation is at afrequency well below 350 Hz, the 4th order model should exhibit decaying oscillations with approximatelythe same frequency as that predicted by the 2nd order model.

The corresponding closed loop Bode plots for the three models, (5), (8), and (16), are found in Figure 5.As we expect, the two system models that include damping have lightly damped poles with approximatelythe same natural frequency as that of the double integrator system, for which the poles are on the imaginaryaxis.

Finally, the closed loop responses of both the three systems (5), (8), and (16) to an initial haptic wheeldisplacement θz(0) = 20◦ are shown in Figure 6. �

3 Digital Implementation Effects

The preceding analysis has completely neglected the effects of the digital implementation of the virtualspring. For example, we have ignored the effects of time sampling and encoder quantization, the fact thatwe use PWM rather than a linear input, and the fact that the applied torque must satisfy saturation limits.

We now study the effect of one of these implementation effects, specifically that of time sampling. InLab 4 we update the encoder angle and the reaction torque in an untimed loop. However, we can measure anaverage value of the sample time in the lab, and use this value to determine the effects of sampling. In Lab 6we use an interrupt routine to read the encoder and provide a specified time step with which to performthese tasks.

3.1 Sampling and the Double Integrator Model

We shall first analyze this effect for the second order model that neglects damping, as shown in Figure 7.

4

Page 5: Implementation Issues for the Virtual Spring · 2017. 9. 20. · Implementation Issues for the Virtual Spring J. S. Freudenberg EECS 461 Embedded Control Systems 1 Introduction One

−100

−50

0

50

100

150

200

Magnitude (

dB

)

10−2

10−1

100

101

102

103

−360

−270

−180

−90

Phase (

deg)

3 open loop mode ls for haptic whee l/motor

Frequency (Hz)

GG 2G 4

Figure 4: Bode plots of the double integrator, 2nd order damped, and 4th order plant models, ETH Zurichdata.

−100

−50

0

50

100

150

Magnitude (

dB

)

10−2

10−1

100

101

102

103

−360

−270

−180

−90

0

Phase (

deg)

3 c losed loop mode ls for haptic whee l/motor

Frequency (Hz)

GC L

GC L2

GC L4

Figure 5: Closed loop Bode plots for the double integrator, 2nd order damped, and 4th order plant models,ETH Zurich data.

5

Page 6: Implementation Issues for the Virtual Spring · 2017. 9. 20. · Implementation Issues for the Virtual Spring J. S. Freudenberg EECS 461 Embedded Control Systems 1 Introduction One

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2−20

0

20

response to init ial displacement θz 0 = 20◦

Time (seconds)

Am

plit

ud

e

GC L(s)

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2−20

0

20

Time (seconds)

Am

plit

ud

e

GC L2 (s)

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2−20

0

20

Time (seconds)

Am

plit

ud

e

GC L4 (s)

Figure 6: Closed loop response to initial displacement θz(0) = 20◦ for the double integrator, 2nd orderdamped, and 4th order plant models, ETH Zurich data.

θz(t)

Σ k-

θz*(kT) τ

G(s)T

ZOH

Gd(z)

θz(kT)

Figure 7: Sampled-data system.

6

Page 7: Implementation Issues for the Virtual Spring · 2017. 9. 20. · Implementation Issues for the Virtual Spring J. S. Freudenberg EECS 461 Embedded Control Systems 1 Introduction One

Consider an analog plant with transfer function G(s) followed by a sampler with period T and precededby a Zero Order Hold (ZOH). It is a standard result in control textbooks3 that the transfer function of theresulting discrete time system is given by

Gd(z) = (1− z−1)Z{ST{L−1

{G(s)

s

}}}, (17)

where Z, L, and ST denote the z transform, Laplace transform, and sampling operators, respectively4.Applying (17) to (2) yields

Gd(z) =1

J

T 2

2

z + 1

(z − 1)2(18)

The closed loop transfer function from reference position to wheel angle in Figure 7 is thus given by

GCLd (z) =kGd(z)

1 + kGd(z)

=kT 2(z + 1)

2Jz2 + (kT 2 − 4J)z + (2J + kT 2). (19)

Define α , (k/J)(T 2/2) and note that α = ω2nT

2/2. Then (19) reduces to

GCLd (z) =α(z + 1)

z2 + (α− 2)z + (1 + α). (20)

One may show that the closed loop system will be unstable for any value of sample time T . Indeed, let p1and p2 denote the closed loop poles. Then (z−p1)(z−p2) = z2−(p1+p2)z+p1p2, and thus p1p2 = 1+α > 1.It follows that at least one of p1 and p2 must lie outside the closed unit circle.

Solving for the pole locations yields

p1,2 = 1− ω2nT

2

4± jωnT

√1− ω2

nT2/16. (21)

Suppose that T is sufficiently small that ω2nT

2/16 ≤ 1. Then it may be verified that

|p1,2|2 = 1 +ω2nT

2

2, (22)

and thus that the system is unstable even for small values of sample time, such as those observed in Lab 4.

3.2 Sampling and the 2nd Order Model with Damping

In fact, instability may not be observed when implementing a virtual spring in Lab 4. The reason is thedamping in the motor that we discussed in Section 2.2. Rewrite the damped second order model (7) as

G2(s) =1

bm

bm/J

s(s+ bm/J), (23)

and define the parameters

a , bm/J

k0 , 1/bm

c ,1− e−aT − aTe−aT

aT − 1 + e−aT

k1 , k0(aT − 1 + e−aT )

a.

3For example, see Chapter 8 of G. F. Franklin, J. D. Powell, A. Emami-Naeini, Feedback Control of Dynamic Systems,5th ed., Pearson Prentice Hall, 2006.

4This expression is often abbreviated Gd(z) = (1− z−1)Z {G(s)/s}.

7

Page 8: Implementation Issues for the Virtual Spring · 2017. 9. 20. · Implementation Issues for the Virtual Spring J. S. Freudenberg EECS 461 Embedded Control Systems 1 Introduction One

Then applying (17) yields the discrete model

G2d(z) = k1(z + c)

(z − 1)(z − e−aT ). (24)

The feedback system in Figure 3 becomes

GCL2d (z) =kG2d(z)

1 + kG2d(z)

=kk1(z + c)

z2 + z(kk1 − 1− e−aT ) + (kk1c+ e−aT ). (25)

Examples show that the system (25) may be stable for sufficiently small values of sample time.

Example 4 (ETH Zurich) For a sample time T = 1 msec, it may be verified numerically that the polesof (25) lie outside the unit circle in the z-plane, and thus the discretized system is unstable.

For a sample time T = 0.1 msec, on the other hand, the poles lie strictly inside the unit circle, and thusthe system will display decaying oscillations. To illustrate, the response to an initial condition θz(0) = 20◦ isplotted in Figure 8, and we see that the inherent damping is sufficient to overcome the destabilizing effectsof the sampled-data controller implementation. �

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2−20

−15

−10

−5

0

5

10

15

20

Response to Initial Conditions

Time (seconds)

hapticwheelangle,degre

es

GC L

2d (z )

Figure 8: Response to initial displacement θz(0) = 20◦ for the system (25) with T = 0.0001 second.

3.3 Damping to Exactly Offset the Sampled-Data Instability

It is interesting to compute the amount of motor damping that would exactly offset the destabilizing effectsof the sampled-data implementation for a given value of sample time T . (Of course, we cannot in practicevary the motor damping.) As we shall see, the equations involved are too complicated to exactly computethis value; however, for small values of T we can make a reasonable approximation.

The closed loop poles are the roots of the denominator polynomial in (25). To have complex poles lyingon the stability boundary it is necessary that the constant coefficient of this polynomial, which is equal to

8

Page 9: Implementation Issues for the Virtual Spring · 2017. 9. 20. · Implementation Issues for the Virtual Spring J. S. Freudenberg EECS 461 Embedded Control Systems 1 Introduction One

the product of the poles, be equal to one: kk1c + e−aT = 1. Substituting the definitions of the parametersk1 and c yields

kk0a

(1− e−aT − aTe−aT

)+ e−aT = 1. (26)

For small values of T , the equation (26) may be approximated using e−aT ≈ 1− aT + a2T 2/2, yielding

kk0a

(1− (1− aT + a2T 2/2)− aT (1− aT + a2T 2/2)

)+ (1− aT + a2T 2/2) =

kk0a

(a2T 2/2− a3T 3/2

)+ (1− aT + a2T 2/2) ≈ 1 (27)

Subtracting 1 from both sides of (27), dividing through by T , and keeping only first order terms yields

kk0T

2≈ 1. (28)

Finally, substituting k0 = 1/bm shows that the necessary condition (26) for the discrete system to be a stableoscillator is (approximately) that the motor damping satisfies

bm =kT

2. (29)

Of course we cannot vary the motor damping; however, we could think of adding additional virtual dampingto that the sum of motor damping bm and virtual damping b satisfies (29). In the next section, we addvirtual damping for a different purpose.

4 Critical Damping

We have seen previously that the effect of the damping bm present in the wheel/motor model causes thepredicted oscillations to decay with time. Using a simple model of the motor, we can compute the amountof additional virtual damping that must be added to the system in order to make the response to an initialdisplacement critically damped. As you recall, critical damping is the smallest value of damping for whichthe response of a system converges monotonically to its final position, exhibiting no oscillations or overshoot.

To make the computations tractable, we will work with G2(s), the 2nd order model of the wheel/motorsystem that includes the motor damping that is described in (6). Next, we add a damping term to ourtorque computation, yielding

τ = −k(θz − θ∗z)− bθ̇z (30)

Applying (30) to (6) yieldsJθ̈z + (bm + b)θ̇z + kθz = kθ∗z ,

and the closed loop transfer function from θ∗z to θz is given by

GCL2 =k/J

s2 + ((bm + b)/J)s+ k/J. (31)

Comparing the denominator of (31) to the standard parameterization s2+2ζωns+ω2n, we see that ωn =

√k/J

and

ζ =bm + b

2

1√kJ

. (32)

For critical damping we must set (32) equal to one; doing so and solving for b yields

b = 2√kJ − bm. (33)

Example 5 Figure 9 shows the response of the haptic wheel to an initial angle displacement θz(0) = 20◦

with critical damping (33). As predicted, the wheel angle returns monotonically to zero.�

9

Page 10: Implementation Issues for the Virtual Spring · 2017. 9. 20. · Implementation Issues for the Virtual Spring J. S. Freudenberg EECS 461 Embedded Control Systems 1 Introduction One

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

2

4

6

8

10

12

14

16

18

20

Response to Initial Conditions

Time (seconds)

Am

plit

ude

Figure 9: Response of the haptic wheel to initial angle displacement with critical damping: b = 2√kJ − bm.

5 Torque Saturation

Recall that we impose a limit on the duty cycle of the PWM signal in order to avoid excessively large torqueinputs. Hence if you test the virtual spring by turning the haptic wheel too far before releasing it, the desiredtorque value may not be achievable. As a result, you may not see the expected oscillation frequency untilthe amplitude of the oscillations have decayed sufficiently.

Consider the feedback system in Figure 10, where the limit on the commanded torque value is modeledas a saturation nonlinearity with limit δ:

τsat =

δ, τ > δτ, |τ | ≤ δ−δ, τ < −δ

(34)

1/s 1/sθz

θz

.

Σ k 1/J

-

θz* τ τ

sat

Figure 10: Haptic wheel with inertia J attached to reference position with virtual spring k and torquesaturation.

To understand the effect of the saturation, suppose we turn the wheel to an initial angle θz(0) and releaseit. With no loss of generality, we assume that the reference positions is θ∗z = 0, and thus that the initialreaction torque is given by τ = −kθz(0). If θz(0) is sufficiently small that |τ | ≤ δ, then the wheel willoscillate with frequency fn =

√k/J/2π Hz and amplitude θz(0). Otherwise, if |τ | > δ, the magnitude of the

10

Page 11: Implementation Issues for the Virtual Spring · 2017. 9. 20. · Implementation Issues for the Virtual Spring J. S. Freudenberg EECS 461 Embedded Control Systems 1 Introduction One

torque applied to the wheel will be equal to the saturation limit, and it is difficult to determine what effectthis will have on the motion of the wheel.

To analyze the effect of torque saturation, we will use a technique from nonlinear control termed describingfunction analysis5. This technique is based on several assumptions, and at most will yield only approximateresults. We shall gloss over these assumptions, and merely discuss the steps required to perform the analysis,which as it happens works fairly well in this application.

To apply describing function analysis, we suppose that the haptic wheel is oscillating periodically withperiod fn Hz and amplitude θmaxz . Then it follows that torque is also oscillating with period fn Hz andamplitude

A = kθmaxz . (35)

The describing function associated with the torque nonlinearity (34) is a function of both the saturationlimit δ and the amplitude A given by (35)

N(A) =

{1, A/δ ≤ 1

(2/π)(

arcsin(δ/A) + (δ/A)√

1− (δ/A)2), A/δ > 1.

(36)

and is plotted as a function of A/δ in Figure 11.

0 1 2 3 4 5 6 7 8 9 100

0.2

0.4

0.6

0.8

1

A/δ

N(A

/δ)

Figure 11: Normalized describing function (36) of saturation nonlinearity (34).

Suppose that the torque applied to the wheel is oscillating with amplitude A. Then, using describingfunction analysis, the frequency of oscillations may be estimated by replacing the saturation in Figure 10 bya constant gain with value N(A). The closed loop transfer function corresponding to (5) is now given by

GCLsat(s) =kN(A)

Js2 + kN(A). (37)

The poles of the transfer function lie at s = j√kN(A)/J , corresponding to a natural frequency

fn =√kN(A)/J/2π Hz. (38)

5A good introduction is found in Chapter 7 of H. K. Khalil, Nonlinear Systems, 3rd ed., Prentice Hall, 2002.

11

Page 12: Implementation Issues for the Virtual Spring · 2017. 9. 20. · Implementation Issues for the Virtual Spring J. S. Freudenberg EECS 461 Embedded Control Systems 1 Introduction One

Clearly, if A ≤ δ then N(A) = 1, and the frequency of oscillations is identical to that without the saturation.Otherwise, if A > δ, then it follows from Figure 11 that N(A) < 1, and thus (38) predicts that the effect ofthe saturation will be a lower oscillation frequency.

Example 6 (ETH Zurich) For the ETH Zurich haptic wheel, torque saturates at δ = 0.835 Nm. Theassociated non-normalized describing function is plotted in Figure 12.

Suppose we turn the wheel to an initial angle θz(0) and release it. With no saturation present, the wheelwill oscillate with a frequency fn = 12.7 Hz that is independent of the initial angle displacement, and torquewill oscillate with the same frequency, achieving a maximum amplitude A = kθz(0) Nm, where k = 0.05Nm/degree.

If the saturation nonlinearity is present, the applied torque will saturate unless kθz(0) < 0.835, orθz(0) < 16.7◦. For three different values of θz(0) that result in saturation, Table 1 collects the valuesof torque amplitude A (34), the resulting value of the describing function N(A) (36), and the frequencyof oscillation predicted by (38). Note that a 90◦ initial displacement results in oscillations withfrequencyapproximately half that observed when no saturation is present.

0 1 2 3 4 5 60

0.2

0.4

0.6

0.8

1

A

N(A

)

δ =0.835

N (A)40◦

60◦

90◦

Figure 12: Describing function (36) of saturation nonlinearity of ETH wheel, with δ = 0.835 Nm.

θz(0) A Nm N(A) fn Hz

40◦ 2 0.52 9.160◦ 3 0.35 7.590◦ 4.5 0.24 6.2

Table 1: Initial wheel displacement θz(0), maximum torque A (34), describing function N(A) (36), andpredicted frequency of oscillation fn (38).

We now simulate the effect of the saturation nonlinearity using the 2nd order model with dampingdescribed in Section 2.2. Because of the damping, the oscillations that result from an initial displacement

12

Page 13: Implementation Issues for the Virtual Spring · 2017. 9. 20. · Implementation Issues for the Virtual Spring J. S. Freudenberg EECS 461 Embedded Control Systems 1 Introduction One

that causes torque saturation will eventually decay, and torque will come off saturation. The initial oscillationfrequency should thus be smaller than if the saturation were not present; the frequency should increase tothe theoretical value without saturation as the amplitude of the oscillations decays.

Example 7 (ETH Zurich) For an initial angle displacement θz(0) = 90◦ plots commanded and actualtorque are plotted in Figure 13.

0 0.5 1 1.5 2 2.5 3 3.5 4−5

−4

−3

−2

−1

0

1

2

3

4

5

t ime , seconds

torq

ue,N-m

θz(0) =90◦

commanded torquesaturated torque

Figure 13: Commanded vs saturated torque, θz(0) = 90◦.

The resulting wheel angle θz(t) is plotted in Figure 14.Figure 15 shows in detail the initial and final portion of the wheel oscillations. Note that, as predicted,

the initial oscillations have frequency 7 Hz, and increase to 12 Hz as they decay in amplitude.�

13

Page 14: Implementation Issues for the Virtual Spring · 2017. 9. 20. · Implementation Issues for the Virtual Spring J. S. Freudenberg EECS 461 Embedded Control Systems 1 Introduction One

0 0.5 1 1.5 2 2.5 3 3.5 4−100

−80

−60

−40

−20

0

20

40

60

80

100

θz(0) =90◦

t ime , seconds

hapticwheelangle,degre

es

Figure 14: Haptic wheel angle, θz(0) = 90◦.

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1−100

−50

0

50

100

time, seconds

θz(0) =90◦

θz ,saturated

3 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4−3

−2

−1

0

1

2

3

θz(0) =90◦

time, seconds

θz , unsaturated

Figure 15: Detail of haptic wheel angle, θz(0) = 90◦.

14