Energy-based modeling and Hamiltonian LQG control of a flexible beam actuated by IPMC actuators

The control of a flexible beam using ionic polymer metal composites (IPMCs) is investigated in this paper. The mechanical flexible dynamics are modelled as a Timoshenko beam. The electric dynamics of the IPMCs are considered in the model. The port-Hamiltonian framework is used to propose an interconnected control model of the mechanical flexible beam and IPMC actuator. Furthermore, a passive and Hamiltonian structure-preserving linear quadratic Gaussian (LQG) controller is used to achieve the desired configuration of the system, and the asymptotic stability of the closed-loop system is shown using damping injection. An experimental setup is built using a flexible beam actuated by two IPMC patches to validate the proposed model and show the performance of the proposed control law.


I. INTRODUCTION
The port-Hamiltonian system (PHS) formulation and passivity-based control have been widely used and demonstrated to be effective for the modeling, analysis and control of nonlinear systems [1], [2]. The classical port Hamiltonian system was first introduced for the finite-dimensional system described by ordinary differential equations [3] with application to mechanical, electrical and chemical systems using port energy variables. Later, the authors in [4] discussed the infinite-dimensional port-Hamiltonian system with a new geometric structure called Stokes-Dirac structures. The wellposedness of the infinite-dimensional PHS was investigated in [5], which shows that the passive propriety is very helpful to prove the well-posedness of the PHS.
It is of great interest to use the PHS formalism for complex multi-physics systems. Under the PHS framework, physical natures are considered: energy conservation, dissipation and energy exchanges between system components. The PHS enables the direct and clear interconnection of different components of the complex system via energy ports. Furthermore, when associated with structure-preserving model reduction and passivity-based control techniques, the port-Hamiltonian framework with physical interpretation is of great interest.
Many studies have been dedicated to passivity-based control for multi-physics physical systems [6]- [10].
Ionic polymer-metal composites (IPMCs) are widely used because of their core advantages: ease of fabrication, fast response, large strain, and low actuation voltage [11]. Thus, IPMCs have been increasingly used in various domains in recent decades. Of particular interest is the application of IPMCs in medical endoscopes. The use of smart material provides additional degrees of freedom, which contribute to the avoidance of irreversible damage and alleviation of suffering. In [12], a micro-endoscope actuated by IPMCs to drive the bending movement was proposed for endonasal skull base surgery.
The proposed IPMC actuated endoscope system is composed of two components: the electric dynamics of IPMCs described by an ordinary differential equation and the mechanical flexible beam described by a set of partial differential equations. Different physical properties of IPMCactuated endoscopes lead to a complex multi-physical system problem. Port-Hamiltonian modeling of an IPMC patch actuator was proposed in [10]. The mechanical structure is a polyethylene polytube, modelled as a flexible beam using Timoshenko beam theory in a first approach. The complexity of the multi-physics system motivates the use of the port-Hamiltonian framework. Using the PHS formulation, all physical properties of the complex system, such as the physical nature of IPMC actuators and the mechanical flexibility of the beam, are considered. These components are considered interconnected by the PHS formalism via the energy ports.
Many studies have been dedicated to the control of IPMC actuators and flexible structures. The reader can find some classical control analysis and control design methods for flexible structures in [13], [14]. A reduced-order linearquadratic-Gaussian (LQG) controller was proposed in [15] using an early lumping approach. However, the closed-loop stability was not investigated, and only numerical results were obtained. Of particular interest are the results in [16], where a reduced-order LQG control design technique for high-dimensional port-Hamiltonian systems was proposed. The results are based on the LQG controller [17], [18]; then, an equivalent port-Hamiltonian formulation and structurepreserving model reduction were proposed. In [19], these results were generalized to the infinite-dimensional case. In [20], a nonlinear lumped parameter system of a flexible structure using the PHS framework of a class of 1-D IPMC actuated flexible structures was proposed. In that work, a state feedback control law with a state observer for practical implementation is proposed. However, with the increase in number of links, the proposed model becomes very complex and challenging to control design. To address these constraints, a classical passivity-based interconnection damping assignment passivity-based control (IDA-PBC) method is proposed based on a distributed parameter model in [21]. However, the early lumped approach is considered in the previous work, i.e., and the control design is based on the discretized model of the distributed parameter system. The closed-loop stability has not been discussed when the designed discretized state feedback control law is implemented in the original distributed parameter system.
Unlike previous works, the proposed paper designs a passivity-based optimal LQG control of the ODE-PDE coupled system under the port Hamiltonian framework. The PDE is used to address the structure's flexible nature, and the ODEs are used to describe the main dynamics of the IPMC actuators. By choosing the weighting operators in a special manner, the designed optimal LQG controller is passive and has a Hamiltonian structure, which can guarantee the asymptotic stability of the closed-loop system even when we apply the reduced-order optimal controller on the original PDE-ODE system. This stability issue is not considered in previous works [15], [22]. Furthermore, the effectiveness of the proposed control is validated by experimental results. The control law is implemented on the experimental setup to validate the effectiveness of the proposed method and achieve the desired performance of the flexible structure in both mono-actuated and multi-actuated cases. Preliminary results were reported in [22], where a passive LQG controller was proposed for a mono-IPMC actuated flexible structure. Only simulation results were presented.
In Section II, a PDE-ODE interconnected model in the port-Hamiltonian framework of a one-dimensional IPMC actuated flexible structure is presented. In Section III, an LQG and damping injection-based reduced-order controller is proposed to improve the dynamics of the flexible beam system. The closed-loop stability analysis is also illustrated in the same Section III. An experimental setup is applied to validate the proposed model and the proposed control law in Section IV. Some conclusions and perspectives of future works are given in SectionV.

