KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Looks like its not unlocking. No communication for some reason
 

Attachments

  • 1736701794829.png
    1736701794829.png
    28.9 KB · Views: 8
Is anyone using BluoOsec with modern android versions? Im not getting any connection.
Bluetooth terminal in diagnostics mode works fine but not the app.
 
Is anyone using BluoOsec with modern android versions? Im not getting any connection.
Bluetooth terminal in diagnostics mode works fine but not the app.
Try giving the app all permission in the settings/app/permissions screen if possible. If it can still work, it might not ask for the correct permissions, which changed I think during android 13. It would be better to recompile the app with later SDK support and fix the permissions properly if you have the source code.

Looks like its not unlocking. No communication for some reason
How long is your cable? Swim does not like bad contacts and long cables.
 
Try giving the app all permission in the settings/app/permissions screen if possible. If it can still work, it might not ask for the correct permissions, which changed I think during android 13. It would be better to recompile the app with later SDK support and fix the permissions properly if you have the source code.


How long is your cable? Swim does not like bad contacts and long cables.
Crappy st-link was causing issues with unlocking. Unfortunately app source code is unavailable.
Im using your fork btw

 
Im using your fork btw
A few people are so I've heard. Should give you some leeway to do some more communication/calculations if need be. I'm not maintaining it anymore since it works (mostly) for me and I'm switching to a stm32 controller, so caveat emptor applies. If you find any errors let me know if you made a pull request, I'm not actively checking github atm.


Crappy st-link was causing issues with unlocking
Been there, I had issues with a custom cable which was too long for the crappy stlink clone I had, cut cable in half and it worked half of the time which is better than never.
 
A few people are so I've heard. Should give you some leeway to do some more communication/calculations if need be. I'm not maintaining it anymore since it works (mostly) for me and I'm switching to a stm32 controller, so caveat emptor applies. If you find any errors let me know if you made a pull request, I'm not actively checking github atm.



Been there, I had issues with a custom cable which was too long for the crappy stlink clone I had, cut cable in half and it worked half of the time which is better than never.
I wish i had enough skill to add my own features. Is there any way to disable interpolation on your fork?
 
Just me or is the standard KT firmware kinda shit? The throttle response is sluggish, and setting C4 to 3 in the settings doesn't do anything, it's supposed to do this: Before power assist, the throttle speed limit is 6KM/h, after power assist, throttle is full speed. Stop power assist, return the throttle speed limit is 6KM/H.

But the throttle just always works, which makes my bike illegal in the EU... I guess what I'm saying is, time for me to start soldering/compiling!
 
Just me or is the standard KT firmware kinda shit? The throttle response is sluggish, and setting C4 to 3 in the settings doesn't do anything, it's supposed to do this: Before power assist, the throttle speed limit is 6KM/h, after power assist, throttle is full speed. Stop power assist, return the throttle speed limit is 6KM/H.

But the throttle just always works, which makes my bike illegal in the EU... I guess what I'm saying is, time for me to start soldering/compiling!
Not all settings are available for all devices. Mine responded to settings not in the manual. If you have a old batch/version some things might not work. It's hit or miss.
 
Things are working!! A week ago I bricked my first kunteng controller because a metal clamp on the FETs caused a short somewhere when I unscrewed it without taking the top of the controller off first or apparently letting the capacitors discharge enough.

The instructions said to 'gently lift' the top panel of the enclosure, that didn't work so I thought the body of my controller didn't have a separate top and was just one solid piece. Turns out it did have a separate top piece, but I needed to pry it off.

With my second controller things went a lot better - I finally have a legal ebike, by setting 'without PAS' to 5 km/h and the limit to 25, which wasn't possible (even just the speed limit) with multiple controllers from aliexpress.

Now for what's not working - 'Battery current cal a' doesn't seem to do much, whether I set it to 100 or 200, the max battery current is around ~3.5a when battery current is set to max 30. Phase current is set to 140.

