Symmetries in the wheeled inverted pendulum mechanism

# Symmetries in the wheeled inverted pendulum mechanism

Sneha Gajbhiye S. Gajbhiye and R. N. Banavar Systems and Control Engineering, Indian Institute of Technology, Bombay
22email: sneha@sc.iitb.ac.in; banavar@iitb.ac.inS. Delgado Technical University of Munich, Garching, Germany
Ravi N. Banavar S. Gajbhiye and R. N. Banavar Systems and Control Engineering, Indian Institute of Technology, Bombay
22email: sneha@sc.iitb.ac.in; banavar@iitb.ac.inS. Delgado Technical University of Munich, Garching, Germany
Sergio Delgado S. Gajbhiye and R. N. Banavar Systems and Control Engineering, Indian Institute of Technology, Bombay
22email: sneha@sc.iitb.ac.in; banavar@iitb.ac.inS. Delgado Technical University of Munich, Garching, Germany
###### Abstract

The purpose of this article is to illustrate the role of connections and symmetries in the Wheeled Inverted Pendulum (WIP) mechanism - an underactuated system with rolling constraints - popularized commercially as the Segway, and thereby arrive at a set of simpler dynamical equations that could serve as the starting point for more complex feedback control designs. The first part of the article views the nonholonomic constraints enforced by the rolling assumption as defining an Ehresmann connection on a fiber bundle. The resulting equations are the reduced Euler Lagrange equations, which are identical to the Lagrange d’Alembert equations of motion. In the second part we explore conserved quantities, in particular, nonholonomic momenta. To do so, we first introduce the notion of a symmetry group, whose action leaves both the Lagrangian and distribution invariant. We examine two symmetry groups - and . The first group leads to the purely kinematic case while the second gives rise to nonholonomic momentum equations.

###### Keywords:
Lie group symmetry Robotics Nonholonomic systems
journal: Nonlinear Dynamics

## 1 Introduction

The class of nonholonomic systems forms a large and interesting subset of mechanical control systems. Applications include robotics, rolling and locomotive mechanisms. A better understanding of the system’s intrinsic structure and properties, at times, simplifies control synthesis. Though the classical approaches, like Lagrange-d’Alembert’s principle, yield the equations of motion, geometric approaches exploit underlying properties like symmetry and help understand the structure and intrinsic properties of nonholonomic mechanical systems. bloch2003 () is a comprehensive introduction to these notions. In this article we study the geometric features of one such system, the Wheeled Inverted Pendulum, using tools of geometric mechanics. A miniaturized and compact version of the WIP (see Figure (1)) has been designed and developed in the Institute of Automatic Control, TUM. This prototype is currently being used as an experimental test bed for candidate control algorithms.

The Wheeled Inverted Pendulum (WIP) consists of a vertical body with two coaxial driven wheels. Typical applications of the WIP include baggage transportation, commuting and navigation Segway2014 (). The WIP has gained interest in the past several years due to its maneuverability and simple construction (see e.g. Grasser2002 (), chan2013review ()). Other robotic systems based on the WIP are becoming popular as well in the robotic community for human assistance or transportation as can be seen in the works of Li2012 (), Nasrallah2006 (), Nasrallah2007 (), Baloh2003 (), and a commercially available model for human transportation Segway2014 (). The stabilization and tracking control for the WIP is challenging since the system belongs to a class of underactuated mechanical systems (the control inputs are less than the number of configuration variables) and has nonholonomic constraints as well, that arise due to rolling without slipping assumptions on the wheels. Several control laws have been applied to the WIP, mostly using linearized models as can be seen in blankespoor2004experimental (), salerno2004control (), kim2005dynamic (), Li2012 (). In salerno2003nonlinear (), controllability of the dynamics involving the rotation of the wheels and the pitch of the vertical body (pendulum) were presented and in salerno2004control () a linear controller was designed for stabilization. In kim2005dynamic (), the authors presented the exact dynamics of WIP and derived the linear controller. In pathak2005velocity () and gans2006visual (), the authors propose a the controller based on partial feedback linearization. Nasrallah2007 () develops a model based on the Euler-Rodrigues parameters and analyzes the controllability of the WIP moving on an inclined plane. However, the geometric structure of the WIP and the consequent aid to feedback design is yet to be completely exploited. In delgado2015reduced (), the authors adopt a geometric approach to derive the dynamic model. The aim of this article is to present geometric facets, various group symmetries of the dynamics of this system, in particular the nonholonomic momentum, and finally arrive at a model which would considerably aid in control design.

