the math of hill climbing

mschwett

Well-Known Member
Region
USA
there was an interesting discussion here https://forums.electricbikereview.com/threads/another-new-tq-motor-hpr40.57935/page-13 about climbing hills on lightweight hub drive and mid-drive motors, especially the new TQ HPR40 which looks very, very promising, and @Yako is currently riding.

i haven't been riding much lately, but thought i'd revisit the question on my way home from work. i have a couple bikes - a very lightweight road bike (±14lb s-works aethos), a lightweight road e-bike (±24lb scott addict rc eride) and a 500w front-hub commuter. both the road bikes have 4iiii dual sided power meters on them, and i've ridden maybe 15k miles on them over the years, with basically every ride in strava with power, heart rate, cadence, speed, etc.

i live at the top of this hill, and have accurate-enough map and contour data. the average grade of the fat yellow segment (no stoplights) is 10.57 percent, and the distance is (obviously) also precisely known.

homeRideSlope.jpg


so, yesterday i made sure both the mahle smartBike app and my regular cycling app (which records the rider power at the cranks, heart rate, cadence, etc) were running and rode home up the hill slowly. i have health issues which require keeping my heart rate quite low, so i didn't push it, just an easy commute but under controlled conditions.

average speed was 5.99 mph. average rider power was 147 watts, and average power output from the motor was 145 watts. you can see in the following chart a couple things : the small hub drive of the x20 is unable to produce full power at very low speeds, with the maximum power limited to around 125 watts at 5mph. by 10mph, the power is very closely approaching the maximum 200 mechanical/output watts. the output at lower speeds comes very close to the theoretical maximum of the x20, which can be shortened to w = 28.8 x mph based on the relationship between torque, speed, and power. 5mph should yield as much as 144w, but 125 average is close enough. the spiky green rider power line (sampled every second) stays fairly close to the average regardless of grade. the slightly less spiky red motor power line (sampled twice every second) drops when speed drops and increases when speed increases. the little blips in speed are the flat spots at intersections. i'll try this again soon with a longer climb without intersections that i have similarly accurate data for, but i don't expect the result to be meaningfully different.

mahleClimb.jpg


but, do we know if these power meter and mahle app values are correct!?!? let's plug the grade, total weight (i had on a backpack with a laptop, clothes, etc, so a little heavier than i'd normally be riding), estimates for drag and friction into the great cycling calculator that @Jeremy McCreary pointed me to. in this case we'll take the drivetrain loss (estimated) for the rider power out, since we shouldn't apply that to the hub motor which doesn't go through the chain and we'll reduce the rider power as input, for a total of 284w. guess what? near perfect match. i'm always a skeptic of things like this but when the main factor is gravity and weight and power, it's really super predictable. it all falls apart when you start going really fast, since aerodynamic drag is a much less forgiving mistress.

homeGradePower.jpg


any meaningful conclusions from this? at slow speeds, you can very easily predict how fast you can go with a given combination of rider power and motor power if you know grade and weight. the science is really simple. if you know how fast you're going, you can very easily figure power, probably up to 12 or maybe 15 mph. if you know RIDER power and speed, you can easily figure out how much your motor is really putting out.... which brings me to the big question here, and one that is still a question for me. how efficienct is a small hub motor like this on steep, slow climbs? we've seen figures published in the 70-80% range. i'm not ready to make a claim here because the ride is too short to really trust the battery voltage and percentage indicators, and the battery was pretty low. i'm going to repeat this on some longer climbs at different charge levels and see if the data is meaningful. i'll say for now that based on this one, efficiency is lower than it should be.
 
With a hub you need enough power to help you keep it in its most efficient rpm, you start producing massive amounts of heat below this, the controller mosfets are turning power into heat, the phase wires are warming up and become more resistant to electrical flow , the stator coils are heating up, the magnets start to drop off in effect, the hub is getting less volts, you start to tire the rpm drops even less.
Im starting to sweat, the I feel sick, people are pointing and laughing.

