Identification of the benchmark canonical form

by Jason Moore

This is a description of an identification procedure for the bicycle based around the benchmark canonical form.

Model structure

The identification of the linear dynamics of the bicycle can be formulated with respect to the benchmark canonical form realized in [Meijaard2007].

Mq¨+vC1q˙+[gK0+v2K2]q=T

where the time varying states roll and steer are collected in the vector q=[ϕδ]T and the time varying inputs roll torque and steer torque are collected in the vector T=[TϕTδ]T. I extend the equations to properly account for the lateral perturbation force, F, which was the actual input we delivered during the experiments. It contributes to both the roll torque and steer torque equations.

Mq¨+vC1q˙+[gK0+v2K2]q=T+HF

where H=[HϕFHδF]T is a vector describing the linear contribution of the lateral force to the roll and steer equations. HϕF is approximately the distance from the ground to the force application point. HδF is a distance that is a function of the bicycle geometry (trail, wheelbase) and the longitudinal location of the force application point. HδFH=[HϕF. I compute H for each rider/bicycle from the state space form of the linear equations of motion.

x˙=Ax+Bu

where x=[ϕδϕ˙δ˙]T and u=[FTϕTδ]T. The state and input matrices can be sectioned.

A=[0AlIAr]
B=[0BF0BT]

where Al and Ar are the 2 x 2 submatrices corresponding to the states and their derivatives, respectively. BF and BT are the 2 x 1 and 2 x 2 submatrices corresponding to the lateral force and the torques, respectively. The benchmark canonical form can now be written as

B−1T[q¨−Arq˙−Alq]=T+B−1TBFF

where

M=B−1T
vC1=−B−1TAr
[gK0+v2K2]=−B−1TAl
H=B−1TBF

 

Data processing

The roll and steer angle were measured with potentiometers. The roll and steer rates were measured with a combination of rate gyros. The steer torque was measured with a torque sensor and the lateral force with a load cell. The wheel speed was measured with a DC tachometer. See my draft chapter for more details of the measurements.

All of the signals were filtered with a second order low pass Butterworth filter at 15 Hz. The roll and steer accelerations were computed by numerically differentiating the roll and steer rate signals. The mean was subtracted from all the signals except the lateral force.

I explored complementary filtering various signals but found little improvement in the signal quality. The iPython notebook worksheet details what I tried.

Identification

A simple analytic identification problem can be formulated. If we have good measurements of q, their first and second derivatives, forward speed v and the inputs Tδ F, the entries in the M, C1, K0, K2 and H matrices can be identified by forming two simple regressions, one for each equation in the canonical form. I use the instantaneous speed at each time step rather than the mean over a run to improve accuracy with respect to the speed parameter. The roll and steer equation each can be put into a simple linear form

ΓΘ=Y

where Θ are the unknown parameters and Γ and Θ are made up of the inputs and outputs measured during a run. Theta can generally be all or a subset of the entries in the canonical matrices. If there are N samples in a run and we desire to find M entries in the equation, then Γ is an N×M matrix and Y is an N×1 vector. The Moore-Penrose puesdo inverse can be employed to solve for Θ analytically. The estimate of the unknown parameters is then

Θ^=[ΓTΓ]−1ΓTY

For example if we fix the mass terms in the steer torque equation and let the rest be free the linear equation is

⎡⎣⎢⎢⎢v(1)ϕ˙(1)⋮v(N)ϕ˙(N)v(1)δ˙(1)⋮v(N)δ˙(N)gϕ(1)⋮gϕ(N)gδ(1)⋮gδ(N)v(1)2ϕ(1)⋮v(N)2ϕ(N)v(1)2δ(1)⋮v(N)2δ(N)−F(1)⋮−F(N)⎤⎦⎥⎥⎥⎡⎣⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢C1δϕC1δδK0δϕK0δδK2δϕK2δδHδF⎤⎦⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥=⎡⎣⎢⎢⎢Tδ(1)−Mδϕϕ¨(1)−Mδδδ¨(1)⋮Tδ(N)−Mδϕϕ¨(N)−Mδδδ¨(N)⎤⎦⎥⎥⎥

The error in the fit is

Y^−Y=ΓΘ^−Y

I’m not quite sure what the “noise” model is in this model structure. It doesn’t seem to be strictly an output error model, as we are not necessarily finding only the error in the forcing predictions, as Y^ can be a combination of kinematic and force measurements.

 

This equation can be solved for each run individually, a portion of a run or if there are P runs then they can be all collected in Γ for best fit over multiple runs. If all the runs have the same number of time steps, Γ then becomes an NP×M matrix and Y an NP×1 vector if each run is the same length.

Secondly, all of the parameters in the canonical matrices need not be estimated. The analytical benchmark bicycle model [Meijaard2007] gives us a good idea of which entries in the matrices we may be more certain about from our physical parameters measurements. I went through the benchmark formulation and eliminated free parameters based on these rules:

  • If the parameter is greatly affected by trail, leave it free.
  • If the parameter is greatly affected by the front assembly moments and products of inertia, leave it free.
  • If the parameter is equal or near to zero, fix it.

For the roll equation this leaves Mϕδ, C1ϕδ, and K0ϕδ as free parameters. And for the steer equations this leaves Mδϕ, Mδδ, C1δϕ, C1δδ, K0δϕ, K0δδ, K2δδ, and HδF as free. Previous attempts at identifying all of the parameters and identification from a state space perspective confirmed that this choice of fixed parameters was reasonable for the roll equation and that little is known in the steer equation.

I start by identifying the roll equation. I have much more certainty in the roll equation estimates from first principles. I then use the assumption that Mϕδ=Mδϕ and K0ϕδ=K0δϕ to fix these values in the steer equation to the ones identified in the roll equation, leaving less free parameters in the steer equation. This matrix symmetry is likely enforced in reality due to the simple coupling of the front and rear frames. It is also possible to solve the roll and steer equations simultaneously and enforce the symmetry but this was the easier solution for the time being. Finally, I identify the remaining steer equation coefficients.

The code for this analysis can be found in https://github.com/moorepants/BicycleSystemID/tree/master/scripts.

Results

I have data for three riders on the same bicycle, performing two maneuvers, on two different environments. I don’t suspect that the dynamics of the system should vary much with respect to different maneuvers, but there is potentially a small variation across riders and there may be variation across environments because of the differences in the wheel to floor interaction. If computing the best fit model across a series of runs this leaves these four combinations:

  • All riders in both environments (n=1)
  • All riders in each environment (n=2)
  • Each rider in both environments (n=3)
  • Each rider in each environment (n=6)

for a total of 12 combinations.

All riders in both environments

Here I’ll make the assumption that the model doesn’t vary much across riders or environments and give the results for the last item in the list. I run the fit over 374 runs giving about 142 minutes of data sampled at 200 Hz.

Matrix First Principles (Whipple) Identified Percent Difference
M [129.862770822.290770792.290770790.22039034] [x2.283757682.28375768±7.05777612e−050.20003257±1.94915567e−03] [00.306146210.306146219.23713925]
C1 [0.−0.315009442.072573471.3924634] [x−0.88845094±4.33887933e−0623.94008131±3.15769856e−041.73368327±5.66893205e−07] [0−182.0395005543.098129424.50476423]
K0 [−114.59019659−2.36844326−2.36844326−0.73938563] [x−3.91797216−3.91797216±1.94915567e−03−0.66780731±2.30169695e−06] [0−65.42393996−65.42393996−9.68078349]
K2 [0.0.102.94474772.19688326] [xxx2.33973324±1.19898796e−06] [0006.50239301]]]
H [0.915458330.01101888] [x0.0086155±1.62592752e−09] [021.81146898]
Charlie-Jason-Luke-HorseTreadmill-PavillionFloor-eig.png
This plot shows the root locus of the real (solid line) and imaginary (dotted line) parts of the eigenvalues for three bicycle systems: Identified (black), Whipple (blue), and the Whipple + Arms (model). The first principles models are calculated by taking the mean of the linear model with respect to the three riders. The identified model was computed with all of the available run data and is the "best fit" model for all of the data for all riders and both environments.
Charlie-Jason-Luke-HorseTreadmill-PavillionFloor-Tphi.png
The frequency response for the roll torque to roll angle transfer function for three models: identified (black), Whipple (blue), and Arm (red) for four speeds: 2.0 m/s (solid), 3.0 (dashed), 5.8 (dash-dot), 9.0 (dotted).<br /> <br /> First Principles: Mean of all riders.<br /> Identified: All riders, both environments.<br />
Charlie-Jason-Luke-HorseTreadmill-PavillionFloor-Tdel.png
The frequency response for the steer torque to roll angle transfer function for three models: identified (black), Whipple (blue), and Arm (red) for four speeds: 2.0 m/s (solid), 3.0 (dashed), 5.8 (dash-dot), 9.0 (dotted). First Principles: Mean of all riders. Identified: All riders, both environments.

 