II. IPMC ACTUATED FLEXIBLE BEAM
We modelled the IPMC actuated endoscope using the PHS framework. The considered flexible endoscope is on the 1-D spatial coordinate z from a to b, as depicted in Fig 1. The IPMC actuator patches are attached to the endoscope and subsequently actuated to control its configuration.

Inner tube Flexible beam
End-effector IPMC actuators z a b FIGURE 1. Flexible structure actuated by IPMC

A. FLEXIBLE BEAM WITH DISTRIBUTED CONTROL
Endoscopes are used for high-frequency scanning tasks in medical diagnosis. IPMC actuators are attached to the structure, which leads to a composite material structure for the overall system. When a high-frequency mode is excited and the composite material structure is considered, the shear deformation cannot be neglected [23]- [25]. Hence, the mechanical behaviour of the endoscope is described by a distributed Timoshenko beam model (PDE). An actual endoscope may undergo large deflection. However, in the first instance, we focus on small deformations and control design and keep the modeling as simple as possible. An experimental setup is used to validate the results, for which a Timoshenko beam model is sufficient to handle the primary dynamical behaviour. The mathematical modeling for beams undergoing large deflections can be found in [26] and its PHS formulation in [27]. The extension of the linear beam model to the large deflection case using the port Hamiltonian formulation is direct.
The flexible beam is defined on the 1-D spatial domain z ∈ [a, b] and driven by the distributed bending moment, denoted by u d .This bending moment is generated by the IPMC patches when we apply the applied voltage. We consider the Timoshenko beam model [28], [29] with distributed input and power conjugate output y d under the port Hamiltonian framework to be described as: where J = P 1 ∂ ∂z + P 0 is a skew symmetric differential operator on the state space X = L 2 ([a, b]; R 4 ) and The state variable vector of the system x = [x 1 , x 2 , x 3 , x 4 ] T ∈ X is defined as follows: is the angular strain, and x 4 = I ρ ∂φ ∂t (z, t) is defined as the angular momentum distribution for z ∈ (a, b), t ≥ 0 with transverse displacement w(z, t) and rotation angle of the beam φ(z, t). We consider the total mechanical energy of the flexible beam as a Hamiltonian, which is defined by the energy variables: The energy of the flexible beam can also be presented in the norm form as H b (x) = 1 2 x 2 L with the operator L, which is defined as Iρ .
The coefficients ρ and I ρ are the mass density and mass moment of area, respectively. E, K and I are the Young's modulus, shear modulus, and moment of area, respectively.
Let us define the dissipation operator as: where constants R t and R r represent the translational and angular viscous fractions, respectively. An important advantage of the port Hamiltonian formulation (1) is that one can prove the existence of a solution only by a proper parametrization of the co-energy variable Lx(z, t) at the boundary a and b [5] and a simple matrix condition. The boundary port variables can be defined by From [5, Theorem 4.1], we can choose the boundary input as generates a contraction semigroup on X.
In the following, we consider the boundary condition according to Fig. 1. The flexible beam is clamped at one side (a) and free at the other side (b). Thus, at the fixed side, the velocity and angular velocity are zero; at the free side, the force and moment are zero. The boundary conditions are defined as the boundary input: where the matrix W B is chosen as: which satisfies the condition W B ΣW T B ≥ 0. According to the boundary conditions, the power conjugate outputs at the boundary are the reaction forces F (a) and T (a) at the fixed side and the velocity and angular velocity at the free side.
The distributed control of the beam is defined as follows. The input mapping over the spatial domain is denoted bt B : C i → X; u d ∈ C i is the distributed moment density applied to the beam 1 , and y d ∈ C i is the distributed angular velocity, which is the power-conjugated output of u d . Each distributed input is defined over the i−th interval on the spa- where b i (z) = 1 if z ∈ I bi and b i (z) = 0 elsewhere and the index i ∈ {1, 2, · · · , m} with m actuators attached to the beam. The mean angular velocity is the output over the same Hence, we define the distributed input of the flexible beam as: We define its power conjugate variable as the output variable as y d = B * Lx. Then, the energy balance of the system can be computed as:

