Bike1 - DM15c Program (Ebike maximum speed - Bike power for a given speed - Bike development)

Description

J E Patterson - jepspectro.com - 20180413

This program works with the DM15C series of calculators by SwissMicros. The extended memory firmware should be installed. The hp15c Simulator by Torsten Manz can be used as well if the DM15C preferences are set to 229 registers. The programs are self-contained so they can be extracted as separate programs.

**********************************************************************************************************************

EbikeMax - Ebike maximum speed from given hub motor rpm - J E Patterson - jepspectro.com - version 20160210

EbikeMax starts at line 1 and ends at line 34

This program calculates the maximum speed of a hub motor Ebike at 36 volts and 42 volts, given the specified motor rpm and the bike wheel size.

Enter motor rpm
ENTER
Enter wheel size in inches or mm - the program works out if the units are inches or mm from the magnitude
GSB A

The maximum speed at 36 volts is displayed.
Press R/S.
The maximum speed at 42 volts is displayed.

speed km/h = 4.79E-3 x motor rpm x wheel size in inches at 42 volts
25.4 x pi x 60 / E^6 = 4.79E-3.

Speed is proportional to the battery voltage and the wheel diameter.
Speed is also limited by hills and wind.
For a 20 inch wheel the bike speed in km/h at 42 volts is approximately motor rpm/10.

**********************************************************************************************************************

Bike Power - J E Patterson - jepspectro.com - version 20160119

Bike Power starts at line 35 and ends at line 114

This program calculates the power Pw required to allow a bike plus rider of weight W to attain a given bike speed Vr on a grade G and also into a given head wind.

Enter total weight W (kg),
STO 1. This weight W includes the bike plus rider.

Enter the grade G (%) of the road,
STO 2. For a flat road enter 0, STO 2

Enter V (km/h)
GSB B

The required power P (watts) to reach a bike speed V (km/h) is displayed.

Enter a head wind speed in km/h. This is an optional step..
Press R/S

The power Pw required to maintain the same speed into the head wind is displayed.

Stored results:
R4 = Power required to overcome air drag resistance, Pd
R6 = Power required to overcome rolling resistance, Pr
R7 = Power required to overcome % grade G, Ps
R8 = The total required power, P = (Pd + Pr + Ps) * 1.0309
R9 = The power required into a head wind, Pw = (R4 * (Va/Vr)^2 + R6 + R7) * 1.0309

There are constants in the program:
1.0309 = 1/(1 - 3/100) compensates for a 3% drive-train loss.
0.2778 = 1000/3600 converts km/h to m/s
0.2626 = 0.5 x (Air Density (1.226) * Drag coefficient Cd (0.63) * Frontal area (0.68))
Reduce this constant in proportion for a more streamlined setup

0.0490 = g (9.8067) * Coefficient of rolling resistance Crr (0.005)
9.8067 = g acceleration due to gravity (m/s²)

Equations:
Pd = Vr * 0.5 * rho * Va^2 * Cd * A
Pr = Vr * m * g * cos(arctan(s)) * Crr
Ps = Vr * m * g * sin(arctan(s))
P = (Pd + Pr + Ps) * 1.0309

Va = Vr + head-wind speed (m/s)
Vr = Va in still air.
Pw = (R4 * (Va/Vr)² + R6 + R7) * 1.0309

Terms:
rho = air density = 1.226 kg/m³
Cd = drag coefficient 0.63
A = frontal area 0.68 m² - upright riding style
m = mass kg = W
g = acceleration due to gravity = 9.8607 m/s²
Crr = coefficient rolling resistance 0.005
s = slope = G/100
Vr = bike road speed (m/s)
Va = bike air speed (m/s)

References:
https://en.wikipedia.org/wiki/Bicycle_performance
http://www.bikecalculator.com

**********************************************************************************************************************

Bike Development - J E Patterson - jepspectro.com - version 20160210

Bike Development starts at line 115 and finishes at line 159

Gear-inches, Metres-development and Gain-ratio are calculated.

Enter wheel diameter in inches or mm - the program works out if the units are inches or mm from the magnitude
Enter front sprocket teeth number
Enter rear sprocket teeth number

GSB C returns Gear-Inches
R/S returns Metres-Development
R/S returns Gain-Ratio for a 170 mm crank arm

**********************************************************************************************************************

Bike Speed

Bike Speed starts at line 160 and ends at line 167

