Using rear dropout torque sensor with generic ebike controllers

mustafatahir

100 µW
Joined
May 1, 2014
Messages
7
Location
Turkey
Hi all,

I got the rear dropout torque sensor of the xiaomi qicycle ef1.

I am thinking of using the sensor with 1000w hub motor conversion.

I was expecting the sensor will act like an analog throttle but it turns out it gives constant 5V output no matter how much pressure i put on.

Do you have and idea how this torque sensor works? I am thinking maybe i can read the data from torque sensor with ESP32 and convert to throttle signal.
 

Attachments

  • xiaomi-qicycle-ef1-electric-bike-torque-sensor.jpg
    xiaomi-qicycle-ef1-electric-bike-torque-sensor.jpg
    35.8 KB · Views: 6
A quick google doesn't find any technical info on that bike's TS. If you have any, please post it as it may help us help you.

So, for instance, if instead of using an analog output TS it is using a serial bus output, you won't see a smooth change in voltage on it as you pull the axle forward in the dropout, changing the gap of the slot (that's how most of those types work, as tension increases on the top of the chainline). Depending on the design of the serial port you might see about a 2.5v constant voltage there (or flickering around that value); if it's meant for open-collector output you'd see close to zero volts all the time unless it's hooked up to the controller it was meant for (or you use the proper pullup resistor to the proper voltage).

Not all sensors use 5v supply, either--some use more, some might use less, so if yours needs say, 10v power supply, it may not operate correctly without it. (but if it only needs 5v, it could be damaged by more than that).


How does your sensor mount, to be pulled by the pedal chain and sense it's torque? Is it mounted this way so the forces on it are in the right direction?

Is it 5v output even with zero torque on it?

Are you certain the wiring info for it that you are using is correct?

Is it from a working bike? (if it's not, then the sensor could simply be defective or damaged)
 
I bought 2 brand new sensors from Aliexpress. Unfortunately i don't have the xiaomi qicycle bike itself and i can't measure sensors input voltage coming from the controller.

However sensor have 3 wires like regular throttles (red,black and white)

I haven't installed sensor on the bike yet i am just experimenting by applying force with adjustable pliers. I tried switching white and red colors and KTLCD7c display keeps showing "throttle error"

Yes it is always giving 5V output. I also tried connecting to an ESP32 today. It is always outputting the same value
 

Attachments

  • adjustable-pliers-torque-sensor-force-direction.jpg
    adjustable-pliers-torque-sensor-force-direction.jpg
    61.8 KB · Views: 5
  • Untitled-3.jpg
    Untitled-3.jpg
    148.6 KB · Views: 5
The sensor seems to be a clone of the TMM4.
It has an analogue output, like a throttle normally.
You can build a simple precontroller to convert the signal to be throttle input suited. An ESP is overdone for that simple task. Look at this project with a simple Attiny digispark, for example.

But if you want to have the assistance to be proportional to the riders effort, you have to read the battery current and then control the current depending to your effort.
Of course, if you just want to get faster with more help from the motor, if you are pedalling harder, then you don't have to control the current. The throttle input controls the speed normally, not the power.

regards
stancecoke
 
Last edited:
Will squeezing pliers on one leg like in the photos like that do anything? The video stancecoke linked shows a brief wire frame of a c around the drop out. Squeezing one leg wouldn't affect that C's flexion. It would just be squeezing one end of the C. Like trying to squeeze a metal sheet flatter instead of folding it in half.

Normally a flat sided axle is in the drop out, rotates under stress, and pries the two legs of the drop out apart since it's wider diagonally. So I think you'd have to simulate that by prying the two legs apart, not squeezing one. Or get closer to the real thing, stick a flattened axle in there, and rotate it with some vice grips while the sensor is held steady in a vice, to pry the legs apart.
 
Normally a flat sided axle is in the drop out, rotates under stress, and pries the two legs of the drop out apart since it's wider diagonally. So I think you'd have to simulate that by prying the two legs apart, not squeezing one. Or get closer to the real thing, stick a flattened axle in there, and rotate it with some vice grips while the sensor is held steady in a vice, to pry the legs apart.
These aren't intended to measure axle torque of a hubmotor, they're intended to measure chain tension of the pedal drivetrain. ;)