B. IPMC ACTUATOR MODEL
The dynamics of IPMC actuators can be separated into three different physical phenomena: the electric part, the diffusion phenomena and the mechanical deformation dynamics. The first part comes from the electric distribution over the double electric layers between the electrodes. The diffusion phenomena are the water molecules and caution flux due to different potentials caused by the applied voltage on the double electric layers. The last dynamics of the actuators are the mechanical contributions due to their flexible structure. The main physical deformation induced by the applied voltage is mainly caused by the diffusion of cation flux between the double electrode layers (see Fig 2) [11].
In this work, we assume that the IPMC actuator and beam are perfectly interconnected. Hence, the mechanical contribution of the IPMC patch is assumed to be a part of the Timoshenko beam model. The IPMC electric dynamics are modelled by a simplified lumped RLC control-oriented mode [30]. The torque generated by the IPMC patch is proportional to the applied voltage.
The port-Hamiltonian formulation of the equivalent electrical model is given by: with the state variables vector x a = ϕ Q T where ϕ is the electric flux and Q is the charge of the capacitor for each IPMC equivalent electrical model: We define the dissipation matrices R 1 ∈ R m×m and R 2 ∈ R m×m of the IPMC actuator with resistances r 1i and r 2i of each equivalent IPMC model: The Hamiltonian of the m IPMC actuators is their electric energy defined as: with capacitance matrix C ∈ R m and inductance matrix L ∈ R m : The input variable u is the applied voltage on two electrodes of the actuators, and u a is the current input, which is generated from the mechanical deflection of the actuator structure. From the power conjugate viewpoint, their associated outputs are the current y = ∂Ha ∂ϕ over inductance L and voltage y a = ∂Ha ∂Q of capacitor C. According to the state variables and input-output definitions, the interconnection relation between the flexible beam dynamics and the IPMC patch dynamics is defined as: The bending moments generated by the IPMC actuators are proportional to voltage y a with constant coefficients k i . Since the interconnection is power conservative, the applied current u a on the capacitor is caused by flexible structure movement.
Considering the IPMC actuator equation (10) and flexible equation (1), using the power preserving interconnections, the total system is defined by: where 0 is the zero matrix with the appropriate dimension. The state space of the coupled system is X = Due to the energy-preserving interconnections (II-B), the energy of the interconnected system can be rewritten as the sum of the energies of the two parts:

III. CONTROL DESIGN BY THE LQG METHOD WITH DAMPING INJECTION
The control goal is to obtain a desired configuration of the flexible beam with the desired performance by regulating the input voltages of the IPMC patches. A control law of the endoscope system (16)