Notice that the identified model seems to have a similar eigenvalue locus as the Whipple model except for the higher weave speed and the faster caster mode. Notice the arm model has an unstable capsize mode for all speeds shown. There is a stable oscillatory mode for all speeds shown, with a similar frequency as the Whipple model for speeds above 2 m/s. In the Bode plots, the Whipple model seems to better predict the low speed behavior and the arm model better predicts the high speed behavior.

The question remains as to how well the identified model can predict the measured motion given measured inputs. This is ultimately our measurement of model quality. The following graphs give some example comparisons for various riders and various speeds of the simulation results of the model identified from all runs (all riders and both environments) along with the Whipple and Arm model.

Example fit at 2 m/s
Time histories of the roll and steer states showing example fits against the measured data (green) compared to the three models: identification from all runs and both environments (I), Whipple model (I) and the Arm model (A).
Example fit at 4.25 m/s
Example fit at 4.7 m/s

 

These graphs give evidence that the identified model from all rider and both environments is better at predicting the measure motion of the bicycle given the measured inputs. The variance in the prediction is on the order of 50-80% for the identified model. I will have to run these fits on all of the runs to get an idea of the quality of the model, but this look very promising.

All riders in each environment

The following results make the assumption that the differences in the riders’ inertia are negligible, but that the treadmill and pavilion floor may give different results.