Run Bike Development first
Enter cadence in RPM
GSB D
The bike speed in km/h is returned

**********************************************************************************************************************

Program Resources

Labels

Name Description
 A Ebike maximum speed from hub motor rpm
 B Power required for a given bike speed
 C Bike development
 D Bike speed

Storage Registers

Name Description Name Description
 1 Speed 36V,W,GI  6 Pr, Gain Ratio
 2 Speed 42V,G,25.4  7 Ps
 3 V m/s, 25.4,front/rearT  8 Pt
 4 Pd, Wheel size in inches,Gear Inches  9 Pw
 5 ArcTan(G/100), Metres development

Program

Line Display Key Sequence Line Display Key Sequence Line Display Key Sequence
000 056 43 25 g TAN-¹ 112 20 ×
001 42,21,11 f LBL A 057 44 5 STO 5 113 44 9 STO 9
002 2 2 058 24 COS 114 43 32 g RTN
003 5 5 059 48 . 115 42,21,13 f LBL C
004 48 . 060 0 0 116 10 ÷
005 4 4 061 4 4 117 44 3 STO 3
006 44 3 STO 3 062 9 9 118 20 ×
007 33 R⬇ 063 0 0 119 44 1 STO 1
008 2 2 064 20 × 120 2 2
009 0 0 065 45,20, 1 RCL × 1 121 5 5
010 0 0 066 45,20, 3 RCL × 3 122 48 .
011 34 x↔y 067 44 6 STO 6 123 4 4
012 43,30, 7 g TEST x>y 068 45 5 RCL 5 124 44 2 STO 2
013 45,10, 3 RCL ÷ 3 069 23 SIN 125 2 2
014 44 4 STO 4 070 45,20, 1 RCL × 1 126 0 0
015 33 R⬇ 071 45,20, 3 RCL × 3 127 0 0
016 33 R⬇ 072 9 9 128 45 1 RCL 1
017 4 4 073 48 . 129 45 3 RCL 3
018 48 . 074 8 8 130 10 ÷
019 7 7 075 0 0 131 43,30, 7 g TEST x>y
020 9 9 076 6 6 132 45,10, 2 RCL ÷ 2
021 26 EEX 077 7 7 133 45 3 RCL 3
022 16 CHS 078 20 × 134 20 ×
023 3 3 079 44 7 STO 7 135 44 4 STO 4
024 45,20, 4 RCL × 4 080 45 4 RCL 4 136 45 2 RCL 2
025 20 × 081 45,40, 6 RCL + 6 137 20 ×
026 44 1 STO 1 082 45,40, 7 RCL + 7 138 44 1 STO 1
027 31 R/S 083 1 1 139 45 2 RCL 2
028 48 . 084 48 . 140 10 ÷
029 8 8 085 0 0 141 45 1 RCL 1
030 5 5 086 3 3 142 43 26 g π
031 7 7 087 0 0 143 20 ×
032 10 ÷ 088 9 9 144 26 EEX
033 44 2 STO 2 089 20 × 145 3 3
034 43 32 g RTN 090 44 8 STO 8 146 10 ÷
035 42,21,12 f LBL B 091 31 R/S 147 44 5 STO 5
036 48 . 092 48 . 148 45 1 RCL 1
037 2 2 093 2 2 149 3 3
038 7 7 094 7 7 150 4 4
039 7 7 095 7 7 151 0 0
040 8 8 096 8 8 152 10 ÷
041 20 × 097 20 × 153 44 6 STO 6
042 44 3 STO 3 098 45 3 RCL 3 154 45 4 RCL 4
043 3 3 099 40 + 155 31 R/S
044 14 100 45,10, 3 RCL ÷ 3 156 45 5 RCL 5
045 48 . 101 43 11 g 157 31 R/S
046 2 2 102 45 4 RCL 4 158 45 6 RCL 6
047 6 6 103 20 × 159 43 32 g RTN
048 2 2 104 45,40, 6 RCL + 6 160 42,21,14 f LBL D
049 6 6 105 45,40, 7 RCL + 7 161 45 5 RCL 5
050 20 × 106 1 1 162 20 ×
051 44 4 STO 4 107 48 . 163 48 .
052 45 2 RCL 2 108 0 0 164 0 0
053 26 EEX 109 3 3 165 6 6
054 2 2 110 0 0 166 20 ×
055 10 ÷ 111 9 9 167 43 32 g RTN