A. LQG AND DAMPING INJECTION CONTROL DESIGN
The design is divided into two parts. First, we consider an LQG controller to eliminate the vibration of the endoscope. By definition, LQG control is a combination of linear-quadratic state estimation (LQE) and a linear quadratic regulator (LQR). Thus, the disadvantage is that it has the same order as the system itself. In our case, the LQG controller is also a coupled PDE-ODE system as the system (16). To implement this type of controller, its order must be reduced. However, when the lower-order (finite-dimensional) controller is applied to the PDE system, closed-loop stability cannot be guaranteed in the general case, which is known as the spillover effect. Hence, in this work, an LQG controller using the port-Hamiltonian formulation and model reduction method is applied to obtain a lower-order controller.
This controller can be easily implemented in real physical systems, while closed-loop stability is simultaneously guaranteed. Second, damping injection is applied to reduce the settling time of the system.
The LQG controller can be formulated as an observerbased dynamical feedback: with the LQG controller statex, filter gain F and optimal state feedback gain K. The two gains F and K can be computed as: with the unique solutions P c = P * c > 0 and P f = P * f > 0 of the two Riccati equations [31]: Q v and R w denote the state and output white noise, respectively. The weighting operatorsQ andR are taken from the optimal control problem, which minimizes the energy cost function: Remark 1. The two Riccati equations (18) and (19) [31]. By using the energy function as the Lyapunov function and considering the dissipation term R, these two conditions can easily be verified on the system (16).
In general, LQG controllers are not passive, and we cannot preserve the Hamiltonian structure when the controller is interconnected with the plant system. However, when we take the exceptional choices of weighting operatorsQ andR and covariance operators Q v and R w , the closed-loop system coupled with the LQG controller has a port-Hamiltonian system, as presented in [19]: Theorem 2 (Hamiltonian LQG method). If the control weighting operatorsR,Q and covariance operators R w , Q v are chosen such thatR = R w .
the LQG controller (17) is passive and has a port-Hamiltonian realization. Moreover, the two unique solutions of the operator equations (18) and (19) are related by The above theorem results in an LQG controller with a port Hamiltonian formulation. Using this Hamiltonian LQG VOLUME , 2016 control formulation, we can preserve the port Hamiltonian structure in the closed-loop system. Furthermore, this passive LQG method can provide a balanced reduction coordinate because P c P f = I. This relation implies that the state space can be separated into two parts based on different importance values of their contributions to the controller design. By taking this advantage, the design and reduction of the controller can simultaneously proceed. We define the balanced reduction coordinate for the port-Hamiltonian system as follows: Definition 3. If two Riccati equation solutions P f and P c satisfy where (σ n ) n∈N is a positive and non-increasing sequence with σ 1 > σ 2 > · · · > σ n > · · · > 0. Then, we say that the port Hamiltonian system (16) is Hamiltonian LQG balanced.
Define the transformation operator T that can diagonalize P c and P f as: Then, we can denote the realization of the port-Hamiltonian system (16), i.e., Hamiltonian LQG balanced realization, as: (26) To obtain the reduced-order system of the balanced realization (26) and the reduced Hamiltonian LQG controller while preserving their passivity and Hamiltonian structure, we use the Petrov-Galerkin projection method. The details of this method are shown in [32]. The reduced port-Hamiltonian system is written as: The reduced-order LQG controller is obtained using the reduced-order system (27) and Theorem 2 and formulated as a strictly passive PH control system: 28) Then, this controller (28) is implemented in the original coupled PDE-ODE system (16) to eliminate the vibration of the endoscope using the passive preserving interconnection: To improve the response time performance, output feedback damping injection [33] is employed: The output of system y is the current of the IPMC patch, which can be easily measured. The main purpose of using damping injection is to improve the response performance.
The dynamics of the system can be accelerated using positive damping injection, i.e., the dissipation parameter of the controller r c > 0. Furthermore, this parameter must be bounded below the natural damping coefficient r c > −r 1 to guarantee the stability of the closed-loop system. The oscillation of the flexible beam becomes more important if the response dynamics are faster. The LQG controller will be combined with the damping injection to find the desired compromise between the vibration flexible beam and the response time.