In mechanical systems with nonholonomic constraints, the configuration space is a finite dimensional smooth manifold, the tangent bundle is the velocity phase space, the Lagrangian is a map and a smooth distribution determines the nonholonomic constraints. Typically, is the kinetic energy minus the potential energy. So, at a given point of the configuration space, the distribution characterizes the allowable velocity directions of the system. The Lagrange-d’Alembert principle, then, yields the equations of motion of the system. The constraints form the horizontal space of the tangent space in a direct sum of two subspaces - termed horizontal and vertical, and this horizontal space is realized through an Ehresmann connection. The dynamics then appear in the reduced Euler-Lagrange form with the constraint forcing terms dependant on the curvature of the connection. More scholarly exposition on this is found in BKMM (), bloch2003 (), unicycle (). Often, nonholonomic systems admit a symmetry group, and the action of this group usually makes analysis simpler. The configuration space is then identified “locally” as the product space of a group and a shape space, with the group being the symmetry group. This modifies the Ehresmann connection to a new connection which is associated with this symmetry. This new connection, which is a principal connection, is termed as a and the dynamics is studied on a reduced space or shape space. Hence, using group symmetry one performs Lagrangian reduction and obtains reduced dynamics with a reconstruction equation combined with constraints. The nonholonomic connection, in turn, is realized through two types of connections, one due to the constraints - the - and the second, arising due to the kinetic energy metric, termed as the . So, the holds information about both the constraints and the dynamics. The general references on reduction theory with constraints are marsden1993reduced (), marsden2000reduction (), c2 (), bloch2003 (), BKMM (), ostrowski_thesis (), CHMR (), CMR (). There are three cases to be noticed while computing this principal connection. If the distribution forms the horizontal space, then the principal connection is realized as a kinematic connection and hence we have fiber (vertical) symmetry which yields the standard momentum conservation in both spatial and body frames koiller1992reduction (). If the distribution forms the horizontal symmetry, that is, the distribution lies in the fiber space, then the equation of motion is in the Euler-Poincaré form and the momentum is conserved in the spatial frame, for example in the vertical coin bloch2003 (). And the third one is a general case where the distribution partially lies both in the horizontal and the vertical spaces. This general case gives rise to a generalized momentum equation wherein the momentum is not necessarily conserved. In BKMM (), ostrowski1995mechanics () authors illustrates the Snakeboard example where nonconservation of momentum plays an important role in locomotion. The WIP falls under the category of the general case where the forward motion of the wheels and yaw motion are given by the generalized momentum.

The objective of this paper is to illustrate the symmetries and conserved quantities inherent in the dynamics of the Wheeled Inverted Pendulum (WIP). The first part of the article uses the Ehresmann connection and formulates the dynamics in the form of the Lagrange-d’Alembert equation with the Euler-Lagrange equation in the base variables with curvature form. The nonholonomic constraint distribution forms the horizontal subspace for the Ehresmann connection. In the literature this is called as the kinematic connection. The second formulation uses the notion of a nonholonomic system with symmetry. Here, a symmetry group acts on the WIP configuration space and renders the Lagrangian and distribution invariant. Two types of Lie group symmetries are considered. A connection termed as nonholonomic connection is introduced, which synthesizes the mechanical connection and kinematic connection. This analysis gives rise to momentum equation for group variables and reduced Euler-Lagrange equation for shape variables.

## 2 System description

The WIP consists of a body of mass (center of mass at a distance from the wheels rotation axes) mounted on two wheels of radius . Let be the mass of the wheels and be the distance between the wheels. The wheels are directly mounted on the body and are able to rotate independently. Since the wheels are actuated by motors sitting on the body, a tilting motion automatically rotates the wheels through the tilting angle. The body needs to be stabilized in the upper position through a back and forth motion of the system similar to the inverted pendulum on a cart. The set of generalized coordinates describing the WIP are:

1. Coordinates of the origin of the body-fixed coordinate system in the horizontal plane ()

2. Heading angle around the -axis ()

3. Tilting angle around the -axis ()

4. Relative rotation angle of each of the wheels with respect to the body around the -axis, which coincides with the -axis ( and )

