You are on page 1of 5
coefficients are very hard to calculate exactly and can be time consuming and hard to find by experiments. This section motivates some particular parameters: ‘* The inertia of the chassis is part of the total body inertia Ji, ‘This parameter was found after designing the whole chassis in Autodesk Inventor, and then using that program to calculate the inertia. * The motor parameters were estimated from a dynamometer test run published by the manufacturer. ‘© The friction coefficients were estimat 3.1.2 Nonlinear model fed and considered very unreliable. Below follows a couple of figures that describes the vehicle. The mathematical model is based upon these figures with some small modifications. For example, the yaw angle @ is disregarded (always zero). Lenn Figure 4 - Description of the coordinate system and angles. The figures come from (11). ‘The parameters used in the simulation of the two wheeled vehicle: [Parameter] [Unit] [o/s] Ue} tm} {hgm?] Uke tg] fm} feof [Comments] Gravitational constant Wheel weight Wheel radius Wheel inertia Vehicle body weight Rider weight Total weight Body height Rider height 16 L = (Mv*H/2+Lrider*0.55°Mrider)/M. Inger = Mriaer iger/3 Jy = Iridor + 1.49 fae aes oa 0,722 ma kem?} tkem?| {kgm?] [Ohm] [Vs/rad] [Nm/A] Distance to the centre of mass from the wheel axle Rider inertia Body piteh inertia, DC motor inertia DC motor resistance DC motor back EMF constant DC motor torque constant Gear ratio Friction coefficient between body and DC motor Friction coefficient between wheels and ‘ground Table 2 - Model parameters ‘The derivation of the equations of motion can then be performed by the three steps from Section 2.1: 1. Selection of general coordinates: The number of general coordinates is equal to the degrees of freedom in the system. For balancing control purposes these coordinates were selected as: ‘+ The pitch angle of the pendulum 6: The average of the right and left: wheel angle 2. Applying the Lagrangian function to the expression for energy ‘The energies can be divided into translational kinetic energy (T), rotational kinetic energy (T2) and potential energy (U): r 1 x 4 ay? FInd? + fu? + lu + 5r%In( He ) +42 -¥) 1 1 BMC + 92 + 22) + FMF +7 + 22) + OM (H5 +98 + 28) fa] U = mgz, + mgz, + mgzp where the coordinates can be expressed as: Cans Yous 2m) = (f RO dt,0,R) {18} "7 (Ye 21) {19} Oke, Yoo Bp (me ia [20] Gb, Yoo 20) = Gem + LSINP, Yon» Zm + LCoS wp) (21) 3. Evaluate the Lagrangian equations: ‘The next step is putting Z from the Lagrangian function into the ‘Lagrangian equations: daly ab aeGa)-ao-” au, [22] ~ Fyn ‘The result is the equations of motion for this system: ((2m + MYR? + 2y + 2n7Jm)6 + (MLRcos(ip) — 2n2fm)ip —MLRw sin(p) = Fo ‘ ~ ; [23] (MLRcos() — 2n7Jym)6 + (ML? + Jy + 27m )b — MgLsin@h) = Fy — ‘The last step needed before the model is complete is to find the generalized forces Fo) and Fp) Before that, however, the equations were rewritten for easier Simulink model building by solving for the accelerations. This can be made by rewriting the system on a matrix form and invert the left side matrix: Miz Miz] [8] _ [fat Fo ws, wallgl= Les al tea] = m+ MR? + By + 207, [25] Mzy = MLRcos(Wp) — 21) (26) Mzz = MI? + Jy + 202m 7 18 fi = MLR sin@p) 28} fz = MgLsin@) [29] Inversion of the left side matrix solves the system for the accelerations: le bes Sal He 2 WI) WMer Mezl Ufa + Fy) [30] ‘The system is powered by two DC-motors, and the general forces can thus be derived by considering the DC motor torque and viscous friction (ij and i, denotes the currents in the left and the right motor.) [31] Fg = mK (la + te) + fab — 64) + fn — 6+) — fu(6r + 8) Fy = — Ke (+) ~ fab ~ 81) — fn — 8) Applying Kirschoff's voltage law to the electrical part of the DC-motor, ignoring the inductance (since the electrical time constant of the motor is much smaller than the mechanical time constant) and solving for the current gives: iy = tao) : [2] where vj denotes the input voltage to the right (j=r) and left (j=l) motor. Putting this result in Equation [31] renders the final expression for the generalized forces: Fg = av + vp) — 2B + fiy)0 + 2B [33] Fy = ~aCor + v) + 286 ~ 26h [34] [35] [36] ‘The final equation used when building the simulation model i Simulink is Equation [30] where the general forces are given by Equation [33}-[36]. 19 3.1.3 Linear model ‘The linear model was used for control design and was derived by linearizing the nonlinear model in the operating point where the vehicle is standing straight up. This means that -» 0, sin(sp) + and cos() > 1 was considered. This gives the following system: Fo i + M)R? + 2fy + 2n7Jm)O + (MLR = 277 Jn) [371 (MLR — 2nJyq)6 + (ML? + Jy + 2n?Jm)ip - Mglip = Fy To achieve a controllable model on state space form the vector x = {0,¥,,0} was chosen, To shorten the equations for the full state space, a matrix E is defined: (2m + M)R? + Zw + 2n7J_ — MLR — 27 Jyy, MLR = 2n Jy, ML? + Jy + 2n7frn! [35 By letting E(ij) denote the i:th row and the j:th column of E, and det(B) be the determinant of B, the linear model can be described on state space form as: 0 0 1 0 0 0 0 1 =gMLE(1,2) —2(B + fyE(2.2) + BE(L2)) 2B(E(2,2) + E(1,2)) A=10 ~aee ey det) det) {59} GMLE(L1) — 2(GB+ fu)EC,2)+BEG1)) -28(E(1,1) + £(1,2)) : det (EY det) det) 0 0 0 0 a(E(2,2) + E(1,2)) @(E (2,2) + E(,2)) det (E) det (E) [40 =a(EQL1)+E(L2)) -a(E(1) + £C,2)) det (E) det (E) c=[0 10 o} (at) D=0 42] [43]

You might also like