moorepants / BicycleParameters

Calculates the geometry, masses, centers of mass, and the moments of inertia of the bicycle rider system.
https://bicycleparameters.readthedocs.io
Other
38 stars 20 forks source link

Add RawData files for the Balanceassistv1 #110

Closed moorepants closed 1 month ago

moorepants commented 2 months ago

Christoph and Jason measured the Balanceassistv1 bicycle, i.e. the first balance assist bicycle we received from Bosch/Gazelle, with the standard procedure. This is a modified Gazelle Grenoble step through frame with the e-bike battery in the downtube. The torsional and compound pendulum data files will be added to Figshare and the periods recorded in these files result from that data and the current version of BicycleParameters. The measurements were recorded mostly on July 30-1, 2024 and various corrections recorded upt to and including August 8, 2024.

moorepants commented 2 months ago

@chrismo-schmidt would you like to double check these? I made some changes and took the final measurements so the rider can sit on the bike.

moorepants commented 2 months ago

Resulting figures:

image

Resulting parameters without rider:

{'IBxx': 1.14925449488747,
 'IBxz': 0.05719397280279859,
 'IByy': 3.1019340904048214,
 'IBzz': 2.0895833926673024,
 'IFxx': 0.09947076116547277,
 'IFyy': 0.19230532606494322,
 'IFzz': 0.09947076116547277,
 'IHxx': 0.3113335653577265,
 'IHxz': -0.051328838578187846,
 'IHyy': 0.2566995843845019,
 'IHzz': 0.06539535254969839,
 'IRxx': 0.10407036275570299,
 'IRyy': 0.18685868837700836,
 'IRzz': 0.10407036275570299,
 'c': 0.041754825960194364,
 'g': 9.80665,
 'lam': 0.25453392722979173,
 'mB': 22.5,
 'mF': 2.235,
 'mH': 4.3,
 'mR': 4.085,
 'rF': 0.3523093609017968,
 'rR': 0.3489472127289805,
 'v': 1.0,
 'w': 1.1132722200610523,
 'xB': 0.5191964830280268,
 'xH': 0.9208250036668604,
 'zB': -0.5212573173045935,
 'zH': -0.8600415661998936}

with Jason as rider:

{'IBxx': 19.692864561933778,
 'IBxz': -3.507187082718745,
 'IByy': 22.616790645669592,
 'IBzz': 4.971570470059646,
 'IFxx': 0.09947076116547277,
 'IFyy': 0.19230532606494322,
 'IFzz': 0.09947076116547277,
 'IHxx': 0.3113335653577265,
 'IHxz': -0.051328838578187846,
 'IHyy': 0.2566995843845019,
 'IHzz': 0.06539535254969839,
 'IRxx': 0.10407036275570299,
 'IRyy': 0.18685868837700836,
 'IRzz': 0.10407036275570299,
 'c': 0.041754825960194364,
 'g': 9.80665,
 'lam': 0.25453392722979173,
 'mB': 106.00000000000001,
 'mF': 2.235,
 'mH': 4.3,
 'mR': 4.085,
 'rF': 0.3523093609017968,
 'rR': 0.3489472127289805,
 'v': 1.0,
 'w': 1.1132722200610523,
 'xB': 0.37430384487162016,
 'xH': 0.9208250036668604,
 'yB': 0.0,
 'zB': -1.009365940238417,
 'zH': -0.8600415661998936}
moorepants commented 2 months ago

Test script:

import pprint
import numpy as np
import matplotlib.pyplot as plt
import bicycleparameters as bp
from bicycleparameters.parameter_sets import Meijaard2007ParameterSet
from bicycleparameters.models import Meijaard2007Model

data_dir = "/home/moorepants/Data/bicycle-parameters"
v = np.linspace(0.0, 10.0, num=401)

bicycle = bp.Bicycle("Balanceassistv1", pathToData=data_dir,
                     forcePeriodCalc=True, forceRawCalc=True)

print(bicycle)
print('Bicycle short name:', bicycle.bicycleName)
print('Directory:', bicycle.directory)
pprint.pprint(bicycle.extras)
M, C1, K0, K2 = bicycle.canonical()
print('M:', M)
print('C1:', C1)
print('K0:', K0)
print('k2:', K2)
A, B = bicycle.state_space(3.2)
print('A:', A)
print('B:', B)
print(*bicycle.eig([1.0, 2.0]))