The configuration space of the system is thus with .

Assuming the wheels roll without slipping, the system has nonholonomic constraints given by:

 ˙xLcosθ+˙yLsinθ=r˙ϕ1;˙xRcosθ+˙yRsinθ=r˙ϕ2;−˙xL/Rsinθ+˙yL/Rcosθ=0, (1)

With , , and these are equivalent to

 ˙x−rcosθ(˙ϕ1+˙ϕ2)=0, (2) ˙y−rsinθ(˙ϕ1+˙ϕ2)=0, (3) ˙θ−rd(˙ϕ2−˙ϕ1)=0. (4)

Equations (2) and (3) are treated as nonintegrable constraints, that is, the translational velocity of the body (chassis) in both and directions are completely determined by the angular velocities of the wheels and the body yaw angle. Equation (4) is, in fact, a holonomic constraint, which relates the yaw angle with the roll angle of the wheels.. Consider coordinates ) for , and a set of velocities at point , that defines the tangent space . Let be a distribution that describes the kinematic constraints as above. So, at a given point , the distribution characterizes the allowable velocity direction of the system, i.e, is a collection of linear subspaces , . The nonholonomic constraint can be expressed as , where , and

 A=⎡⎢⎣0−rcosθ−rcosθ0−rsinθ−rsinθ0rd−rd⎤⎥⎦. (5)

The above constraints have a geometric interpretation. Consider a bundle map which is a submersion and is termed the , then is a derivative map (onto) at each and kernel of at any point forms a vertical space . This vertical subbundle (of ) is also referred as the fiber distribution, and is defined as

 VQ=∪q∈QVqQVqQ={vq∈TqQ|vq∈kerTqπ}. (6)
###### Definition 1

An Ehresmann connection is defined as a vector-valued one form which splits the tangent space at every point into a vertical and a horizontal space, satisfying: 1) and, 2) is a projection, for all . For , implying .

We choose the Ehresmann connection such that the constraint distribution forms the horizontal space. For , we then have the horizontal part of the vector field as . In bundle coordinates, , the connection which is a vector-valued one form can be expressed in local coordinates as . Therefore, the vertical component is and the horizontal component .

The Lagrangian for the WIP is taken to be the total kinetic energy minus the potential energy and is given by

 L(q,˙q )=12(mb+2mW)˙x2+12(mb+2mW)˙y2+12Iθ(α)˙θ2 +12(mbb2+IByy)˙α2+12IWyy(˙ϕ21+˙ϕ22)−mbbsinαsinθ˙x˙θ +mbbcosαcosθ˙α˙x+mbbsinαcosθ˙θ˙y+mbbcosαsinθ˙α˙y −mbbgcosα (7)

where,

 Iθ(α)=2IWzz+IBzcos2α+2mWd2+(IBxx+mBb2)sin2α.

Given and a smooth distribution that represents the constraints, the Lagrange-d’Alembert principle that yields the equations of motion states that the motion of the system occurs along trajectories that satisfy Hamilton’s variational principle where the variations of are taken along curves which satisfy , and are assumed to vanish at the endpoints. We now define the constrained Lagrangian by substituting the constraints (2)-(4) into the Lagrangian as

 Lc(α,˙α,˙ϕ1,˙ϕ2)=L(θ,α,rcosθ(˙ϕ1+˙ϕ2),rsinθ(˙ϕ1+˙ϕ2),rd(˙ϕ2−˙ϕ2))

yielding as

 Lc =12a1˙ϕ21+12a1˙ϕ22+12c ˙α2+12a2˙α(˙ϕ1+˙ϕ2)+a3˙ϕ1˙ϕ2−mbbgcosα

where

 a1=(14(mb+2mW)r2+r24d2Iθ(α)+IWyy); a2=((mb+2mW)r2+mbbcosα); a3=(14(mb+2mW)r2−r24d2Iθ(α)); c=(mbb2+IByy).

Following BKMM (), the equations of motion in terms of the constrained Lagrangian , termed as reduced Euler-Lagrange equations, are given by

 ddt(∂Lc∂˙α)−∂Lc∂α+Aaα∂Lc∂sa=−∂L∂˙sb(Bbαα˙α+Bbαϕ1˙ϕ1+Bbαϕ2˙ϕ2), (8) ddt(∂Lc∂˙ϕ1)+Aaϕ1∂Lc∂sa=−∂L∂˙sb(Bbϕ1α˙α+Bbϕ1ϕ1˙ϕ1+Bbϕ1ϕ2˙ϕ2), (9) ddt(∂Lc∂˙ϕ2)+Aaϕ2∂Lc∂sa=−∂L∂˙sb(Bbϕ2α˙α+Bbϕ2ϕ1˙ϕ1+Bbϕ2ϕ2˙ϕ2) (10)

