[python] Re: Bicycling physics

  • From: mtb@xxxxxxx
  • To: python@xxxxxxxxxxxxx
  • Date: Thu, 10 Mar 2005 08:03:11 -0800

Hi Dirk,

Attached is the code I referred to. It uses Jürgen's newest P* geometry
Attached also is a sketch I used as a guide.
    wheelBase = 72.5
    steerAngle = 20.  * math.pi / 180.0
    rearMassZ = 28.
    rearMassX = 67.
    frontWheelRadius = 33.
    rearWheelRadius = 33.

The code tries to calculate the rise of the rear mass using a methodology I saw in one of the PDFs.
Some assumptions:
-a wheelie is a positive angle, the rear wheel is fixed and the frame rotates around it
-the rear frame does not lean
-turnAnglePnt is imaginary point the axle rotates about with steer,
is fixed with respect to rear frame, and is the center of a torus
swept by the wheel. It is on the pivot axis perpendicular to the front hub.
-all measurements are in the x-z plane


In the first part, measure the x-z change of the front hub as the rear frame is fixed and the pivot rotates. The front axle moves along the x-z plane with steer, sweeping through the torus. Then calc the angle between initial 0 steer, and current steer, relative to rear axle height; add any existing angle between axles. (If the front wheel was a point, this would definitely be the frame rise angle.)

Now, rotate the steer without mechanical trail holding frame fixed, and calc the low z point of the tire which change due to wheel flop. Calc angle due to steer -
max fWheel drop/flop is proportional to steer Angle==90


Subtract the angle the wheel drops due to flop, from the angle the frame rises due to the whole wheel sweeping about the center of the torus
Calc the angle from the rear mass to the rear axle.
Then:
newrearMassZ = rearWheelRadius+
rmass2Raxle*sin(rmass2RaxleAngle+frontAxleAngle-steerDropAngle)


If you see something I missed, please let me know! Each part checks out for the geometric extremes, steer=0,90,180, but the "peak rise" result differs from your reference frame vector method.

By the way, I saw a very good German bike site:
http://www.kreuzotter.de/english/elenk.htm
Maybe some of you know Walter Zorn?

Ray

sample rise output below.


steerAngle 20.0 ground trail pivot 10 5 0 -5 -10 -15 -20 -25 angle 40 5.753 5.862 5.971 6.081 6.191 6.301 6.411 6.521 41 5.787 5.898 6.008 6.119 6.23 6.341 6.452 6.564 42 5.817 5.928 6.04 6.151 6.263 6.375 6.488 6.6 43 5.841 5.953 6.066 6.178 6.291 6.404 6.518 6.631 44 5.86 5.973 6.086 6.2 6.313 6.427 6.541 6.656 45 5.874 5.988 6.102 6.216 6.33 6.445 6.559 6.674 46 5.883 5.997 6.112 6.226 6.341 6.456 6.571 6.687 47 5.887 6.001 6.116 6.231 6.346 6.461 6.577 6.693 48 5.885 6.0 6.114 6.23 6.345 6.461 6.577 6.693 49 5.878 5.993 6.108 6.223 6.338 6.454 6.57 6.687 50 5.865 5.98 6.095 6.21 6.326 6.442 6.558 6.674 51 5.848 5.962 6.077 6.192 6.307 6.423 6.539 6.655 52 5.824 5.939 6.053 6.168 6.283 6.398 6.514 6.63 53 5.796 5.909 6.023 6.138 6.252 6.367 6.483 6.598 54 5.762 5.875 5.988 6.102 6.216 6.33 6.445 6.56 55 5.723 5.835 5.947 6.06 6.174 6.287 6.401 6.516 56 5.678 5.789 5.901 6.013 6.125 6.238 6.351 6.465 57 5.628 5.738 5.849 5.96 6.071 6.183 6.295 6.408 58 5.573 5.682 5.791 5.901 6.011 6.121 6.232 6.344 59 5.513 5.62 5.728 5.836 5.945 6.054 6.164 6.274 60 5.447 5.553 5.659 5.766 5.873 5.981 6.089 6.198 61 5.376 5.48 5.585 5.69 5.796 5.902 6.008 6.115 62 5.3 5.403 5.506 5.609 5.713 5.817 5.922 6.027 63 5.22 5.32 5.421 5.522 5.624 5.726 5.829 5.932 64 5.134 5.232 5.331 5.43 5.53 5.63 5.731 5.832 65 5.044 5.14 5.236 5.333 5.43 5.528 5.626 5.725 66 4.949 5.042 5.136 5.231 5.325 5.421 5.517 5.613 67 4.849 4.94 5.031 5.123 5.215 5.308 5.401 5.495 68 4.745 4.833 4.922 5.011 5.1 5.19 5.281 5.372 69 4.637 4.722 4.808 4.894 4.981 5.068 5.155 5.243 70 4.524 4.606 4.689 4.772 4.856 4.94 5.025 5.11 71 4.408 4.487 4.566 4.646 4.727 4.808 4.889 4.971 72 4.287 4.363 4.439 4.516 4.593 4.671 4.749 4.827 73 4.163 4.236 4.308 4.382 4.455 4.529 4.604 4.679 74 4.035 4.104 4.174 4.243 4.313 4.384 4.455 4.526 75 3.905 3.97 4.035 4.101 4.168 4.234 4.302 4.369 76 3.77 3.832 3.894 3.956 4.018 4.081 4.145 4.208 77 3.633 3.691 3.749 3.807 3.866 3.925 3.984 4.044 78 3.494 3.547 3.601 3.655 3.71 3.765 3.82 3.875 79 3.351 3.401 3.45 3.5 3.551 3.602 3.653 3.704




