Hi,
I'm planning to use the github 'project'
https://github.com/stancecoke/Minimal_E ... controller
to interface between an erider torque sensor and a kt controller.
I'll have to make a few changes to the software to make it work with the erider, and I'm not totally confident on my ability here, but in UKlockdown phase2 I need a little project.
I've been communicating on github, and understand that the open firmware for the KT controller can do this without the need for the digispark, but that project looks a little beyond my knowledge at the moment. Maybe I'll attempt that later.
Bits should be arriving over the next week or so.....
Attempt at Torque Sensor Precontroller
- stancecoke 1 MW
- Posts: 1596
- Joined: Aug 02 2017 2:56pm
Re: Attempt at Torque Sensor Precontroller
Welcome and thank you for your interest in my little projectSteveDillon wrote: ↑Nov 01 2020 11:00amto interface between an erider torque sensor and a kt controller.

Perhaps you can use the google translation of the german step-by-step tutorial for getting started!
https://translate.google.com/translate? ... -Anleitung
regards
stancecoke
-
- Posts: 10
- Joined: Oct 14 2020 5:07am
Re: Attempt at Torque Sensor Precontroller
Update....
Because I reckoned that testing (and debugging) using a 'real' torque sensor would be tricky, I've decided to use another of these magic little Digispark devices to make a torque sensor simulator, which I can use to test the eventual torque sensor precontroller.
Managed to get that working OK, with a couple of potentiometers to adjust cadence and torque.
Also, today, received the KT controller, display and throttle from China so tried to get them all to work together with the Shengyi DGWX2 rear hub motor. At the moment, I can't get the motor to run smoothly, it seems to run nicely at very slow speeds, then get rough suddenly as the speed increases. I've tried changing the P1 setting on the controller (I think the setting should be 72 for the Shengyi, 15 pole pairs and 4.83 reduction ratio) but no real difference. I'm fearing that I'll have to play around with the hall sensor wires which will be a pain as the motor connector is a nice neat 9 pin Julet connector that won't be easy to get into.
Any advice here would be welcome.
I'll post more details of the torque sensor simulator hardware/software when it's all working
Because I reckoned that testing (and debugging) using a 'real' torque sensor would be tricky, I've decided to use another of these magic little Digispark devices to make a torque sensor simulator, which I can use to test the eventual torque sensor precontroller.
Managed to get that working OK, with a couple of potentiometers to adjust cadence and torque.
Also, today, received the KT controller, display and throttle from China so tried to get them all to work together with the Shengyi DGWX2 rear hub motor. At the moment, I can't get the motor to run smoothly, it seems to run nicely at very slow speeds, then get rough suddenly as the speed increases. I've tried changing the P1 setting on the controller (I think the setting should be 72 for the Shengyi, 15 pole pairs and 4.83 reduction ratio) but no real difference. I'm fearing that I'll have to play around with the hall sensor wires which will be a pain as the motor connector is a nice neat 9 pin Julet connector that won't be easy to get into.
Any advice here would be welcome.
I'll post more details of the torque sensor simulator hardware/software when it's all working
Re: Attempt at Torque Sensor Precontroller
interesting project, what kind of throttle mode does it need?:stancecoke wrote: ↑Nov 01 2020 12:52pm
Welcome and thank you for your interest in my little project
Perhaps you can use the google translation of the german step-by-step tutorial for getting started!
https://translate.google.com/translate? ... -Anleitung
regards
stancecoke
- Battery current throttle mode,
- motor current throttle mode
- or speed throttle?
- stancecoke 1 MW
- Posts: 1596
- Joined: Aug 02 2017 2:56pm
Re: Attempt at Torque Sensor Precontroller
That doesn't matter in the end. If you make more effort when pedaling, the motor also increases its power.
You'll get:
Battery current throttle mode:
human power proportional to electrical power
motor current throttle mode:
human power proportional to mechanical power (needs adaption of the software, as you have to consider mechanical power= motor current*wheel speed*2PI*factor)
speed throttle:
human power proportional to the setpoint for speed
regards
stancecoke
Last edited by stancecoke on Jan 21 2022 4:26am, edited 1 time in total.
Re: Attempt at Torque Sensor Precontroller
In expression for mechanical power, shouldn't it be "motor speed" instead of "cadece" (cadence) ?stancecoke wrote: ↑Jan 21 2022 1:55ammotor current throttle mode:
human power proportional to mechanical power (needs adaption of the software, as you have to consider mechanical power= motor current*cadece*2PI*factor)
- stancecoke 1 MW
- Posts: 1596
- Joined: Aug 02 2017 2:56pm
Re: Attempt at Torque Sensor Precontroller
Yes, of course you are right.
Rider‘s power is cadence * torque on crank *2Pi.
regards
stancecoke
Rider‘s power is cadence * torque on crank *2Pi.
regards
stancecoke
Re: Attempt at Torque Sensor Precontroller
Okay that explains. The speed throttle hovewer used with torque sensor works a bit akward in my opinion (yes i have tried such solution) so if the rider effort translates proportionally to the bike speed which is only a case in a ideal setup: - riding always flat terrain, with same surface and zero wind speed. So when you want go fast you need to push a lot, always.. In reality you can face smooth surface and some backwind , or the other way around. Thus the proportion between rider effort and motor output vary significantly. What i actually like much about the torque sensor with proper setup is that proportion between human and machine are proportionalstancecoke wrote: ↑Jan 21 2022 1:55am
..That doesn't matter in the end. If you make more effort when pedaling, the motor also increases its power......

- stancecoke 1 MW
- Posts: 1596
- Joined: Aug 02 2017 2:56pm
Re: Attempt at Torque Sensor Precontroller
That's just a matter of your amplifying factor. I rode this setup a while, the behaviour can be a feature also. You get always the same speed with the same effort. If you have headwind one day, you don't have to pedal harder to get the same speed. It's always a question of personal preference.

If your controller has the speed trhottle mode only, you would have to add an ACS712 module and do a PI control on the battery current, proportional to your human power. Some lines more of code, but no whitchcraft at all.

regards
stancecoke