bicycle.plot_bicycle_geometry(show=False)
bicycle.plot_eigenvalues_vs_speed(v)
par = bp.io.remove_uncertainties(bicycle.parameters['Benchmark'])
par['v'] = 1.0
pprint.pprint(par)
par_set = Meijaard2007ParameterSet(par, False)
par_set.plot_all()
model = Meijaard2007Model(par_set)
model.plot_eigenvalue_parts(v=v)

bicycle.add_rider('Jason')
print(bicycle)
bicycle.plot_bicycle_geometry(show=False)
par = bp.io.remove_uncertainties(bicycle.parameters['Benchmark'])
par['v'] = 1.0
pprint.pprint(par)
par_set = Meijaard2007ParameterSet(par, True)
par_set.plot_all()
model = Meijaard2007Model(par_set)
model.plot_eigenvalue_parts(v=v)

plt.show()

Which does give this warning:

/home/moorepants/src/BicycleParameters/bicycleparameters/parameter_sets.py:725: RuntimeWarning: invalid value encountered in sqrt
  width = np.sqrt(5/2*(-kaa**2 + kyy**2 + kbb**2))

which is from calculating the inertia ellipsoids I believe.

moorepants commented 2 months ago

It does look like it is failing to draw the inertia ellipsoid of the handelbar.

moorepants commented 2 months ago

If I truncate the pendulum period measurements the fork decayed oscillation fits are signficantly poorer, this must result in the inertia of the fork not being quite right and thus the principal inertia calc for the ellipsoid exposes that. If I skip truncated from 100% to 90% of the decay in the signal, then the fits are great and inertia of fork seems to be correct. I guess I'll just skip the truncation if the time array is given.

moorepants commented 2 months ago

I'm now thinking that the fork inertia values could just be erroneous. I measured the Crescendo years back which has a very similar fork, including a fender+light. The ellipsoid for the fork has more inertia about the steer axis than what we get from our measurements. Here is the Crescendo: image and the inertia figure: image

moorepants commented 1 month ago

Here are the final results (based on not truncating the period time series if the measurement has a time variable in the mat file).

Test script:

import pprint
import numpy as np
import matplotlib.pyplot as plt
import bicycleparameters as bp
from bicycleparameters.parameter_sets import Meijaard2007ParameterSet
from bicycleparameters.models import Meijaard2007Model

data_dir = "/home/moorepants/Data/bicycle-parameters"
v = np.linspace(0.0, 10.0, num=401)

bicycle = bp.Bicycle("Balanceassistv1", pathToData=data_dir,
                     forcePeriodCalc=True, forceRawCalc=True)

print(bicycle)
print('Bicycle short name:', bicycle.bicycleName)
print('Directory:', bicycle.directory)
pprint.pprint(bicycle.extras)
M, C1, K0, K2 = bicycle.canonical()
print('M:', M)
print('C1:', C1)
print('K0:', K0)
print('k2:', K2)
A, B = bicycle.state_space(3.2)
print('A:', A)
print('B:', B)
print(*bicycle.eig([1.0, 2.0]))

bicycle.plot_bicycle_geometry(show=False)
bicycle.plot_eigenvalues_vs_speed(v)
par = bp.io.remove_uncertainties(bicycle.parameters['Benchmark'])
par['v'] = 1.0
pprint.pprint(par)
par_set = Meijaard2007ParameterSet(par, False)
par_set.plot_all()
model = Meijaard2007Model(par_set)
model.plot_eigenvalue_parts(v=v)

bicycle.add_rider('Jason')
print(bicycle)
bicycle.plot_bicycle_geometry(show=False)
par = bp.io.remove_uncertainties(bicycle.parameters['Benchmark'])
par['v'] = 1.0
pprint.pprint(par)
par_set = Meijaard2007ParameterSet(par, True)
par_set.plot_all()
model = Meijaard2007Model(par_set)
model.plot_eigenvalue_parts(v=v)

plt.show()

Script text output

