A HYBRID SYSTEM APPROACH TO IMPEDANCE AND ADMITTANCE CONTROL By Frank Mathis A THESIS Submitted to Michigan State University in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE Mechanical Engineering 2012 ABSTRACT A HYBRID SYSTEM APPROACH TO IMPEDANCE AND ADMITTANCE CONTROL By Frank Mathis Impedance Control and Admittance Control are two different implementation methods that are used to achieve the same control objective of producing a desired relationship between applied force and displacement of a robotic system interacting with an environment. Due to the difference in implementation method, impedance control and admittance control have complementary performance and stability characteristics. Impedance control is stable for all contact environment stiffness and has good performance for stiff environments, but results in poor performance during interaction with soft environments. Admittance control results in good performance during interaction with soft environments but results in either poor performance and or unstable behaviour during interaction with stiff environments. We use a hybrid system framework to propose a family of controllers that attempt to interpolate the stability and performance characteristics of impedance control and admittance control. The advantages of this approach are first demonstrated through analysis and simulations of a single degree-of-freedom rigid linear model. The methodology is then extended to multi degree-of-freedom linear and non-linear models and single degree-of-freedom system with flexibility. Experimental results with a lightweight robotic arm are presented to demonstrate the usefulness of the approach. ACKNOWLEDGMENTS I would like to thank Dr. Christian Ott for his mentorship, patience, and support during this project. I would also like to thank my advisor, Dr. Ranjan Mukherjee, for his support, his patience, and his guidance throughout this work. Thanks to Wieland Bertleff for his help in setting up the experiments. Finally, I would like to thank the Deutsches Zentrum f¨r Luft- und Raumfahrt, DLR, u for the funding that they provided for this work as well as the use of their equipment. iii TABLE OF CONTENTS . . . . . . . . . . . . . . . . . . vi 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 List of Figures . . . . . . . . . . . . . 2 Background . . . . . . . . . . . . 2.1 Problem Statement . . . . . . 2.2 Impedance Control . . . . . . 2.3 Admittance Control . . . . . . 2.4 Motivation for Hybrid Control 2.5 Hybrid Framework . . . . . . 2.6 Stability . . . . . . . . . . . . 2.7 Stability of Nominal Plant . . 2.8 Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 5 7 7 8 10 13 15 18 3 Preliminary Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Comparison of Additive Control . . . . . . . . . . . . . . . . . . . . 3.3 Stability of Nominal Plant . . . . . . . . . . . . . . . . . . . . . . . 3.4 Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 Change of Switching Conditions . . . . . . . . . . . . . . . . . . . . 3.5.1 Matching Eigenvalues . . . . . . . . . . . . . . . . . . . . . . 3.5.2 Minimizing Discrete Difference Between Desired and Actual haviour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6 Linear Separation of External Force in Switching Condition . . . . . 3.6.1 Derivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 . . . 27 . . . 31 . . . 34 . . . 36 . . . 38 . . . 43 Be. . . 44 . . . 45 . . . 45 4 N-DOF Rigid Joint Models . 4.1 Linear N-DOF . . . . . . . . 4.1.1 Equations of Motion 4.1.2 Impedance Control . 4.1.3 Admittance Control 4.1.4 Hybrid Framework . 4.1.5 Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 . 56 . 56 . 57 . 58 . 58 . 63 4.2 Non-linear N-DOF Model . . 4.2.1 Equations of Motion . 4.2.2 Impedance Controller . 4.2.3 Admittance Controller 4.2.4 Hybrid Framework . . 4.2.5 Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 64 65 65 66 71 5 Flexible Joint Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 Linear 1-DOF Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.1 Equations of Motion . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.2 Passive Impedance Controller . . . . . . . . . . . . . . . . . . . . 5.1.3 Admittance Controller . . . . . . . . . . . . . . . . . . . . . . . . 5.1.4 Hybrid Framework . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.5 Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.6 Simulations and Performance . . . . . . . . . . . . . . . . . . . . 5.2 Change of Switching Conditions . . . . . . . . . . . . . . . . . . . . . . . 5.2.1 Matching Eigenvalues . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.2 Minimizing Discrete Difference Between Desired and Actual Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.2.1 Choosing Desired Behavior based on Passive Impedance 5.2.2.2 Choosing Desired Behavior based on Rigid Impedance . 5.2.2.3 Choosing Desired Behavior based on Combination of Passive and Rigid Impedance . . . . . . . . . . . . . . . . . 5.3 Linear Separation of External Force in Switching Condition . . . . . . . . 5.3.1 Derivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 74 74 75 78 80 84 85 91 97 6 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1 Experimental Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Results for Desired Response Equal to Passive Impedance . . . . . . . . . 6.3 Results for Desired Response Equal to Combination of Passive Impedance and Rigid Impedance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 98 100 102 103 103 114 115 119 128 7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 LIST OF FIGURES Figure 2.1 A single degree-of-freedom mass interacting with the environment 5 Figure 2.2 Qualitative illustaration of the performance of impedance control and admittance control for different environment stiffness . . . . 9 Stability boundaries for hybrid impedance and admittance control for different values of δ . . . . . . . . . . . . . . . . . . . . . 16 Stability boundaries for hybrid impedance and admittance control for δ values 10 ms, 20 ms, 30 ms, and 40 ms . . . . . . . . 17 Figure 2.5 Soft Contact position response for δ = 50 ms and n = 0.9 . . . . 18 Figure 2.6 Soft contact position response for δ = 50 ms and n = 0.1 . . . . 19 Figure 2.7 Soft contact position response for δ = 50 ms and n = 0.5 . . . . 20 Figure 2.8 Soft Contact position response for δ = 50 ms and a range of n values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Figure 2.9 Stiff contact position response for δ = 50 ms and n = 0.9 . . . . 22 Figure 2.10 Stiff contact position response for δ = 50 ms and n = 0.1 . . . . 23 Figure 2.11 Stiff contact position response for δ = 50 ms and n = 0.5 . . . . 24 Figure 2.12 Stiff contact position response for δ = 50 ms and a range of n values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Stability boundaries for convex combination of impedance and admittance control . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Figure 2.3 Figure 2.4 Figure 3.1 vi Figure 3.2 Stability boundaries for hybrid impedance and admittance control for δ = 10 ms and Kp = 10000 N/m . . . . . . . . . . . . . 34 Stability boundaries for hybrid impedance and admittance control for δ = 60 ms and Kp = 10000 N/m . . . . . . . . . . . . . 35 Soft contact position response for Kp = 10000 N/m, δ = 50 ms, and n = 0.9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Soft contact position response for Kp = 10000 N/m, δ = 50 ms, and n = 0.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Figure 5.1 Single degree-of-freedom flexible joint model . . . . . . . . . . . 74 Figure 5.2 Single degree-of-freedom passive impedance for flexible joint model 76 Figure 5.3 Soft contact position response for δ = 50 ms and n = 0.1 . . . . 86 Figure 5.4 Soft contact position response for δ = 50 ms and n = 0.5 . . . . 87 Figure 5.5 Soft contact position response for δ = 50 ms, and n = 0.9 . . . . 88 Figure 5.6 Stiff contact position response for δ = 50 ms and n = 0.1 . . . . 89 Figure 5.7 Stiff contact position response for δ = 50 ms and n = 0.5 . . . . 90 Figure 5.8 Stiff contact position response for δ = 50 ms and n = 0.9 . . . . 91 Figure 6.1 Photo of Experimental Setup . . . . . . . . . . . . . . . . . . . . 114 Figure 6.2 Reference Diagram of Experimental Set-up . . . . . . . . . . . . 115 Figure 6.3 Free Space Hybrid Response for Different n values with δ = 25 ms, and using the passive impedance as the desired behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 Figure 6.4 Free Space Hybrid Response for Different n values with δ = 25 ms, and using the passive impedance as the desired behavior ignoring gravity . . . . . . . . . . . . . . . . . . . . . . . . . 121 Figure 3.3 Figure 3.4 Figure 3.5 vii Figure 6.5 Soft contact position response for δ = 25 ms, n = 1, and varying Kpa values while using passive impedance controller for desired behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 Figure 6.6 Soft contact position response for δ = 25 ms, Kpa = 0.005, and varying n while using passive impedance controller for desired behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Figure 6.7 Hard contact position response for δ = 25 ms, n = 1, and varying Kpa while using passive impedance controller for desired behavior 125 Figure 6.8 Hard contact position response for δ = 25 ms, Kpa = 0.005 and varying n while using passive impedance controller for desired behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Figure 6.9 Hard contact position response for δ = 25 ms, Kpa = −0.005, and varying n while using passive impedance controller for desired behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 Figure 6.10 Free Space Hybrid Response for Different n values with δ = 25 ms, and using a combination of passive impedance and rigid impedance as the desired behavior . . . . . . . . . . . . . . . . . 129 Figure 6.11 Free Space Hybrid Response for Different n values with δ = 25 ms, and using a combination of passive impedance and rigid impedance as the desired behavior while ignoring gravity . . . . 130 Figure 6.12 Soft contact position response for δ = 25 ms, n = 1, and varying Kpa values while using a combination of passive impedance and rigid impedance as the desired behavior . . . . . . . . . . . . . . 131 Figure 6.13 Soft contact position response for δ = 25 ms, Kpa = 0.005, and varying n while using a combination of passive impedance and rigid impedance as the desired behavior . . . . . . . . . . . . . . 132 Figure 6.14 Hard contact position response for δ = 25 ms, n = 1, and varying Kpa while using a combination of passive impedance and rigid impedance as the desired behavior . . . . . . . . . . . . . . . . . 134 Figure 6.15 Hard contact position response for δ = 25 ms, Kpa = 0.005 and varying n while using a combination of passive impedance and rigid impedance as the desired behavior . . . . . . . . . . . . . . 135 viii Figure 6.16 Hard contact position response for δ = 25 ms, Kpa = −0.005 and varying n while using a combination of passive impedance and rigid impedance as the desired behavior . . . . . . . . . . . 136 ix Chapter 1 Introduction Most popular implementations for industrial robots are restricted to tasks which involve little to no exchange of mechanical energy between the end-effector and the environment. Instead they require precise position controls, such as in welding, painting, and pick and place operations. The first control method is called “Hybrid Position and Force Control” and was developed by Raibert and Craig [23]. In hybrid position and force control the control input is decomposed into two orthogonal subsets, one subset for position control and one subset for force control. The force control subset is used to control the desired force of interaction of the end effector with the environment in certain directions, and the position control subset is used to control the position of the effector in the remaining directions. However, because the subsets of the control method are orthogonal, and dynamic coupling between the position of the effector and the force from the environment is not considered, it is not possible to accurately control either the end effector force or position. The compliance control method proposed by Mason is a variation of the 1 hybrid position and force control method [14] and sufferes from the same drawbacks as “Hybrid Position and Force Control”. The second control method was proposed by Hogan and is known as “Impedance Control” [8]. In impedance control, the mechanical impedance of the manipulator is controlled to match that of a desired model. Therefore, impedance imposes a relationship between the position of the effector and the force produced by the environment, and provides a unifying methodology for all tasks ranging from motion in free-space to dynamic interaction with an environment. Strategies that combine impedance control and hybrid position and force control have also been proposed. Anderson and Spong [3] proposed a method that uses feedback linearization as an inner loop. For the outer loop, they used a hybrid position and force type controller which uses impedance control instead of position control. Liu and Goldenberg [12] proposed a robust method for hybrid position and force control, it uses impedance control in the position control subspace, and an inertia normalization and damping in the force control subspace. A PI controller is used to achieve robustness, and the controller was implemented on a two degree of freedom direct drive robot. The impedance control method may be implemented in one of two ways. Although Hogan [8] refers to both methods as impedance control, we make the distinction between the two. In the first method of implementation, which are referred to as “Impedance Control”, the control force is derived from the desired mechanical impedance between the end efector position and force exerted between the end effector and the environment. The second implementation method is referred to as “Admittance Control” wherein the control input is a position controller that drives the end effector to the resulting 2 mechanical admittance derived from the desired relationship between the force produced by the environment and the end-effector. Stability properties of impedance control and admittance control are discussed in [10]. Robotic systems controlled with impedance control typically have more stable dynamics when interacting with stiff environments, but have poor accuracy in free space when compared to admittance control. The accuracy problem of impedance control may be mitigated through hardware modifications such as low-friction joints and direct-drive actuators. Impedance control has been implemented ATR’s Humanoid built by Sarcos [4] and in DLR’s light-weight robot using inner loop torque sensing and control [18] as well in the Phantom haptic device using low-friction joints and low inertias. Admittance control has complementary characteristics of impecance control and has high accuracy in free-space, but can result in instability when implemented with high contact stiffness. To improve stability characteristics, admittance control is implemented together with series elastic actuation but such hardware modification reduces the performance of the system in free-space. Also, admittance control usually requires high transmission drives, as compared to the direct drives that are used with impedance control, to achieve accurate position control and higher torque values for the inner loop position controller. Impedance control and admittance control have complementary characteristics but neither provides good performance over the full range of control tasks from accurate position control in free-space to stability in contact with rigid environments. Although hardware modifications can be made to improve either controller, such modifications result in a predisposition to that controller as it degrades the performance of the other. 3 To overcome this obstacle and have complete flexibility over choosing the best controller for a given task, a hybrid switching control based on a hybrid systems framework [11] was proposed by Ott, Mukherjee, and Nakamura [19]. However, the proposed method was investigated with a single degree of freedom linear time invariant model. In this thesis, we extend this analysis to higher dimensions as well as the use of series elastic actuation and verify the results through experimentation. 4 Chapter 2 Background 2.1 Problem Statement x F m Fext Figure 2.1: A single degree-of-freedom mass interacting with the environment We begin with a review of the hybrid impedance admittance control problem as originally proposed by Ott, Mukherjee, and Nakamura for a single degree-of-freedom 5 linear system [19]. Consider a single degree of freedom mass, m, that interacts with its environment as shown in figure 2.1. The displacement x with F and Fext denoting the control force and force applied on the mass by the environment, respectively. Both F and Fext are measured positive in the direction of positive displacement. The equation of motion is written as m¨ = F + Fext x (2.1) The control objective of both impedance and the admittance control is to design the control force F that will result in the following dynamic relationship Mθ e + Dθ e + Kθ e = Fext ¨ ˙ (2.2) e = x − x0 (2.3) between which is the error in the position of the mass relative to a desired equilibrium trajectory x0 and Fext . Where Mθ , Dθ , and Kθ are positive constants that represent the desired inertia, damping and stiffness, respectively. For the single degree of freedom system, the differential map may be written as a transfer function between e and Fext denoted by Gd (s) = 1 Mθ s 2 + Dθ s + K θ 6 (2.4) 2.2 Impedance Control For impedance control, the control force is a mechanical impedance with the control plant and desired plant being a mechanical admittance. From equations (2.1) and (2.2) we have x = m−1 (F + Fext ) ¨ (2.5) −1 x = x0 + Mθ (Fext − Kθ e − Dθ e) ¨ ¨ ˙ (2.6) Comparing equations (2.6) and (2.5) and solving for F we set −1 −1 F = Fi = m¨0 + (mMθ − 1)Fext − mMθ (Dθ e + Kθ e) x (2.7) It can be verified that the substitution of equation (2.7) into (2.1) yields Mθ (¨ − x0 ) + Dθ (x − x0 ) + Kθ (x − x0 ) = Fext x ¨ ˙ ˙ 2.3 (2.8) Admittance Control For admittance control, the control force is a position-controller designed to track the trajectory, x = xd . Traditionally, tracking is implemented using a PD regulation controller of the form F = Fa = Kp (xd − x) − Kd x ˙ 7 (2.9) with positive gains kp and kd . The desired trajectory, xd , is derived from the mechanical admittance in (2.2). Then, xd may be written as the solution to the differential equation Mθ (¨d − x0 ) + Dθ (xd − x0 ) + Kθ (xd − x0 ) = Fext x ¨ ˙ ˙ (2.10) Substituting (2.9) into (2.1) we find the complete system dynamics to be given by m¨ + Kd x + Kp (x − xd ) = Fext x ˙ Md (¨d − x0 ) + Dθ (xd − x0 ) + Kθ (xd − x0 ) = Fext x ¨ ˙ ˙ 2.4 (2.11) (2.12) Motivation for Hybrid Control The performance of impedance control in terms of position accuracy depends primarily on the back drive-ability of the system as well as unmodeled friction. For large unmodeled friction, the position accuracy in free space tends to be poor as it depends on the desired stiffness and damping which are generally chosen to be small to reduce input noise [26]. However, impedance control is robustly stable for model uncertainties and even when in contact with stiff environments, as analysed by [6], [2], and [15]. The performance of admittance control depends heavily on the position controller [22], which effectively compensates for unmodeled friction [26], [13]. Therefore, admittance control may be implemented in systems with poor back drive-ability and large unmodeled friction. However, we find that the position controller results in instability when the mass comes in contact with large stiffness environments even in the absence 8 of uncertainties [10]. To compensate for the instability issue of admittance control researchers have proposed adaptive control methods for dealing with environments with unknown stiffness [25], [24]. The complementary characteristics of the two controllers is well known [27] and is illustrated with the help of fig. 2.2 bellow [19]. Ideal Control Performance Admittance Control Impedance Control Environment Stiffness Figure 2.2: Qualitative illustaration of the performance of impedance control and admittance control for different environment stiffness To overcome the limitations of both the impedance controller and the admittance controller we propose a hybrid controller in the next section that can potentially provide good performance for the entire spectrum of tasks ranging from motion in free space to dynamic interaction . 9 2.5 Hybrid Framework For the single degree-of-freedom system described by equation (2.1), we propose to switch between the impedance controller and admittance controller as follows:    Fi F =   F a : t ∈ [t0 + kδ, t0 + (k + 1 − n)δ) : t ∈ [t0 + (k + 1 − n)δ, t0 + (k + 1)δ) (2.13) where t0 is the initial time, δ is the switching period, n ∈ [0, 1] is the duty cycle, and k is a positive integer. Fi is given by equation (2.7), and Fa is given by equations (2.10) and (2.9). If the environment is modelled as a linear spring, namely Fext = −ke (x − x0 ) (2.14) and the equilibrium trajectory, x0 is assumed to be constant, i.e., x0 = x0 = 0 ˙ ¨ (2.15) the hybrid system follows the descriptions ˙ Xi = Ai Xi : t ∈ [t0 + kδ, t0 + (k + 1 − n)δ) ˙ Xa = Aa Xa : t ∈ [t0 + (k + 1 − n)δ, t0 + (k + 1)δ) 10 (2.16) where Xi = (e e)T ˙   Ai =  0 (2.17) 1 −(Kθ + ke )/Mθ −Dθ /Mθ  (2.18)   Xa = (e e ed ed )T ˙ ˙ (2.19) e d = xd − x0 (2.20) and   Aa =  0 1 0  0   −(Kp + ke )/m −Kd /m Kp /m 0 (2.21) When switching from the impedance controller to the admittance controller, two additional states are introduced. These states, ed and ed , are chosen at the instant of ˙ switching to maintain continuity of the control force F and its derivative. Equation (2.9) gives the expression for the control force of the admittance controller 11 1 (F + Kd x) ˙ Kp i 1 ⇒ ed = e + (F + Kd e) ˙ Kp i 1 ˙ xd = x + ˙ ˙ F i + Kd x ¨ Kp 1 ˙ F + Kd (F1 + Fext ) ⇒ ed = e + ˙ ˙ Kp i xd = x + (2.22) (2.23) Replacing Fi in equations (2.22) and (2.23) with Fi from equation (2.7), it is possible to obtain an expression of the form    I  Sai =   S Xa = Sai Xi , (2.24) at the instant of switching, where I is the identity matrix, and sij , i = 1, 2, j = 1, 2 of the S matrix have the expression Ke m K m ( − 1) − θ K p Mθ K p Mθ K d Dθ m − s12 = K p K p Mθ Dθ m (Kθ + ke ) Kd − s12 = − Mθ Kp m Mtheta D m K d Dθ m ke −1 − θ − s22 = 1 − K p Mθ Mθ K p K p M θ s11 = 1 − − Kθ m K p Mθ (2.25) When the system switched from the admittance controller to the impedance controller, the state mapping is given by 12 Xi = Sia Xa , Sia = [I 0] (2.26) Where 0 is the 2 × 2 matrix of zeros. 2.6 Stability Knowing the states at time t = t0 + kδ, the states at t = t0 + (k + 1)δ, k ∈ Z+ is a positive integer, can be obtained using equations (2.16), (2.24), and (2.26) as Xi (t0 + (k + 1 − n)δ) = eAi (1−n)δ Xi (t0 + kδ) ⇒ Xa (t0 + (k + 1 − n)δ) = Sai eAi (1−n)δ Xi (t0 + kδ) ⇒ Xa (t0 + (k + 1)δ) = eAa nδ Xa (t0 + (k + 1 − n)δ) ⇒ Xi (t0 + (k + 1)δ) = Sia eAa nδ Xa (t0 + (k + 1 − n)δ) ⇒ Xi (t0 + (k + 1)δ) = Sia eAa nδ Sai eAi (1−n)δ Xi (t0 + kδ) (2.27) We now define the matrix Adis to be Adis Sia eAa nδ Sai eAi (1−n) (2.28) such that Xi (t0 + (k + 1)δ) = Adis Xi (t0 + kδ) 13 (2.29) We see that Adis defines a discrete map of states from time t = t0 +kδ to t = t0 +(k+1)δ, independent of k. We now define a Discrete Equivalent System based on the definition in Das and Mukherjee [5]. Definition 1. [Discrete Equivalent Subsystem (DES)] The time-invariant linear system ˙ X = Aeq X (2.30) is a DES of a switched linear system if the state variables of the DES assume identical values of a subset of the states of the switched system at regular intervals of time, starting from the same initial conditions Based on definition 1, the system given by equation (2.30) is a DES of the switched system described by (2.16), (2.24), and (2.26) if Aeq = 1 ln[Adis ] δ (2.31) Where ln is defined as the principle matrix natural logarithm. Now, the following theorem on stability is presented [19]. Theorem 1. The equilibrium Xi = 0 of the switched system described by equations (2.16), (2.24), and (2.26) is exponentially if Aeq of the DES system in equation (2.30) is Hurwitz. Proof. see [19]. Remark 1. The necessary and sufficient condition for Aeq in equation (2.31) to exist is that Adis is non-singular [7]. Furthermore, we find that if λdis is an eigenvalue of Adis , 14 then the eigenvalue, λeq corresponding to Aeq is given by [7] λeq = 1 1 ln(|λdis |) + i arg(λdis ) δ δ (2.32) where arg is taken to be the principle argument. Remark 2. The stability analysis is based on switching from impedance control to admittance control and back to impedance control. This sequence leads to a DES defined by the principle matrix logarithm of the 2 × 2 matrix Sia eAa nδ Sai eAi (1−n)δ as shown in equation (2.27). However, if the hybrid system is switched from admittance control to impedance control and back to admittance control, the DES would be defined by the principle matrix logarithm of a 4 × 4 matrix Sai eAi (1−n)δ Sia eAa nδ instead. This is problematic, since for any two matrices A ∈ Rm×n and B ∈ Rn×n with m < n, the eigenvalues of AB and BA are the same except for the (n − m) additional eigenvalues of BA which are identically zero [9]. Therefore, the matrix Sai eAi (1−n)δ Sia eAa nδ is singular. However, we note that the states corresponding to the zero eigenvalues are virtual states. 2.7 Stability of Nominal Plant Theorem 1 provides a sufficient condition for exponential stability of the linear single degree of freedom switched system. However, the matrix Aeq is dependant on both the external stiffness, ke , the switching period, δ, and the weight n. Therefore, before simulating a sample system we will analyse the stability properties of the system in the abscense of model uncertainties. 15 4 x10 5 δ=2 4.5 δ=5 4 3.5 ke (N/m) 3 2.5 2 1.5 1 δ = 100 δ = 10 0.5 0 0 0.2 0.4 0.6 0.8 1 n Figure 2.3: Stability boundaries for hybrid impedance and admittance control for different values of δ Let the parameters of a single degree-of-freedom system be given by m = 1 kg Kp = 106 N Kd = 1.4 m Mθ = 1 kg Kθ = 100 N Dθ = 1.4 m Ns m Ns K θ Mθ m Kp m (2.33) Figure 2.3 show stability boundaries of the system for different values of ke , n, and δ. The solid lines in the figure represent the projection of the stability boundary for a constant δ in the (n, ke ) plane, with the lower left side of the solid lines denoting the stable region. We see from the figure that the region of stability increases as δ decreases. We notice also that the stability boundary does not necessarily meet the stability boundary of the 16 admittance controller when n = 1. This is due to the resetting condition when switching from the impedance controller to the admittance controller, as found by the mapping Sai as defined in (2.24). x10 4 5 4.5 δ = 20 4 3.5 ke (N/m) 3 δ = 10 2.5 2 1.5 δ = 40 1 δ = 30 0.5 0 0 0.2 0.4 0.6 0.8 1 n Figure 2.4: Stability boundaries for hybrid impedance and admittance control for δ values 10 ms, 20 ms, 30 ms, and 40 ms We note that Figure 2.3 does not provide a complete picture of the change in the stability boundary for changing delta. We see in Figure 2.4 that at certain ke values the largest n value in the stable region does not necessarily correspond to the smallest δ value. 17 0.6 0.5 Position x (m) 0.4 0.3 0.2 Desired Admittance Impedance Hybrid 0.1 0 −0.1 0 0.1 0.2 0.3 0.4 0.5 Time (sec) 0.6 0.7 0.8 Figure 2.5: Soft Contact position response for δ = 50 ms and n = 0.9 2.8 Simulations We will now simulate a sample single degree-of-freedom system in order to study the performance when switching in the presence of uncertainties, like time delay on sensors, uncertain mass value, noise, and unmodeled damping. We will let the parameters of the system be given by m = 1 kg, Mθ = 0.8 kg, N , m N Kθ = 100 , m Kp = 106 Kd = 1.4 Dθ = 1.4 N s , m N s K θ Mθ m Kp m (2.34) where the measured value of m is 80% the actual value. The simulations use a fixed time Diamond-Prince method with time step of T = 0.001 s. We assume the measured 18 value of x, x, and Fext have a delay of Td = 0.002 s, and the external input is corrupted ˙ by noise. We choose the function Fext to be given by Fext = −ke x (2.35) and x0 is chosen to be a constant value of 1 m. We choose δ = 50 ms for all simulations. We begin by considering the soft environment stiffness to be given by ke = 100 N/m. We then wish to demonstrate how different values of n change the performance. Therefore, let us begin with n = 0.9 0.6 0.5 Position x (m) 0.4 0.3 0.2 Desired Admittance Impedance Hybrid 0.1 0 −0.1 0 0.1 0.2 0.3 0.4 0.5 Time (sec) 0.6 0.7 0.8 Figure 2.6: Soft contact position response for δ = 50 ms and n = 0.1 Figure 2.5 shows the response of the impedance controller, admittance controller, ideal response in the abscence of uncertainties, and the hybrid controller when interacting 19 with a soft environment and for n = 0.9. From the figure we see that the response of the admittance, hybrid, and ideal response are very close to each other while the response of the impedance controller lags behind the ideal response and results in a steady state error. This implies that for δ = 0.5 the admittance controller has a very similar response to the hybrid controller as n → 1. To further investigate, consider the same external stiffness, ke = 100 N/m, but let n = 0.1. 0.6 0.5 Position x (m) 0.4 0.3 0.2 Desired Admittance Impedance Hybrid 0.1 0 −0.1 0 0.1 0.2 0.3 0.4 0.5 Time (sec) 0.6 0.7 0.8 Figure 2.7: Soft contact position response for δ = 50 ms and n = 0.5 Figure 2.6 again shows the response of the impedance controller, admittance controller, ideal response, and the hybrid controller when interacting with a soft environment and for n = 0.1. We now have the hybrid controller closely approximating the same performance as the impedance controller. This is expected since when n = 0 the hybrid controlled system is the impedance controlled system. Now, consider the system subject 20 to the same external stiffness, ke = 100 N/m, but let n = 0.5. 0.6 0.5 n decreasing Position x (m) 0.4 0.3 0.2 0.1 0 -0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Time (sec) Figure 2.8: Soft Contact position response for δ = 50 ms and a range of n values Figure 2.7 again shows the response of the impedance controller, admittance controller, ideal response, and the hybrid controller when interacting with a soft environment and for n = 0.5. Now the hybrid controller approximates a mean performance between the impedance controller and the admittance controller. This implies that the switched system response resembles a weighted average between the impedance controller and the admittance controller with the weights being based on the value of n. This is shown in Figure 2.8 which plots the response of different n values in the hybrid controller for the 21 0.8 same external stiffness, ke = 100 N/m. 0.16 Desired Admittance Impedance Hybrid 0.14 Position x (m) 0.12 0.1 0.08 0.06 0.04 0.02 0 −0.02 0 0.1 0.2 0.3 0.4 0.5 Time (sec) 0.6 0.7 0.8 Figure 2.9: Stiff contact position response for δ = 50 ms and n = 0.9 Figures 2.5-2.8 demonstrate the variation in the response of the hybrid system as a function of n, and how it interpolates between the response of the impedance controller and the admittance controller. However, the figures plot the results for a soft contact, for which the admittance controller has good performance. Therefore, we now investigate the scenarios where the system comes in contact with a hard surface, ke = 1000 N/m. We again begin with n = 0.9. Figure 2.9 shows the response of the closed loops system under impedance control, admittance control, the hybrid control, and the ideal response when interacting with a stiff environment and n = 0.9. From the figure we see that the hybrid control and the admittance control closely approximate each other. This is consistent with the soft 22 0.16 Desired Admittance Impedance Hybrid 0.14 Position x (m) 0.12 0.1 0.08 0.06 0.04 0.02 0 −0.02 0 0.1 0.2 0.3 0.4 0.5 Time (sec) 0.6 0.7 0.8 Figure 2.10: Stiff contact position response for δ = 50 ms and n = 0.1 contact case. However, we see that the admittance controller does not approximate the desired performance. We then let n = 0.5 with the same external stiffness, ke = 1000 N/m. Figure 2.10 shows the responses of the closed loop system uner admittance control, impedance control, hybrid control, and the ideal response when interacting with a stiff environment and n = 0.1. From figure 2.10 we see that the hybrid controller response closely approximates the impedance controller. Again, this is not surprising as when n = 0 the hybrid controller is the impedance controller. Therefore, we consider the case where n = 0.5 for the same external stiffness, ke = 1000 N/m. From figure 2.11 we see that the hybrid response again approximates a mean between the admittance controller and the impedance controller when interacting with a 23 0.16 Desired Admittance Impedance Hybrid 0.14 Position x (m) 0.12 0.1 0.08 0.06 0.04 0.02 0 −0.02 0 0.1 0.2 0.3 0.4 0.5 Time (sec) 0.6 0.7 0.8 Figure 2.11: Stiff contact position response for δ = 50 ms and n = 0.5 stiff environment. We again infer that changing the value of n from 1 to 0 changes the response of the hybrid controller from the admittance controller to the impedance controller in a similar manner to that of a weighted average based on the value of n. This is further demonstrated in Figure 2.12 which shows the response of the hybrid controller for different values of n for the same external stiffness, ke = 1000 N/m. This simple example demonstrates the desired effect of switching between admittance and impedance in order to improve the overall performance for a range of external stiffness values. 24 0.16 0.14 0.12 n=0.4 n=0.6 Position x (m) 0.1 n=0 n=0.2 0.08 0.06 n=0.8 0.04 0.02 0 -0.02 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Time (sec) Figure 2.12: Stiff contact position response for δ = 50 ms and a range of n values 25 0.8 Chapter 3 Preliminary Work The previous chapter introduces the idea of switching between the impedance control and the admittance control in order to improve the the performance based on the stiffness of the environment. However, the proof of stability using a DES is inadequate since it is unable to handle analysis of switching for the sequence of admittance control to impedance control, and back to admittance control due to the singularity of the resulting matrix. Therefore, we begin this section by providing a new stability theorem that does not have the same issue. We then briefly investigate why we choose to switch controllers instead of producing a feedback control that is a weighted combination of the admittance control and impedance control. The gains of the position controller used in the admittance controller are large and may be diificult to implement in experiments due to hardware restrictions. Therefore, we revisit the nominal plant stability and simulations of the previous section using smaller position gains. From this investigation we find that the position gains effect the performance of the switched system. Therefore, we propose a new method of defining 26 the additional states of the admittance controller at the instant of switching to help compensate for the effect of smaller gains. Finally, we discuss a method for solving the new switching method using only measured values of the external force instead of using a known function for the external force. 3.1 Stability Using the same notation used in chapter 2 for a single degree-of-freedom switched system we express the states at t = t0 + (k + 1)δ in terms of the states at time t = t0 + kδ by, namely Xi (t0 + (k + 1 − n)δ) = eAi (1−n)δ Xi (t0 + kδ) Xa (t0 + (k + 1 − n)δ) = Sai eAi (1−n)δ Xi (t0 + kδ) Xa (t0 + (k + 1)δ) = eAa nδ Xa (t0 + (k + 1 − n)δ) Xi (t0 + (k + 1)δ) = Sia eAa nδ Xa (t0 + (k + 1 − n)δ) Xi (t0 + (k + 1)δ) = Sia eAa nδ Sai eAi (1−n)δ Xi (t0 + kδ) (3.1) We now define the matrix Adis Adis = Sia eAa nδ Sai eAi (1−n) such that 27 (3.2) Xi (t0 + (k + 1)δ) = Adis Xi (t0 + kδ) (3.3) the matrix Adis defines a discrete map of states from time t = t0 + kδ to t = t0 + (k + 1)δ independent of k. We now have the following theorem. Theorem 2. The origin of the switched system described by (2.16), (2.24), and (2.26) is asymptotically stable iff all eigenvalues of Adis lie within the open unit circle about the origin. Proof. For convenience we define the following variables: A1 (τ ) = eAi (1−n)τ (3.4) A2 (τ ) = Sia eAa nτ Sai eAi (1−n)δ (3.5) M = max { A1 (τ ) 2 , A2 (τ ) 2 } τ ∈[0,δ] (3.6) Sufficiency: From discrete control theory, the system described by equation (3.3) is asymptotically stable iff the eigenvalues of Adis lie within the open unit circle about at the origin [16]. Then, from the discrete linear converse Lyapunov theorem there exists a V (x) given by [16] T V (Xi (t0 + kδ)) = Xi (t0 + kδ)P Xi (t0 + kδ) for a positive definite P , such that 28 (3.7) T V (Xi (t0 + (k + 1)δ)) − V (Xi (t0 + kδ)) ≤ Xi (t0 + kδ)QXi (t0 + kδ) (3.8) where Q is negative definite. From equations (3.6), (3.7), and (3.1) we may find T V (Xi (t0 + ǫ)) ≤ M [Xi (t0 )P Xi (t0 )] ∀ǫ ∈ [0, δ] (3.9) T ⇒ V (Xi (t0 + kδ + ǫ)) ≤ M [Xi (t0 + kδ)P Xi (t0 + kδ)] ∀ǫ ∈ [0, δ] (3.10) From equation (3.7) and (3.10) that V (Xi (t0 + kδ + ǫ)) ≤ M V (Xi (t0 + kδ)) ∀ǫ ∈ [0, δ] (3.11) and since equation (3.8) the sequence of functions V (Xi (t0 + kδ)) is monotonically decreasing, we may write equation (3.11) as V (Xi (t0 + kδ + ǫ)) ≤ M V (Xi (t0 )) V (Xi (t)) ≤ M V (Xi (t0 )) ∀ǫ ∈ [0, δ] (3.12) ∀t ≥ t0 (3.13) For asymptotic stability we wish to show that Xi (t) → 0 as t → ∞. To do this we consider that, V (Xi (t0 + δ)), V (Xi )(t0 + 2δ)), ... is decreasing and lower bounded, therefore the limit of V( Xi ) as k → ∞ and may be given by L ≥ 0 [21]. Then we have 29 0 = L − L = lim V (Xi (t0 + (k + 1)δ)) − lim V (Xi (t0 + kδ)) = k→∞ k→∞ lim [V (Xi (t0 + (k + 1)δ)) − V (Xi (t0 + kδ))] ≤ k→∞ lim k→∞ T Xi (t0 + kδ)QXi (t0 + kδ) ≤ 0 (3.14) therefore, Xi (t0 +kδ) → 0 as k → ∞ since Q is negative definite. Therefore, Xi (t) → 0 as t → ∞. Necessity for the proof of necessity we use contradiction. Assume that the switched system is asymptotically stable, but that Adis has at least one eigenvalue not in the open unit circle. Then the discrete system is not asymptotically stable. Therefore, there exists a choice Xi (t0 ) ∈ Bη , and an N > 0 such that Xi (t0 + kδ) ≥ N ∀k ≥ 0 (3.15) However, from the fact that the switched system is asymptotically stable we have lim Xi (t) = 0 t→∞ (3.16) implying that lim k→∞ Xi (t0 + kδ) = 0 Therefore, there exists a λ > 0 such that if k > λ then 30 (3.17) Xi (t0 + kδ) < N (3.18) which is a contradiction of equation (3.15). Remark 3. The stability analysis is again based on switching from impedance control to admittance control, and then back to impedance control. This sequence leads to a 2 × 2 matrix Adis , as shown in equation (3.2). If we instead switched from the admittance control to the impedance control, and back to the admittance control the matrix Adis would be a 4 × 4 matrix given by Adis = Sai eAi (1−n) Sia eAa nδ (3.19) However, this does not change the stability analysis, since for any two matrices A ∈ Rm×n and B ∈ Rn×m with m < n, the non-zero eigenvalues of AB and BA are the same except for the (n − m) additional eigenvalues of BA which are identically zero [9], which is in the open unit circle. 3.2 Comparison of Additive Control The control method proposed thus far is for a switching based control strategy. However, switching is only one possible method for hybrid control. Therefore, we will now briefly investigate a hybrid method that uses a convex combination of control inputs. Namely, let the input force be given by 31 F = nFa + (1 − n)Fi (3.20) where Fa is given by equations (2.10) and (2.9), Fi is given by equation (2.7), and n ∈ [0, 1]. We again assume that x0 is a constant point, and that Fext is given by equation (2.14). Then by choosing n to be constant yields a time invariant linear differential equation of the form ˙ X = AX (3.21) where X is given by X = [e , e, ˙ ed , ed ]T ˙ (3.22) and A is given by   0    A1  A=   0   k − Me θ  1 0 0 A2 Kp nm 0 0 0 1 0 − Mθ K − Mθ θ D θ           (3.23) where A1 and A2 are given by Kp + ke K + ke + (1 − n) θ ] m Mθ K D A2 = −[n d + (1 − n) θ ] m Mθ A1 = −[n 32 (3.24) (3.25) Then the system described by X is asymptotically stable if and only if A is Hurwitz. x10 4 5 Environment stiffness [N/m] 4.5 4 3.5 3 2.5 2 1.5 1 0.5 0 0 0.2 0.4 0.6 0.8 1 Switching rate (0=Impedance, 1=Admittance) Figure 3.1: Stability boundaries for convex combination of impedance and admittance control Therefore, we are able to compare the stability region produced by the convex combination of impedance and admittance control for different external stiffness compared to the switching method. To do this we consider the parameters of a linear single degree of freedom system given by (2.33). Figure 3.1 shows the stability properties of the combination of controllers for different values of n and ke with the grey portion being unstable, and the white portion being stable. We see from the figure that the set of values (n, ke ) for the convex combination control method is very restrictive compared to the switching method. The resulting closed-loop system is unstable even for small values of n, which approximates impedance control. 33 3.3 Stability of Nominal Plant We revisit stability of the nominal system using theorem 2. Additionally, we explore the effect of the gains used in the position controller. We note that the proportional value Kp used previously is very large and therefore the position control torque might be larger than the hardware permits. Therefore, let us again consider the single degree-of-freedom linear system with parameters given by (2.33) with the exception that Kp = 104 5 x 10 4 N m Kd = 1.4 Kp m N s m (3.26) delta=0.010000 4. 5 Environment stiffness [N/m] 4 3. 5 3 2. 5 2 1. 5 1 0. 5 0 0 0. 2 0. 4 0. 6 0. 8 1 Switching rate (0=Impedance, 1=Admittance) Figure 3.2: Stability boundaries for hybrid impedance and admittance control for δ = 10 ms and Kp = 10000 N/m Figure 3.2 shows the region in which the controlled system is stable (in white), and the region in which the controlled system is unstable (in grey) for δ = 10 ms and for varying 34 ke and n values. We notice that the separation between stable an unstable regions are smooth similar to the when Kp is large at the value δ = 10 ms in Figure (2.3). 5 x 10 4 delta=0.060000 4. 5 Environment stiffness [N/m] 4 3. 5 3 2. 5 2 1. 5 1 0. 5 0 0 0. 2 0. 4 0. 6 0. 8 1 Switching rate (0=Impedance, 1=Admittance) Figure 3.3: Stability boundaries for hybrid impedance and admittance control for δ = 60 ms and Kp = 10000 N/m While figure 3.2 is informative, it does not provide a complete picture of the region of stability to compare to the case with larger value Kp . A plot of the stability region for δ = 50ms in Figure 3.3 shows similar features to figure 2.4. However, we notice that when ke > 35000 N/m the regions where the system is unstable are not connected. This indicates that reducing the value of Kp causes the the boundary between stable and unstable pairs (n, ke ) to deform irregularly as δ increases. 35 0.7 0.6 Position x (m) 0.5 0.4 0.3 Desired Admittance Impedance Hybrid 0.2 0.1 0 −0.1 0 0.1 0.2 0.3 0.4 Time (sec) 0.5 0.6 0.7 0.8 Figure 3.4: Soft contact position response for Kp = 10000 N/m, δ = 50 ms, and n = 0.9 3.4 Simulations We see from the previous section that the position gains can change the stability characteristics of the hybrid system. We now wish to see how a similar change in gains effect performance. Let us again consider the single degree of freedom system whose model is given by equation (2.1). Let us also choose the parameters of the system to be given by (2.34), except we now change Kp to be Kp = 104 N m (3.27) which also changes the value of Kd since it is based on the value of Kp . The external stiffness is chosen to be ke = 100 N/m. We again begin with n = 0.9. Figure 3.4 shows 36 0.7 0.6 Position x (m) 0.5 0.4 0.3 Desired Admittance Impedance Hybrid 0.2 0.1 0 −0.1 0 0.1 0.2 0.3 0.4 0.5 Time (sec) 0.6 0.7 0.8 Figure 3.5: Soft contact position response for Kp = 10000 N/m, δ = 50 ms, and n = 0.5 the response of the admittance controller, impedance controller, hybrid controller, and the ideal response. We notice immediately that the response of the hybrid controller is not a good approximation of the admittance controller as it was before, instead we see that the hybrid controller results in a steady state error as well as the fact that the admittance controller no longer closely approximates the ideal response. To further investigate we consider Figure 3.5 which shows the response of the admittance, impedance, and hybrid controllers as well as the desired response for n = 0.5. We notice that contrary to the case where Kp is very large, for Kp smaller the hybrid controller no longer approximates an average between the impedance control response and the hybrid response when n = 1. Instead the hybrid controller produces a larger steady state error when n = 0.5 than the impedance controller. The deviation in behaviour is because 37 the position controller used in the admittance controller does not track a trajectory, but instead assumes that xd is a sequence of fixed points with a disturbance Fext . Thus, the gains of position controller greatly effect the performance of the admittance controller. 3.5 Change of Switching Conditions A large factor in the performance of the switched system is the position control gain used in the admittance algorithm. This is partly because the control force in (2.9) is based on the assumption that xd is a constant. Therefore, choosing the states xd and xd ˙ (when switching from the impedance controller to the admittance controller) such that the force and force derivative are continuous, is not necessarily optimal. We change the algorithm as follows for the single degree-of-freedom case. We have the impedance control torque to be given by (2.7). We then change the admittance torque to be given by a P D controller instead of just a position controller giving F = Fa = −Kp (x − xd ) − Kd (x − xd ) ˙ ˙ (3.28) with xd , xd to again be given by solutions to (3.28). We again let the external force, ˙ Fext Fext = −ke (x − x0 ) with x0 again being a constant. We then consider the hybrid switching as proposed in (2.13) giving 38 (3.29) ˙ Xi = Ai Xi : t ∈ [t0 + kδ, t0 + (k + 1 − n)δ) ˙ Xa = Aa Xa : t ∈ [t0 + (k + 1 − n)δ, t0 + (k + 1)δ) (3.30) where Xi = (e e)T ˙ e = q − q0   Ai =  (3.31) (3.32) 0 1 −1 −Mθ (Kθ + ke ) −1 −Mθ Dθ    (3.33) Xa = (e e ed ed )T ˙ ˙ (3.34) e d = qd − q0 (3.35) and 39  0 1 0 0     −M −1 (Kp + ke ) −M −1 Kd M −1 Kp M −1 Kd  Aa =    0 0 0 1   −1 −1 −1 −Mθ ke 0 −Mθ Kθ Mθ Dθ            (3.36) When switching from the admittance to the impedance controller, we have Xi = Sia Xa , Sia = [I 0] (3.37) at the instant of switching. When switching form impedance controller to the admittance controller we have two additional states, xd and xd , which must be defined. We wish to find xd such that the ˙ control force is continuous. Using (3.28) as the expression for the control force of the admittance control we have xd ((tk + (1 − n)δ)+ ) = lim t→(tk +(1−n)δ)− ⇒ ed ((tk + (1 − n)δ)+ ) = lim t→(tk +(1−n)δ)− −1 x + Kp (Fi + Kd (x − xd )) ˙ ˙ (3.38) −1 e + Kp (Fi + Kd (e − ed )) ˙ ˙ (3.39) Instead of defining xd such that the derivative of the force is continuous at the instant ˙ of switching, we consider it to be chosen later. We may then obtain the expression Xa = Sai Xi + Bai ed , ˙ 40    I  Sai =   S (3.40) at the instant of switching. Where S is given by    S11 S12  S=  0 0 (3.41) −1 −1 −1 −1 S11 = 1 − Kp ke (M Md − 1) − Kp Kθ M Mθ (3.42) −1 −1 −1 S12 = Kp Kd − Kp Dθ M Mθ (3.43) and Bai is given by  0     0  Bai =   −1  −Kp Kd   1            (3.44) For brevity, let us define tk such that tk = t0 + kδ, k ∈ Z+ . Then, knowing the states at time t = tk , the states at t = tk + δ can be obtained using equations (3.30), (3.37), and (3.40) as 41 Xi (tk + (1 − n)δ) = eAi (1−n)δ Xi (tk ) Xa (tk + (1 − n)δ) = Sai eAi (1−n)δ Xi (tk ) + Bai ed ˙ Xa (tk + δ) = eAa nδ Xa (tk + (1 − n)δ) Xi (tk + δ) = Sia eAa nδ Xa (tk + (1 − n)δ) Xi (tk + δ) = Sia eAa nδ Sai eAi (1−n)δ Xi (tk ) +Sia eAa nδ Bai ed ˙ (3.45) We define Adis as follows Adis = Sia eAa nδ Sai eAi (1−n)δ (3.46) Bdis = Sia eAa nδ Bai (3.47) Xi (tk + δ) = Adis Xi (tk ) + Bdis ed ˙ (3.48) and Bdis as follows This gives Let us now define the following as the desired behaviour of the closed loop system. ˙ Xdes = Ades Xdes 42 (3.49) with Xdes , and Ades given by Xdes = [e, e]T ˙   Ades =  0 (3.50) 1 −1 −Mθ (Kθ + ke ) −1 −Mθ Dθ    (3.51) Solving (3.49) from time tk to time tk + δ gives Xdes (tk + δ) = eAdes δ Xdes (tk ) (3.52) Ad = eAdes δ (3.53) Xdes (tk + δ) = Ad Xdes (tk ) (3.54) Let Ad be given by such that In the next section, we define ed at the instant when we switch from the impedance ˙ controller to the admittance controller. We note that the matrix Adis and the vector Bdis depend on the value of n, and that Bdis is zero when n = 0 since Bai is in the null space of Sia . However, we also find that Adis = Ad when n = 0 making the case trivial. 3.5.1 Matching Eigenvalues The first method of choosing ed is have it be a feedback of the form ˙ 43 ed = Kei Xi (tk ) ˙ (3.55) where Kei is a matrix chosen such that the eigenvalues of Ad are the same as the eigenvalues of Adis +Bdis Kei . This method produces similar response times from the switched system and the desired system. While the requirement that the pair (Adis , Bdis ) match all eigenvalues is not very restrictive, the resulting gains do not necessarily produce a smooth space with respect to variations in (n, ke ). Also, matching the eigenvalues does not take the eigenvectors into consideration producing different responses as the order of the system increases. 3.5.2 Minimizing Discrete Difference Between Desired and Actual Behaviour The goal is then to minimize |Xdes (tk + δ) − Xi (tk + δ)|. To solve this we may write [Ad − Adis ] Xi (tk ) − Bdis ed = 0 ˙ (3.56) Using the Moore-Penrose inverse we find T ed = Bdis Bdis ˙ −1 T Bdis [Ad − Adis ]Xi (tk ) We define Kh to be 44 (3.57) T Kh = Bdis Bdis −1 T Bdis [Ad − Adis ] (3.58) such that ed = Kh Xi (tk ) ˙ (3.59) Then, we have the discrete mapping of the switched system to be given by Xi (tk + δ) = (Adis + Bdis Kh )Xi (tk ) 3.6 (3.60) Linear Separation of External Force in Switching Condition The change of switching conditions mentioned in the previous section is based on prior knowledge of the external force Fext . However, the form of the equation of the external force is not generally known, but can be measured using a force sensor. Therefore, we now rederive the method in the last section accounting for only measurements of the external force and not the actual equation in (3.29). 3.6.1 Derivation Let us consider the external force as an unknown input into the closed loop differential equation. Then the system dynamics when the impedance controller is applied in 45 equation (2.7) may be written as ˙ Xi = Ai Xi + Bi Fext (3.61)  (3.62) where Xi is given by   e  Xi =   e ˙ Ai is given by   Ai =  0 1 −1 −Mθ Kθ −1 −Mθ Kθ    (3.63) and Bi is given by   Bi =  0 −1 Mθ    (3.64) The system dynamics when the admittance control is applied according to equations (3.30), (3.34), and (3.36) may be written as ˙ Xa = Aa Xa + Ba Fext where Xa is given by 46 (3.65)       Xa =       e    e  ˙    ed    ed ˙ (3.66) Aa in equation (3.65) is given by  0 1 0 0     −M −1 Kp −M −1 Kd M −1 Kp M −1 Kd  Aa =    0 0 0 1   −1 −1 0 0 −Mθ Kθ Mθ Dθ            (3.67) And Ba is given by   0   −1  M  Ba =    0   −1 Mθ            (3.68) Solving equations (3.61) and (3.65) give the general solutions Xi (t) = eAi (t−t0 ) Xi (t0 ) + t t0 eAi t−τ Ba Fext (τ )dτ (3.69) and Xa (t) = eAa (t−t0 ) Xa (t0 ) + 47 t t0 eAa t−τ Bi Fext (τ )dτ (3.70) respectively. Then, for switched system we have ˙ Xi = Ai Xi + Bi Fext ∀t ∈ [tk , tk + (1 − n)δ) ˙ Xa = Aa Xa + Ba Fext (3.71) ∀t ∈ [tk + (1 − n)δ, tk + δ) (3.72) for a positive integer, k, and for 0 ≤ n ≤ 1. At time tk the system is switched from the admittance controlled system to the impedance controlled system. We then have the change of states given by the mapping Xi = Sia Xa Sia = [I 0] (3.73) At the time tk + (1 − n)δ, the system is switched from the impedance controlled system to the admittance controlled system. This results in additional states ed and ed ˙ where ed is chosen such that the control force is continuous and ed is chosen later as in ˙ the previous section. From (3.38) we have ed ((tk + (1 − n)δ)+ ) = lim t→(tk +(1−n)δ)− −1 e + Kp (F1 + Kd (e − ed )) ˙ ˙ (3.74) Then, the change in states at time tk + (1 − n)δ may be given by Xa = Sai Xi + Kai Fext + Bai ed ˙ where S is given by 48    I  Sia =   S (3.75)    S11 S12  S=  0 0 (3.76) −1 S11 = 1 − Kp Kθ M Mθ (3.77) −1 −1 S12 = Kp Kd − Kp Dθ M Mθ (3.78) Bai is given by  0     0  Bai =   −1  −Kp Kd   1            (3.79) and Kai is given by  0     0  Kai =   −1  Kp (M M −1 − 1) θ   0            (3.80) Solving for the general solution of the switched system from time tk to time (tk + δ) we find 49 Xi (tk + δ) =Sia eAa nδ Sai eAi (1−n)δ Xi (tk ) + Sia eAa (tk +δ) tk +δ tk +(1−n)δ e−Aa τ Ba Fext (τ )dτ + Sia eAa nδ Sai eAi (tk +(1−n)δ) tk +(1−n)δ tk e−Ai τ Bi Fext (τ )dτ + Sia eAa nδ Kai Fext (tk + (1 − n)δ) + Sia eAa nδ Bai ed ˙ (3.81) We now write the desired behaviour in equation (3.49) as Xdes = Ades Xdes + Bdes Fext (3.82) Where Ades is given by   Ades =  0 1 −1 −Mθ Kθ −1 − Mθ D θ    (3.83) and Bdes given by   Bdes =  0 −1 Mθ    (3.84) Then, the general solution of Xdes from tk to (tk + δ) is given by Xdes (t) = eAdes (t−t0 ) Xdes (tk ) + tk +δ tk 50 eAdes (t−τ ) Bdes1 Fext (τ )dτ (3.85) As in section 3.5.2 we have the goal is to choose xd at tk + (1 − n)δ such that ˙ Xdes (tk + δ) − Xi (tk + δ) = 0 (3.86) Substituting equations (3.81) and (3.85) into (3.86) we get eAdes δ Xdes (tk ) + eAdes (tk +δ) tk +δ tk e−Ades τ Bdes Fext (τ )dτ − [Sia eAa nδ Sai eAi (1−n)δ Xi (tk ) + Sia eAa (tk +δ) + Sia eAa nδ Sai eAi (tk +(1−n)δ) tk +(1−n)δ tk tk +δ tk +(1−n)δ e−Aa τ Ba Fext (τ )dτ e−Ai τ Bi Fext (τ )dτ + Sia eAa nδ Kai Fext (tk + (1 − n)δ + Sia eAa nδ Bai ed ] = 0 ˙ (3.87) To solve equation (3.87) we will consider xd to be of the form ˙ e d = uh + up ˙ (3.88) where uh minimizes the homogeneous portion of (3.87), when Fext ≡ 0. And up minimizes the additional terms when Fext = 0. Then, to find uh we find equation (3.87) may be written as [eAdes δ Xdes (tk ) − Sia eAa nδ Sai eAi (1−n)δ Xi (tk )] − eAa nδ Bai uh = 0 Letting Xdes (tk ) = X(tk ), (3.89) simplifies to 51 (3.89) [eAdes δ − Sia eAa nδ Sai eAi (1−n)δ ]Xi (tk ) − eAa nδ Bai uh = 0 (3.90) using the Moore-Penrose inverse we find uh to be given by uh = (Sia eAa nδ Bai )T Sia eAa nδ Bai −1 (Sia eAa nδ Bai )T [eAdes δ − Sia eAa nδ Sai eAi (1−n)δ ]Xi (tk ) (3.91) We will then let Kh be given by Kh = (Sia eAa nδ Bai )T Sia eAa nδ Bai −1 (Sia eAa nδ Bai )T [eAdes δ − Sia eAa nδ Sai eAi (1−n)δ ] (3.92) such that uh = Kh Xi (tk ) (3.93) Since switching occurs at tk + (1 − n)δ it is desirable to write uh in the form uh = Kh (eAi (1−n)δ )−1 Xi (tk + (1 − n)δ) By substituting (3.94) and (3.88) into (3.87) we find 52 (3.94) eAdes δ Xdes (tk ) + eAdes (tk +δ) tk +δ tk e−Ades τ Bdes Fext (τ )dτ − [Sia eAa nδ Sai eAi (1−n)δ Xi (tk ) + Sia eAa (tk +δ) + Sia eAa nδ Sai eAi (tk +(1−n)δ) tk +(1−n)δ tk tk +δ tk +(1−n)δ e−Aa τ Ba Fext (τ )dτ e−Ai τ Bi Fext (τ )dτ + Sia eAa nδ Bin Kh (eAi (1−n)δ )−1 Xi (tk + (1 − n)δ) + Sia eAa nδ Kai Fext (tk + (1 − n)δ) + Sia eAa nδ Bai up ] = 0 (3.95) Using equation (3.69) we write (3.95) as {eAdes δ Xdes (tk ) − Sia eAa nδ Sai eAi (1−n)δ X(tk ) − Sia eAa nδ Bai Kh Xi (tk )}+ tk +δ eAdes (tk +δ) tk [Sia eAa (tk +δ) e−Ades τ Bdes Fext (τ )dτ − tk +δ tk +(1−n)δ e−Aa τ Ba Fext (τ )dτ + Sia eAa nδ Sai eAi (tk +(1−n)δ) + Sia eAa nδ Bai Kh eAi tk tk +(1−n)δ tk tk +(1−n)δ tk e−Ai τ Bi Fext (τ )dτ e−Ai τ Bi Fext (τ )dτ + Sia eAa nδ Kai Fext (tk + (1 − n)δ) + Sia eAa nδ Bai up ] = 0 (3.96) From equations (3.89), (3.93), and from linearity we have the choice of up can only be chosen to minimize portions of (3.96) containing the external force. Thus, (3.96) simplifies to. 53 tk +δ eAdes (tk +δ) tk [Sia eAa (tk +δ) e−Ades τ Bdes Fext (τ )dτ − tk +δ tk +(1−n)δ e−Aa τ Ba Fext (τ )dτ + Sia eAa nδ Sai eAi (tk +(1−n)δ) + Sia eAa nδ Bai Kh eAi tk tk +(1−n)δ tk tk +(1−n)δ tk e−Ai τ Bi Fext (τ )dτ e−Ai τ Bi Fext (τ )dτ + Sia eAa nδ Kai Fext (tk + (1 − n)δ) + Sia eAa nδ Bai up ] = 0 (3.97) Solving for up gives up = (Sia eAa nδ Bai )T Sia eAa nδ Bai {eAdes (tk +δ) tk +δ tk [Sia eAa (tk +δ) −1 (Sia eAa nδ Bai )T e−Ades τ Bdes Fext (τ )dτ − tk +δ tk +(1−n)δ e−Aa τ Ba Fext (τ )dτ + Sia eAa nδ Sai eAi (tk +(1−n)δ) + Sia eAa nδ Bin Kh eAi tk tk +(1−n)δ tk tk +(1−n)δ tk − Sia eAa nδ Kai Fext (tk + (1 − n)δ)} If we define the functions Fp and Hp as 54 e−Ai τ Bi Fext (τ )dτ e−Ai τ Bi Fext (τ )dτ ] (3.98) Fp = (Sia eAa nδ Bai )T Sia eAa nδ Bai −1 (Sia eAa nδ Bai )T {eAdes (tk +δ) e−Ades τ Bdes − Sia eAa (tk +δ) e−Aa τ Ba } Hp = − (Sia eAa nδ Bai )T Sia eAa nδ Bai −1 (Sia eAa nδ Bai )T Sia eAa nδ Kai (3.99) (3.100) Then up may be expressed in the compact form: up = tk +δ tk Fp (t − τ )Fext (τ )dτ + Hp Fext (tk + (1 − n)δ) (3.101) We then find that the choice ed = uh + up is the same as the choice of ed in section 3.5.2 ˙ ˙ due to uniqueness of the convolution mapping. However, the value of up must be solved numerically based on measured values of the external force on-line. 55 Chapter 4 N-DOF Rigid Joint Models The theory in the previous chapters are applicable to a single degree-of-freedom linear model. In this chapter we now wish to extend the theory to multi-dimensional systems. We proceed by considering a multi-degree-of-freedom linear rigid joint system and deriving switching conditions based on continuity of control force and its derivative. We then generalize the control method and switching conditions for multi-degree-of-freedom non-linear systems. 4.1 4.1.1 Linear N-DOF Equations of Motion Assuming rigid joints, the system dynamics of a general linear N-DOF is given by M q + C q + Gq = τ + J T Fext ¨ ˙ (4.1) where M is the symmetric positive definite mass matrix, C is a symmetric matrix acting 56 as a form of damping, and G acts as a stiffness matrix. Fext is the external force applied to the system, J is the Jacobian matrix transforming rotational coordinates to Euclidean coordinates, and τ is the input torque. The control objective is to the design τ such that (q, q) satisfies the system of differential equations ˙ Mθ (¨ − q0 ) + Dθ (q − q0 ) + Kθ (q − q0 ) = J T Fext q ¨ ˙ ˙ (4.2) where Mθ , Dθ , and Kθ are positive definite matrices. 4.1.2 Impedance Control In impedance control, we let the controller be a mechanical impedance. Therefore, by comparing equations (4.1) and (4.2), and solving for τ we find the impedance torque to be given by −1 τ = τi = M q0 + C q + Gq + M MD [−Kθ (q − q0 ) − Dθ q] ¨ ˙ ˙ −1 +(M Md − I)J T Fext (4.3) Indeed, substituting (4.3) into (4.1) results in Mθ (¨ − q0 ) + Dθ (q − q0 ) + Kθ (q − q0 ) = J T Fext q ¨ ˙ ˙ 57 (4.4) 4.1.3 Admittance Control For the admittance control, the control torque is a position controller to a trajectory qd which is generated by the mechanical admittance. Therefore we consider the control torque to be given by τ = τa = −Kp (q − qd ) − Kd (q) + C q + Gq ˙ ˙ (4.5) where Kp and Kd are positive definite matrices, and qd is given by the solution to the desired behavior Mθ (¨d − q0 ) + Dθ (qd − q0 ) + Kθ (qd − q0 ) = J T Fext q ¨ ˙ ˙ (4.6) Substituting (4.5) into (4.1) results in the dynamic equations M q + Kd q + Kp (q − qd ) = J T Fext ¨ ˙ (4.7) Md (¨d − q0 ) + Dθ (qd − q0 ) + Kθ (qd − x0 ) = J T Fext q ¨ ˙ ˙ (4.8) If q converges to qd , by the virtue of gains chosen in (4.7), then (4.8) gives (4.2). 4.1.4 Hybrid Framework For the linear N-DOF system described by equation (4.1), we propose the following switching torque 58    τi : t ∈ [t0 + kδ, t0 + (k + 1 − n)δ) τ=   τ : t ∈ [t + (k + 1 − n)δ, t + (k + 1)δ) a 0 0 (4.9) where t0 is the initial time, δ is the switching period, n ∈ [0, 1] is the duty cycle, k is a positive integer. τi is given by equation (4.3), and τa is given by equations (4.5) and (4.6). If the environment is modeled as a linear spring J T Fext = −ke (q − q0 ) (4.10) for a positive definite definite matrix ke , and the virtual trajectory q0 is assumed to be constant, i.e. q0 = q0 = 0 ˙ ¨ (4.11) the hybrid system follows the descriptions ˙ X = γ(t)Ai X + (1 − γ(t))Aa X ∆X = Φj X ∀t = tj (4.12) ∀t = tj (4.13) where tj defines the instants of switching between the impedance and admittance control torques and may be written as 59 tj ∈ {t|t = t0 + kδ, k ∈ Z+ } ∪ {t|t = t0 + (k + 1 − n)δ, k ∈ Z+ , n ∈ [0, 1]} (4.14) and γ(t) indicates which controller, impedance or admittance, is being applied at any given time, and may be written as γ(t) =    1 : t ∈ (t0 + kδ, t0 + (k + 1 − n)δ) (4.15)   0 : t ∈ (t + (k + 1 − n)δ, t + (k + 1)δ) 0 0 The state X and the matrices Ai and Aa are given by the relations: X = (e e ed ed )T ˙ ˙ (4.16) e = q − q0 (4.17) e d = qd − q0 (4.18)  0 I 0 0     −M −1 (Kθ + ke ) −M −1 Dθ 0 0  θ θ Ai =    0 0 0 I   −1 −1 −1 −Mθ ke 0 −Mθ Kθ Mθ Dθ and 60            (4.19)  0 I 0 0     −M −1 (Kp + ke ) −M −1 Kd M −1 Kp 0  Aa =    0 0 0 I   −1 −1 −1 −Mθ ke 0 −Mθ Kθ −Mθ Dθ            (4.20) When switching from the impedance controller to the admittance controller, additional states are introduced into the control torque. The states, ed and ed , are chosen at the ˙ instant of switching to maintain continuity of the control torque τ and its derivative. By setting equations (4.3) and (4.5) equal to each other we find ed ((tk + (1 − n)δ)+ ) = lim −1 e + Kp (τi − C q − Gq + Kd e) ˙ ˙ (4.21) lim −1 ˙ e + Kp ( τi − C q − Gq + Kd e ) ˙ ¨ ˙ ¨ (4.22) t→(tk +(1−n)δ)− By differentiating (4.21) we have ed ((tk + (1 − n)δ)+ ) = ˙ t→(tk +(1−n)δ)− Substituting equation (4.3) for τi in equations (4.21) and (4.22), it is possible to obtain an expression of the form X + (t0 + (k + 1 − n)δ) = Sai X − (t0 + (k + 1 − n)δ), 61    I 0  Sai =   S 0 (4.23) at the instant of switching. Where X + (t) denotes the right limit, X − (t) denotes the left limit, I is the identity matrix, and S is of the form    S11 S12  S=  S21 S22 (4.24) where −1 −1 −1 −1 S11 = I − Kp (M Mθ − 1)ke − Kp M Mθ Kθ (4.25) −1 −1 −1 S12 = Kp Kd − Kp Dθ M Mθ (4.26) −1 −1 −1 −1 −1 S21 = −Kp Kd Mθ (Kθ + ke ) − Kp M Mθ Dθ Mθ Kθ (4.27) −1 −1 −1 −1 S22 = I − Kp (M Mθ − I)ke − Kp M Mθ Kθ −1 −1 −1 −1 −1 −Kp Kd Mθ Dθ + Kp M Mθ Dθ Mθ Dθ (4.28) Then, we find that Φj to be given by   Φj (t0 + (k + 1 − n)δ) = Sai − I =  0 0 Sai − I    (4.29) When the system is switched from the admittance controller to the impedance controller, the state mapping is given by X + (t0 + kδ) = Sia X − (t0 + kδ),    I 0  Sia =   0 I (4.30) Where 0 is the n × n matrix of zeros. We then find Φj at this instant to be given by 62 Φj (t0 + kδ) = Sia − I = ∅ 4.1.5 (4.31) Stability Knowing the states at time t = t0 + kδ, the states at t = t0 + (k + 1)δ, k ∈ Z+ is a positive integer, can be obtained using equations (4.12), (4.23), and (4.30) as X − (t0 + (k + 1 − n)δ) = eAi (1−n)δ X + (t0 + kδ) X + (t0 + (k + 1 − n)δ) = Sai eAi (1−n)δ X + (t0 + kδ) X − (t0 + (k + 1)δ) = eAa nδ X + (t0 + (k + 1 − n)δ) X + (t0 + (k + 1)δ) = Sia eAa nδ X + (t0 + (k + 1 − n)δ) X + (t0 + (k + 1)δ) = Sia eAa nδ Sai eAi (1−n)δ X + (t0 + kδ) (4.32) We now define a matrix Adis to be Adis = Sia eAa nδ Sai eAi (1−n) (4.33) X + (t0 + (k + 1)δ) = Adis X + (t0 + kδ) (4.34) such that With Adis being a n × n matrix now instead of a 2 × 2 matrix. However, theorem 2 holds independently of the size of Adis , and therefore holds here. 63 4.2 Non-linear N-DOF Model For the linear case we found that the single degree-of-freedom system can be generalized to n dimensions. We now wish to generalize the concept to a non-linear system. However, we note that the position controller used in the single degree-of-freedom and the linear multiple degree-of-freedom cases rely on Fext = 0 when x = x0 and that x0 = 0. ˙ Therefore, we additionally consider a position control that is better suited for tracking a trajectory, and is independent of when the external force is zero. 4.2.1 Equations of Motion Consider a general non-linear dynamic system given by M (q)¨ + C(q, q)q + G(q) = τ + J T Fext q ˙ ˙ (4.35) where M (q) is the mass inertia matrix, C(q, q) is the matrix representing the Coriolis ˙ effects, and G(q) is the gravitational matrix. Our goal is to design τ such that (q, q) ˙ form the solution to the differential equation Mθ (¨ − q0 ) + Dθ (q − q0 ) + Kθ (q − q0 ) = J T Fext q ¨ ˙ ˙ (4.36) Where the virtual trajectory, q0 is then assumed to be a smooth bounded function in time. 64 4.2.2 Impedance Controller For the impedance controller we consider a force feedback controller that attempts to cancel the non-linear dynamics and then feedback the desired control objective. This is achieved by a control torque of the form: τ = τi = C(q, q)q + G(q) + M (q)¨0 ˙ ˙ q −1 −1 ˙ ˙ ˙ − M (q)Mθ [Kθ (q − q0 ) + Dθ (q − q0 )] + (M (q)Mθ − I)J T Fext (q, q) (4.37) By substituting (4.37) into (4.35) gives Mθ (¨ − q0 ) + Dθ (q − q0 ) + Kθ (q − q0 ) = J T Fext (q, q) q ¨ ˙ ˙ ˙ 4.2.3 (4.38) Admittance Controller For the tracking controller we cancel the non-linear dynamics and produces a controller that allows q to track a desired trajectory qd . Thus, we consider a control torque given by τ = τa = C(q, q)q + G(q) + M (q)¨d − J T Fext + ˙ ˙ q −1 ˙ ˙ M (q)Md [−Kp (q − qd ) − Kd (q − qd )] Substituting equation (4.39) into (4.35) we have 65 (4.39) Md (¨ − qd ) + Kd (q − qd ) + Kp (q − qd ) = 0 q ¨ ˙ ˙ (4.40) For positive definite values Md , Kd , and Kp , q converges to qd for any initial value q(t0 ). The desired trajectory qd is obtained by solving the differential equation Mθ (¨d − q0 ) + Dθ (qd − q0 ) + Kθ (qd − q0 ) = J T Fext q ¨ ˙ ˙ (4.41) The admittance controlled system is represented by the dynamics Md (¨ − qd ) + Kd (q − qd ) + Kp (q − qd ) = 0 q ¨ ˙ ˙ Mθ (¨d − q0 ) + Dθ (qd − q0 ) + Kθ (qd − q0 ) = J T Fext q ¨ ˙ ˙ 4.2.4 (4.42) (4.43) Hybrid Framework We define a switching controller based on the hybrid system framework. Let us begin by defining the force caused by interaction with the environment to be modeled as a linear spring J T Fext (q) = −ke (q − qext ) (4.44) for a positive definite definite matrix ke , and qext is a constant offset. Now, let us define a function r which forms a solution to (4.36) generated by an arbitrary set of initial conditions, namely 66 Mθ (¨ − q0 ) + Dθ (r − q0 ) + Kθ (r − q0 ) = −ke (r − qext ) r ¨ ˙ ˙ (4.45) Where (r(t0 ), r(t0 )) ∈ R2n . We then have that the control objective is achieved if there ˙ exists a pair (r(t0 ), r(t0 )), and a tj such that ˙ |q − r| = 0 ∀ t ≥ tj (4.46) We then define the variable e = q−r and ed = qd −r. Then, the system under impedance control may be given by ˙ Xi = Ai Xi (4.47) Xi = (e , e , ed , ed )T ˙ ˙ (4.48) where  0 I 0 0     −M −1 (Kθ + ke ) −M −1 Dθ 0 0  θ θ Ai =    0 0 0 I   −1 −1 −1 −Mθ ke 0 −Mθ Kθ −Mθ Dθ            (4.49) Likewise, the system under the admittance control may be given by ˙ X a = Aa X a 67 (4.50) where Xa = (e , e , ed , ed )T ˙ ˙  and      Aa =      (4.51) 0 I 0 0 Aa1 Aa2 Aa3 Aa4 0 0 0 I −1 −Mθ ke 0 −1 −1 −Mθ Kθ −Mθ Dθ            (4.52) −1 −1 Aa1 = −(Mθ ke + Md Kp ) (4.53) −1 Aa2 = −Md Kd (4.54) −1 −1 Aa3 = Md Kp − Mθ Kθ (4.55) −1 −1 Aa4 = Md Kd − Mθ Dθ (4.56) Both Xi and Xa have the same number of states, and both are invariant when Xi = Xa = 0 which corresponds to q − r = 0. Now, we define the set of times σ to be σ = {t|t = t0 + kδ, k ∈ Z+ } ∪ {t|t = t0 + (k + 1 − n)δ, k ∈ Z+ , n ∈ [0, 1]} Then we may write the general hybrid control law as 68 (4.57) ˙ X = γ(t)Ai X + (1 − γ(t))Aa X ∆X = Φj X ∀t = tj (4.58) ∀t = tj (4.59) where tj ∈ σ, and γ(t) ∈ [0, 1] for all t. Since we are only concerned with switching we have γ(t) =    1 : t ∈ (t0 + kδ, t0 + (k + 1 − n)δ) (4.60)   0 : t ∈ (t + (k + 1 − n)δ, t + (k + 1)δ) 0 0 namely, we either apply all impedance control or all admittance control, but not both at the same time. We must then define Φj which causes an impulse in the system at times t = tj . Since the times tj ∈ σ and σ is the union of two sets, we will investigate each individually. First, we will investigate is {t|t = t0 + (k + 1 − n)δ, k ∈ Z+ , n ∈ (0, 1)}. In this case we see that we switch from the impedance controller to the admittance controller. When we switch we wish to ensure that the control torque is smooth at that instant. Setting equations (4.37) and (4.39) equal we find 69 −1 M (q)¨d − J T Fext + M (q)Md [−Kp (q − qd ) − Kd (q − qd )] q ˙ ˙ −1 = M (q)¨0 − M (q)Mθ [Kθ (q − q0 ) + Dθ (q − q0 )] q ˙ ˙ −1 +(M (q)Mθ − I)J T Fext (4.61) −1 ˙ ˙ ⇒ qd + Md [−Kp (q − qd ) − Kd (q − qd )] = ¨ −1 −1 q0 − Mθ [Kθ (q − q0 ) + Dθ (q − q0 )] + Mθ J T Fext ¨ ˙ ˙ (4.62) −1 ⇒ Mθ Md [−Kp (q − qd ) − Kd (q − qd )] = ˙ ˙ Mθ (¨0 − qd ) − Kθ (q − q0 ) + Dθ (q − q0 ) + J T Fext q ¨ ˙ ˙ (4.63) We see from (4.63) that the choice q = qd and q = qd satisfies the equation and all its ˙ ˙ derivatives. Therefore, we have X + (t0 + (k + 1 − n)δ) = Sai X + (t0 + (k + 1 − n)δ),    I 0  Sai =   I 0 (4.64) at the instant of switching from impedance control to admittance control. We then have that Φj to be given by    0 0  Φj = Sai − I =   I −I (4.65) For the set {t|t = t0 + kδ, k ∈ Z+ } the system is switched from the admittance controller to the impedance controller. During this switching instant we choose to keep 70 the states continuously differentiable. Thus the state mapping is given by X + (t0 + kδ) = Sia X − (t0 + kδ),    I 0  Sia =   0 I (4.66) and does not result in an impulse, meaning Φj is given by Φj = Sia − I = ∅ 4.2.5 (4.67) Stability Knowing the states at time t = t0 + kδ, the states at t = t0 + (k + 1)δ, k ∈ Z+ is a positive integer, can be obtained using equations (4.58), (4.59), (4.64), and (4.66) as X − (t0 + (k + 1 − n)δ) = eAi (1−n)δ Xi (t0 + kδ) X + (t0 + (k + 1 − n)δ) = Sai eAi (1−n)δ Xi (t0 + kδ) X − (t0 + (k + 1)δ) = eAa nδ Xa (t0 + (k + 1 − n)δ) X + (t0 + (k + 1)δ) = Sia eAa nδ Xa (t0 + (k + 1 − n)δ) X + (t0 + (k + 1)δ) = Sia eAa nδ Sai eAi (1−n)δ Xi (t0 + kδ) (4.68) We now define a matrix Adis to be Adis = Sia eAa nδ Sai eAi (1−n) such that 71 (4.69) X + (t0 + (k + 1)δ) = Adis X + (t0 + kδ) (4.70) With Adis being a n × n matrix now instead of a 2 × 2 matrix. We again note that theorem 2 holds independently of the size of Adis , and therefore holds here. 72 Chapter 5 Flexible Joint Model All development thus far is for a rigid joint model which is characteristic of a directly driven system. However, in order to achieve large torque values gearing of the actuator is required. This leads to some flexibility between the actuator and the joint. Furthermore, many modern robotic control drives use series elastic actuation which improves the stability of position control methods and enforces smoothness of torques on the link. For this chapter we rederive the impedance control, admittance control, and hybrid methods for a single degree-of-freedom flexible joint system using continuity of control force and control force derivative. We then rederive the alternate switching conditions for the system with joint flexibility. Finally we examine a simple nonlinear system with flexibility, and examine the changes the impedance, admittance, and hybrid controller, as well as the proof of stability of the hybrid controller. 73 5.1 Linear 1-DOF Model We begin with the simplest case as in chapter 2, a single degree-of-freedom linear system. However, to add flexibility to the system we consider the actuator to be coupled to the system through a spring. 5.1.1 Equations of Motion x M y Km Fm B Figure 5.1: Single degree-of-freedom flexible joint model For the single degree of freedom linear flexible joint model as shown in figure 5.1.1 the system dynamics are given by M x = F + Fext ¨ (5.1) B y + F = Fm ¨ (5.2) F = Km (y − x) (5.3) Where x represents link side dynamics and y represents actuator side dynamics, M is a 74 positive constant corresponding to the mass of the system, Km is the stiffness between the actuator and the joint, Fext is the external force applied to the system, and Fm is the input force. We choose the desired dynamics to be given by Mθ (¨ − x0 ) + Dθ (x − x0 ) + Kθ (x − x0 ) = Fext x ¨ ˙ ˙ (5.4) ˙ We note that the values that we can measure are y, y, F , and F . We cannot explicitly ˙ measure x or x. ˙ 5.1.2 Passive Impedance Controller For the passive impedance controller, we assume a controller of the form [17]: −1 −1 Fm = Fi = BBd {M Mθ [−Kc (y − y0 ) − Dc (y − y0 )] ˙ ˙ −1 −1 ¨ +(M Mθ − 1)Fext + M x0 } + (I − BBd )τ (5.5) Where Bd is a normalization of the acutator mass B. By substituting equation (5.5) into equation (5.2) we find the dynamics to be given by M x = F + Fext ¨ (5.6) −1 ˙ ˙ Bd y + M Mθ [Dc (y − y0 ) + Kc (y− y0 )] ¨ −1 −(M Mθ − 1)Fext + M x0 = −F ¨ 75 (5.7) By combining equations (5.6) and (5.7) we get Mθ (¨ − x0 ) + Dc (y − y0 ) + Kc (y − y0 ) = Fext − Mθ M −1 Bd y x ¨ ˙ ˙ ¨ x (5.8) y Kc Km M Dc Figure 5.2: Single degree-of-freedom passive impedance for flexible joint model We choose Bd to be as small as possible such that the effect of y is negligible. The ¨ resulting model is shown in figure 5.1.2. We then wish to find the values of Dc , Kc , and y0 such that (5.8) produces the same result as (5.4). To find y0 we consider the static solutions of (5.6), (5.7), and (5.4) when Fext = 0. This yields the equations xss = yxx (5.9) xss = x0 (5.10) yss = y0 (5.11) where xss represents the static value of x, and yss represents the static value of y. Solving (5.9)-(5.11) we have the equation 76 y0 = x0 (5.12) To solve for Kc we consider the static solutions of (5.6), (5.7), and (5.4) when Fext = 0 this yields Km (xss − yss ) = Fext (5.13) Kθ (xss − x0 ) = Fext (5.14) Kc (yss − y0 ) = Fext (5.15) Solving equations (5.13)-(5.15) we find −1 −1 Kc = Kθ − Km −1 (5.16) Finally, to find Dc we consider that all internal forces in figure 5.1.2 must be equal. This gives the equation Dc (y − y0 ) + Kc (y − y0 ) = Dθ (x − x0 ) + Kθ (x − x0 ) ˙ ˙ ˙ ˙ (5.17) From equations (5.13)-(5.15) we assume Kc (y − y0 ) = Kθ (x − x0 ) Giving 77 (5.18) Dc ( y − y 0 ) = Dθ ( x − x 0 ) ˙ ˙ ˙ ˙ (5.19) Then we have D c = Dθ x − x0 ˙ ˙ y − y0 ˙ ˙ (5.20) Since, we always will initialize the system from rest we then assume x − x0 ≈ y − y0 for ˙ ˙ ˙ ˙ Km large. This gives Dc = D θ (5.21) Therefore, We, for small Bd , have (5.8) is approximated by Mθ (¨ − x0 ) + Dθ (y − y0 ) + Kc (y − y0 ) = Fext x ¨ ˙ ˙ (5.22) which is equivalent to Mθ (¨ − x0 ) + Dθ (x − x0 ) + Kθ (x − x0 ) = Fext x ¨ ˙ ˙ 5.1.3 Admittance Controller For the admittance controller, let the position controller be given by [1] 78 (5.23) −1 −1 Fm = Fa = BBd [−Kp (y − yd ) − Kd y − KT Km (F − Fd ) ˙ −1 −1 ˙ −KS Km F ] + (I − BBd )F (5.24) This produces the dynamic equations M x = τ + Fext ¨ (5.25) Bd y + Kd y + Kp (y − yd ) + ¨ ˙ −1 ˙ −1 KS Km F + KT Km (F − Fd ) = −F (5.26) Combining equations (5.25) and (5.26) we find M x + Kd y + Kp (y − yd ) ¨ ˙ −1 ˙ −1 + KS Km F + KT Km (F − Fd ) = Fext − Bd y ¨ (5.27) We again choose Bd small such that the effects of y is negligible. We then choose xd , ¨ xd to be given by the mechanical admittance in equation (5.4). Namely, let xd , and xd ˙ ˙ be the solution to M (¨d − x0 ) + Dθ (xd − x0 ) + Kθ (xd − x0 ) = Fext x ¨ ˙ ˙ (5.28) We then assume that the stiffness Km is large enough such that y ≈ x and y ≈ x. Thus, ˙ ˙ 79 we choose yd = xd and yd = xd making Fd = 0. We then find that the full dynamics of ˙ ˙ the system to be given by M x = F + Fext ¨ (5.29) Bd y + Kd y + Kp (y − yd ) + ¨ ˙ −1 ˙ −1 KS Km F + KT Km F = −F M (¨d − x0 ) + Dθ (yd − x0 ) + Kθ (yd − x0 ) = Fext y ¨ ˙ ˙ 5.1.4 (5.30) (5.31) Hybrid Framework For the single degree-of-freedom system described by equations (5.1)-(5.3), we propose to switch the controller between impedance and admittance as follows Fm =    F1 : t ∈ [t0 + kδ, t0 + (k + 1 − n)δ) (5.32)   F : t ∈ [t + (k + 1 − n)δ, t + (k + 1)δ) 2 0 0 where t0 is the initial time, δ is the switching period, n ∈ [0, 1] is the duty cycle, k is a positive integer. F1 is given by eq. (5.5), and F2 is given by equations (5.24) and (5.28). Let the environment is modeled as a linear spring Fext = −ke (x − x0 ) (5.33) and the virtual trajectory, x0 is assumed to be constant, x0 = x0 = 0 ˙ ¨ 80 (5.34) The hybrid system then follows the descriptions ˙ Xi = Ai Xi : t ∈ [t0 + kδ, t0 + (k + 1 − n)δ) ˙ Xa = Aa Xa : t ∈ [t0 + (k + 1 − n)δ, t0 + (k + 1)δ) (5.35) where Xi = (e , e , eθ , eθ )T ˙ ˙ (5.36) e = x − x0 e θ = y − y0       Ai =      (5.37) (5.38) 0 1 0 0 −M −1 (Km + ke ) 0 M −1 Km 0 0 0 0 1 −1 −1 −1 −1 Ai1 0 − Bd M Mθ (Kc + Km ) − Bd M Mθ Kd            (5.39) −1 −1 −1 Ai1 = Bd (M Mθ Km + (M Mθ − 1)ke ) (5.40) Xa = (e , e eθ , eθ , ed , ed )T ˙ ˙ ˙ (5.41) 81 e d = yd − x0 (5.42) and           Aa =          0 1 0 0 0 0 −M −1 (Km − ke ) 0 M −1 Km 0 0 0 0 0 0 1 0 0 Aa1 Aa2 Aa3 Aa4 Aa5 0 0 0 0 0 0 1 −1 −1 −1 −Mθ ke 0 0 0 − Mθ Kθ − Mθ Dθ                    (5.43) −1 −1 Aa1 = Bd (Km + KT Km ) (5.44) −1 −1 Aa2 = Bd KS Km (5.45) −1 −1 Aa3 = −Bd (Km + Kp + KT Km ) (5.46) −1 −1 Aa4 = −Bd (KS Km + Kd ) (5.47) −1 Aa5 = Bd Kp (5.48) When switching from the impedance controller to the admittance controller, two 82 additional states are introduced. These states, ed and ed , are chosen at the instant of ˙ switching to maintain continuity of the control force F and its derivative. Equation (5.24) gives the expression for the control force of the admittance controller and may be written as yd = ⇒ ed = y+ 1 Kp 1 Kp eθ + Bd K F K ˙ Fi + Kd y + T + S F − +(1 − ˙ B Km Km Bd K F K ˙ Fi + Kd eθ + T + S F − +(1 − ˙ B Km Km Bd )F B Bd )F B (5.49) and differentiating equation (5.49) gives yd = ˙ ⇒ ed = ˙ y+ ˙ eθ + ˙ 1 Kp 1 Kp ˙ K F Bd ˙ B ˙ K ¨ Fi + Kd y + T + S F − +(1 − d )F ¨ B Km Km B ˙ Bd ˙ B ˙ K ¨ K F Fi + Kd eθ + T + S F − +(1 − d )F ¨ B Km Km B (5.50) Substituting equation (5.5) for F1 in equations (5.49) and (5.50), it is possible to obtain an expression of the form    I  Sai =   S Xa = Sai Xi , (5.51) at the instant of switching. Where I is the identity matrix, and S is given by    s11 s12 s13 s14  S=  s21 s22 s23 s24 83 (5.52) Where −1 s11 = −Kp KT −1 s12 = −Kp KS −1 −1 −1 s13 = KP [KP + KT − M Mθ Kc − (M Mθ − 1)ke ] −1 −1 s14 = Kp (Kd + KS − M Mθ Dθ ) −1 s21 = −Kp KT M Km (Km + ke ) + (Kd + KS − Dθ ) ] M Mθ Bd −1 −1 K Km + (K + K − M Dθ ) (Km + M Mθ Kc ) ] s23 = −Kp [ S S d M Mθ Bd M Kc M −1 s24 = Kp {[Kp + KT − −( − 1)ke ] − Mθ Mθ M Dθ M Dθ (Kd + KS − ) } Mθ B d Mθ −1 s22 = Kp [KS (5.53) When the system switched from the admittance controller to the impedance controller, the state mapping is given by Xi = Sia Xa , Sia = [I 0] (5.54) Where 0 is the 2 × 2 matrix of zeros. 5.1.5 Stability Knowing the states at time t = t0 + kδ, the states at t = t0 + (k + 1)δ, k ∈ Z+ is a positive integer, can be obtained using equations (5.35), (5.51), and (5.54) as 84 Xi (t0 + (k + 1 − n)δ) = eAi (1−n)δ Xi (t0 + kδ) Xa (t0 + (k + 1 − n)δ) = Sai eAi (1−n)δ Xi (t0 + kδ) Xa (t0 + (k + 1)δ) = eAa nδ Xa (t0 + (k + 1 − n)δ) Xi (t0 + (k + 1)δ) = Sia eAa nδ Xa (t0 + (k + 1 − n)δ) Xi (t0 + (k + 1)δ) = Sia eAa nδ Sai eAi (1−n)δ Xi (t0 + kδ) (5.55) We now define a matrix Adis to be Adis = Sia eAa nδ Sai eAi (1−n) (5.56) Xi (t0 + (k + 1)δ) = Adis Xi (t0 + kδ) (5.57) such that With Adis being a n × n matrix now instead of a 2 × 2 matrix. However, theorem 2 holds independently of the size of Adis , and therefore holds here. 5.1.6 Simulations and Performance Let us now consider a linear single degree-of-freedom system described by equations (5.1)-(5.3) and with parameters given by 85 N s m N m N KT = 119470 m Mθ = 3.6344 kg Bθ = 0.34017 kg m = 3.6 kg N m N s KS = 3076.4 m Kp = 113580 B = 1.5308 kg Kd = 361.2 Kθ = 100 N m Km = 22000 Dθ = 23.872 N s m (5.58) We then choose the external force to be given by Fext = −ke x (5.59) 0.7 0.6 Position x (m ) 0.5 0.4 0.3 Desired Impedance Admittance Hybrid 0.2 0.1 0 −0.1 0 0.2 0.4 0.6 0.8 1 Time (sec) 1.2 1.4 1.6 Figure 5.3: Soft contact position response for δ = 50 ms and n = 0.1 86 1.8 and x0 is chosen as a constant input of 1 m with a system initial condition given as x(t0 ) = y(t0 ) = 0. The switching time, δ, is chosen to be 50 ms. We then add a mass error to the system of 80% as well as a feedback time delay, input noise, and unmodeled friction. To simulate a soft stiffness, ke is initially chosen to have a value of 100 N/m. 0.7 0.6 Position x (m) 0.5 0.4 0.3 0.2 Desired Impedance Admittance Hybrid 0.1 0 −0.1 0 0.2 0.4 0.6 0.8 1 Time (sec) 1.2 1.4 1.6 1.8 Figure 5.4: Soft contact position response for δ = 50 ms and n = 0.5 Figures 5.3, 5.4, and 5.5 show the response of the passive impedance controlled system, the admittance controlled system, the hybrid controlled system, and the desired response for n = 0.1, n = 0.5, and n = 0.9 respectively. We see from figure 5.3 that the hybrid controlled system response is almost identical to the passive impedance controlled system. This is expected since the hybrid controlled system is the same as the passive impedance controlled system when n = 0. Then from figure 5.4 we see that increasing n from 0.1 to 0.5 improves the performance of the hybrid system and causes the resulting 87 response to approach that of the admittance controlled system. 0.7 0.6 Position x (m) 0.5 0.4 0.3 0.2 Desired Impedance Admittance Hybrid 0.1 0 −0.1 0 0.2 0.4 0.6 0.8 1 Time (sec) 1.2 1.4 1.6 1.8 Figure 5.5: Soft contact position response for δ = 50 ms, and n = 0.9 We again see from figure 5.5 that again increasing n from 0.5 to 0.9 improves the performance of the hybrid system and causes the response to approach the response curve of of the admittance controlled system. However, we notice that as n goes to 1, while the hybrid system does approach the admittance controlled system it does not converge to it. This is due to the flexibility in the position controller used as the inner loop of the admittance controller. We have shown that the hybrid control method can improve the performance of the impedance control for a soft environment, but tuning of the position controller is required to reach the performance of the admittance controller. Now we wish to see the performance of the hybrid control method when the system is in contact with a stiff 88 0.18 Desired Impedance Admittance Hybrid 0.16 0.14 Position x (m) 0.12 0.1 0.08 0.06 0.04 0.02 0 −0.02 0 0.5 1 Time (sec) 1.5 2 Figure 5.6: Stiff contact position response for δ = 50 ms and n = 0.1 environment. Therefore, to simulate a stiff environment we choose ke = 1000 N/m. Then, Figures 5.6, 5.7, and 5.8 show the response of the passive impedance controlled system, the admittance controlled system, the hybrid controlled system, and the desired response for n = 0.1, n = 0.5, and n = 0.9 respectively for the stiff environment. We see from figure 5.6 that when n = 0.1 the response of the hybrid system is again almost identical to the passive impedance controlled system. This is again is not surprising since when n = 0 the hybrid controlled system is identical to the passive impedance controlled system. From figure 5.7 we see that increasing n from 0.1 to 0.5 shifts the response of the hybrid system toward that of the admittance controlled system and away from the passive impedance controlled system. Then, from figure 5.7 we again see that increasing n from 89 0.18 Desired Impedance Admittance Hybrid 0.16 0.14 Position x (m) 0.12 0.1 0.08 0.06 0.04 0.02 0 −0.02 0 0.5 1 Time (sec) 1.5 2 Figure 5.7: Stiff contact position response for δ = 50 ms and n = 0.5 0.5 to 0.9 shifts the response of the hybrid system closer to the response of the admittance controlled system. However, the deviation between the response of the hybrid controlled system and the admittance controlled system remains as n goes to 1. This again is due in part to tuning of the inner loop position controller used in the admittance control algorithm. Therefore, we find that through the switching method it is possible to vary the response of the hybrid method between the the admittance controller response and the passive impedance controller response possibly producing better performance than either. However, the variation in response of the hybrid controlled system is highly dependant on the tuning of the inner loop position controller used in the admittance algorithm. 90 0.18 Desired Impedance Admittance Hybrid 0.16 0.14 Position x (m) 0.12 0.1 0.08 0.06 0.04 0.02 0 −0.02 0 0.5 1 Time (sec) 1.5 2 Figure 5.8: Stiff contact position response for δ = 50 ms and n = 0.9 5.2 Change of Switching Conditions A large factor in the performance of the switches system is the position control used as the control force in the admittance algorithm. This is partly because the control force in (5.24) is based on the assumption that xd is a constant. Then, choosing the states xd and xd when switching from the impedance to admittance controller such that the ˙ control force and its derivative are continuous is not necessarily optimal. Therefore, we change the algorithm as follows. We have the impedance control torque to be given by (5.5). We then change the admittance torque to be given by a P D controller instead of just a position controller giving 91 −1 −1 Fm = Fa = BBD [−Kp (y − yd ) − Kd (y − yd ) − KT Km (F − Fd ) ˙ ˙ −1 −1 ˙ ˙ −KS Km (F − Fd )] + (I − BBd )F (5.60) with xd , xd to again be given by (5.28). We again let the external force, Fext ˙ Fext = −ke (x − x0 ) (5.61) with x0 again being a constant. We then consider the hybrid switching as proposed in (5.32). Then the switched system may be written as ˙ Xi = Ai Xi : t ∈ [t0 + kδ, t0 + (k + 1 − n)δ) ˙ Xa = Aa Xa : t ∈ [t0 + (k + 1 − n)δ, t0 + (k + 1)δ) (5.62) where Xi = (e , e , eθ , eθ )T ˙ ˙ (5.63) e = x − x0 e θ = y − y0 92 (5.64)       Ai =      0 1 0  0 −M −1 (Km + ke ) 0 M −1 Km 0 0 0 0 1 −1 −1 −1 −1 Ai1 0 − Bd M Mθ (Kc + Km ) − Bd M Mθ Kd           (5.65) −1 −1 −1 Ai1 = Bd (M Mθ Km + (M Mθ − 1)ke ) (5.66) Xa = (e , e , eθ , eθ , ed , ed )T ˙ ˙ ˙ (5.67) e d = xd − x0 (5.68) and           Aa =          0 1 0 0 0 0 −M −1 (Km − ke ) 0 M −1 Km 0 0 0 0 0 0 1 0 0 Aa1 Aa2 Aa3 Aa4 Aa5 Aa6 0 0 0 0 0 1 −1 −1 −1 −Mθ ke 0 0 0 − Mθ Kθ − Mθ Dθ                    (5.69) −1 −1 Aa1 = Bd (Km + KT Km ) (5.70) −1 −1 Aa2 = Bd KS Km (5.71) 93 −1 −1 Aa3 = −Bd (Km + Kp + KT Km ) (5.72) −1 −1 Aa4 = −Bd (KS Km + Kd ) (5.73) −1 Aa5 = Bd Kp (5.74) −1 Aa6 = Bd Kd (5.75) We remember that when switching from the admittance to the impedance controller, we have Xi = Sia Xa , Sia = [I 0] (5.76) at the instant of switching. When switching form impedance controller to the admittance controller we again have two additional sets of states xd and xd which must be defined. We again wish to ˙ find xd such that the control force is continuous. Using (5.60) as the expression for the control force of the admittance control we have yd = ⇒ ed = y+ eθ + 1 Kp 1 Kp Bθ B K F K ˙ Fi + Kd y + T + S F − +(1 − θ )F ˙ B Km Km B B Bθ K F K ˙ Fi + Kd eθ + T + S F − +(1 − θ )F ˙ B Km Km B 94 (5.77) Instead of defining yd such that the derivative of the force is continuous at the instant ˙ of switching, we consider it to be chosen later. We may then obtain the expression Xa = Sai Xi + Bai ed , ˙    I  Sai =   S (5.78) at the instant of switching. Where S is given by    S11 S12 S13 S14  S=  0 0 0 0 (5.79) −1 s11 = −Kp KT −1 s12 = −Kp KS −1 −1 −1 s13 = KP [KP + KT − M Mθ Kc − (M Mθ − 1)ke ] −1 −1 s14 = Kp (Kd + KS − M Mθ Dθ ) (5.80) and Bai is given by  0     0     0  Bai =    0    −1  −Kp Kd   1 95                    (5.81) For brevity, let us define tk such that tk = t0 + kδ, k ∈ Z+ . Then, knowing the states at time t = tk , the states at t = tk + δ can be obtained using equations (5.62), (5.76), and (5.78) as Xi (tk + (1 − n)δ) = eAi (1−n)δ Xi (tk ) Xa (tk + (1 − n)δ) = Sai eAi (1−n)δ Xi (tk ) + Bai ed ˙ Xa (tk + δ) = eAa nδ Xa (tk + (1 − n)δ) Xi (tk + δ) = Sia eAa nδ Xa (tk + (1 − n)δ) Xi (tk + δ) = Sia eAa nδ Sai eAi (1−n)δ Xi (tk ) +Sia eAa nδ Bia ed ˙ (5.82) We then let Adis be given by Adis = Sia eAa nδ Sai eAi (1−n)δ (5.83) Bdis = Sia eAa nδ Bia (5.84) Xi (tk + δ) = Adis Xi (tk ) + Bdis ed ˙ (5.85) and Bdis be given by giving We now wish to define the desired closed loop behavior by 96 ˙ ˙ Xdes = Ades Xdes (5.86) with Xdes = [e , e, ˙ eθ , eθ ] T ˙ (5.87) However, since the the desired system given by equation (5.4) does not contain eθ or eθ we cannot define Ades the same way we did for the rigid joint model. We will instead ˙ leave the discussion of the choice of Ades for later. 5.2.1 Matching Eigenvalues The first method of choosing ed is have it be a feedback of the form ˙ ed = Kei Xi (tk ) ˙ (5.88) where Kei is a matrix chosen such that the eigenvalues of eAdes δ are the same as the eigenvalues of Adis + Bdis Kei . This method produces similar response times from the switched system and the desired system. While the requirement that the pair (Adis , Bdis ) to match all eigenvalues is not very restrictive, the resulting gains do not necessarily produce a smooth space with respect to variations in (n, ke ). Also, matching the eigenvalues does not take the eigenvectors into consideration producing different responded as the order of the system increases. Therefore, we will not consider this method further for the flexible joint model. 97 5.2.2 Minimizing Discrete Difference Between Desired and Actual Behavior For the flexible joint model we have additional states, (eθ , eθ ), which were not present ˙ in the rigid body case. However, we note that these additional states do not appear in the equation for the desired behavior. Therefore, the desired equation of motion of the states (eθ , eθ ) must be determined before proceeding to the ˙ 5.2.2.1 Choosing Desired Behavior based on Passive Impedance The first method investigated is to choose Ades as an ideal system being controlled by the passive impedance controller. Ades is then given by       Ades =      0 1 0 0 −M −1 (Km + ke ) 0 M −1 Km 0 0 0 0 1 −1 −1 −1 −1 Ades1 0 − Bd M Mθ (Kc + Km ) − Bd M Mθ Kd −1 −1 −1 Ades1 = Bd (M Mθ Km + (M Mθ − 1)ke )            (5.89) (5.90) Solving (5.86) from time tk to tk + δ gives Xdes (tk + δ) = eAdes δ Xdes (tk ) Let Ad be given by 98 (5.91) Ad = eAdes δ (5.92) Xdes (tk + δ) = Ad Xdes (tk ) (5.93) such that The goal is then to minimize |Xdes (tk + δ) − Xi (tk + δ)|. To solve this we may write [Ad − Adis ] Xi (tk ) − Bdis ed = 0 ˙ (5.94) using the Moore-Penrose inverse we find T ed = Bdis Bdis ˙ −1 T Bdis [Ad − Adis ]Xi (tk ) (5.95) We will then let Kh be given by T Kh = Bdis Bdis −1 T Bdis [Ad − Adis ] (5.96) such that ed = Kh Xi (tk ) ˙ Then, we have the discrete mapping of the switched system to be given by 99 (5.97) Xi (tk + δ) = (Adis + Bdis Kh )Xi (tk ) 5.2.2.2 (5.98) Choosing Desired Behavior based on Rigid Impedance For the second method we choose Ades to be the desired rigid joint impedance decoupled from the additional states (eθ , eθ ). We thus let Ades to be given by ˙    Ades1 0  Ades =   0 0 (5.99) with 0 being a 2 × 2 matrix of zeros, and Ades1 is given by   Ades1 =  0 1 Kθ +k − M e θ    (5.100)  Xdes (tk ) (5.101) D − Mθ θ Solving for (5.86) from time tk to tk + δ we have   A δ  e des1 0  Xdes (tk + δ) =  0 0 Let Ad be given by    Ad1 0  Ad =   0 0 (5.102) where Ad1 is given by Ad1 = eAdes1 δ 100 (5.103) such that Xdes (tk + δ) = Ad Xdes (tk ) (5.104) Our goal is to minimize |CXdes (tk + δ) − CXi (tk + δ)|, where C is given by C = [I 0] (5.105) [CAd − CAdis ] Xi (tk ) − CBdis ed = 0 ˙ (5.106) We then have Using the Moore-Penrose inverse we set ed = (CBdis )T (CBdis ) ˙ −1 (CBdis )T [Ad1 − CAdis ]Xi (tk ) ed = Kh Xi (tk ) ˙ (5.107) (5.108) Where Kh is defined as Kh = (CBdis )T (CBdis ) −1 (CBdis )T [Ad1 − CAdis ] The discrete mapping of the switched system is then given by 101 (5.109) Xi (tk + δ) = (Adis + Bdis Kh )Xi (tk ) (5.110) We see that as n → 0 the switched system is dominated by the passive impedance controller. However, the passive impedance does not exactly reproduce the rigid impedance causing the resulting gains of Kh grow unbounded. 5.2.2.3 Choosing Desired Behavior based on Combination of Passive and Rigid Impedance Since the passive impedance controller does not exactly produce the desired rigid joint behavior. Therefore, the first method is not the most appropriate method. However, as noted the second method which does use the desired rigid joint behavior is not ideal since it produces unbounded control gains as n → 0. We therefore propose to use a gain Kh that is a convex combination of the two desired behaviors. Kh = γKh1 + (1 − γ)Kh2 , γ ∈ [0, 1] (5.111) where Kh1 is given by (5.96) and Kh2 is given by (5.109). The variable γ is chosen such that γ = 1 when n = 0 and γ = 0 when n = 1. Since there are infinitely many functions, γ(n) which satisfy the boundary conditions, trial and error is used to find an appropriate combination at each n value. 102 5.3 Linear Separation of External Force in Switching Condition In the change of switching conditions section we determined a set of values of ed and ed ˙ at the instant the system is switched from the impedance controller to the admittance controller. However, we notice that the choice of ed is dependant on the value of ke , ˙ which may not be known. Therefore, we wish to re derive the conditions used in the previous section with the external force not modeled as a spring force but as a measured variable. We will again use the assumption that the system is a single degree of freedom linear model given by equations (5.1)-(5.3) 5.3.1 Derivation Let us consider the external force as an unknown input into the closed loop differential equation. Then the hybrid switched system dynamics may be written as ˙ Xi = Ai Xi + Bi Fext ∀t ∈ [tk , tk + (1 − n)δ) ˙ Xa = Aa Xa + Ba Fext ∀t ∈ [tk + (1 − n)δ, tk + δ) (5.112) for a positive integer, k, and for 0 ≤ n ≤ 1. Where Xi is given by Xi = [e , e , eθ , eθ ]T ˙ ˙ Ai is given by 103 (5.113)  0     −M −1 Km  Ai =    0   −1 B d Km 1 0 0 0 M −1 Km 0 0 0 1 −1 −1 0 −Bd (Kc + Km ) −Bd Kd            (5.114) Bi is given by       Bi =      0 −1 Mθ 0 −1 (M Mθ − 1)            (5.115) Xa is given by Xa = [e , e , eθ , eθ , ed , ed ]T ˙ ˙ ˙ (5.116) Aa is given by  0 1 0 0 0 0     −M −1 Km 0 M −1 Km 0 0 0     0 0 0 1 0 0  Aa =    Aa1 Aa2 Aa3 Aa4 Aa5 Aa6     0 0 0 0 0 1   0 0 0 0 −M −1 Kθ − M −1 Dθ 104                    (5.117) −1 −1 Aa1 = Bd (Km + KT Km ) (5.118) −1 −1 Aa2 = Bd KS Km (5.119) −1 −1 Aa3 = −Bd (Km + Kp + KT Km ) (5.120) −1 −1 Aa4 = −Bd (KS Km + Kd ) (5.121) −1 Aa5 = Bd Kp (5.122) −1 Aa6 = Bd Kd (5.123) and Ba is given by   0    M −1     0  Ba =    0     0   −1 Mθ                    (5.124) Solving the differential equations in (5.112) give the general solutions Xi (t) = eAi (t−t0 ) Xi (t0 ) + t t0 eAi t−τ Ba Fext (τ )dτ (5.125) and Xa (t) = eAa (t−t0 ) Xa (t0 ) + 105 t t0 eAa t−τ Bi Fext (τ )dτ (5.126) for a positive integer, k, and for 0 ≤ n ≤ 1. At time tk the system is switched from the admittance controlled system to the impedance controlled system. We then have the change of states given by the mapping Xi = Sia Xa Sia = [I 0] (5.127) At time tk + (1 − n)δ, the system is switched from the impedance controlled system to the admittance controlled system. This results in additional states ed and ed where ed ˙ is chosen such that the control force is continuous and ed is chosen to satisfy equation ˙ (5.139). From (5.77) we have yd = ⇒ ed = y+ ey + 1 Kp 1 Kp Bθ K F K ˙ Fi + Kd y + T + S F − (1 − ˙ B Km Km Bθ K ˙ K F Fi + Kd ey + T + S F − (1 − ˙ B Km Km Bθ )F B Bθ )F B (5.128) The states at time tk + (1 − n)δ are given by the realtion Xa = Sai Xi + Kai Fext + Bai ed ˙    I  Sia =   S (5.129) where S is given by    S11 S12 S13 S14  S=  0 0 0 0 106 (5.130) −1 s11 = −Kp KT −1 s12 = −Kp KS −1 −1 s13 = KP [KP + KT − M Mθ Kc ] −1 −1 s14 = Kp (Kd + KS − M Mθ Dθ ) (5.131) Bai is given by  and Kai is given by 0     0     0  Bai =    0    −1  −Kp Kd   1                     0     0     0  Kai =    0    −1 −1  Kp (M Mθ − 1)   0 (5.132)                    (5.133) For the switched system, the states from time tk to time tk + δ can be expressed by the 107 mapping: X(tk + δ) =Sia eAa nδ Sai eAi (1−n)δ Xi (tk ) + Sia eAa (tk +δ) tk +δ tk +(1−n)δ e−Aa τ Ba Fext (τ )dτ tk +(1−n)δ + Sia eAa nδ Sai eAi (tk +(1−n)δ) tk e−Ai τ Bi Fext (τ )dτ + Sia eAa nδ Kai Fext (tk + (1 − n)δ) + Sia eAa nδ Bai ed ˙ (5.134) We consider the desired behavior of the closed-loop system to be that of the system under passive impedance control. The desired dynamics can be written as Xdes = Ades Xdes + Bdes Fext (5.135) Ades is given by  0     −M −1 Km  Ades =    0   −1 B d Km 1 0 0 0 M −1 Km 0 0 0 1 −1 −1 0 −Bd (Kc + Km ) −Bd Kd and Bdes given by 108            (5.136)       Bdes =       0 −1 Mθ 0 −1 (M Mθ − 1)           (5.137) The general solution of Xdes from tk to tk + δ is given by Xdes (t) = eAdes (t−t0 ) Xdes (tk ) + tk +δ tk eAdes (t−τ ) Bdes1 Fext (τ )dτ (5.138) As in section (5.2.2.1) we have the goal is to choose ed at tk + (1 − n)δ such that ˙ Xdes (tk + δ) − X(tk + δ) = 0 (5.139) Substituting equations (5.134) and (5.138) into (5.139) we get eAdes δ Xdes (tk ) + eAdes (tk +δ) tk +δ tk e−Ades τ Bdes Fext (τ )dτ − [Sia eAa nδ Sai eAi (1−n)δ Xi (tk ) + Sia eAa (tk +δ) + Sia eAa nδ Sai eAi (tk +(1−n)δ) tk +(1−n)δ tk tk +δ tk +(1−n)δ e−Aa τ Ba Fext (τ )dτ e−Ai τ Bi Fext (τ )dτ + Sia eAa nδ Kai Fext (tk + (1 − n)δ + Sia eAa nδ Bai ed ] = 0 ˙ To solve equation (5.140) we will consider ed to be of the form ˙ 109 (5.140) e d = uh + up ˙ (5.141) where uh minimizes the homogeneous portion of (5.140), when Fext ≡ 0, and up minimizes the additional terms when Fext = 0. To find uh we let Fext ≡ 0 and up = 0 and equation (5.140) can then be written as [eAdes δ Xdes (tk ) − Sia eAa nδ Sai eAi (1−n)δ X(tk )] − eAa nδ Bai uh = 0 (5.142) Letting Xdes (tk ) = X(tk ), (5.142) simplifies to. [eAdes δ − Sia eAa nδ Sai eAi (1−n)δ ]X(tk ) − eAa nδ Bai uh = 0 (5.143) Using the Moore-Penrose, set uh = Kh Xi (tk ) (5.144) where Kh = (Sia eAa nδ Bai )T Sia eAa nδ Bai −1 (Sia eAa nδ Bai )T [eAdes δ − Sia eAa nδ Sai eAi (1−n)δ ] Since switching occurs at tk + (1 − n)δ, it is desirable to write uh in the form 110 (5.145) uh = Kh (eAi (1−n)δ )−1 Xi (tk + (1 − n)δ) (5.146) By substituting (5.146) back into (5.140) and find eAdes δ Xdes (tk ) + eAdes (tk +δ) tk +δ tk e−Ades τ Bdes Fext (τ )dτ − [Sia eAa nδ Sai eAi (1−n)δ X(tk ) + Sia eAa (tk +δ) + Sia eAa nδ Sai eAi (tk +(1−n)δ) tk +(1−n)δ tk tk +δ tk +(1−n)δ e−Aa τ Ba Fext (τ )dτ e−Ai τ Bi Fext (τ )dτ + Sia eAa nδ Bin Kh (eAi (1−n)δ )−1 X(tk + (1 − n)δ) + Sia eAa nδ Kai Fext (tk + (1 − n)δ) + Sia eAa nδ Bai up ] = 0 (5.147) Using equation (5.125) we write (5.147) as {eAdes δ Xdes (tk ) − Sia eAa nδ Sai eAi (1−n)δ X(tk ) − Sia eAa nδ Bai Kh X(tk )}+ tk +δ eAdes (tk +δ) tk [Sia eAa (tk +δ) e−Ades τ Bdes Fext (τ )dτ − tk +δ tk +(1−n)δ e−Aa τ Ba Fext (τ )dτ + Sia eAa nδ Sai eAi (tk +(1−n)δ) + Sia eAa nδ Bai Kh eAi tk tk +(1−n)δ tk tk +(1−n)δ tk e−Ai τ Bi Fext (τ )dτ e−Ai τ Bi Fext (τ )dτ + Sia eAa nδ Kai Fext (tk + (1 − n)δ) + Sia eAa nδ Bai up ] = 0 111 (5.148) From equations (5.139), (5.140), (5.144), and from linearity we have the choice of up can only be chosen to minimize portions of (5.148) containing the external force. Thus, (5.148) simplifies to tk +δ eAdes (tk +δ) tk [Sia eAa (tk +δ) e−Ades τ Bdes Fext (τ )dτ − tk +δ tk +(1−n)δ e−Aa τ Ba Fext (τ )dτ + Sia eAa nδ Sai eAi (tk +(1−n)δ) + Sia eAa nδ Bai Kh eAi tk tk +(1−n)δ tk tk +(1−n)δ tk e−Ai τ Bi Fext (τ )dτ e−Ai τ Bi Fext (τ )dτ + Sia eAa nδ Kai Fext (tk + (1 − n)δ) + Sia eAa nδ Bai up ] = 0 (5.149) Solving for up gives up = (Sia eAa nδ Bai )T Sia eAa nδ Bai {eAdes (tk +δ) tk +δ tk [Sia eAa (tk +δ) −1 (Sia eAa nδ Bai )T e−Ades τ Bdes Fext (τ )dτ − tk +δ tk +(1−n)δ e−Aa τ Ba Fext (τ )dτ + Sia eAa nδ Sai eAi (tk +(1−n)δ) + Sia eAa nδ Bin Kh eAi tk tk +(1−n)δ tk tk +(1−n)δ tk − Sia eAa nδ Kai Fext (tk + (1 − n)δ)} 112 e−Ai τ Bi Fext (τ )dτ e−Ai τ Bi Fext (τ )dτ ] (5.150) which may be written in the form up = tk +δ tk Fp (t − τ )Fext (τ )dτ + Hp Fext (tk + (1 − n)δ) (5.151) where Fp (t) is given by Fp = (Sia eAa nδ Bai )T Sia eAa nδ Bai −1 (Sia eAa nδ Bai )T {eAdes (tk +δ) e−Ades τ Bdes − [Sia eAa nδ Sai eAi (tk +(1−n)δ) e−Ai τ Bi + Sia eAa nδ Bin Kh eAi tk e−Ai τ Bi ]} (5.152) for τ ∈ (tk , tk + (1 − n)δ], Fp is given by Fp = (Sia eAa nδ Bai )T Sia eAa nδ Bai −1 (Sia eAa nδ Bai )T {eAdes (tk +δ) e−Ades τ Bdes − Sia eAa (tk +δ) e−Aa τ Ba } (5.153) for τ ∈ (tk + (1 − n)δ, tk + δ], and Hp is given by Hp = − (Sia eAa nδ Bai )T Sia eAa nδ Bai −1 113 (Sia eAa nδ Bai )T Sia eAa nδ Kai (5.154) Chapter 6 Experiments We now investigate the performance of the hybrid impedance and admittance controller as we change n value using the KUKA-DLR lightweight arm, shown in Figure 6.1. The arm is equipped with a force sensor at the end of the effector to measure the external forces. Figure 6.1: Photo of Experimental Setup 114 6.1 Experimental Set-up The reference angle for the arm is shown in Figure 6.2. The large gear ratio in the drive of the joint causes the arm to act according to the flexible joint model. The joint is equipped with a force torque sensor to measure the resulting torque between the link and the motor. The model of the single-DOF flexible joint Kuka-DLR arm is assumed to be: q Figure 6.2: Reference Diagram of Experimental Set-up −1 ˙ m¨ + g(q) = τ + Dm Km τ + J T Fext q (6.1) −1 ¨ B θ + τ + Dm K m τ = τ m ˙ (6.2) τ = Km (θ − q) (6.3) (6.4) 115 The parameters of the single joint of the KUKA-DLR lightweight arm are given as follows: m = 3.6 Kg m2 B = 1.5308 Kg m2 Dm = 12 N ms Km = 24000 N m g(q) = −73 sin(q) N m (6.5) The parameters of the desired impedance were chosen as follows: Mθ = m Kθ = 100 N m Dθ = 1.4 Kθ Mθ N ms B = 4.5 Bθ (6.6) The impedance controller is implemented according to −1 −1 ˙ τm = τi =BBθ {g(q l (θ)) + M Mθ [−Kθ (q l (θ) − q0 ) − Dθ (θ − q0 )] −1 −1 + M q0 + (M Mθ − 1)τext } + (1 − BBθ )τ ¨ (6.7) where q l is given by q l (θ) = h−1 (θ) l (6.8) −1 hl (q) = q + Km l(q) (6.9) hl is given by 116 and l(q) is given by l(q) = g(q) − Kθ (q − q0 ) (6.10) and the admittance controller is implemented according to the control law. τm = τa = B ˙ ˙ ˙ [−Kp θ − Kd (θ) − KT (θ − q) − Ks (θ − q) Bθ −1 + (Km + KT + Kp )Km g(qd ) + Kp qd + Kd qd ] + (1 − ˙ B )τ Bθ (6.11) with qd again being given by Mθ (¨d − q0 ) + Dθ (qd − q0 ) + Kθ (qd − q0 ) = J T Fext q ¨ ˙ ˙ (6.12) We see that the mapping q l is a steady state approximation of the value of q at a given value of θ. The control gains chosen to be Kp = 6732.78 N m KT = −0.402 N m Kd = 292.09 N ms Ks = −0.00446 N ms (6.13) We implemented the hybrid controller described by (5.32). At the instant that the system is switched from the impedance controller to the admittance controller we consider the choice of states qd and qd such that the control force τm is continuous. Setting ˙ equations (6.7) and (6.11) equal gives 117 −1 ˙ (Km + KP + KT )Km g(qd ) + Kp qd = (Kd + KS − Dθ )θ +(Kp + KT )θ − KT q − KS q + Kθ (q0 − q l (θ)) + g(q l (θ)) − Kd qd ˙ ˙ (6.14) Inverting equation (6.14) may be difficult analytically, However, given qd we find that ˙ (6.14) may be solved using the same iterative process used in section (4.2.4). To solve for qd we wish to use a process similar to that used in section (5.3). However, the non˙ linearity of the control and switching complicates the minimization equations. Therefore, to simplify the process we consider the linearization of the equations about the operating point and use the linear method to find qd . ˙ We have qd given by ˙ q d = u h + up ˙ (6.15) where uh and up are given by the relations uh = (Sia eAa nδ Bai )T Sia eAa nδ Bai −1 (Sia eAa nδ Bai )T eAdes δ (eAi (1−n)δ )−1 Xi (tk + (1 − n)δ) −Sia eAa nδ Sai eAi (1−n)δ (eAi (1−n)δ )−1 Xi (tk + (1 − n)δ) up = tk +δ tk Fp (t − τ )Fext (τ )dτ + Hp Fext (tk + (1 − n)δ) (6.16) (6.17) Note that the solution of up requires knowledge of the external torque at future times 118 t ∈ [tk + (1 − n)δ, tk + δ]. We then use theorem 3.2.3 from [20] which allows us to rewrite (6.17) as up = Up (tk + δ)Fext (tk + δ) + Hp Fext (tk + (1 − n)δ) (6.18) This again requires Fext (tk + δ) which is not known at time tk + (1 − n)δ. However, Fext (t) is surjective and therefore there exists a right inverse allowing us to write ˆ up = [Up (tk + δ) + Hp ]Fext (tk + (1 − n)δ) (6.19) ˆ Since Up (tk + δ) cannot be calculated at the time the experiment was performed, we instead show the validity of the approach by choosing a set of values constant Kpa where up = Kpa Fext (tk + (1 − n)δ) (6.20) ˆ We now proceed to analyse the response of the system under different values of Hp to demonstrate the change in response and verify that there exists a time varying function that satisfies (6.20) is equivalent to (6.17). 6.2 Results for Desired Response Equal to Passive Impedance In (5.2.2) we discussed briefly that it is possible to choose different desired behaviors for a flexible joint model based on the passive impedance control response and the rigid impedance control response. Therefore, we will analyse multiple desired behaviors the 119 understand fully the advantages and disadvantages of each. First we consider the desired behavior to be given by the passive impedance control response. The experimental response of the hybrid system when no external force is shown in Figure 6.3 with a switching rate of 25 ms -0.05 0 Position q (rad) 0.05 0. 1 n decreasing 0.15 0. 2 0.25 0. 3 Admittance 0.35 0 1 n=0 n=1 2 3 4 5 Time (sec) 6 7 8 9 Figure 6.3: Free Space Hybrid Response for Different n values with δ = 25 ms, and using the passive impedance as the desired behavior From Figure 6.3 we see that there is little deviation between the passive impedance controlled system and the hybrid system during the free response case. This is not surprising since the passive impedance controller is used as the desired behavior for 120 10 the choice of states of the switching conditions, and because gravitational feedback was tuned for the passive impedance control. To verify that there is a difference in response for different values of n in the case with no external force let us consider the application of the gravity free control in the system with gravity. -0.1 Admittance 0 n decreasing Position q (rad) 0. 1 0. 2 0. 3 n=0 0. 4 n=1 0. 5 0. 6 0 1 2 3 4 5 6 Time (sec) 7 8 9 Figure 6.4: Free Space Hybrid Response for Different n values with δ = 25 ms, and using the passive impedance as the desired behavior ignoring gravity We see from Figure 6.4 that when gravity is not considered the system produces a large steady state error when controlled by the passive impedance controller while it produces virtually no error when controlled by the admittance controller. We further see 121 10 that the hybrid controller produces a steady state error between that of the admittance controller and the passive impedance controller. Furthermore, the steady state error of the hybrid controller decreases as the value of n increases giving more weight to the admittance controller. However, we find that the hybrid controller does not closely approximate the admittance controller when n = 0. This is due to restrictions on the position controller gains due to torque restrictions and noise in the read position and velocity. We next consider contact with a soft environment. To this end, a padded surface is placed in the path of the end effector. Then the link is moved until the effector is in contact but there is no force. Then the reference position is commanded to move 10 degrees into the surface. Since the presence of the external force requires the particular solution of the feedback in the form of up in (6.20), we observe the change in response for a constant n value and a switching rate of 25 ms, and for different values of Kpa . Figure 6.5 shows the response of the system for n = 1 (admittance control with resetting) for Kpa with values 0.005, 0.000, −0.001, −0.002, −0.003, −0.004, and −0.005 shown in decreasing order from right to left. We notice that there is a small change in the steady state solution as Kpa varies, but the change is small due to the softness of the external stiffness. We also see that as Kpa decreases, the rate at which the hybrid system response converges to the steady state solution increases. We may therefore infer that the changing the value of Kpa changes the transient response of the system. However, we are unable to compare the system to the admittance controlled system since the experiment would need to be reinitialized to change the controller, which changes the set point at which the effector contacts the surface. 122 Kpa=0.005 1.13 Position (rad) 1.14 Kpa decreasing 1.15 1.16 1.17 1.18 Kpa=-0.005 Kpa=0 0 1 2 3 4 Time (sec) 5 6 Figure 6.5: Soft contact position response for δ = 25 ms, n = 1, and varying Kpa values while using passive impedance controller for desired behavior Figure 6.6 shows the response of the hybrid system with switching rate 25 ms using a constant value Kpa = 0.005 and varying n from 1 to 0 in decrements of 0.1 shown from left to right. We see from the figure that there is a small change in the steady state position as the value of n changes. However, some of the variation can be attributed to the slight change in initial configuration. We also notice that the rate of convergence to the steady state solution increases noticeably as n decreases. The change of rate of convergence is characteristic of the admittance controller with lower gains. From Figures 123 7 1.13 Position q (rad) 1.14 1.15 n decreasing 1.16 1.17 1.18 n=0 n=1 0 1 2 3 4 5 Time (sec) 6 7 8 Figure 6.6: Soft contact position response for δ = 25 ms, Kpa = 0.005, and varying n while using passive impedance controller for desired behavior 6.5 and 6.6 we see that when in contact with a soft environment the hybrid system shows large overshoot and oscillations for small n which decrease as n increase, and that we may change the value of Kpa to achieve the desired performance for a given n value. We now study the response when the hybrid controller is implemented during contact with a stiff environment. The experiment for stiff contact is done in the same manner as the soft contact, except that the padded surface has been removed completely leaving only the stiff surface the pad was sitting on. We observe the change in response when 124 9 1.199 Kpa=0 1. 2 1.201 Position q (rad) 1.202 Kpa decreasing 1.203 1.204 1.205 Kpa=-0.005 1.206 1.207 1.208 Kpa=0.005 0 1 2 3 4 5 6 Time (sec) Figure 6.7: Hard contact position response for δ = 25 ms, n = 1, and varying Kpa while using passive impedance controller for desired behavior contact is made with a constant n value and a varying Kpa value. Figure 6.7 shows the position response when in contact with a stiff environment for n = 1 (admittance control with resetting) and with Kpa values 0.005, 0.000, −0.001, −0.002, −0.003, −0.004, and −0.005 shown in decreasing order from right to left. We notice a slight variation in the mean steady state value, as was the case for soft contact. However, for smaller Kpa values the system does not reach a steady state value, and produces a high frequency vibration about a mean value instead. This is because the steady state value of the 125 7 position controller is not the same value as the passive impedance controller, and the deviation between the steady state values increases as the external stiffness increases. This also explains why the oscillations were not observed for the soft and free space cases. Noting that the performance changes as Kpa changes allows us to again infer that there exists a varying Kpa value that produces the desire result. 1.199 1. 2 1.201 Position q (rad) 1.202 n decreasing 1.203 1.204 1.205 n=0 1.206 1.207 n=1 1.208 0 1 2 3 4 5 6 7 Time (sec) Figure 6.8: Hard contact position response for δ = 25 ms, Kpa = 0.005 and varying n while using passive impedance controller for desired behavior Figure 6.8 shows the response of the joint angle for Kpa = 0.005, δ = 0.25, and n varying from 0 to 1, with n decreasing from left to right. Similarly Figure 6.9 shows the response of the joint angle for Kpa = −0.005, δ = 0.25, and n varying from 0 to 1, with 126 8 1.199 1.2 1.201 Position q (rad) 1.202 1.203 n decreasing 1.204 1.205 n=0 1.206 1.207 n=1 1.208 0 1 2 3 4 5 6 7 Time (sec) Figure 6.9: Hard contact position response for δ = 25 ms, Kpa = −0.005, and varying n while using passive impedance controller for desired behavior n decreasing from left to right. We see from both Figures 6.8 and 6.9 that changing the value of n changes the steady state behavior of the system, and can result in a persistent excitation. We also note that the response more closely resembles the passive impedance controller as n goes to 0. Therefore, we find that we may choose a value of n to produce the best behavior for a given external stiffness. 127 8 6.3 Results for Desired Response Equal to Combination of Passive Impedance and Rigid Impedance In the previous section we analysed experimental results with resetting conditions that were chosen to minimize the difference between the switched behavior and the ideal passive impedance behavior. However, the ideal passive impedance behavior does not exactly match the desired link behavior. Therefore, we investigate experimentally the effect of switching based on a convex combination of the passive impedance controller and the rigid joint impedance as described in Section 5.2.2.3. The experiments are preformed with γ in equation (5.111) given by γ = (1 − n)2 (6.21) Figure 6.10 shows the response of the system in free motion for varying n values with δ = 25 ms. For free motion we do not have to consider the external torque. We notice that there is a change in transient response of the hybrid controller as n is changed, and that small n values produce transient responses closer to the passive impedance controller while larger n values produce transient responses closer to the admittance controller. This is an improvement over the choice of passive impedance as the desired behavior shown in figure 6.3 since it did not change the transient response as n varied. However, we notice that there is a difference between the steady state position of the admittance control compared to both the impedance and hybrid control methods, and that the steady state response of the hybrid controller does not vary much as n changes. To investigate the steady state error effects closely, we apply the control again in free 128 -0.05 0 Position q (rad) 0.05 0. 1 n decreasing 0.15 0. 2 0.25 0. 3 0.35 0 Admittance 1 n=1 2 n=0 3 4 5 6 Time (sec) 7 8 9 Figure 6.10: Free Space Hybrid Response for Different n values with δ = 25 ms, and using a combination of passive impedance and rigid impedance as the desired behavior space but assume that there is no gravity present. Figure 6.11 shows the response of the system in free space with varying n, n decreasing from left to right, for δ = 25 ms, and without gravity compensation. We see from the figure that there is a large change in the steady state response as n changes, with the steady state position of the hybrid controller equal to that generated by the passive impedance controller when n = 0 and approaching the steady state position of the admittance control as n goes to 1. However, the steady state response with the 129 10 -0.1 Admittance 0 n decreasing Position q (rad) 0. 1 0. 2 n=0 0. 3 0. 4 n=1 0. 5 0. 6 0 1 2 3 4 5 6 7 8 9 Time (sec) Figure 6.11: Free Space Hybrid Response for Different n values with δ = 25 ms, and using a combination of passive impedance and rigid impedance as the desired behavior while ignoring gravity hybrid controller never reaches the steady state position of the admittance control. This is due to the low position gains, constrained by hardware limitations. We next consider the response of the system when it comes in contact with an external surface. We first consider a soft surface which is produced by putting a padding on the rigid surface. We use the same procedure as in the previous section of moving the effector until it is in contact with the surface but the force measurement is still zero. We then send a step input command of moving 10 degrees into the surface and record 130 10 1.115 Kpa=0.005 1.12 1.125 Position q (rad) 1.13 1.135 1.14 Kpa decreasing 1.145 1.15 Kpa=-0.005 1.155 1.16 1.165 Kpa=0 0 1 2 3 4 Time (sec) 5 6 Figure 6.12: Soft contact position response for δ = 25 ms, n = 1, and varying Kpa values while using a combination of passive impedance and rigid impedance as the desired behavior the response. Figure 6.12 shows the joint angle response for δ = 25 ms, n = 1, and for varying Kpa values. We see from the figure that the steady state response changes as Kpa changes. Also, the rate at which the system converges to steady state changes as Kpa changes. Clearly, it is possible to change the performance of the hybrid system through our choice of Kpa . We next investigate the change in response as n varies. Figure 6.13 shows the response of the system for δ = 25 ms, Kpa = 0.005, and n changing in decrements of 0.1 from left to right. We see from the figure that the 131 7 1.115 n=0 n=1 1.12 1.125 Position q (rad) 1.13 1.135 1.14 n decreasing 1.145 1.15 1.155 1.16 1.165 0 1 2 3 4 5 6 Time (sec) 7 8 9 Figure 6.13: Soft contact position response for δ = 25 ms, Kpa = 0.005, and varying n while using a combination of passive impedance and rigid impedance as the desired behavior steady state response of the hybrid system varies noticeably as n changes. Also notice that the transient response changes as n changes. However, we notice that the passive impedance control, n = 0, does not appear in line with the trend of decreasing n. Namely, we notice that as n is decreasing, the steady state position gradually decreases and the rate of convergence of the system gradually increases. When n changes from 0.1 to 0.0, we notice a sudden increase in the steady state position of the system and a very large decrease in the rate of convergence of the system. This is due to a constant choice 132 10 of Kpa over all n values. We notice from chapter 5.3.1 that the value of Kpa should ultimately be determined by both the external stiffness, and the switching weight n and from figure 6.12 we see that the value for Kpa effects the steady state position. Therefore, we are able infer that varying Kpa and n can be used to change the behavior of the system meaning there is a selection of Kpa and n that will produce the best response for the soft contact case. However, we notice that the steady state response is more sensitive to the choice of Kpa then when the passive impedance control is used as the desired behavior. The admittance controller is again not shown as the system must be reinitialized in order to run the admittance control which changes the set point of the surface contact. We have now examined the soft contact and the free space motion of the link and seen that choosing n and Kpa allows for a wide range of performance form the system. We now wish to examine contact with a stiff contact surface. The contact with the stiff contact is done the same way as in the previous section. The effector is bought into contact with the surface such that the force sensor continues to read 0 external force. Then the system is given a step into of 10 degrees into the surface and the response is measured. Figure 6.14 shown the response curves for stiff contact with n = 1, δ = 25 ms, and Kpa varying. We see from the figure that there is an increase in high frequency vibration as Kpa decreases. Furthermore, the high frequency vibration persists causing the system to never reach a steady state equilibrium. This behavior is also present when the passive impedance control is used as the desired dynamics. We now proceed to investigate the effect of varying n for a given Kpa value. Figures 6.15 and 6.16 show the response of the hybrid controlled system for δ = 133 1.172 1.173 1.174 Position q (rad) 1.175 Kpa decreasing 1.176 1.177 1.178 1.179 1.18 Kpa=0.005 1.181 0 1 Kpa=-0.005 Kpa=0 2 3 4 Time (sec) 5 6 Figure 6.14: Hard contact position response for δ = 25 ms, n = 1, and varying Kpa while using a combination of passive impedance and rigid impedance as the desired behavior 25 ms, n decreasing by 0.1 with each curve from right to left, and Kpa = 0.005 and Kpa = −0.005 respectively. From figure 6.15 we see that the steady state behavior changes drastically as n changes from 0.2 to 0.1. Furthermore, we see that the high frequency behavior decreases as n decreases. However, in figure 6.16 we notice that the large change in steady state behavior occurs when n changes from 0.3 to 0.2, a larger n value than in figure 6.15. However, we also see in figure 6.16 that the higher frequency behavior of the system is of larger magnitude for larger n values. Figures 6.8 134 7 1.172 n=0 1.173 1.174 n decreasing Position q (rad) 1.175 1.176 1.177 1.178 1.179 1.18 1.181 n=1 0 1 2 3 4 5 Time (sec) 6 7 8 Figure 6.15: Hard contact position response for δ = 25 ms, Kpa = 0.005 and varying n while using a combination of passive impedance and rigid impedance as the desired behavior and 6.9 which use the passive impedance control show smaller deviations in steady state behavior and smaller effects of the high frequency motion for larger n. However, we see that the high frequency motion has higher magnitude at steady state when using the passive impedance control as the desire behavior. Therefore, we conclude that using a combination of rigid joint impedance and passive impedance control to find the desired behavior produces better results for larger n in free space than choosing the passive impedance control as the desired behavior. How135 9 1.172 n=0 1.173 1.174 n decreasing Position q (rad) 1.175 1.176 1.177 1.178 1.179 1.18 n=1 1.181 0 1 2 3 4 5 Time (sec) 6 7 8 Figure 6.16: Hard contact position response for δ = 25 ms, Kpa = −0.005 and varying n while using a combination of passive impedance and rigid impedance as the desired behavior ever, choosing the desired impedance control as the desired behavior is less sensitive to the chosen value of Kpa as the external stiffness increases. Even with the comparable behavior we find that we may choose a pair n and Kpa to produce the same or better performance of the passive impedance control for all external stiffness values, and better performance than the admittance control for stiffer external stiffness. Although we are unable to match the admittance control performance in free space due to hardware restrictions. 136 9 Chapter 7 Conclusion We have presented a hybrid switching method as originally proposed by Ott et al. for a single degree of freedom system [19]. The method uses a duty cycle as a parameter design to interpolate performance characteristics and stability of the impedance control and the admittance control. We then expand upon the previous work by providing a new stability theorem which includes a wider range of possible systems, and produced new switching conditions to improve improve the performance of the switched system. We then generalized the theory for general system modelled by the rigid joint model, linear single degree-of-freedom system modelled with a flexible joint, and a class of non-linear single degree-of-freedom systems modelled with a flexible joint. Through simulations and experiments we find that we are able to combine robustness of the impedance control in stiff contact and accuracy of the admittance control. However, the the combination is limited by the quality of the position control and becomes numerically difficult to calculate for the flexible system as non-linearities are added. All analysis of robustness here is done based on simulation and experimentation and more analytic methods of 137 analysis are an important goal of future work. Through experimentation and simulation we have shown that it is possible to change the performance of the controller for a given stiffness by changing the duty cycle allowing us to choose one which we believe to be best. However, since the performance of the hybrid control it based on the external stiffness and thus a method of adaptive approximation of the external stiffness is also included as a future research goal. 138 BIBLIOGRAPHY 139 BIBLIOGRAPHY [1] A. Albu-Schaffer and G. Hirzinger. State feedback controller for flexible joint robots: A globally stable approach implemented on DLR’s light-weight robots. In Intelligent Robots and Systems, 2000.(IROS 2000). Proceedings. 2000 IEEE/RSJ International Conference on, volume 2, pages 1087–1093. IEEE, 2000. [2] C. An and J. Hollerbach. Dynamic stability issues in force control of manipulators. In Robotics and Automation. Proceedings. 1987 IEEE International Conference on, volume 4, pages 890–896. IEEE, 1987. [3] R.J. Anderson and M.W. Spong. Hybrid impedance control of robotic manipulators. Robotics and Automation, IEEE Journal of, 4(5):549–556, 1988. [4] G. Cheng, S.H. Hyon, J. Morimoto, A. Ude, G. Colvin, W. Scroggin, and S.C. Jacobsen. CB: A humanoid research platform for exploring neuroscience. In Humanoid Robots, 2006 6th IEEE-RAS International Conference on, pages 182–187. IEEE, 2007. [5] T. Das and R. Mukherjee. Shared-sensing and control using reversible transducers. Control Systems Technology, IEEE Transactions on, 17(1):242–248, 2009. [6] S. Eppinger and W. Seering. Understanding bandwidth limitations in robot force control. In Robotics and Automation. Proceedings. 1987 IEEE International Conference on, volume 4, pages 904–909. IEEE, 1987. [7] FR Gantmacher. The Theory of Matrices. Chelsea, 1959. [8] N. Hogan. Impedance control: an approach to manipulation: parts 1, 2, 3. Journal of Dynamic Systems, Measurement and Control, 107:1–24, 1985. [9] R.A. Horn and C.R. Johnson. Matrix analysis. Cambridge university press, 1990. 140 [10] D.A. Lawrence. Impedance control stability properties in common implementations. In Robotics and Automation, 1988. Proceedings., 1988 IEEE International Conference on, pages 1185–1190. IEEE, 1988. [11] D. Liberzon and A.S. Morse. Basic problems in stability and design of switched systems. Control Systems Magazine, IEEE, 19(5):59–70, 1999. [12] GJ Liu and AA Goldenberg. Robust hybrid impedance control of robot manipulators. In Robotics and Automation, 1991. Proceedings., 1991 IEEE International Conference on, pages 287–292. IEEE, 1991. [13] W.S. Lu and Q.H. Meng. Impedance control with adaptation for robotic manipulations. Robotics and Automation, IEEE Transactions on, 7(3):408–415, 1991. [14] M.T. Mason. Compliance and force control for computer controlled manipulators. Systems, Man and Cybernetics, IEEE Transactions on, 11(6):418–432, 1981. [15] W.S. Newman. Stability and performance limits of interaction controllers. Journal of dynamic systems, measurement, and control, 114:563, 1992. [16] K. Ogata. Discrete-time control systems, volume 1. Prentice-Hall, 1995. [17] C. Ott. Cartesian impedance control of redundant and flexible-joint robots. Springer Verlag, 2008. [18] C. Ott, O. Eiberger, W. Friedl, B. Bauml, U. Hillenbrand, C. Borst, A. AlbuSchaffer, B. Brunner, H. Hirschmuller, S. Kielhofer, et al. A humanoid two-arm system for dexterous manipulation. In Humanoid Robots, 2006 6th IEEE-RAS International Conference on, pages 276–283. IEEE, 2006. [19] C. Ott, R. Mukherjee, and Y. Nakamura. Unified Impedance and Admittance Control. In Robotics and Automation (ICRA), 2010 IEEE International Conference on, pages 554–561. IEEE, 2010. [20] J.R. Partington. Linear operators and linear systems: an analytical approach to control theory. Cambridge University Press, 2004. [21] P. Peleties and R. DeCarlo. Asymptotic stability of m-switched systems using Lyapunov-like functions. In American Control Conference, 1991, pages 1679–1684. IEEE, 1991. 141 [22] M. Pelletier and M. Doyon. On the implementation and performance of impedance control on position controlled robots. In Robotics and Automation, 1994. Proceedings., 1994 IEEE International Conference on, pages 1228–1233. IEEE, 1994. [23] M.H. Raibert and J.J. Craig. Hybrid position/force control of manipulators. Journal of Dynamic Systems, Measurement, and Control, 102(127):126–133, 1981. [24] J. Roy and L.L. Whitcomb. Adaptive force control of position/velocity controlled robots: theory and experiment. Robotics and Automation, IEEE Transactions on, 18(2):121–137, 2002. [25] H. Seraji. Adaptive admittance control: An approach to explicit force control in compliant motion. In Robotics and Automation, 1994. Proceedings., 1994 IEEE International Conference on, pages 2705–2712. IEEE, 1994. [26] B. Siciliano and O. Khatib. Handbook of Robotics. Springer-Verlag New York Inc, 2008. [27] T. Valency and M. Zacksenhouse. Accuracy/robustness dilemma in impedance control. Journal of dynamic systems, measurement, and control, 125:310, 2003. 142