Towards Port-Hamiltonian Approach for Modeling and Control of Two-wheeled Wheelchair

This paper introduces the modeling and control design of a two-wheeled wheelchair (TWW) based on structure-preserving port-Hamiltonian concept. In this paper, a model of TWW with features, including space-saving, four to two-wheel transformation, and adjustable seat height is proposed to increased mobility and independence of the user. Then, the mathematical model of a TWW in its balanced mode is derived. The model is based on the total energy in the system. The system is divided into subsystems whereby the interconnections which exist are utilized. The nonlinearity of the model is preserved using port-controlled Hamiltonian (PCH) system and made to advantage. The proposed controlled is designed based on the idea of PCH such that the energy balance in the system can be achieved while stabilizing the system.


Introduction
Many researches were conducted to find a better solution for helping the disabled people with different types of disabilities to be independent in their daily activities. Most of these researches on electric powered wheelchair were aimed to increase the comfort, handling and safety of the wheelchair [2][3][4][5]. Control algorithms were also embedded to improve its usability. However, existing mechanical designs and control algorithms of electric powered wheelchair do not give the users the full ability to act independently in life.
Though there are few wheelchair models that can adjust the seat to a certain height, only fewer of them that are actually operable in two wheels configuration. This feature increases user's mobility by allowing them to maneuver in narrow spaces. This advantage was already recognized in JOE [6], a two-wheeled mobile robot, which is regarded as a pioneer in this field. This two-wheeled mobile robot, along with other similar robots [7] triggered the research on self-balancing robot, which is inspired by an inverted pendulum concept. These researches were then improved further for wheelchair application. Hence, the dawn of research on two-wheeled wheelchair.
Nakamura and Murakami [8][9][10] proposed a wheelchair on two wheels. They implemented the socalled disturbance observer (PADO) to balance and steer the wheelchair. A PADO was developed to estimate the disturbance on pitch angle to achieve a robust stabilization. Later, they added a reaction torque observer (RTOB) to realize a power-assist control on yaw direction. In [11][12], a new mechanism that transforms the wheelchair from four wheels to two wheels configuration was proposed. Furthermore, they added an extendable feature to the second link which lifts the user to an eye-level height with a standing person. This feature increases user's confident while having a conversation.
In the last decade, Port-controlled Hamiltonian (PCH) systems have emerged as an interesting class of nonlinear models suitable for a large number of physical applications. This modeling approach originates from the network modeling of energy-conserving lumped-parameter physical systems with independent storage elements. This kind of models encompasses a very large class of physical systems, containing the class of Euler-Lagrange models. The Hamiltonian function, used in this approach, is a good candidate of Lyapunov functions for many physical systems [13]. The name PCH systems refers to two major components of a control paradigm [14]: • Port: the modeling approach is port-based, which successfully composes complex systems by means of power-preserving interconnections. • Hamiltonian: the mathematical framework extends the Hamiltonian mechanics, which emphasizes energy function Hamiltonian as basic concept for modeling multi-physics system. Latest applications of PCH systems include various types of control problem, structure-preserved modeling of nonlinear system, and stabilization technique, e.g. [15][16][17][18][19].
In this paper, an electric-powered TWW is modeled using PCH systems. The proposed TWW has a transformable wheel configuration, which turns the four-wheeled wheelchair into a two-wheeled wheelchair. This two-wheeled configuration has similar dynamics to a double-inverted pendulum on two wheels, which is a nonlinear, multi-variable, higher order, and unstable system. The PCH systems approach preserves the nonlinear structure of the system, hence preserving also its nonlinear dynamics [20].
This paper is organized as follows. Section 2 summarizes the concept of Port-controlled Hamiltonian Systems. After developing the simplified model of TWW using MapleSim, the mathematical model is derived in section 3. Section 4 proposes the steps to design a controller based on PCH systems.

