Simulation of bicycle (self-)stability
In this project we examine the self-stability of a bicycle by numerically simulating the dynamics of a bicycle. The math is based on the paper "Linearized dynamics equations for the balance and steer of a bicycle: a benchmark and review" by J. P. Meijaard et al (2007). The paper is available here.
Additionally, to simulating the bicycle on its own, we also model a rider controlling the bicycle via the steering angle to keep it upright.
To use the project, create a virtual environment and install the required packages:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txtpython bicycler simulate --output FILENAMEFor additional parameters like model parameters, simulation settings and rider control, see the help message:
python bicycler simulate --helppython bicycler visualize -i FILENAMEpython bicycler simulate --show -o showAdd any parameters just like in the simulate command.
The behavior of the simulation is evaluated by comparing the results to the analytical results presented in the paper. Below are the parameters used in the evaluation:
// inverted-prendulum-like fall
python bicycler simulate --show -o show -t 0.01 -s 1600 -v 4.
// low speed weave mode
python bicycler simulate --show -o show -t 0.01 -s 1600 -v 4.2
// riderless stable mode
python bicycler simulate --show -o show -t 0.005 -s 1500 -v 4.35
// capsize mode
python bicycler simulate --show -o show -t 0.01 -s 2000 -v 10Furthermore we show that the rider control can stabilize the bicycle at otherwise installable speeds:
// stability at high speed with rider control
python bicycler simulate --show -o show -t 0.01 -s 500 -v 10 -c pid
// stability with high initial lean
python bicycler simulate --show -o show -t 0.005 -s 1000 -v 20 -c pid --roll 20