where the curvature is

 Bbβγ=⎛⎝∂Abβ∂rγ−∂Abγ∂rβ+Aaβ∂Abγ∂sa−Aaγ∂Abβ∂sa⎞⎠ (11)

where are the coordinate expression of the Ehresmann connection on the tangent bundle defined by the constraints. The Ehresmann connection in coordinates is

 Axα=0, Axϕ1=−rcosθ, Axϕ2=−rcosθ, Ayα=0, Ayϕ1=−rsinθ, Ayϕ2=−rsinθ, Aθα=0, Aθϕ1=rd, Aθϕ2=−rd. (12)

and the coefficients are given by

 Bbαα=Bbαϕ1=Bbαϕ2=Bbϕ1α=Bbϕ2α=Bbϕ1ϕ1=Bbϕ2ϕ2=0, Bbϕ1ϕ2=Aθϕ1∂Abϕ2∂θ−Aθϕ2∂Abϕ1∂θ,Bbϕ2ϕ1=Aθϕ2∂Abϕ1∂θ−Aθϕ1∂Abϕ2∂θ.

The equations of motion, calculated from (8)-(10) are

 ddt(∂Lc∂˙α)−∂Lc∂α=0,ddt(∂Lc∂˙ϕ1)=−2mbbr2dsinα(rd(˙ϕ2−˙ϕ1))˙ϕ2+τ1ddt(∂Lc∂˙ϕ2)=2mbbr2dsinα(rd(˙ϕ2−˙ϕ1))˙ϕ1+τ2 (13)

where and are the respective torques on the two wheels. These equations of motion are identical to the one given in delgado2015reduced (). In section 3, we show that using symmetry yields a principal kinematic case and, the principal connection in such a case is equivalent to the Ehresmann connection defined above. For a completeness of exposition, the preliminary notions of a nonholonomic system with symmetry as developed in bloch2003 (), BKMM () are presented in the Appendix. We now illustrate these tools on the WIP system.

## 3 Symmetries in the WIP mechanism

We make two choices for the group action:

• (the position on the plane and the yaw angle) and

• (the position on the plane and the yaw angle, and the roll of the wheels) .

In the first case we illustrate that the principal connection is equivalent to the Ehersmann connection and the equations of motion are given by the reduced Euler-Lagrange equations. In the second case we first identify the configuration variable as and then choose the group action of on this . This choice of comes from the fact that instead of the absolute wheel angles and we take the difference which represent the yaw angle, and the sum which permits us to calculate the forward distance traversed as . This modified choice also comes from the ultimate control synthesis objective where one wants to control the forward and yaw velocity of the WIP. In this case we illustrate the nonholonomic momentum and derive the reduced nonholonomic Lagrange-d’Alembert equations.
Case I: Consider the Lie group and the symmetry in variables of the system. The action by the group element is given by

 (x,y,θ,α,ϕ1,ϕ2)⟼(xcos¯θ−ysin¯θ+¯x,xsin¯θ+ycos¯θ+¯y,θ+¯θ,α,ϕ1,ϕ2)

The tangent space to the group orbit is given by

 TqOrb(q)=span{∂∂x,∂∂y,∂∂θ} (14)

The Lagrangian (7) and constraints (1) are invariant under the action of . The vector fields that are the local generators for the constrained distribution and are given by

 X1=cosθ∂∂x−sinθ∂∂y+1r∂∂ϕ1+1r∂∂ϕ2, X2=∂∂α, X3=∂∂θ+dr∂∂ϕ1−dr∂∂ϕ2

therefore,

 Dq=span{X1,X2,X3}. (15)