The Concept of Energy
A dynamical system can be viewed as a set of simpler subsystems that exchange energy, (from theory of passivity, which is compatible with 'interconnection theory' [21]). Energy can serve as a lingua franca to facilitate communication among scientists and engineers from different fields. Most engineering applications are mixtures of electrical, mechanical and other domains. In PCH systemsbased modeling; an energy-based perspective and the role of interconnection between subsystems provide the basis in modeling physical systems.
Port-controlled Hamiltonian system-sometimes referred also as port-Hamiltonian systems or generalized port-controlled Hamiltonian systems-is first introduced by A.J. van der Schaft [20]. This technique extends the theory of Hamiltonian mechanics. In this technique, the nonlinear dynamics of a system is modeled as the Hamiltonian equations of motion, which are derived from the total energy of the system H, also known as the Hamiltonian.
where q is the generalized coordinates, p is the generalized momenta, , M is the k x k inertia (or generalized mass) matrix which is symmetric and positive definite for all q.
In PCH systems, any engineering domain (electrical, mechanical or hydraulical, with exception to thermodynamical) is introduced two variables, called power conjugate variables, whose product equals power. These variables are labeled as effort e and flow f. For any given system (from any When modeling a physical system using this approach, it is viewed as an interconnection between energy storage elements, dissipative (resistive) elements, and the environment. The structure of any storage element is the following: where ( ) s f t is the flow variable of storage element, ( ) s e t is the effort variable of storage element, z is the generalized state variable and E(z) is the stored energy. Figure 1 illustrates this relation. The change in energy of a storage element is always its external power flow, i.e.
Thus, by construction, a product of effort and flow implies the integral of power with regards to time yields energy. For a dissipative element, the energy dissipation D(x) is expressed by direct relation between effort and flow variables. In the linear case, 2 0, 0 where ( ) (2.6) The power and energy balance of PCH system with storage and dissipative element are, respectively: 0, The Hamiltonian equations of motion satisfies the general energy balance equation, from which the controller will be designed. The designed controller will ensure the stability (with preserving structure of the Hamiltonian system and conservation of energy) of the system in the Lyapunov sense [23].

PCH-based Modeling
Consider the following nonlinear system in the form where ( ) f z , ( ) g z , and ( ) h z are nonlinear functions of the state z, u is the input of the system and y is the output. Equation (2.10) can be rewritten as a general Port-controlled Hamiltonian systems form: where the Hamiltonian H is the total (kinetic and potential) energy as described by equation is an n n × skew-symmetric matrix.
For a system with dissipation, equation (2.11) and (2.12) are rewritten as: is a positive semi-definite symmetric matrix, which represents the dissipation term corresponds to the internal energy dissipation in the system. Matrix ( ) z J corresponds to the internal power-conserving interconnection structure of the physical systems due to: 1. Basic conservation laws, such as Kirchhoff's laws; 2. Powerless constraints; kinematic constraints;

Transformers, gyrators, exchange between different types of energy.
In many examples, the structure matrix ( ) z J will additionally satisfy an integrability condition. The main message of this approach is that Port-controlled Hamiltonian system is closer to physical modeling, and capturing more information than just energy-balance of passivity. Three major features of PCH systems are [14]: its scalabilityto very large interconnected multi-physics systems, its ability for incorporating nonlinearities while retaining underlying conservation laws, and its integration of the treatment of both finite-dimensional and infinite-dimensional components.

3D Model
Before deriving the mathematical model, a 3D frame-based model of the wheelchair is designed in MapleSim. This step helps in analyzing the interconnection relationship between elements for PCH systems derivation. From [24], the TWW system involves the following mechanism: 1. Transformation from four wheels to two wheels involves lifting the casters (front wheels) using certain mechanism; 2. The lower part of the system, which includes casters, main wheels, motor and motor housing, caster lifting mechanism; is assumed as first link; 3. The second part of the system, located atop the first one has a chair with extendable height; is assumed as second link; 4. While at two wheels, i.e. balancing mode, the system resembles a double-inverted pendulum on two wheels; Figure 2 shows the 3D model of a TWW in balance mode, i.e. on two wheels. Its similar dynamics with a double-inverted pendulum is shown in figure 3. The definition of each symbol is described in table 1.  This model is built with these assumptions: 1. The system is divided into three subsystems: base, first link, and second link; 2. The model is constrained to move in x-direction only, i.e. the base only move straight forward and backward without turning and the two links rotate in x-direction only; 3. On the base, there are two identical motors to rotate the two main wheels; 4. On the first link, only the mass of the link itself is considered; 5. On the second link, there are two masses considered, the link's mass itself and the load;

Mathematical Model
Consider the TWW is in balancing mode, i.e. in two wheels as shown in figure 3. The system has two inputs, one torque F applied to the base consisting of synchronous torques from identical left and right motors, and one torque τ from the motor between first and second link, which drives the second link.   On the base, the kinetic energy is considered from translational dynamic of the two wheels, which is the following: θ is the rotation angle of each wheel and 0 J is the inertia of the wheel. Since The potential energy is zero, i.e. 0 0 U = . The storage energy on the base, 0 H , is the sum of the kinetic and potential energy 0 On the second subsystem, i.e. the first link, the kinetic energy is given as: The potential energy acting on the first link due to gravitational acceleration is: The potential energy by gravitational force is given by ( )    The closed-loop system is represented by the following