B. CLOSED-LOOP STABILITY ANALYSIS
In this part, we analyse the closed-loop stability of the original coupled PDE-ODE system (16) with the reduced-order controller (28). First, the existence of a solution is considered in the following theorem. x 2 ≤ u T y and let the controller (28) be strictly passive. Then, the closed-loop system with the interconnection relation (29) is defined bẏ whereX = X × R n is the state space of the closed-loop system, w = x x r ∈X and J cl :X →X is a linear operator defined by Moreover, the operator A c defined by A c w = J cl w with generates a contraction semigroup onX.
Proof. The open-loop operator A = J − R of the system (16) is a generator of the contraction semigroup [34], [35]. The closed-loop operator is a consequence of the power preserving interconnection of the system (16) with the controller (28). Then, from the Lumer-Phillips theorem, the closed-loop operator A c generates a contraction semigroup.
The stability of the closed-loop system (31) is considered in the following theorem.
Proof. Since the controller (28) is strictly positive real and the system (16) satisfies 1 2 d dt x 2 ≤ u T y, the closedloop system (31) has a compact resolvent [34]. We can choose the closed-loop energy function as a Lyapunov function candidate, and the asymptotic stability can be proven using the Lyapunov argument in combination with Lasalle's invariance principle. To use Lasalle's invariance principle, we need the solution trajectory of the closed-loop system to be precompact. Since the system is linear, the precompact condition for the trajectory can be reduced so that the closedloop operator has a compact resolvent. In our case, we can prove the norm of operator (λI − A c ) x X ≥ a x X with a > 0 because of the dissipativity of the closed system. Thus, using Theorem 2.25 in [34], we obtain that the closed-loop system operator has a compact resolvent.
r , the equilibrium profile satisfies u r = y r = 0, and from Remark 1, it reduces to zero.

IV. EXPERIMENTAL METHOD
The experimental setup is depicted in Fig. 4. A dSPACE MicroLabBox compact prototyping unit and a computer with MATLAB Simulink are used to acquire the measurements and implement the designed control law in the system by generating a voltage across the IPMC patches. The displacement measurement is acquired by a KEYENCE (LK-G152) laser sensor to identify unknown parameters.
The dimension of the flexible structure L is 160 mm, the width W is 5 mm, and the beam thickness T is approximately 0.20 mm. The mass density ρ is 936kg/m 3 . The inertia moment of area I and angular moment of inertia I ρ can be calculated by physical parameters L and W since the Timoshenko beam model is used, and their values are 4.7 × 10 −15 m 4 and 4.34 × 10 −12 kg/m, respectively. Remark 6. The controlled beam in the experiment is actuated by the IPMC patches, which leads to a composite structure. The actuation of the beam is driven by the torques generated from the IPMC actuators. Hence, the Timoshenko beam assumptions fit quite well with the proposed experimental setup even if the considered beam is quite thin. The Timoshenko beam model is discretized for the identification procedure in MATLAB ® . A structure-preserving discretization method (mixed finite elements method [36]) is used to preserve the port-Hamiltonian structure of the model. Sequential quadratic programming (SQP) and trust-regionreflective algorithms ('fmincon') are used to identify the unknown parameters. This optimal nonlinear model identification algorithm can be found in the identification toolbox, which has been implemented in the MATLAB software ® .  Table 1.

A. VALIDATION OF THE IPMC ACTUATOR
The length of the IPMC patch L a is measured as 3 × 10 −2 m. The inductance in the RLC circuit is considered negligible compared to other electrical parameters in Table 2.   The blocking force of the IPMC has been measured by different researchers and shown in [11], [30]. It has an almost linear relation with respect to the applied voltage: where F is the measured blocking force and U is the applied voltage. The bending moment of the IPMC actuator can be computed by the blocking force as follows [30]: From (35) and (36), we can find the coupling constant In the setup in Fig. 4, the flexible structure is actuated by one IPMC patch on the clamped side. Fig. 6 illustrates the identification result of the IPMC actuator with u = 1.5V .