This is my average ride to the shop.
 
With a hub you need enough power to help you keep it in its most efficient rpm, you start producing massive amounts of heat below this, the controller mosfets are turning power into heat, the phase wires are warming up and become more resistant to electrical flow , the stator coils are heating up, the magnets start to drop off in effect, the hub is getting less volts, you start to tire the rpm drops even less.
Im starting to sweat, the I feel sick, people are pointing and laughing.

This is my average ride to the shop.

right, the question is are these small hub motors geared internally in a way to be efficient at, say, 6mph - which is around 75 rpm here. i assume it’s internally at least 5:1 on a motor this small so the range we’re asking it to be efficient in is roughly 350 to 1,150 RPM.
 
With a hub you need enough power to help you keep it in its most efficient rpm, you start producing massive amounts of heat below this, the controller mosfets are turning power into heat, the phase wires are warming up and become more resistant to electrical flow , the stator coils are heating up, the magnets start to drop off in effect, the hub is getting less volts, you start to tire the rpm drops even less.
Im starting to sweat, the I feel sick, people are pointing and laughing.

This is my average ride to the shop.
What happens when you hit a hill?
;^}
 
there was an interesting discussion here https://forums.electricbikereview.com/threads/another-new-tq-motor-hpr40.57935/page-13 about climbing hills on lightweight hub drive and mid-drive motors, especially the new TQ HPR40 which looks very, very promising, and @Yako is currently riding.

i haven't been riding much lately, but thought i'd revisit the question on my way home from work. i have a couple bikes - a very lightweight road bike (±14lb s-works aethos), a lightweight road e-bike (±24lb scott addict rc eride) and a 500w front-hub commuter. both the road bikes have 4iiii dual sided power meters on them, and i've ridden maybe 15k miles on them over the years, with basically every ride in strava with power, heart rate, cadence, speed, etc.

i live at the top of this hill, and have accurate-enough map and contour data. the average grade of the fat yellow segment (no stoplights) is 10.57 percent, and the distance is (obviously) also precisely known.

View attachment 198044

so, yesterday i made sure both the mahle smartBike app and my regular cycling app (which records the rider power at the cranks, heart rate, cadence, etc) were running and rode home up the hill slowly. i have health issues which require keeping my heart rate quite low, so i didn't push it, just an easy commute but under controlled conditions.

average speed was 5.99 mph. average rider power was 147 watts, and average power output from the motor was 145 watts. you can see in the following chart a couple things : the small hub drive of the x20 is unable to produce full power at very low speeds, with the maximum power limited to around 125 watts at 5mph. by 10mph, the power is very closely approaching the maximum 200 mechanical/output watts. the output at lower speeds comes very close to the theoretical maximum of the x20, which can be shortened to w = 28.8 x mph based on the relationship between torque, speed, and power. 5mph should yield as much as 144w, but 125 average is close enough. the spiky green rider power line (sampled every second) stays fairly close to the average regardless of grade. the slightly less spiky red motor power line (sampled twice every second) drops when speed drops and increases when speed increases. the little blips in speed are the flat spots at intersections. i'll try this again soon with a longer climb without intersections that i have similarly accurate data for, but i don't expect the result to be meaningfully different.

View attachment 198046

but, do we know if these power meter and mahle app values are correct!?!? let's plug the grade, total weight (i had on a backpack with a laptop, clothes, etc, so a little heavier than i'd normally be riding), estimates for drag and friction into the great cycling calculator that @Jeremy McCreary pointed me to. in this case we'll take the drivetrain loss (estimated) for the rider power out, since we shouldn't apply that to the hub motor which doesn't go through the chain and we'll reduce the rider power as input, for a total of 284w. guess what? near perfect match. i'm always a skeptic of things like this but when the main factor is gravity and weight and power, it's really super predictable. it all falls apart when you start going really fast, since aerodynamic drag is a much less forgiving mistress.

View attachment 198045

