Torque sensing with VESC and erider

aspartame

1 mW
Joined
Aug 26, 2024
Messages
10
Location
Floflo-1408
Hello
I’m building a bike with a MXUS 1500w hub motor and 52v BMS 40A battery. Initially it was a minimal build with cheap controller and throttle only. I want to add a erider T17 BB torque/cadence sensor but I don’t like the CA . I saw that stancecoke did a minimalist build with a digispark but control is done through a poti and lack personnalisation

Casinho did something similar here with a VESC 75100, and I like the idea of customisation offered there :

But the code is for Bafang torque sensor through a can bus . Can someone give me directions to make something similar but with the erider signals .

Thanks
 
Well if you are working with a VESC, you *may* be able to just read the torque signal on the throttle input(ADC1,ADC2)
You may have to scale the signal in VESC settings to work how you want it.
According to ebikes.ca, this is the torque signal output of the T17:
"This sensor has an 18 pole 2 wire cadence sensor and a 1.5V - 3.5V output voltage that is proportional to crank torque with a scaling of 70 Nm/V."
VESC can scale/map 1.5V - 3.5V input to whatever controller response you want.
 
Thanks for you answer ! I never used the VESC tool before, but can I tell him to read torque signal, only if cadence is giving out a signal too ( erider gives two signal : one analog for torque and one digital for PAS cadence)? To prevent motor activating while standing on bike ?
@stancecoke said it can be indeed programmed inside a VESC but I cannot find a code/fw for it. IMG_0913.png
 
@stancecoke said it can be indeed programmed inside a VESC but I cannot find a code/fw for it.
You may have to do some research to know what stancecoke is referring to.
Saw this video last month, then someone started a thread
I am attaching the .lisp(just change .zip to .lisp)script here for posterity, and will attach to the thread above.
Ask questions for anything that doesn't make sense.
FYI, I have not tested this script or pas setup, and may need modifications to work simultaneously with torque sensing.
 

Attachments

  • pas_vedder.zip
    2.4 KB · Views: 14
it is indeed the code for PAS cadence sensing, but i want to use the eriderT9 torque signal + cadence.
@stancecoke do you think the code you wrote for the digispark precontoller could be adapted for the VESC ?
Thanks !
 
Last edited:
I've often thought about buying a VESC, but never did, because the price/performance ratio of the Lishuis is simply better. ;)
Of course you can go via the lisp script, but implementing it directly in the source code would be much nicer.

regards
stancecoke
 
Yes I read about lishui OSF, but controllers are limited to 48v 25a I cannot find a suitable controller for 52v40A on my setup .
 
it is indeed the code for PAS cadence sensing, but i want to use the eriderT9 torque signal + cadence.
@stancecoke do you think the code you wrote for the digispark precontoller could be adapted for the VESC ?
Thanks !
Hi, right now I'm in the same point as you i think. I have a hub motor, vesc and erider t17. everything is connected RX,TX etc. Pas is working and the torque sensor is conencted to throttle. the problem is with torque sensor giving 1,5V. So i had to calibrate input and throtle catch very high right now . Time to test it outside when i get the time. But the script seems to be interesting
 
Hi
So you’re using unaltered VESC fw with PAS from erider un the PAS app of Vesc and torque sensor as throttle ? then PAS an Throttle will compete with each other ?

Can you tell me more about your setup ?
Thanks
 
Yes i works, but didnt have time to test it on the road. Need to take it for a spin, but in home it is working.
i have qs205 paired with mks 75200 (older one with 6.02 firmware no limits) and erider t17 and 20S battery.
Before conecting torque sensor, PAS and Throttle was working more or less (sometimes the pas worked for couple seconds after i stop pedaling).
T17 signal wires hooked to rx and tx on vesc V+ 5v (erider t17 works from 5v , t9 requires 9v i think) and gnd to vesc. Throttle hooked to adc1 with diode on signal wires from throttle and torque sensor .
 
you use a throttle + torque sensor ? What about the cadence signal from erider ? Do you use it ?
i have them connected because i was using PAS only and throttle before to have rotation in correct way.
But if this will work witout rx and tx i might think to use rx and tx for reverse and cruise control or lcd.
sad thing there are no control on the power of support level. wee need better solution in future
 
you didn’t use adc input ?
Don’t you think I’ll work by just plugging erider signal into adc1/throttle input? And what about when the is torque on the pedal but no crank movement ( I.e standing on the bike at stop ) how do you stop it from giving power to the motor ? Through ebrake might be a solution ?

Regards
 
I have ebrake on adc2, I set min rpm for 6 to pas also the min voltage to throttle is set instead 1.5V to 1.7V.
in default mode i have throttle set to regen braking
 
Normally you want the assistance from the motor to be proportional to riders effort.
The basic equation is
Code:
Motor torque * motor rpm = assist factor * cadence * torque on the crank

As the motor torque is proportional to the motor current, you can calculate the wanted motor current easily....

It's just one line of code to add.
But the structure of the VESC code is horrible, with thousands of options, you will never need. So you need to find the right line, where the setpoint of the motor current is defined and replace it.

regards
stancecoke
 
Back
Top