Hi guys, I'm a new user from Italy.
I followed silently this thread a for months, since I had the idea to build an ebike from scratch by myself.
My goal was to build a pedelec with just some assistance (not exceding EU legal power), minimizing weight, and experimenting ways to maximize trip distance.
I finally succedeed to build a lightweight 13kg 26" ebike, based on a Xiongda YTW 06 front motor powered by a 7Ah bottle battery.
I added a Sempu T2 3d gen TS, that's the (first) reason I began to follow this thread, because the stock controller FW obviously doesn't manage it.
In these days, I'm getting familiar with OSEC and BluOsec setup: thank you for the fantastic work, and I would like to (try to) contribute a little.
Since from the beginning, for distance maximizing I wanted to experiment with automatic gear shifting, so I built the bike only with rear derailleur (it's a 1x10 config, with a HUGE&SEXY Sunrace 11-46 cassette
I want to investigate on my thought that in some situations (hilly journeys), the power saved by auto shift (letting the driver legs/motor work with the most adequate gear) is more than the power consumption of this sub-system.
I noticed, in fact, that many ebike drivers tend to underuse the gear shifters, insisting in higher gears than usual and asking the motor to balance it.
The mechanical part is ready: derailleur is driven by a 25KG digital servo, fixed on a 3D printed PLA support.
The servo has its standard 20 mm diameter round alu pulley which wind up the shift cable: I was VERY lucky when I realizedthat the 172° servo travel + pulley diameter cover perfectly the travel needed by my Shimano SLX derailleur!
I verified briefly the forces involved, a standard derailleur needs about 12kg to retain position, and some more to move. For position keeping, I've noticed that most of the 12kg are sustained by the internal reduction gears of the servo, so it doesn't need too much current to stay in idle in some gear.
Initially I imagined to use a separate Arduino Mega platform to drive the servo, sharing sensors (cadence, speed, torque at least) with the KT controller...until I opened my spare KT controller I bought and compared to the STM8S datasheet: the KT board (at least my revision) is plenty of free pads other than famous X4 one, which could be used to my needs...yeah!
So, I rerouted/created some input/output of my KT36/48SVPR-HRD01:
- Rearranged some wires to power the Sempu T2 @ 36 V
- Draw current directly from Vbat +36V pad to a DC/DC Step Down Converter to 6,8V, to power the servo. I reached to connect and enclose it inside the controller box
- Attached Servo signal output to a pad connected (via a 2,2K resistor) to PIN 43 of STM8S: I want try to use it as a PWM output of Timer 3, not used yet by OSEC, @ about 50 Hz. I've to check if i'll need to short circuit the 2,2 K resistor, I hope not
- Attached a passive buzzer output to a pad connected (via 2,2 K resistor, again) to PIN 45: it would be sooo nice to notice the driver of an imminent gear shift...This PIN has to be reconfigured with the STM8 S Option byte to work as a Beep source.
The algorithm could be simple at the beginning, I think I'll create a Optimal cadence parameter (typically 90 rpm) and an Overlapping parameter to manage gears shifts, but it could be made more omplex...I'm thinking about torque value, but also parameters, for example, from BlueOsec: clinometer, FC from a HRM, etc...
I hope there will be some headroom left in STM8S resources...
(I think that in future BlueOsec could be the gate to share other async sensed values to controller, provided by a common phone: otherwise, most of the sensing modules on the market are I2C or UART based, but the first is not avaible in KT controller, the second is busy...)
After finishing optimizing the OSEC to my motor (it worked at first start!), next days I'll work on FW to create the automatic gear shift function: altough I'm not a programmer I have a past experience in motor controllers...so let's try!
Long post sorry, I don't want to bother you anymore: if you want some detail/photos/etc...just ask!
Thank you all!