The intersection of the tangent space to the orbit with the constrained distribution and the components of curvature are independent of and . This is the principal kinematic case, in which there is a principal connection whose horizontal space is spanned by the distribution . The projection on the vertical space defines the Ehresmann connection and since the distribution is invariant under the group action, the principal connection related to the Ehresmann connection as , given in (2). The system is reduced from to by the group action. Substituting the constraint from (2)-(4), the reduced equations of motion are obtained on . The reduced constrained Lagrangian is

 lc(α,˙α,˙ϕ1,˙ϕ2)=l(rcosθ(˙ϕ1+˙ϕ2),rsinθ(˙ϕ1+˙ϕ2),rd(˙ϕ2−˙ϕ2))

There is no momentum equation and correspondingly no body velocity. The equation of motion is the reduced Euler-Lagrange equation given in (13) with the reconstruction equation being .
Case II: Consider the group action on . The group here denotes the position, heading angle and sum of wheel angles. Let be sum of wheel velocity results in the forward velocity of the cart. With this let the configuration space is now identify as with configuration variables as . Then the left action of on is given as

 Φ:(x,y,θ,α,ϕ)⟼(xcos¯θ−ysin¯θ+¯x,xsin¯θ+ycos¯θ+¯y,θ+¯θ,α,ϕ+¯ϕ)

where and . The left action of on the tangent-lifted coordinates of the manifold is

 TΦ(¯x,¯y,¯θ,¯ϕ) :(x,y,θ,α,ϕ,˙x,˙y,˙θ,˙α,˙ϕ)⟶ (xcos¯θ−ysin¯θ+¯x,xsin¯θ+ycos¯θ+¯y,θ+¯θ,α, ϕ+¯ϕ,˙xcos¯θ−˙ysin¯θ,˙xsin¯θ+˙ycosθ,˙θ,˙α,˙ϕ)

The Lagrangian of the system is,

 L(q,˙q) =12(mb+2mW)(˙x2+˙y2)+12(Iθ(α)+d22r2IWyy)˙θ2 +12(mbb2+IByy)˙α2+12IWyy2˙ϕ2+mbbsinα˙θ(−sinθ˙x +cosθ˙y)+mbbcosα˙α(cosθ˙x+sinθ˙y)−mbbgcosα (16)

and the nonholonomic constraint is

 ˙x−rcosθ˙ϕ=0,˙y−rsinθ˙ϕ=0. (17)

It is easily proved that the Lagrangian and distribution are invariant under the action of the group .
Substituting the constraints in the Lagrangian (16), the constrained Lagrangian is determined as

 Lc =(mb+2mW)r2˙ϕ2+rmbbcosα˙ϕ˙α+12(Iθ+d22r2IWyy)˙θ2 +12(mbb2+IB)˙α+122IWyy˙ϕ2 (18)

The tangent space to the orbit is

 TqOrb(q)=span{∂∂x,∂∂y,∂∂θ,∂∂ϕ} (19)

and the constraint distribution is given by . with

 X1=cosθ∂∂x−sinθ∂∂y+1r∂∂ϕ;X2=∂∂α;X3=∂∂θ.

The constraint fiber distribution is calculated as

 Sq=Dq∩TqOrb(q)={cosθ∂∂x+sinθ∂∂y+1r∂∂ϕ,∂∂θ} (20)

For obtaining the corresponding momentum equation, we consider the bundle whose fibers span the tangent vectors in and choose a section of this bundle. Consider the Lie algebra of . The generators corresponding to the Lie algebra elements can be represented in standard basis in as

 (1,0,0,0)Q=∂∂x,(0,1,0,0)Q=∂∂y,
 (0,0,1,0)Q=−y∂∂x+x∂∂y+∂∂θ,(0,0,0,1)Q=∂∂ϕ

where the first two components represent translations, the third is the yawing motion and the fourth being the rolling motion. Therefore, to obtain the section of given by vector fields

 (ξq1)Q=rcosθ∂∂x+rsinθ∂∂y+∂∂ϕ,and% (ξq2)Q=∂∂θ (21)

and the corresponding Lie algebra elements are

 ξq1=(rcosθ,rsinθ,0,1) and ξq2=(y,−x,1,0). (22)

We have two the nonholonomic momenta corresponding to the two infinitesimal generators in . The nonholonomic momentum in the body representation are calculated from (54) and (6.1) as

 pi(ξq)=∂L∂˙qi(ξqi)Q (23)