I hope I don't blow anything this way, is there a way to fix/diagnose this?20250304_201923.jpg
 
Things are working!! A week ago I bricked my first kunteng controller because a metal clamp on the FETs caused a short somewhere when I unscrewed it without taking the top of the controller off first or apparently letting the capacitors discharge enough.

The instructions said to 'gently lift' the top panel of the enclosure, that didn't work so I thought the body of my controller didn't have a separate top and was just one solid piece. Turns out it did have a separate top piece, but I needed to pry it off.

With my second controller things went a lot better - I finally have a legal ebike, by setting 'without PAS' to 5 km/h and the limit to 25, which wasn't possible (even just the speed limit) with multiple controllers from aliexpress.

Now for what's not working - 'Battery current cal a' doesn't seem to do much, whether I set it to 100 or 200, the max battery current is around ~3.5a when battery current is set to max 30. Phase current is set to 140.

I hope I don't blow anything this way, is there a way to fix/diagnose this?View attachment 366684
It's a while since I played with this fw but from memory I don't think that 'bat current cal a' has any function in the code these days. Also, I'm pretty sure that 'bat current max' and 'phase current max' settings don't relate directly to amps, mine are set to 150 and 500 for these settings which seems to give a max current current of around 20amps.
As stated all from (fading) memory, but probably worth playing around with those numbers...:)
 
It's a while since I played with this fw but from memory I don't think that 'bat current cal a' has any function in the code these days. Also, I'm pretty sure that 'bat current max' and 'phase current max' settings don't relate directly to amps, mine are set to 150 and 500 for these settings which seems to give a max current current of around 20amps.
As stated all from (fading) memory, but probably worth playing around with those numbers...:)
Ok, that makes sense, I can still lower the battery/phase amperages by inputting lower current numbers to account for the measurements being out of calibration.
 
@stancecoke Im trying to catch up on the code, could you tell me something about those two commits:

e9dd587 Pushed Andreas changes from zip at ES
That just seems to merge back the same as in
d430d8d Changed to integer arithemtics and right shift
into yet another branch?

And in both cases the new calculation uses SPEED_INFLUENCES_TORQUESENSOR?
 
Hi @Xnyle,

nice to see, that you are active again, I saw your comments on the GitHub issue also.
I don't use Kuntengs any more, the last commits were just a service for guys, who are not familiar with GitHub. I didn't check them technically.

I would be happy, if you could maintain the Kunteng project on your GitHub account, or push it back to the OpenSourceEBike Organization, that @casainho opened several years ago.
You would have to ask @casainho, to invite you to this organization.

1743365243363.png

 
Last edited:
Hey guys,

I have a 2 almost identical builds for mostly cross country based on bafang g040 motor + KT controller (48v 22a 9 mosfets for Polly 5C case), throttle, 10 magnets PAS with Shimano bottom bracket, KT LCD 5 and 11 displays, without brake sensors. I didn't touch the firmware yet, but did minimal improvements into controllers (replaced some mosfets + changed resistor before LM317T to 360 ohm to step down voltage to 20v instead of 15v). I like minimalistic concept of Polly cases with "build in" controllers. For the last time I was looking on torque sensor configuration. I looked on erider t9 and t17. As I understood I don't need to step down power for t17 comparing to t9, so I will choose t17 most probably. Also I was checking between VESC and KT. I know that VESC is better, but I want to keep my controller in the bottom rail of the battery case and I don't want to do a lot of customizations again.

And I have a few questions regarding this firmware. Sorry if I am asking too stupid questions.

1. Is it possible to revert firmware back to stock one? just in case
2. Is it possible to use throttle together with torque sensor? Should I use diodes in this case for the throttle signal?
3. Will it work with my displays? Most probably that yes, but just to double check
 
Last edited:
Hey guys,