Found the RawData directory: /home/moorepants/Data/bicycle-parameters/bicycles/Balanceassistv1/RawData
Recalcuting the parameters.
Calculating the period for: Balanceassistv1ForkCompoundFirst1.mat
The period is: 1.62270+/-0.00004 

Calculating the period for: Balanceassistv1ForkCompoundFirst2.mat
The period is: 1.62128+/-0.00008 

Calculating the period for: Balanceassistv1ForkCompoundFirst3.mat
The period is: 1.62073+/-0.00008 

Calculating the period for: Balanceassistv1ForkCompoundFirst4.mat
The period is: 1.62014+/-0.00006 

Calculating the period for: Balanceassistv1ForkTorsionalFirst1.mat
The period is: 1.51347+/-0.00017 

Calculating the period for: Balanceassistv1ForkTorsionalFirst2.mat
The period is: 1.51608+/-0.00029 

Calculating the period for: Balanceassistv1ForkTorsionalFirst3.mat
The period is: 1.50943+/-0.00020 

Calculating the period for: Balanceassistv1ForkTorsionalSecond1.mat
The period is: 1.2406+/-0.0004 

Calculating the period for: Balanceassistv1ForkTorsionalSecond2.mat
The period is: 1.24048+/-0.00018 

Calculating the period for: Balanceassistv1ForkTorsionalSecond3.mat
The period is: 1.24008+/-0.00016 

Calculating the period for: Balanceassistv1ForkTorsionalThird1.mat
The period is: 0.73596+/-0.00010 

Calculating the period for: Balanceassistv1ForkTorsionalThird2.mat
The period is: 0.73716+/-0.00009 

Calculating the period for: Balanceassistv1ForkTorsionalThird3.mat
The period is: 0.73708+/-0.00009 

Calculating the period for: Balanceassistv1FrameCompoundFirst1.mat
The period is: 1.79750+/-0.00011 

Calculating the period for: Balanceassistv1FrameCompoundFirst2.mat
The period is: 1.79909+/-0.00008 

Calculating the period for: Balanceassistv1FrameCompoundFirst3.mat
The period is: 1.80003+/-0.00005 

Calculating the period for: Balanceassistv1FrameTorsionalFirst1.mat
The period is: 3.2877+/-0.0004 

Calculating the period for: Balanceassistv1FrameTorsionalFirst2.mat
The period is: 3.29309+/-0.00034 

Calculating the period for: Balanceassistv1FrameTorsionalFirst3.mat
The period is: 3.30595+/-0.00028 

Calculating the period for: Balanceassistv1FrameTorsionalSecond1.mat
The period is: 3.7128+/-0.0004 

Calculating the period for: Balanceassistv1FrameTorsionalSecond2.mat
The period is: 3.71415+/-0.00030 

Calculating the period for: Balanceassistv1FrameTorsionalSecond3.mat
The period is: 3.71615+/-0.00030 

Calculating the period for: Balanceassistv1FrameTorsionalThird1.mat
The period is: 3.09983+/-0.00029 

Calculating the period for: Balanceassistv1FrameTorsionalThird2.mat
The period is: 3.09881+/-0.00027 

Calculating the period for: Balanceassistv1FrameTorsionalThird3.mat
The period is: 3.09933+/-0.00022 

Calculating the period for: Balanceassistv1FwheelCompoundFirst1.mat
The period is: 1.533589+/-0.000020 

Calculating the period for: Balanceassistv1FwheelCompoundFirst2.mat
The period is: 1.53278+/-0.00004 

Calculating the period for: Balanceassistv1FwheelCompoundFirst3.mat
The period is: 1.531369+/-0.000020 

Calculating the period for: Balanceassistv1FwheelCompoundFirst4.mat
The period is: 1.53265+/-0.00007 

Calculating the period for: Balanceassistv1FwheelTorsionalFirst1.mat
The period is: 0.88159+/-0.00004 

Calculating the period for: Balanceassistv1FwheelTorsionalFirst2.mat
The period is: 0.882016+/-0.000024 

Calculating the period for: Balanceassistv1FwheelTorsionalFirst3.mat
The period is: 0.881827+/-0.000022 

Calculating the period for: Balanceassistv1RwheelCompoundFirst1.mat
The period is: 1.347828+/-0.000024 