At 08:56 AM 3/10/2005 +0100, you wrote:
Hi Ray,

OK, can you sent it to me (or better to the group). This weekend I should be able to look at it. Do note that it is not impossible that the error is on my side ;-)

It has been very busy on the list!!! I have only had the chance to look at what has been going on, without having the time to delve into the discussion. But I am looking forward to catch up with you guys!

Good stuff!
Dirk

Ray Schümacher wrote:

Hello Dirk,

I had coded a short routine in Python to calculate rear mass rise, but I still get somewhat different results than yours. Might you have time to look at it and see if anything jumps out at you? I have an image as well, sketching out the geometry. I'll post them to the group if that would be helpful.

Cheers,
Ray



Attachment: pivot copy.jpg
Description: JPEG image

#!/usr/bin/env python
#Boa:PyApp:main

import math

modules ={}

def main():

    wheelBase = 72.5
    steerAngle = 20.  * math.pi / 180.0
    rearMassZ = 28.
    rearMassX = 67.
    frontWheelRadius = 33.
    rearWheelRadius = 33.


    ## calc angle from raxle to rmass, from horizontal
    rmass2RaxleAngle = math.asin((rearMassZ-rearWheelRadius)/rearMassX)
    ## calc dist from raxle to rmass
    rmass2Raxle = ((rearWheelRadius-rearMassZ)**2+rearMassX**2)**.5
    ## angle front to rear axle
    ## a wheelie is a pos+ angle
    angleBtwnAxles = math.atan((frontWheelRadius-rearWheelRadius)/wheelBase)
    
    print 'steerAngle', steerAngle/math.pi*180.0
    print 'pivot                           ground trail                      '
    print '     ', '\t10', '\t5', '\t0', '\t-5', '\t-10', '\t-15', '\t-20', 
'\t-25'
    for angle in range(40, 80, 1):        
        headAngle = angle  * math.pi / 180.0 # deg from horiz
        print '\n',int(round(headAngle*180/math.pi)), '   ',
        ## iterate over the ground trail
        for gtrail in range(-42, -50, -1):            
            mechTrail = frontWheelRadius*math.cos(headAngle) - 
gtrail*math.sin(headAngle) 
                
            ## rear wheel does not move or roll, frame rotates around the axle
            ## turnAnglePnt is imaginary point the axle rotates about with 
steer, 
            ## is fixed with respect to rear frame, and is the center of a torus
            ## swept by the wheel
            turnAnglePntZ = 
frontWheelRadius+(math.cos(math.pi-headAngle)*mechTrail)#
            turnAnglePntX = wheelBase-(math.sin(math.pi-headAngle)*mechTrail)#
            turnAnglePnt2RearAxle = 
((frontWheelRadius-turnAnglePntZ)**2+turnAnglePntX**2)**.5#
            
            
            ## front axle moves along the x-z plane with steer, sweeping 
through the torus
            ## steerAngle==pi at 180
            frontAxleZ = 
frontWheelRadius-((steerAngle/math.pi)*2)*(math.sin(math.pi/2-headAngle)*mechTrail)#
            frontAxleX = 
wheelBase-((steerAngle/math.pi)*2)*(math.sin(headAngle)*mechTrail)#
            ## angle between initial place, 0 steer, and current steer, frame 
not moved yet...
            ## relative to rear axle height; add any existing angle
            frontAxleAngle = 
math.atan((rearWheelRadius-frontAxleZ)/frontAxleX)+angleBtwnAxles#
            
            ## now, rotate the steer, calc angle due to steer without trail - 
holding frame fixed            
            ## max fWheel drop is prop. to steer Angle==90
            steerDropAngle = math.asin( 
(math.sin(steerAngle)*math.cos(headAngle)*frontWheelRadius) /     \
                                       
(wheelBase+math.sin(steerAngle)*math.cos(headAngle)*frontWheelRadius) )#
            
            ## subtract the amount the wheel drops due to flop, from the amount 
            ## the frame rises due to the whole wheel sweeping about the center 
of the torus
            ## frontAxleAngle-steerDropAngle
            
            ## calc rearMassHeight
            ## so, hypotenous == rmass2Raxle
            newrmass2RaxleAngle = 
rmass2RaxleAngle+frontAxleAngle-steerDropAngle#
            newrearMassZ = 
rearWheelRadius+rmass2Raxle*math.sin(newrmass2RaxleAngle)#
                            
            #print '\t', round(newrearMassZ-rearMassZ, 2),
            #print '\t', round(rearPitchAngle/math.pi * 180.0, 2),
            #print ' ', round(frontAxle2Ground, 1),
            #print ' ', round(turnAnglePntZ, 1),
            print '\t', round(newrearMassZ-rearMassZ, 3),
            
if __name__ == '__main__':
    main()

Other related posts: