Out of curiosity how do you like it compared to the stock? Is it worse in any way? Still trying to decide if I want to take the one way trip on my kit when it shows uo
KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)
-
- Posts: 16
- Joined: Aug 23 2020 12:45am
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
@tenten4801
This firmware runs way more efficient/quieter than the stock rom, also the ability to change most of the parameters at runtime through the BluOESC app such as the top speed, the individual speeds of just Throttle, throttle with pas and only the pas is amazing. The only thing I'm missing out at the moment ist regen l, but having read that it works quite well, this should work on your Controller, as I haven't read about anyone having the same problem as I have
Regards
This firmware runs way more efficient/quieter than the stock rom, also the ability to change most of the parameters at runtime through the BluOESC app such as the top speed, the individual speeds of just Throttle, throttle with pas and only the pas is amazing. The only thing I'm missing out at the moment ist regen l, but having read that it works quite well, this should work on your Controller, as I haven't read about anyone having the same problem as I have
Regards
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
Hi, i have problem with regen, its brake very slow and nothing go back to battery and any reaction on regen current maxstancecoke wrote: ↑Sep 18 2020 10:28amCorrida victim wrote: ↑Sep 17 2020 6:35pmmy code change will set the target power for walk assist to ±500w and limit the speed to 20km/h (to make it legal in Europe for speed pedelecs)![]()
You could have made the few changes yourself, but here you go(not tested):
https://github.com/stancecoke/BMSBatter ... 8db04c547d
regards
stancecoke
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
I am building junior MTB with torque sensor without throttle.stancecoke wrote: ↑Sep 13 2020 1:15pmI've implemented the walk assist in the new branch "Walk_Assist":sylvain_wm wrote: ↑Sep 13 2020 3:48ambecause I was trying to pore over every single ligne of the program to figure out where I had to change the code....
https://github.com/stancecoke/BMSBatter ... alk_Assist
It's just quick and dirty and not tested yet. When the walk assist bit is set, the current target is simply set to 1 amp (for the 6FET calibration).
If someone can confirm that it works properly, I can push it to the master branch.Code: Select all
if (ui8_walk_assist) uint32_current_target = 10 + ui16_current_cal_b;
regads
stancecoke
1. How to activate walk assist? Is it working by holding "down" button on display? Or will it support startup by engaging the motor at zero cadence? I very courious about it

2. The dynamic assist mode: what is the assit variation here? Can we compare IT to dynamic modes od Trail in Shimano or eMTB on Bosch?
Looking forward for your answer
- stancecoke 100 kW
- Posts: 1381
- Joined: Aug 02 2017 2:56pm
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
Please log the data in debug mode and look at the duty cycle during regen. I guess, the motor-constant has to be adjusted to your motor.
With a Kunteng-Display, yes.
Sorry, this feature was added by @Xnyle. I have no idea, what it does, I don't use it.
regards
stancecoke
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
Not sure if you've seen this, but there is some reference to it in the wiki, copied below:-stancecoke wrote: ↑Sep 24 2020 9:28amSorry, this feature was added by @Xnyle. I have no idea, what it does, I don't use it.
regards
stancecoke
Ride Options:
Dynamic Assist Level: Using the throttle for a longer period of time will automatically increase the assist factor a bit. After the throttle is released, the assist factor will slowly ramp down again.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 6-fet, LCD3, 48v 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 6-fet, LCD3, 48v 12s lipo.
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
I saw that , Thanks. I was wondering what is the variation. So for instance going uphill it will increase the assit but how much? It says "a bit" so would it be 10%-20%?. Nevertheless i asked Xnyle directly but no response do far since few monthsgeofft wrote: ↑Sep 24 2020 11:27amNot sure if you've seen this, but there is some reference to it in the wiki, copied below:-stancecoke wrote: ↑Sep 24 2020 9:28amSorry, this feature was added by @Xnyle. I have no idea, what it does, I don't use it.
regards
stancecoke
Ride Options:
Dynamic Assist Level: Using the throttle for a longer period of time will automatically increase the assist factor a bit. After the throttle is released, the assist factor will slowly ramp down again.