B. TRAJECTORY TRACKING OF THE FLEXIBLE BEAM
Trajectory tracking of the flexible beam tip is an important control problem. In this part, this problem will be investigated by using the experimental setup. We employ the damping injection (30), where output y is the current. The following figure shows the experimental validation of the proposed control law for reference tracking.
In Fig. 7, the tracked reference is a periodic signal. The open-loop response cannot reach the reference since the response time of the open-loop system is too slow with respect to the reference. The control law (30) is used to track the reference. The solid red line shows the experimental result. We observe that the closed-loop system tracks the reference signal with good precision.

C. CONTROL OF THE IPMC ACTUATED FLEXIBLE BEAM
The settling time for the open-loop system is approximately 11s, as shown in Fig. 6. We illustrate the closed-loop performances with the designed state feedback controls in Section where the operator and matrix are defined in the balanced realization of the system (26) andR = I. The cost function is defined as shown in equation (20), which is the input output energy function in this case. To guarantee the closed loop passivity and stability, we compute the covariance operators R w and Q v using (21) and (22), which are defined in Theorem 2. For implementation purposes, the designed full-order LQG controller is reduced in a structure-preserving manner to the lower-order controller, as shown in (28). We observe that with simple positive damping injection, the raising time is approximately 6 s instead of 11 s for the open-loop system. However, we observe a significant oscillation of the displacement due to the vibration of the flexible beam, which may gradually irreversibly destroy the flexible structure. By using LQG control plus positive damping injection control, we observe that the response time is reduced to 6 seconds. Furthermore, compared to only using the positive damping injection, the vibration has been significantly reduced.

D. MULTI-ACTUATION OF A FLEXIBLE BEAM
To work in the human body environment, the endoscope should be capable of being driven to the desired shape. In this part, a multi-actuation case with two patches is considered, as shown in Fig. 9. The first IPMC patch is attached at the fixed side of the beam to achieve the largest deflection of the beam's free tip. The second patch cannot be placed too close to the free end because the beam would be deformed by the actuator and its wires. Hence, the patch is attached at the middle of the structure. Then, the distributed input map B  (1) can be defined as: The control weighting operators are defined in the same manner as the mono-actuation case, as shown in IV-C.The control objective in this case is to drive the beam to a desired shape (position) as fast as possible while reducing the beam vibration. The desired shape is presented in Fig. 9. We first use the clamped side IPMC actuator to move the flexible beam such that the beam tip is displaced 5mm. Then, the second IPMC actuator is used to change the beam configuration in the middle. In this case, we use the second actuator to drive the beam tip to 10 mm.
In Fig. 10, we show the beam tip displacements (red dashed line in the top figure) and middle displacement (solid blue line). The clamped side actuator is activated at 3 seconds, and the second actuator is actuated at 15 seconds. We see that the tip displacement is changed by the two actuators, while the middle displacement depends only on the clamped side actuator. The second actuator has no impact on the middle displacement except for a slight vibration at approximately 15 seconds.

V. CONCLUSION AND PERSPECTIVE
An interconnected control model and LQG control strategy of the IPMC actuated flexible structure using the PHS framework is presented. The mechanical flexible dynamics are modelled as a Timoshenko beam, while the electric dynamics of the IPMCs are considered a lumped RLC equivalent circuit model.  interconnected by the PHS formalism via the energy change ports. The control strategy is composed of a Hamiltonian LQG control method coupled with damping injection. Damping injection is applied to improve the response time performance, while the LQG controller reduces the oscillation. The presented model has been identified and validated via an experimental setup, where the flexible beam is driven by IPMC patch actuators.
Finally, we implement the proposed control law in the same experimental setup. The experimental results illustrated the mono-actuation and multi-actuation cases to show the effectiveness of the presented control methods.
A perspective of this work is to consider the uncertainty of the parameters due to environmental reasons and the disturbance from external perturbations. During the experiment, the actuation of the IPMC actuator is sensitive to the humidity of the working conditions. The robustness of the control law should be considered in future work. Moreover, in [10], a complete IPMC actuator model, where the diffusion phenomena were considered, was proposed using the port-Hamiltonian approach. The control design based on this complete actuator model should be considered in the future.