which yields

 p1 (ξq1)=∂L∂˙q(ξq1)Q =⟨((mb+2mW)˙x−mbbsinαsinθ˙θ+mbbcosαcosθ˙α, (mb+2mW)˙y+mbbsinαcosθ˙θ+mbbcosαsinθ˙α, (Iθ+d22r2IWyy)˙θ+mbbsinα(−sinθ˙x+cosθ˙y),(mbb2+IByy)˙α +mbbcosα(cosθ˙x+sinθ˙y),2IWyy˙ϕ);(rcosθ,rsinθ,0,0,1)⟩ =[(mb+2mW)r2+2IWyy]˙ϕ+rmbbcosα˙α (24)

and

 p2(ξq2) +mbbcosαcosθ˙α,(mb+2mW)˙y+mbbsinαcosθ˙θ +mbbcosαsinθ˙α,(Iθ+d22r2IWyy)˙θ +mbbsinα(−sinθ˙x+cosθ˙y),(mbb2+IByy)˙α +mbbcosα(cosθ˙x+sinθ˙y),2IWyy˙ϕ);(0,0,1,0,0)⟩ =[Iθ(α)+d22r2IWyy]˙θ (25)

From the nonholonomic momenta calculated in (24) and (25), the nonholonomic momentum equations are evaluated as

 ddtp1(ξq1) =∂L∂˙q[ddt(ξq1)]Q=−((mb+2mW)˙x−mbbsinα˙θsinθ +mbbcosα˙αcosθ)rsinθ˙θ+((mb+2mW)˙y +mbbsinα˙θcosθ+mbbcosα˙αsinθ)rcosθ˙θ =mbrbsinα˙θ2, (26)
 ddtp2(ξq2) =∂L∂˙q[ddt(ξq2)]Q=((mb+2mW)˙x−mbbsinα˙θsinθ +mbbcosα˙αsinθ)˙x =−mbbrsinα˙ϕ˙θ. (27)

Eliminating and using equations (24) and (25), the momentum dynamics are expressed as

 ˙p1=mbrbsinα[f(α)]2p22, (28) ˙p2=−mbbrsinαp2f(α)h[mbbcosα˙α+p1], (29)

with

 h=((mb+2mw)r2+2IWyy) and f(α)=(Iθ(α)+d22r2IWyy).

and

 Iθ(α)=2IWzz+IBzcos2α+2mWd2+(IBxx+mBb2)sin2α. (30)

This completes the momentum equations computation for the group variables corresponding to . Now we calculate the the dynamic equation governing the shape variable given in (59).

### 3.1 Shape dynamics of the WIP under G2 action

To explicitly express the shape dynamics, the reduced Lagrangian and the constrained reduced Lagrangian are computed as follows.

#### 3.1.1 Reduced Lagrangian and constrained reduced Lagrangian

The rolling constraint (17) is now expressed in the body coordinate frame as

 ξ1=rξ4;ξ2=0. (31)

where is the (left-invariant) body angular velocity, expressed by

 ⎡⎢ ⎢ ⎢ ⎢⎣ξ1ξ2ξ3ξ4⎤⎥ ⎥ ⎥ ⎥⎦=⎡⎢ ⎢ ⎢ ⎢⎣cosθ˙x+sinθ˙y−sinθ˙x+cosθ˙y˙θ˙ϕ⎤⎥ ⎥ ⎥ ⎥⎦. (32)
###### Theorem 3.1

With and as the group action, the constrained reduced Lagrangian is

 lc(α,˙α,ξ)=12((mb+2mw)r2+2IWyy)ξ24+rmbbcosα˙αξ4+12(Iθ+d22r2IWyy)ξ23+12(mbb2+IB)˙α2−mbgbcosα. (33)

Proof: When the Lagrangian and the distribution are invariant under the action of a group , the system is reduced to the quotient space . From a system(, ) on , a reduced Lagrangian is calculated as

 l(α,˙α,ξ) =12(mb+2mw)ξ21−mbbsinα˙θξ2+mbbcosα˙αξ1 +12(mb+2mW)ξ22+12(Iθ+d22r2IWyy)ξ23 +12(mbb2+IB)˙α2+12(2IWyy)ξ24−mbgbcosα

where . The constraint reads and (this eliminates two variables of the Lie algebra.) The constrained reduced Lagrangian is

 lc(α,˙α,ξ)=12((mb+2mw)r2+2IWyy)ξ24+rmbbcosα˙αξ4+12(Iθ+d22r2IWyy)ξ23+12(mbb2+IB)˙α2