I have a 2 almost identical builds for mostly cross country based on bafang g040 motor + KT controller (48v 22a 9 mosfets for Polly 5C case), throttle, 10 magnets PAS with Shimano bottom bracket, KT LCD 5 and 11 displays, without brake sensors. I didn't touch the firmware yet, but did minimal improvements into controllers (replaced some mosfets + changed resistor before LM317T to 360 ohm to step down voltage to 20v instead of 15v). I like minimalistic concept of Polly cases with "build in" controllers. For the last time I was looking on torque sensor configuration. I looked on erider t9 and t17. As I understood I don't need to step down power for t17 comparing to t9, so I will choose t17 most probably. Also I was checking between VESC and KT. I know that VESC is better, but I want to keep my controller in the bottom rail of the battery case and I don't want to do a lot of customizations again.

And I have a few questions regarding this firmware. Sorry if I am asking too stupid questions.

1. Is it possible to revert firmware back to stock one? just in case
2. Is it possible to use throttle together with torque sensor? Should I use diodes in this case for the throttle signal?
3. Will it work with my displays? Most probably that yes, but just to double check
Although the os fw generally works well with the 6-fet and 12-fet controllers I think I remember there being some issues with the 9-fet - I'm not totally sure about this tbh. The answers to your questions are all somewhere in this thread, but hard to find I realise. So:-

1) No, Bafang normally read protect their fw, so you won't be able to download and restore it.

2) If your controller has an X4 connector you *may* be able to connect your torquesensor o/p to that and use the 'Torque_from_X4' branch with the throttle also. Problem here is that it seems that there are variations in X4 circuitry in some controllers that may prevent this from working, so it's a bit of a lottery. Suggest you search for X4 in this thread and have a good read.

3) Same view as yourself - that display seems to have identical functions to the lcd3 display so will probably work but don't know for sure.

......so to be honest it would seem a bit risky to attempt this, maybe worth buying another controller and using that as a test mule rather than potentially bricking your current controllers?
 
Although the os fw generally works well with the 6-fet and 12-fet controllers I think I remember there being some issues with the 9-fet - I'm not totally sure about this tbh. The answers to your questions are all somewhere in this thread, but hard to find I realise. So:-

1) No, Bafang normally read protect their fw, so you won't be able to download and restore it.

2) If your controller has an X4 connector you *may* be able to connect your torquesensor o/p to that and use the 'Torque_from_X4' branch with the throttle also. Problem here is that it seems that there are variations in X4 circuitry in some controllers that may prevent this from working, so it's a bit of a lottery. Suggest you search for X4 in this thread and have a good read.

3) Same view as yourself - that display seems to have identical functions to the lcd3 display so will probably work but don't know for sure.

......so to be honest it would seem a bit risky to attempt this, maybe worth buying another controller and using that as a test mule rather than potentially bricking your current controllers?

Thanks for the answer! I read previously about X4, will check if I have it on my Polly controller because they are a bit simplified comparing to regular in the box. Also for the tests I have a separate "external" controller which I used previously. This is how one of my builds looks like. I wanted to try something new and improve a bit controller's functionality if possible. But also don't want to ruin what has been already created and is working pretty fine.photo_2025-02-13_14-07-41 (3).jpg

photo_2025-02-13_14-07-41 (2).jpgphoto_2025-02-13_14-07-41.jpg
 
Nice bike, functional, no frills :cool:
 
Hi @Xnyle,

nice to see, that you are active again, I saw your comments on the GitHub issue also.
I don't use Kuntengs any more, the last commits were just a service for guys, who are not familiar with GitHub. I didn't check them technically.

I would be happy, if you could maintain the Kunteng project on your GitHub account, or push it back to the OpenSourceEBike Organization, that @casainho opened several years ago.
You would have to ask @casainho, to invite you to this organization.

View attachment 368076

Already figured out that branch is more or less dead and consp did a good job polishing the FW.
I'm currently working on my own branch but have to wait for another motor delivery so I can finalize my testing rig.
@casainho If you want me to push back the changes, just add me as co owner to the original repo.
 
Back
Top