I have the DC/DC for powering Sempu T4. Does anyone knows what is the EN pin for?
- Attachments
-
- IMG_20200925_074902.jpg (351.34 KiB) Viewed 796 times
- stancecoke 100 kW
- Posts: 1381
- Joined: Aug 02 2017 2:56pm
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
This is the enable pin. It has to be on TTL high to enable the 12V output.
You can just short it to the VIN+ pad to enable the output permanently.
regards
stancecoke
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
Thanksstancecoke wrote: ↑Sep 25 2020 1:55amThis is the enable pin. It has to be on TTL high to enable the 12V output.
You can just short it to the VIN+ pad to enable the output permanently.
regards
stancecoke

Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
I have not found na answer anywhere do here the very basic(dumny ) question:
When flashing the firmware the controller schould or schould not be connected:
1. To a battery?
2. To other peripherals like LCD, Pas etc.?
3. Powered on or off?
When flashing the firmware the controller schould or schould not be connected:
1. To a battery?
2. To other peripherals like LCD, Pas etc.?
3. Powered on or off?
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
With the Kunteng controllers, if you have connected the 5v +ve from the STlink to the controller you don't require main battery or any other connection to flash.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 6-fet, LCD3, 48v 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 6-fet, LCD3, 48v 12s lipo.
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
Does anyone know does the KT controller original software have the feature of power rollback, basically, when coming close to LVC it starts taking less power from the battery?
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
I am flashing the firmware for junior MTB on 24wheels with AKM 85 motor with torque sensor. What i would to achieve is kimś od soft start do the motor powr does increase over 0.5 to 1 sec. I read the manual but cannot clearly determine which Ramp schould i define and what value pit there. Can you help to specify?
- stancecoke 100 kW
- Posts: 1381
- Joined: Aug 02 2017 2:56pm
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
The ramp settings are for "torque-simulation" mode only. With a torque-sensor, they have no function.
For slower respond you have to reduce the Gain P and Gain I settings of the PI-control.
eg.
Gain P = 0.05
Gain I = 0.01
regards
stancecoke
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
Okay all clear now.stancecoke wrote: ↑Sep 30 2020 6:47amThe ramp settings are for "torque-simulation" mode only. With a torque-sensor, they have no function.
For slower respond you have to reduce the Gain P and Gain I settings of the PI-control.
eg.
Gain P = 0.05
Gain I = 0.01
regards
stancecoke

Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
Just run first test. It works just great. I have set the Gain P on 0.10 and Gain I on 0.02. Are those perimeters also responsible for the speed of power decrease?
The lower values seemed to sluggish and we need some reactivity for offroad riding. Tomorrow next test
The lower values seemed to sluggish and we need some reactivity for offroad riding. Tomorrow next test

Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
I have set the PAS threshold on 1.5 for Sempu T4 with 48pulses per rotation.
Is it correct given the readouts for forward rotation in BlueOsec (bakward is just zero):?
PAS status - PAS fraction
2,44 - 8/3
2,4 - 9/3
2,4 - 9/3
1 - 7/4
1,68 - 5/3
2,58 - 7/3
1,66 - 8/4
1,77 - 5/3
2,48 - 7/3
1,65 - 7/4
1,66 - 3/1
1,66 - 3/1
2,54 - 5/2
1 - 1/1
Please advise
Is it correct given the readouts for forward rotation in BlueOsec (bakward is just zero):?
PAS status - PAS fraction
2,44 - 8/3
2,4 - 9/3
2,4 - 9/3
1 - 7/4
1,68 - 5/3
2,58 - 7/3
1,66 - 8/4
1,77 - 5/3
2,48 - 7/3
1,65 - 7/4
1,66 - 3/1
1,66 - 3/1
2,54 - 5/2
1 - 1/1
Please advise
- stancecoke 100 kW
- Posts: 1381
- Joined: Aug 02 2017 2:56pm
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
The PAS threshold is irrelevant in torque sensor mode. It's not used in the code.
regards
stancecoke
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
Okay but then is it PAS irrelevant at all. I though cadence is affecting the power calculation ? so then i am looking for the reson why sometimes the motor does not star from idle. It may takie few to 10 seconds before it start again from coasting or idle. Appreciate your response.stancecoke wrote: ↑Oct 03 2020 3:17am
The PAS threshold is irrelevant in torque sensor mode. It's not used in the code.
regards
stancecoke
PS The torque output is OK. Could it be something obout P and I settings?
- stancecoke 100 kW
- Posts: 1381
- Joined: Aug 02 2017 2:56pm
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
No, just the direction detection via the PAS fraction is irrelvant.
Code: Select all
else { // torque sensor mode
float_temp = (float) ui16_sum_torque;
float_temp *= ((float) ui8_assist_percent_actual / 100.0);
if (flt_torquesensorCalibration != 0.0) {
float_temp *= flt_torquesensorCalibration / ((float) ui16_time_ticks_between_pas_interrupt_smoothed); // influence of cadence
}
Please log the output in debug mode, then we can see what happens.
regards
stancecoke
-
- Posts: 23
- Joined: Feb 27 2020 8:45am
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
Hi! Just wondering which settings I could play around with to attempt to improve efficiency.
Right now the power consumption sits at 14-16amps (700-800w) at 35km/h. I average between 23 and 26wh/km, which is rather high compared to my previous speed-pedelec which averaged 12wh/km at similar speeds on the same trip.
Right now the power consumption sits at 14-16amps (700-800w) at 35km/h. I average between 23 and 26wh/km, which is rather high compared to my previous speed-pedelec which averaged 12wh/km at similar speeds on the same trip.
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
Hi,
If I've understood the interactions of this software's features correctly then there seems to be an obvious way to effectively adjust "assistance level" without using a display.
But I'd really like to know for sure before launching into my first e-bike build on false assumptions and being disappointed.
As I understand it there’s three* means to modulate hub motor power on-the-fly with this firmware:
1. Varying “Assistance level” over UART
2. Varying pulse frequency on “PAS sensor” input
3. Varying voltage on “Throttle” input
If you want a sleek control system without display, throttle, or torque sensor, you need only retain PAS and accept the compromise of regulating power via cadence. It's too much of a compromise though, without a way to scale power to account for fatigue, weather conditions and terrain.
So how to scale power?
Conceivably by operating in "torque sensor mode" and using "throttle input" as a proxy for "assistance level" .
With the default “assistance level” set at 100% and “torque sensor mode” activated, wouldn't voltage on the "throttle input" be conceptually equivalent to "assistance level", due to power being mediated by cadence? i.e. assuming a hypothetical valid input range from 1-4V, 0V would equate to no assistance, and 4V to full assistance
(FWIW, I’d adjust the voltage signal by ditching front chainring shifting and use a spring return linear position sensor or cable-actuated hall throttle mechanism controlled by the ratcheting left gear shifter, in my case with a Campagnolo shifter resulting in nine distinct locked positions across 15mm of cable pull).
* not including the ability to move the motor into different parts of its power band by altering wheel RPM via rider power input and/or aerodynamic profile
If I've understood the interactions of this software's features correctly then there seems to be an obvious way to effectively adjust "assistance level" without using a display.
But I'd really like to know for sure before launching into my first e-bike build on false assumptions and being disappointed.
As I understand it there’s three* means to modulate hub motor power on-the-fly with this firmware:
1. Varying “Assistance level” over UART
2. Varying pulse frequency on “PAS sensor” input
3. Varying voltage on “Throttle” input
If you want a sleek control system without display, throttle, or torque sensor, you need only retain PAS and accept the compromise of regulating power via cadence. It's too much of a compromise though, without a way to scale power to account for fatigue, weather conditions and terrain.
So how to scale power?
Conceivably by operating in "torque sensor mode" and using "throttle input" as a proxy for "assistance level" .
With the default “assistance level” set at 100% and “torque sensor mode” activated, wouldn't voltage on the "throttle input" be conceptually equivalent to "assistance level", due to power being mediated by cadence? i.e. assuming a hypothetical valid input range from 1-4V, 0V would equate to no assistance, and 4V to full assistance
(FWIW, I’d adjust the voltage signal by ditching front chainring shifting and use a spring return linear position sensor or cable-actuated hall throttle mechanism controlled by the ratcheting left gear shifter, in my case with a Campagnolo shifter resulting in nine distinct locked positions across 15mm of cable pull).
* not including the ability to move the motor into different parts of its power band by altering wheel RPM via rider power input and/or aerodynamic profile
- stancecoke 100 kW
- Posts: 1381
- Joined: Aug 02 2017 2:56pm
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
The main parameter is the motor specific angle. You can vary it e.g. in steps of 5 to find the best setting.Corrida victim wrote: ↑Oct 03 2020 8:02pmJust wondering which settings I could play around with to attempt to improve efficiency.
If you have a ZWS type or a 12 or even 18 FET controller, that has the ACS712 sensings pads shortened, you have to disable the option Enable rotor angle correction. You can solder in the phase current sensor / remove the solder bridge from the sensor for best efficiency of course.
Honestly I don't understand your post. Do you have a specific question?!
regards
stancecoke
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
Sorry, I can ask differently …
Is it correct that in “torque sensor mode”, voltage seen on the controller’s throttle input is converted into a weighting factor or multiplier?
I was imagining a use case without display or torque sensor, where the rider regulates this voltage with a handlebar-mounted static control such as a potentiometer. That way you could ride in whatever cadence is comfortable, and command more or less "assistance" by adjusting this voltage.
Is it correct that in “torque sensor mode”, voltage seen on the controller’s throttle input is converted into a weighting factor or multiplier?
I was imagining a use case without display or torque sensor, where the rider regulates this voltage with a handlebar-mounted static control such as a potentiometer. That way you could ride in whatever cadence is comfortable, and command more or less "assistance" by adjusting this voltage.
- stancecoke 100 kW
- Posts: 1381
- Joined: Aug 02 2017 2:56pm
Re: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW
OK, still the motor power would be depending on the cadence. This sounds like a very strange setup.

I suggest to remove the spring from a normal thumb throttle. Then you get your wanted behaviour even with the stock firmware.
regards
stancecoke