How is purely torque-sensing PAS actually implemented?

people seldom agree and the internet makes it worse. you have to try to find as much info as you can and pick out the parts that help you. I doubt your going to find much info as that info may not be freely given out. of from non English sources. There is no standard so even if you find the info it may not apply to your bike.
 
Thanks for all your help. Where can I read about ebike control models like this? No problem reading engineering journals.
Sorry, but I don't know of any global theoretical article.

Each controller does its own thing, and they don't publicize the way they do it as it is part of their IP. Some do offer programming access like the Bafang, some don't.

But remember that for the sensors to be really useful, the motor controller needs to have the inputs and the programing to incorporate them in the power delivery.

Without it, you can sometimes use the sensor signal to generate a throttle signal if the bike has a throttle input. But even then, to do a decent job, you would want a controller that has some programming functionality like low pass filter to smooth out the Torque sensor input.

I did such a project on a high-power e-bike a while back below
 
Last edited:
Jeremy I agree, this quickly devolves into oooo I've got 5 sensors .... well I've got 6 sensors .... I must be better. It all seems to be a common theme on this forum.

Is the number really important?

I ride a pair of very responsive natural feeling ebikes with "just" 3 motion/position sensors (cadence, wheel speed, throttle position). In actuality you'd only really need one to operate an ebike ... either a PAS/cadence or a throttle.

Exactly how many motion/position sensors do you need on a bike? If you need/want torque sensing then I guess it would be something like pedal pressure, cadence, wheel speed, and optionally throttle position. Then if you also have an overlap of human pressure and motor pressure on the chainline you'd also want a gear shift sensor. The other common sensors are brake lever position and motor temperature. Then there could things like battery temperature, tire pressure, etc. Next someone will have a butt pressure sensor.

The bigger question is whether or not there are the smarts to use all those inputs and manage the motor output effectively ... but the bottom line really is more sensors = more complexity and more code to manage them ... and therefore more costs.
 
How the hell do you kill a message that's been started but not yet posted?

I ask because I just started a different question, then realized I already had the answer before posting. But it won't go away! I clear out all the text, go to another thread, come back to this page, and everything I deleted from the composition textbox is there again!

All I could think of was to change the original question to this one.
 
This is an example of a fairly open pedal assist programing, using both torque and cadence sensing on the Bafang ultra motor
Exactly what I was looking for! Very impressive Valkyrie project in your previous post.
 
Exactly what I was looking for! Very impressive Valkyrie project in your previous post.
If you really want to see how its done, the TSDZ2 open source code would be a good start.

https://github.com/OpenSourceEBike/TSDZ2-Smart-EBike

I played with this code awhile back trying several things. Ultimately I abandoned the TSDZ2 due to it being a POS.

In a nutshell, this code determines human power base on the torque sensor and cadence (power = force x distance) and provide assist based on multiplication of the human power (i.e. 1x, 2x, etc...). The cadence was used to determine distance using an assumed crankarm length. I havent looked at the code for several years though and am just going off memory

The basic power calculation is in ebike_app.c line 1062
Line 1062: ui16_m_pedal_power_x10 = (uint16_t) (((uint32_t) ui16_m_pedal_torque_x100 * (uint32_t) ui8_pas_cadence_rpm) / (uint32_t) 96);

The assist is in ebike_app.c line 272
Line 272: ui32_current_amps_x10_final = ((uint32_t) ui16_m_pedal_power_x10 * ui32_assist_level_factor_x1000) / 1000;;
 
Last edited:
Different bikes feel totally different. For some wheel speed is a big factor. Some will give you more at lower speeds. Some will kick in only after three wheel revolutions others are immediate. The best feeling bikes for my preference give the most power at a high cadence with high pedal pressure, regardless of wheel speed. People who don't really ride bikes want the power at the low end. I remove speed sensors to improve feel. I don't want a bike second guessing me.
 
Exactly how many motion/position sensors do you need on a bike? If you need/want torque sensing then I guess it would be something like pedal pressure, cadence, wheel speed, and optionally throttle position. Then if you also have an overlap of human pressure and motor pressure on the chainline you'd also want a gear shift sensor. The other common sensors are brake lever position and motor temperature. Then there could things like battery temperature, tire pressure, etc. Next someone will have a butt pressure sensor.
In my neighborhood, I could really use a "pedestrian ahead about to do something stupid" sensor.

Now that you've reminded me of all the sensors feeding my Bafang display, seems like a good bit of information potentially useful in supplementing the torque-based control is already onboard. Whether the controller is smart enough to put it all together is a separate matter, as you point out. But the power delivery on my Rook is pretty darned natural, so it must be doing something right.
 
