Bicycle Gear Calculator

A tool to compare bicycle gear configurations

Jonathan Leslie
(Use arrow keys to navigate)

Background

The "size" of a bicycle gear is a function of many factors:

  • Radius of the wheels
  • Radius of the crank arms (that the pedals are mounted on)
  • Radius of the front chain ring (proportional to the number of teeth)
  • Radius of the gear in the back (proportional to the number of teeth)

Problem

  • It can be difficult to determine how different configurations of cranks, chain rings and gears will compare in terms of final gearing.
  • This can be important, for example, when deciding how to configure the drivetrain of a bike.

My app

Creates a visual comparison of two different drivetrain configurations on the same graph

Input:

  • Crank length
  • Frong chain ring size (two values: small and large (according to number of teeth))
  • A choice from several common 10-cog rear gear clusters

Output:

  • A graph showing the GAIN RATIO as a function of chain ring and sprocket

Gain Ratio

  • A measure of the size of a gear: a higher gain ratio is a 'bigger' gear that will carry the bike further with each pedal stroke but which requires more force to turn
  • For example, if the gain ratio is 5.58:
    • "...for every inch, or kilometer, or furlong the pedal travels in its orbit around the bottom bracket, the bicycle will travel 5.58 inches, or kilometers, or furlongs." - Sheldon Brown http://www.sheldonbrown.com/gain.html
  • Calculated as:
    • {(radius of wheel)/(radius of crank arm)} * {(teeth in chain ring/teeth in rear sprocket)}
  • Note: in this app, wheel radius is kept constant at 340 mm (standard wheel size for road bikes)
  • Source code for the shiny app can be found at

Example calculation used in the app

WheelR <- 340; CrankR <- 175 ##Standard for 'road' bikes
FrontVector <- rep(c(42, 52), each = 10)
RearVector <- c(11,12,13,14,15,16,17,19,21,23)
GainRatio <- WheelR/CrankR*FrontVector/RearVector
Gears <- data.frame(Config = rep("Configuration 1", 20), Front = FrontVector,
                    Ring = rep(c("small", "large"), each = 10),
                    Rear = RearVector, GainRatio = GainRatio)
head(Gears)
##            Config Front  Ring Rear GainRatio
## 1 Configuration 1    42 small   11  7.418182
## 2 Configuration 1    42 small   12  6.800000
## 3 Configuration 1    42 small   13  6.276923
## 4 Configuration 1    42 small   14  5.828571
## 5 Configuration 1    42 small   15  5.440000
## 6 Configuration 1    42 small   16  5.100000