Calculating the period for: Balanceassistv1RwheelCompoundFirst2.mat
The period is: 1.348834+/-0.000016 

Calculating the period for: Balanceassistv1RwheelCompoundFirst3.mat
The period is: 1.348391+/-0.000012 

Calculating the period for: Balanceassistv1RwheelCompoundFirst4.mat
The period is: 1.347953+/-0.000034 

Calculating the period for: Balanceassistv1RwheelTorsionalFirst1.mat
The period is: 0.89414+/-0.00004 

Calculating the period for: Balanceassistv1RwheelTorsionalFirst2.mat
The period is: 0.89384+/-0.00004 

Calculating the period for: Balanceassistv1RwheelTorsionalFirst3.mat
The period is: 0.893628+/-0.000033 

Calculating the period for: RodRodTorsionalFirst1.mat
The period is: 0.964128+/-0.000019 

Calculating the period for: RodRodTorsionalFirst2.mat
The period is: 0.96481+/-0.00008 

Calculating the period for: RodRodTorsionalFirst3.mat
The period is: 0.96553+/-0.00006 

The glory of the Balanceassistv1 parameters are upon you!
Balanceassistv1 with no one on board.
Bicycle short name: Balanceassistv1
Directory: /home/moorepants/Data/bicycle-parameters/bicycles/Balanceassistv1
{'betas': {'B': [-5.6883121758109+/-0.027688544632344214,
                 -0.8869114035744998+/-0.027688544632344214,
                 -2.7544137032084324+/-0.027688544632344214],
           'H': [-2.775357654232365+/-0.027688544632344214,
                 -0.5552988456955772+/-0.027688544632344214,
                 -1.1417294743656718+/-0.027688544632344214]},
 'intercepts': {'B': [-0.1617987808277105+/-0.003710977527879129,
                      -1.1086703853269324+/-0.025856069984397746,
                      -0.3165490315996673+/-0.0011488504490626953],
                'H': [-0.5358131793589308+/-0.029016809884671143,
                      -1.4137057446586518+/-0.049359105831349434,
                      -2.917937765619192+/-0.1870702072638602]},
 'pendulumInertias': {'B': [1.3902007491332655+/-0.007570132883878139,
                            1.765979579999164+/-0.009615594205888917,
                            1.229564442351413+/-0.006694784335607237],
                      'H': [0.2930164951250737+/-0.001595981028390291,
                            0.19693536282436983+/-0.0010731350895737822,
                            0.06947637471905611+/-0.00037836112978763714]},
 'slopes': {'B': [-0.676636585016892+/-0.04036538672907974,
                  1.226832704636709+/-0.06936308498583547,
                  -0.4077610145494889+/-0.032292292505428186],
            'H': [-0.38353805801273044+/-0.03176156947309774,
                  0.6204197159449089+/-0.03834643650802733,
                  2.1858301573111802+/-0.15998035386628937]}}
M: [[11.688942525993475+/-0.31594150944060384
  0.4406131920896975+/-0.09313204253742689]
 [0.4406131920896975+/-0.09313204253742689
  0.19410189902471633+/-0.01255464963661183]]
C1: [[0.0 10.225105813876123+/-0.24096160633951902]
 [-0.5615672307821129+/-0.006883599474168358
  0.6877300951088847+/-0.10857086496036385]]
K0: [[-17.639329159626296+/-0.32095068488456974
  -0.7225780895249696+/-0.14676562280312822]
 [-0.7225780895249696+/-0.14676562280312822
  -0.18194110186637624+/-0.05477497412059674]]
k2: [[0.0 16.273256477906656+/-0.21968344619707672]
 [0.0 0.7462886916588964+/-0.13526862918254584]]
A: [[0.0 0.0 1.0 0.0]
 [0.0 0.0 0.0 1.0]
 [14.678735393679776+/-0.16987045705682288
  -13.683072997301307+/-0.27800240387835695
  -0.3816389372179702+/-0.06331810525475134
  -2.5938164365370975+/-0.08076234022884007]
 [3.1860891990140985+/-0.7871645723544941
  0.8819026286099074+/-1.6739345881159413
  10.124425874915588+/-0.25564721855886846
  -5.450057778241475+/-0.36244843734941384]]