Our little Lectric XP 2.0st bikes have cadence (which we've shut off) and twist throttle, which seems very natural to us.

Nonetheless, what would seem to me to be an ideal setup would be no cadence sensing at all and the use of an idler wheel engaging the upper chain just behind the chainring. Software would sense the chain tension in this way and I would imagine a fast ramp-up, slow ramp-down would provide a wonderful power amplification effect. It would work through a hub motor, so the chain tension was strictly from leg power.

I've always loved the power-amplification machines in the movie "Aliens." Wonder if they really exist in that format these days.
 
Jeremy, just as an FYI, there is another option to the torque sensing systems and some of the less expensive PAS only systems that surge to 12 mph or so as soon as you start pedaling in PAS 1 (those are PAS "speed based" systems). The aftermarket KT systems controllers have an option for what they call "imitation torque control". What it amounts to is a "power based" system where a predetermined amount of power (established by you) is supplied to the motor for each PAS level. Speed has no effect on this amount of power, so it is truly based on how much assist you want to use. This ability enables awesome low speed control down into the areas so slow the bike is difficult to balance. 6 mph for instance, is easily maintained while using less than 100w of power in PAS 1. When this power based low speed control is compared to Bafang's torque sensing at the same speeds (using both the M600 and Ultra/M620), you can actually see the difference on the watt meter. Where the KT has a nice relatively smooth draw, the Bafang meters are surging with each power stroke - and yes, you can feel that surging. Nothing terrible, but you can feel it....

Totally spoiled by what can be done with a KT controller/display, my geared hub bikes have all been converted pretty much when they come out of the box.

And only meant as a side note, the UART based Ultra/M620 is WAY over the top when it comes to what can be done with them. They can be extremely difficult to set up due to the inter dependent nature of many of the settings (change one and it affects 6 others). Point being here, be careful what you wish for! I was wandering aimlessly for quite a while when I first got mine, until I came across Frey bike's "Smooth" tune. That tames the bull in the china shop to something I'd put up against anything available. Yup, that good.....

And last, also noteworthy, is that the UART based Bafang mid drives offer this very same power vs. speed based option that KT offers, where the power based option is by far the more popular option... -Al
 
Last edited:
In a nutshell, this code determines human power base on the torque sensor and cadence (power = force x distance) and provide assist based on multiplication of the human power (i.e. 1x, 2x, etc...). The cadence was used to determine distance using an assumed crankarm length. I havent looked at the code for several years though and am just going off memory

The basic power calculation is in ebike_app.c line 1062
Line 1062: ui16_m_pedal_power_x10 = (uint16_t) (((uint32_t) ui16_m_pedal_torque_x100 * (uint32_t) ui8_pas_cadence_rpm) / (uint32_t) 96);

The assist is in ebike_app.c line 272
Line 272: ui32_current_amps_x10_final = ((uint32_t) ui16_m_pedal_power_x10 * ui32_assist_level_factor_x1000) / 1000;;
Thanks! I've done a fair amount of programming in other languages, but I've never been good at reading C.

Power-sensing control strategies like the ones you and others have described are easy to understand and make a lot of sense for ebikes. Just not sure that's what my "torque-sensing" Rook is doing. It has a rear drop-out torque sensor and NO visible cadence sensor.

So I'm left to wonder: Could the very smooth and natual power delivery really come from pure torque-sensing?

Others have expressed serious doubts about that, and now I'm not sure what to think. Could the Rook have a hidden cadence sensor, or some sneaky way to pull cadence info out of the many other sensors onboard?

Terminology may be adding to the confusion. Grin's bottom-bracket "torque sensors" are really power (torque AND cadence) sensors and are used as such by their control system.
 
You two need to wear more clown makeup. So narrow so uninspired.
so I am wrong? you have any others that have high refined a torque sensing system? or are you just upset about it? hell from what I heard of people who owned several bikes Stromer is better at smoothness over Bosch.
 
Some of the torque sensor that are on the rear dropout do have a cadence sensor incorporated
 
Nonetheless, what would seem to me to be an ideal setup would be no cadence sensing at all and the use of an idler wheel engaging the upper chain just behind the chainring. Software would sense the chain tension in this way and I would imagine a fast ramp-up, slow ramp-down would provide a wonderful power amplification effect. It would work through a hub motor, so the chain tension was strictly from leg power.
Thanks! Follow the link @scrambler provided in Post #24 above to see a cool implementation of this very control strategy.

You might enjoy the sign my wife bought me for my LEGO workshop...
51YkNQ2Ow2L.jpg
 
Some of the torque sensor that are on the rear dropout do have a cadence sensor incorporated
Hmmm, Surface 604's homepage proudly displays this quote from @Court:

Really smooth with that multi sensor torque sensing drop out...

I bet that's what he meant. I'm declaring this mystery solved!
 
OP if you not happy with your ebike get a better one. It's always going to be a pissing contest especially if you posting pics of $1 ebike.
Just go demo ride some bikes and figure it out yourself. You will then feel and realize what is best for you.
Huh? Quite content with my ebike. And I did a lot of test riding to find it.

Just trying to understand how it works.
 
OP if you not happy with your ebike get a better one. It's always going to be a pissing contest especially if you posting pics of $1 ebike.
Just go demo ride some bikes and figure it out yourself. You will then feel and realize what is best for you.
I think you got the wrong guy.
 
Back