any meaningful conclusions from this? at slow speeds, you can very easily predict how fast you can go with a given combination of rider power and motor power if you know grade and weight. the science is really simple. if you know how fast you're going, you can very easily figure power, probably up to 12 or maybe 15 mph. if you know RIDER power and speed, you can easily figure out how much your motor is really putting out.... which brings me to the big question here, and one that is still a question for me. how efficienct is a small hub motor like this on steep, slow climbs? we've seen figures published in the 70-80% range. i'm not ready to make a claim here because the ride is too short to really trust the battery voltage and percentage indicators, and the battery was pretty low. i'm going to repeat this on some longer climbs at different charge levels and see if the data is meaningful. i'll say for now that based on this one, efficiency is lower than it should be.
Strong work here! Glad to see that the Gribble calculator checks out against some credible real-world data. My own spreadsheet model of these things checks out with Gribble but generally not with the more often cited bikecalculator.com.

You're right: This stuff isn't rocket science. The well-established formulas are just algebra and readily available from Gribble's site or from Wilson & Schmidt's Bicycling Science among many other sources.

Put in realistic values for gross mass (rider+bike+cargo), Crr (coefficient of rolling resistance), CdA (drag area), air density, drivetrain efficiency, and gradient, and you should get a realistic estimate of steady-state speed from a known total mechanical power input or vice versa. Getting realistic input parameter values is the trick, but @mschwett seems to have that covered for the Scott road ebike at hand.

And as you noted, the calculations are greatly simplified at climbing speeds low enough that air resistance can be safely ignored. That could be below 10 mph on an upright commuter on hybrid tires in street clothes. But when it's a legit approximation, you have an opportunity to estimate Crr or in this case, electromechanical motor efficiency Em.

Once you know Em as a function of hub-drive wheel speed or mid-drive cadence, you can take the math all the way back to the battery on the motor side.

Here we're trying to use credible empirical ride data to get at low-speed Em in the hub- and mid-drive motors used in lightweight road ebikes. @mschwett is definitely the man for the job, and I can't wait to see what he finds.
 
Last edited:
Strong work here! Glad to see that the Gribble calculator checks out against some credible real-world data. My own spreadsheet model of these things checks out with Gribble but generally not with the more often cited bikecalculator.com.

...

Here we're trying to use credible empirical ride data to get at low-speed Em in the hub- and mid-drive motors used in lightweight road ebikes. @mschwett is definitely the man for the job, and I can't wait to see what he finds.

i was surprised to see (after you pointed both of them out to me) that bikecalculator seemed to diverge from gribble, but the real issue is just not knowing all the values they use for the drop downs. some of the CdA values are higher than i would have guessed but not unreasonable. my own experience shows that i'm even less aerodynamic than i thought, lol, so this explains why the values diverged initially.

i wonder how reliable the battery state of charge info in these bikes is. i'm sure it's all voltage based, which probably means it's really unreliable at the extremes, right?
 
any meaningful conclusions from this? at slow speeds, you can very easily predict how fast you can go with a given combination of rider power and motor power if you know grade and weight. the science is really simple. if you know how fast you're going, you can very easily figure power, probably up to 12 or maybe 15 mph. if you know RIDER power and speed, you can easily figure out how much your motor is really putting out.... which brings me to the big question here, and one that is still a question for me. how efficienct is a small hub motor like this on steep, slow climbs? we've seen figures published in the 70-80% range. i'm not ready to make a claim here because the ride is too short to really trust the battery voltage and percentage indicators, and the battery was pretty low. i'm going to repeat this on some longer climbs at different charge levels and see if the data is meaningful. i'll say for now that based on this one, efficiency is lower than it should be.
I calculate motor output by seeing the terminal speed up a known grade on throttle alone. If I want to test PAS power, I ghost pedal instead. I ignore rolling resistance and air drag. Newtons of propulsion (on the pavement) is gross weight in kg times percent grade times g (9.8). Meters per second is mph times 0.45. Newtons times meters per second is watts.