If twisting the axle in the dropout activates the sensor, then you cannot use one with a rear hubmotor, or it will probably go into runaway operation since activating the motor will provide torque that further activates the motor that provides more torque that further activates the motor...etc. :(

The way most dropout sensors are likely to measure chain torque is to detect that the axle is being pulled forward/upward by the chain tension on the hub itself, which pulls against the axle, etc.
 
Some thoughts you may want to investigate:


I bought 2 brand new sensors from Aliexpress. Unfortunately i don't have the xiaomi qicycle bike itself and i can't measure sensors input voltage coming from the controller.
Do the AE sale pages include a pinout for the sensor to show you which wires are which, and what voltage(s) to input, and what their outputs should be?

We can't check this for you as you haven't provided a link to the source page yours came from; we can only guess as we have no data outside what you've posted in this thread. ;)


However sensor have 3 wires like regular throttles (red,black and white)
Unfortunately, that doesn't mean anything other than that they have three wires. Doesn't tell you anything about voltage/current required, or what signal types they use. There are sensors that have three wires but use digital output, or even digital I/O that is addressed that requires a query by the bus the data line is connected to in order for the sensor to output anything.

If it always has the same voltage on the output pin (assuming you are certain that it *is* the output pin, and that the pins you are connecting supply voltage and ground to are actually the correct pins as well; any miswire could damage a sensor and leave it inoperative even when rewired correctly).

Hopefully Stancecoke is correct and these are clones of the TMM4...but they may not be.

If these are supposed to be analog output, and they are clones of the TMM4, they would not have 5v on the output when no force is applied.
1710106085949.png 1710106238106.png
The TMM4 Sensor

The TMM4 sensor has the world's best price performance. It is a patented development of IDbike, and can be used for measuring the crank torque of the cyclist. Because of its high precision this sensor can be applied in electric bicycles as well as in power measurement systems. Here you can find is a nice example of the application of our TMM 4 sensor

Due to the sensor’s low profile the rear drop out can be designed so that it covers the sensor completely. This way the sensor is fully protected and the appearance improved.

The TMM4 sensor consists of a housing of engineering plastic, which holds a printed circuit board (pcb) , a magnet and a small set screw, which is used to calibrate the zero value

The sensor, mounted on the sensor plate, measures the deflection of the plate caused by the chain force. This, in turn calculates the pedal torque of the cyclist. The deflection is detected using Hall technology and is maximal 0.1 mm.

The sensor is connected to the control unit with a 3 wired cable. The sensor can be hardwired or can be connected with a small connector.

The printed circuit is protected against moisture, salt and dust, by a special coating. The sensors are tested by immersion - in operationt - in salt water for at least one week.

And of course our sensors are tested under extreme outdoor conditions:

The sensor units are available in 2 versions:

Medium sensitivity for sportive bicycles, such as mountain bikes and speed pedelecs
High sensitivity for normal bikes like city and touring bicycles

Soon IDbike will be able to deliver new generation sensors, which will be smaller, completely flat, and with even better stability.

RegularCompactSC

The TMM4 Regular is the actual sensor unit, the compact will be available in the end of 2018, and the Super Compact, to be used with through axle in 2019.
Specifications TMM Sensor Unit

Supply voltage:
5 V
Output voltage: 0,1 V- 4,9 V
Measuring range sensor unit: 120 Nm ( High sensitivity) / 300 Nm (medium sensitivity)
Sensitivity TMM sensor unit:

40 Nm/V (High sensitivity)/ 100 Nm/V (medium sensitivity)
Tolerance on sensitivity: < 3 %
Allowable range ZTV (zero torque value): 0,5-2 V
Temperature influence: < 1 mV/ ºC
Electrical disturbance: < 10 mV
Effect of moisture: < 10 mV
Operational temperature: -10 - 60 ºC
Storage temperature: -40 - 85 ºC
Durability: At least 10 million cycles
Protection Class: IP66 >> protection aigainst water and dust


I haven't installed sensor on the bike yet i am just experimenting by applying force with adjustable pliers.
I can't tell if the forces applied are the same as the way the chain would pull. If they're not, they may not cause output as expected.


I haven't installed sensor on the bike yet i am just experimenting by applying force with adjustable pliers. I tried switching white and red colors and KTLCD7c display keeps showing "throttle error"

Yes it is always giving 5V output. I also tried connecting to an ESP32 today. It is always outputting the same value

A controller *should* show an error for any throttle signal that is above it's maximum throttle input value (usually around 4v or so).

Are all the tests you've done with it connected to a controller, MCU, etc?

Or have you done any testing with just the manufacturer-specified supply voltage connected to just the manufacturer-specified supply pins, and measuring the otherwise-not-connected manufacturer-specified output pin with a voltmeter or multimeter?

Note that swapping wires for supply voltage input from what they should be can damage the part.
 
Back
Top