B: [[0.0 0.0]
 [0.0 0.0]
 [0.0935563415068749+/-0.001390448537546629
  -0.21237380200143693+/-0.03303175703268857]
 [-0.21237380200143693+/-0.03303175703268857
  5.6340236974024975+/-0.19414818504659848]]
[[-3.73879106+0.62776527j -3.73879106-0.62776527j  2.82758845+0.45733248j
   2.82758845-0.45733248j]
 [-3.83787261+0.83559703j -3.83787261-0.83559703j  2.01546738+1.51314516j
   2.01546738-1.51314516j]] [[[-0.02252645+0.09492353j -0.02252645-0.09492353j
   -0.13483573-0.04650224j -0.13483573+0.04650224j]
  [ 0.23240054+0.03902143j  0.23240054-0.03902143j
   -0.29334183+0.04744493j -0.29334183-0.04744493j]
  [ 0.024632  -0.36904055j  0.024632  +0.36904055j
   -0.35999296-0.19315396j -0.35999296+0.19315396j]
  [-0.89339338+0.j         -0.89339338-0.j
   -0.85114807+0.j         -0.85114807-0.j        ]]

 [[ 0.02776644+0.05737999j  0.02776644-0.05737999j
   -0.19467024-0.02314574j -0.19467024+0.02314574j]
  [ 0.23289269+0.05070633j  0.23289269-0.05070633j
   -0.24982379+0.1875593j  -0.24982379-0.1875593j ]
  [-0.15451061-0.19701553j -0.15451061+0.19701553j
   -0.35732867-0.34121381j -0.35732867+0.34121381j]
  [-0.93618255+0.j         -0.93618255-0.j
   -0.78731615+0.j         -0.78731615-0.j        ]]]
{'IBxx': 1.1198252298472995,
 'IBxz': 0.04678005457419021,
 'IByy': 3.1606031126515646,
 'IBzz': 2.119022714899317,
 'IFxx': 0.09953295608625136,
 'IFyy': 0.19015619017713314,
 'IFzz': 0.09953295608625136,
 'IHxx': 0.29844713987805804,
 'IHxz': -0.03826451175579229,
 'IHyy': 0.25662501245035463,
 'IHzz': 0.05656444304099169,
 'IRxx': 0.10227397798804952,
 'IRyy': 0.1886505218140362,
 'IRzz': 0.10227397798804952,
 'c': 0.041754825960194364,
 'g': np.float64(9.80665),
 'lam': 0.25453392722979173,
 'mB': 22.5,
 'mF': 2.235,
 'mH': 4.3,
 'mR': 4.085,
 'rF': 0.3523093609017968,
 'rR': 0.3489472127289805,
 'v': 1.0,
 'w': 1.1132722200610523,
 'xB': 0.5191964830280268,
 'xH': 0.9208250036668604,
 'zB': -0.5212573173045935,
 'zH': -0.8600415661998936}
There is no rider on the bicycle, now adding Jason.
No parameter files found, calculating the human configuration.
Balanceassistv1 with Jason on board.
{'IBxx': 19.66343529689361,
 'IBxz': -3.5176010009473533,
 'IByy': 22.675459667916336,
 'IBzz': 5.001009792291661,
 'IFxx': 0.09953295608625136,
 'IFyy': 0.19015619017713314,
 'IFzz': 0.09953295608625136,
 'IHxx': 0.29844713987805804,
 'IHxz': -0.03826451175579229,
 'IHyy': 0.25662501245035463,
 'IHzz': 0.05656444304099169,
 'IRxx': 0.10227397798804952,
 'IRyy': 0.1886505218140362,
 'IRzz': 0.10227397798804952,
 'c': 0.041754825960194364,
 'g': np.float64(9.80665),
 'lam': 0.25453392722979173,
 'mB': 106.00000000000001,
 'mF': 2.235,
 'mH': 4.3,
 'mR': 4.085,
 'rF': 0.3523093609017968,
 'rR': 0.3489472127289805,
 'v': 1.0,
 'w': 1.1132722200610523,
 'xB': 0.37430384487162016,
 'xH': 0.9208250036668604,
 'yB': 0.0,
 'zB': -1.009365940238417,
 'zH': -0.8600415661998936}

Figures Without Rider

image

Figures With Rider

image