(Technically, percent grade is rise over run, or tan. When I say it, I mean rise over pavement length, or sine. For street grades, they're very close.)

Maybe someday I'll hook up a battery watt meter. Then if I know speed on a grade, I can calculate motor efficiency at that speed.
 
I calculate motor output by seeing the terminal speed up a known grade on throttle alone. If I want to test PAS power, I ghost pedal instead. I ignore rolling resistance and air drag. Newtons of propulsion (on the pavement) is gross weight in kg times percent grade times g (9.8). Meters per second is mph times 0.45. Newtons times meters per second is watts.

(Technically, percent grade is rise over run, or tan. When I say it, I mean rise over pavement length, or sine. For street grades, they're very close.)

Maybe someday I'll hook up a battery watt meter. Then if I know speed on a grade, I can calculate motor efficiency at that speed.

yep, that’s a good method if the bike goes by itself! if you need to pedal also, then of course you need to know how much work the rider is doing.

without a watt meter, i wonder how accurate the SOC estimates from these things are…
 
I checked amazon for "DC watt meter." They're likely to tell volts, amps, watts, and watt hours. Some use Hall sensors so you don't need to put a shunt in the line.

With a hub motor and cadence PAS, motor output at a given PAS level should be about the same over much of the motor's speed range. Instead of PAS, I use the throttle to add power as needed, so I estimate differently. If I normally pedal up a hill at 5 mph unassisted and I've calculated it takes 160 watts with no headwind, I can give my hub motor a little throttle and shift to a higher gear to climb it at 10 mph. If my legs are providing the same power, the other 160 watts must come from the motor.

I might do that to save a little time. More often, it's because I feel lazy. I might still pedal at 160 watts, but at twice the speed, I have to maintain the effort half as long.
 
here's an example with efficiency. i am missing a little motor power data at the end due to user error (the chart is a little shorter in time than the math), but no reason to believe the relationship between speed and power would suddenly change.


red line is motor power. blue line is speed. this shows pretty clearly that above 10mph, the x20 delivers 200w mechanical power. it actually peaked at 212, and it's interesting to note that i was not pedaling hard at this point - the green line is rider power, which was around 140 at that peak.


tpClimb4.jpg



the gribble prediction is here. average motor power was 186w, average rider power, 137w, 5.98% grade for a bit over a mile. there was a small headwind which sailflow told me was 5mph, but i dropped it a bit because this a pretty sheltered road on the leeward side of a big hill. certainly some margin of error here! still, the prediction is pretty close, 320 vs 312w. certainly "close enough for engineering work" as my father (a phd engineer) would have said.

but the most important number here, i think, is the efficiency. this is still a pretty slow ground speed, so is the X20 doing a decent job? it seems like it is. battery state showed 25.x wh used with voltage going from 39.8v to 39.0v, and the actual mechanical work done is almost 20wh (186w average motor power x .107 hours). so, 76% efficiency, give or take. pretty much what you'd expect, similar to the numbers specialized claims for the x20 in the ads where they claim the SL is more efficient at 80% or so.

tpClimb2.jpg


here's the test segment. in this case strava happens to also be right on with the elevation climbed (within a few feet!) but off by 3 or 4 percent on the distance.

tpTest3.jpg
 
without a watt meter, i wonder how accurate the SOC estimates from these things are…
State of charge vs. voltage for a given battery type is pretty well understood and reliable, if not terribly accurate.

Another way to figure out for us backwards Americans is HP=F*V/375 where F is the force in pounds and V is velocity in mph. For the additional power required for a hill climb (i.e. the power required to lift the bike and rider against gravity, neglecting friction and air drag), F is the bike+rider weight times the sine of the angle. And 1HP=746W.

Of course you have to divide that by the motor+gearing efficiency to get the electrical power required.

If you have a wattmeter (my Radster has one built in), you can work it backwards to determine the air drag + friction on level ground at any constant speed.
 
but the most important number here, i think, is the efficiency. this is still a pretty slow ground speed, so is the X20 doing a decent job? it seems like it is. battery state showed 25.x wh used with voltage going from 39.8v to 39.0v, and the actual mechanical work done is almost 20wh (186w average motor power x .107 hours). so, 76% efficiency, give or take. pretty much what you'd expect, similar to the numbers specialized claims for the x20 in the ads where they claim the SL is more efficient at 80% or so.
Have no numbers, but certain that the efficiency of my commuter's 500W Bafang G020 hub motor is WAY lower at 6 mph than it is at 15 mph. So the x20's 76% at 6 mph sounds pretty impressive.

The good news: On many a hill, the 70 lb commuter left me doing most of the work as it bogged down in wheel speed. Reduced the gearing accordingly and put up with it for nearly 3,000 mi over 2 years.

And that trained me up to ride the same hills on my newer 250W, 35 Nm Vado SL 1 mid-drive with relative ease. Doubt the SL would've been such a smashing success without that commuter paving the way.
 
Have no numbers, but certain that the efficiency of my commuter's 500W Bafang G020 hub motor is WAY lower at 6 mph than it is at 15 mph. So the x20's 76% at 6 mph sounds pretty impressive.

The good news: On many a hill, the 70 lb commuter left me doing most of the work as it bogged down in wheel speed. Reduced the gearing accordingly and put up with it for nearly 3,000 mi over 2 years.

And that trained me up to ride the same hills on my newer 250W, 35 Nm Vado SL 1 mid-drive with relative ease. Doubt the SL would've been such a smashing success without that commuter paving the way.

important distinction - 10 MPH, not 6. 6% grade. i don't know yet what it'll be at 6mph (which is more like a 10% grade, coincidentally) since i didn't get good battery values for that first test. one interesting thing about the mahle data is that the WH capacity doesn't seem to go up if the voltage goes up after heavy use. typically right when the load ends the voltage is a few tenths lower than it levels off to in a few minutes. this makes me wonder if the wh readout is actually based on watts used, not the real-time voltage measurement.

the x20 gearing also doesn't need to take into account speeds > 20mph, so it's probably geared to be most efficient in that 8-18mph range, if i had to guess, which isn't as hard of a problem as making something efficient between 4 and 28mph, say...
 
My Aventon display says in the last 60.8 miles I've saved 18 kg of CO2 and 3.3 trees. Similarly, the efficiency figure for your motor might not be based on output measurements. When controllers measure wattage, I think it's usually volts and amps from the battery. Motor output would be more complicated.

With fixed phase timing, torque varies directly with current. A spinning motor produces back EMF in proportion to speed. At the top speed, the back EMF equals the controller voltage, so no current will flow. With fixed timing, the motor would have the least back EMF at the lowest speed. That's where current and torque would be highest. Power is torque times speed. That would make low speed very inefficient, drawing the most electrical power but not turning that torque into much mechanical power.

All that current could burn things up, and all that torque could be hazardous. Nice controllers vary the phase timing. They advance it in the midrange to get a little more current, and torque, past the back EMF. Some advance it even more at the top end so the motor will have current to spin a little faster. They retard it at the low end so that current won't burn up the motor and the controller and so the bike will be less likely to tip you over backward.

If a given hub motor has less torque at the low end than at midrange, that's probably because the controller designer wanted it that way. I've had two KT controllers that let me program the low end torque and the startup torque.
 
My Aventon display says in the last 60.8 miles I've saved 18 kg of CO2 and 3.3 trees. Similarly, the efficiency figure for your motor might not be based on output measurements. When controllers measure wattage, I think it's usually volts and amps from the battery. Motor output would be more complicated.


i’m positive that it’s output - or at least an estimate thereof. the math aligns very closely with predicted speed and power requirements going up steep hills slowly, which is really all about gravity and weight. the documentation on the system also specifically mentions a motor torque sensor - and obviously the speed of the motor is known. the power drawn from the battery is also reliably about a third more than the sum of the motor power values. in this case i calculated the efficiency - i’m not sure what the manufacturer claims.
 
Back