# Identifying the bicycle model

I've been working on a small application to visualize and interact with the data resulting from identifying the bicycle model from all of my data. This is a preliminary look at how it is coming along.

I'm using the basic grey box identification technique as described in my previous posts [1], [2]. The basic idea is to fit a 4th order model to the experimental data with steer torque as the input and the four states (roll angle, steer angle, roll rate and steer rate) as the outputs. This has proved to give really good output matching when comparing the identified model to the experimentally measured output data and the models seem to show some repeatability. So far I've been exploring the runs that have no perturbations. I've run two identification routines on the data. The first assumes no process noise (output error model) and the second attempts to compute the Kalman gain matrix that captures that describes the process noise. I'm still blurry on what is going on behind the scene in the Matlab system id toolbox and am continually reading Ljung1999 to try to wrap my head around it all. Here are a few things that are of note with the ID process:

- If I identify the process noise Kalman gain matrix, the resulting model output to measured output fits are all poorer. This makes little sense to me. The output error version assumes that the Kalman gain matrix is zero, so the output error model is in a sub space of the full system description. With that in mind, it seems the process noise identification would always result in a model with better output fit that one without. And if K=0 gives a better output fit, then the minimization process when K is a free parameters should find K=0 for the minima.
- I'm identifying an unstable model for almost all of my runs (the instrumented bicycle with rider has a weave critical speed at about 7 m/s). This presents some issues and the identified model doesn't always give a stable output for the measured steer torque input. I don't necessarily get a good model result from both the output error form and the process noise form. Sometimes they both converge to a good solution, sometimes one or the other does, and sometimes they both don't.

- I plan to add in a root loci plot so that the identified eigenvalues can be compared to the model.
- Fit some curves through the coefficient data. I think I can generate the bicycle model from the data exclusively, assuming that each coefficient is either constant, linear or quadratic with respect to speed. This would basically remove most of the first principles based modeling of the bicycle from the picture and I can move on to identifying the rider. I think that I need to use linear mixed effects (multi-level) modeling to properly do these fits, otherwise my repeated experiments and riders won't be properly accounted for.
- I could free up some particular parameters in my bicycle model including some new parameters that would allow me to a grey box identification on the data with respect to a small set of parameters that I most uncertain in. This would retain the use of the first principles model, methodology.
- The model parameter adjustment needs some speed up. I think my data subset algorithms are slowing things down because of the way I programmed it. I have noticed that changing the trail and other parameters associated with the front frame of the bicycle have little effect on the resulting curves unless you exaggerate them unrealistically. Since there are 20+ parameters to fiddle with, it is hard to get a feel of how you could push the model curves around to better match the data.
- I'm going to add in the model with the rider's arms, as I believe it will fit the data better than the Whipple model. For sure on the steer torque term in the steer acceleration equation.