All of the following graphs follow the same color and line style scheme as the ones above. I also haven’t match frequencies in the phase plots.

Horse Treadmill

Charlie-Jason-Luke-HorseTreadmill-eig.png
Charlie-Jason-Luke-HorseTreadmill-Tphi.png
Charlie-Jason-Luke-HorseTreadmill-Tdel.png

Pavilion Floor

Charlie-Jason-Luke-PavillionFloor-eig.png
Charlie-Jason-Luke-PavillionFloor-Tphi.png
Charlie-Jason-Luke-PavillionFloor-Tdel.png

 

The environment doesn’t seem to change the predicted dynamics too much.

Each Rider on Both Floors

The following results assume that the environment has little difference on the models, but that the rider’s do.

Charlie

Charlie-HorseTreadmill-PavillionFloor-eig.png
Charlie-HorseTreadmill-PavillionFloor-Tphi.png
Charlie-HorseTreadmill-PavillionFloor-Tdel.png

Jason

Jason-HorseTreadmill-PavillionFloor-eig.png
Jason-HorseTreadmill-PavillionFloor-Tphi.png
Jason-HorseTreadmill-PavillionFloor-Tdel.png

Luke

Luke-HorseTreadmill-PavillionFloor-eig.png
Luke-HorseTreadmill-PavillionFloor-Tphi.png
Luke-HorseTreadmill-PavillionFloor-Tdel.png

 

Charlie’s eigenvalue plot looks very different from the other two riders, with an unstable capsize mode similar to the arm model. It is interesting that the Arm model is different for Charlie than Jason and Luke. Luke and Jason’s models seem similar to each other. The frequency response of Charlie doesn’t seem to vary as much with respect to the other riders.

Each rider in each environment

I won’t bore you with the 18 graphs, but they are all in this folder.

Discussion

This method of estimating the bicycle models is the most promising that I’ve done so far. I am able to generate a single models for large sets of data. The resulting models act and look like bicycles, but I have enforced a lot of structure on the model by fixing a great deal of the parameters. The 4th order model still seems to be able to capture the essential dynamics and a modified steer torque equation which includes some kind of tire related torques may be able to account for the differences in the identification and the first principle models. These results give less credence to the Arm model and in the process I realized that I haven’t properly linearized the Arm model in most of my previously report work. When I try to reduce my correct 19 x 19 A matrix to it’s essential 4 x 4 size, I’m not properly accounting for the holonomic constraints. I hope to have that worked out so that I can compare the numerical values of the matrix entries.

The model predictions from the identified model simulation look very promising. My main question at this point, is how this model addresses the process and measurement noise and whether the parameter identification is very accurate.

Bookmark the permalink.

Comments are closed.