Attempt at Torque Sensor Precontroller

Electric Motors and Controllers
Post Reply
SteveDillon   1 mW

1 mW
Posts: 10
Joined: Oct 14 2020 5:07am

Attempt at Torque Sensor Precontroller

Post by SteveDillon » Nov 01 2020 11:00am

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.....

User avatar
stancecoke   1 MW

1 MW
Posts: 1610
Joined: Aug 02 2017 2:56pm

Re: Attempt at Torque Sensor Precontroller

Post by stancecoke » Nov 01 2020 12:52pm

SteveDillon wrote:
Nov 01 2020 11:00am
to interface between an erider torque sensor and a kt controller.
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

SteveDillon   1 mW

1 mW
Posts: 10
Joined: Oct 14 2020 5:07am

Re: Attempt at Torque Sensor Precontroller

Post by SteveDillon » Nov 11 2020 11:57am

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

szkuba   1 W

1 W
Posts: 51
Joined: Nov 26 2018 2:56pm

Re: Attempt at Torque Sensor Precontroller

Post by szkuba » Jan 20 2022 1:54pm

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
interesting project, what kind of throttle mode does it need?:
- Battery current throttle mode,
- motor current throttle mode
- or speed throttle?

User avatar
stancecoke   1 MW

1 MW
Posts: 1610
Joined: Aug 02 2017 2:56pm

Re: Attempt at Torque Sensor Precontroller

Post by stancecoke » Jan 21 2022 1:55am

szkuba wrote:
Jan 20 2022 1:54pm
what kind of throttle mode does it need?
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.

User avatar
afzal   10 W

10 W
Posts: 84
Joined: Jun 13 2021 7:55am
Location: Kerala, India

Re: Attempt at Torque Sensor Precontroller

Post by afzal » Jan 21 2022 2:16am

stancecoke wrote:
Jan 21 2022 1:55am
motor 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)
In expression for mechanical power, shouldn't it be "motor speed" instead of "cadece" (cadence) ?

User avatar
stancecoke   1 MW

1 MW
Posts: 1610
Joined: Aug 02 2017 2:56pm

Re: Attempt at Torque Sensor Precontroller

Post by stancecoke » Jan 21 2022 4:26am

Yes, of course you are right.
Rider‘s power is cadence * torque on crank *2Pi.
regards
stancecoke

szkuba   1 W

1 W
Posts: 51
Joined: Nov 26 2018 2:56pm

Re: Attempt at Torque Sensor Precontroller

Post by szkuba » Jan 22 2022 1:54pm

stancecoke 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......
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 proportional :o

User avatar
stancecoke   1 MW

1 MW
Posts: 1610
Joined: Aug 02 2017 2:56pm

Re: Attempt at Torque Sensor Precontroller

Post by stancecoke » Jan 23 2022 5:12am

szkuba wrote:
Jan 22 2022 1:54pm
So when you want go fast you need to push a lot
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. :wink:
szkuba wrote:
Jan 22 2022 1:54pm
human and machine are proportional
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.

Image

regards
stancecoke

Post Reply