Mathematical Model of Hektor

For the development of a sophisticated state controller a mathematical model of the robot is needed. Engineering mechanics provides two different approaches to derive the governing equations of motion. On the one hand there is the analytical mechanics with Lagrange's equations and on the other hand there is the synthetic mechanics where all reaction forces are calculated explicitly. In the following two sections the equations of motions are derived with both approaches.

Equations of Motion with Lagrage

The balancing robot Hektor can be modeled as a rigid body with mass $m$, moment of inertia $J$ at the center of gravity and distance $l$ between center of gravity and wheel shaft. For simplicity the angular momentum of the wheels is neglected. The equations of motion can be derived with Lagrange introducing the two general coordinates

where $r$ is the horizontal displacement of the wheel shaft and $\phi$ is the angle between the robot's longitudinal axis and the $x$-axis. Lagrange's equation writes

with

where $Q_i$ are the non conservative forces and $T,\ V$ are the kinetic and the potential energy of the system. In a first step the dynamic behavior of the unactuated robot is derived so the non conservative forces vanish:

To derive the kinetic and potential energy the position and velocity of the center of gravity is written in an inertial coordinate system:

For the kinetic energy the squared velocity is needed an yields to

The energy components in equation (2) are calculated now to

hence equation (2) yields

Each term in equation (1) are calculated as follows:

Putting all together yields:

Equations of Motion with Synthetic Mechanics

Principle of linear momentum yields

and principle of angular momentum setup at the shaft yield:

Substituting $\ddot{z}_{\rm CoG}$ with the z-component of equation (3) results in the same equations of motion (7) and (8).

Velocity Control of the Wheels

In the following section a automatic control of the wheel velocity is utilized. The velocity controller is implemented in the OpenServo boards which drives the motors so the main controller can command a setpoint velocity to the system. Relying on this inner control loop the differential equation for the shaft displacement simplifies to

Differentiate equation (9) with respect to time and substitute $\ddot{r}$ in equation (8) yields:

Equation (8) together with equation (10) solved for $\ddot{\phi}$ gives the new equations of motion for the robot:

By introducing a new virtual input $u = \dot{v}_{cmd}$ the development of a controller can be further simplified. The real system is still steered by the velocity but for the development of the controller it is assumed that the acceleration can be set directly. In the implementation the output of the controller is integrated before applied to the system. The equations of motion used for the development of the controller yield:

The developed control scheme can be illustrated with the following diagram:

Hektor/MathModel (last edited 2008-05-18 14:13:15 by StefanEngelke)