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

Electric Motors and Controllers
honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 11 2018 5:58am

@casainho - I have an idea.

For legal purposes in EU, on pedal bike, Throttle can work only to 6km/h

What about something like the "cheat" as it is on stancecokes branch. Like - you press and release brake few times in specific intervals and it limits the throttle to 6km/h/250w (+ remembers even after turned of and on) +only can switch when at standstill.

I know you don't use throttle but I think this will be good future function for a lot of people :) so just sharing the idea

casainho   100 MW

100 MW
Posts: 2679
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Mar 11 2018 6:20am

honya96 wrote:
Mar 11 2018 5:58am
@casainho - I have an idea.

I know you don't use throttle but I think this will be good future function for a lot of people :) so just sharing the idea
That is not a priority for me, at least, I want first having direct drive motor working well. I created a new issue with that idea, so we not forget it over the time: https://github.com/OpenSource-EBike-fir ... /issues/29
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

geofft   1 kW

1 kW
Posts: 319
Joined: Nov 09 2012 9:41am
Location: Berkshire UK

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

Post by geofft » Mar 11 2018 6:27am

honya96 wrote:
Mar 11 2018 5:58am
@casainho - I have an idea.

For legal purposes in EU, on pedal bike, Throttle can work only to 6km/h

What about something like the "cheat" as it is on stancecokes branch. Like - you press and release brake few times in specific intervals and it limits the throttle to 6km/h/250w (+ remembers even after turned of and on) +only can switch when at standstill.

I know you don't use throttle but I think this will be good future function for a lot of people :) so just sharing the idea
Would it maybe be better to always power up in 'legal' mode (6kph thr/25kph/250w) and need to be switched to 'full on' - that way if the bike becomes the subject of a legality test it will always power up legal. Rather than 'cheat' maybe we should call it something like 'off-road mode' - doesn't sound so much like you're trying to...er....cheat... :wink:
Last edited by geofft on Jun 13 2018 7:47am, edited 1 time in total.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

casainho   100 MW

100 MW
Posts: 2679
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Mar 11 2018 6:37am

geofft wrote:
Mar 11 2018 6:27am
honya96 wrote:
Mar 11 2018 5:58am
@casainho - I have an idea.

For legal purposes in EU, on pedal bike, Throttle can work only to 6km/h

What about something like the "cheat" as it is on stancecokes branch. Like - you press and release brake few times in specific intervals and it limits the throttle to 6km/h/250w (+ remembers even after turned of and on) +only can switch when at standstill.

I know you don't use throttle but I think this will be good future function for a lot of people :) so just sharing the idea
Would it maybe be better to always power up in 'legal' mode (6kmh/250w) and need to be switched to 'full on' - that way if the bike becomes the subject of a legality test it will always power up legal. Rather than 'cheat' maybe we should call it something like 'off-road mode' - doesn't sound so much like you're trying to...er....cheat... :wink:
I like that idea of booting always in street mode and thinking that mode changing will happens rarely. But, for users living in places without limitations, a flag on java tool would boot firmware always in offroad mode (no limitations).
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

1N4001   10 W

10 W
Posts: 72
Joined: Nov 28 2017 7:55am

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

Post by 1N4001 » Mar 11 2018 8:22am

+1 on that hidden off-road mode :mrgreen: I like the idea of defaulting to limited mode unless a secret brake lever pattern is entered.

Do you happen to know the max gate charge the FETs may have before the risk of shoot-through becomes apparent with this firmware? I'm wondering if one could replace them with 120nC or 140nC FETs for improved efficiency and lower heat. For reference, the stock STP80NF70 have 75nC.

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 11 2018 9:47am

1N4001 wrote:
Mar 11 2018 8:22am
+1 on that hidden off-road mode :mrgreen: I like the idea of defaulting to limited mode unless a secret brake lever pattern is entered.

Do you happen to know the max gate charge the FETs may have before the risk of shoot-through becomes apparent with this firmware? I'm wondering if one could replace them with 120nC or 140nC FETs for improved efficiency and lower heat. For reference, the stock STP80NF70 have 75nC.
Best you can get is CSD19536(xxx) (down to 2.0mOhm) Tested by me - Working

https://cz.mouser.com/Search/Refine.asp ... d=CSD19536

These controllers use same MOSFET driver from 6 to 24fet - 4 parallel (75x4) so for sure when the bugs will be corrected, you can run 6fet 4,5kw, 12fet 9kw, etc..

User avatar
stancecoke   10 kW

10 kW
Posts: 896
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Mar 11 2018 10:08am

I promised to show some log-data of peak throttle vs. averaged thottle some weeks ago. So here you are. I've used a hm-05 bluetooth module to send the data to my smartphone while riding on the street. The log starts with turning the pedals backwards at standstill, then riding a litte distance, then turning and riding back. Shortly before end, I'm turning pedals backwards again.

throttle max vs. average.PNG
throttle max vs. average.PNG (79.15 KiB) Viewed 745 times

I had to improve the direction detection also, as it is quite tricky with the PAS-Signal of the modded torquesensor. I use a variable that is increased when foreward is detected and decreases when reverse is detected and is limited to the range of 0 ... 7. If the variable is bigger than 3, the flag for foreward turning pedals is set.

PAS direction detection.PNG
PAS direction detection.PNG (66.31 KiB) Viewed 745 times

regards
stancecoke
Last edited by stancecoke on Mar 11 2018 10:14am, edited 3 times in total.

1N4001   10 W

10 W
Posts: 72
Joined: Nov 28 2017 7:55am

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

Post by 1N4001 » Mar 11 2018 10:12am

honya96 wrote:
Mar 11 2018 9:47am
1N4001 wrote:
Mar 11 2018 8:22am
+1 on that hidden off-road mode :mrgreen: I like the idea of defaulting to limited mode unless a secret brake lever pattern is entered.

Do you happen to know the max gate charge the FETs may have before the risk of shoot-through becomes apparent with this firmware? I'm wondering if one could replace them with 120nC or 140nC FETs for improved efficiency and lower heat. For reference, the stock STP80NF70 have 75nC.
Best you can get is CSD19536(xxx) (down to 2.0mOhm) Tested by me - Working

https://cz.mouser.com/Search/Refine.asp ... d=CSD19536

These controllers use same MOSFET driver from 6 to 24fet - 4 parallel (75x4) so for sure when the bugs will be corrected, you can run 6fet 4,5kw, 12fet 9kw, etc..
Wait, so the 24 FET controllers just run 4 FETs in parallel? Interesting. I thought they paralled the gate drivers too, one per FET. Well, in that case up to 300nC should pose no problem at all. Thanks for the info!

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 11 2018 10:23am

1N4001 wrote:
Mar 11 2018 10:12am
Wait, so the 24 FET controllers just run 4 FETs in parallel? Interesting. I thought they paralled the gate drivers too, one per FET. Well, in that case up to 300nC should pose no problem at all. Thanks for the info!
Even Stock 24fet with 4410's (180nC max per MOSFET) exists. I Have 6,12,18fet and the MOSFET drivers look the same, Gates are parallel.

User avatar
stancecoke   10 kW

10 kW
Posts: 896
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Mar 11 2018 10:54am

honya96 wrote:
Mar 11 2018 5:46am
http://s.aliexpress.com/AryyqeER?fromSns=Copy
http://s.aliexpress.com/zINzeMzi?fromSns=Copy

I would like to try, if these work. I don't like the big bulky ones you have.
I've tested these "sempu"-sensors already. They work really fine, but they need a higher supply voltage than 5V. The third generation works with battery voltage directly.

regards
stancecoke

casainho   100 MW

100 MW
Posts: 2679
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Mar 11 2018 11:00am

stancecoke wrote:
Mar 11 2018 10:08am
I had to improve the direction detection also, as it is quite tricky with the PAS-Signal of the modded torquesensor. I use a variable that is increased when foreward is detected and decreases when reverse is detected and is limited to the range of 0 ... 7. If the variable is bigger than 3, the flag for foreward turning pedals is set.
Great! If I need, I will borrow your code :-)
Are you taking advantages on having the "full" PAS signal from the torque sensor? - I know you told about pedaling backwards and doing regen, are you using it?
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 11 2018 11:06am

stancecoke wrote:
Mar 11 2018 10:54am
tested these "sempu"-sensors already. They work really fine, but they need a higher supply voltage than 5V.
It's easy to run them straight from 15v supply :) do they work same as yours after the PAS mod or they would need external PAS?

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 11 2018 11:14am

@casainho - now I found that maybe the bugs I've reported were with the old fw. I wanted to test more today and I can't run it with THROTTLE_PAS

+ If I change more things in config and main to my needs, it fails to flash (as the first time I tried with tool.)

So maybe I didn't notice the flashing failed and was running old fw :?

Please can you add "timeout /t -1 /nobreak" to Start Compiling at github?

I have added it manually like 20 times already because if something fails I start with a fresh copy of the fw.

User avatar
stancecoke   10 kW

10 kW
Posts: 896
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Mar 11 2018 11:43am

casainho wrote:
Mar 11 2018 11:00am
Are you taking advantages on having the "full" PAS signal from the torque sensor?
I had to do the mod, as the µC on the PCB of my torquesensor is defective. This µC normally processes the two PAS-hall quadrature signals and generates the PAS pulses at the yellow wire.
The µC caused a short circuit, so I had to remove it. Therefore I'm using the raw signal of just one PAS hall now :D
I'm not using regen with pedaling backwards.

honya96 wrote:
Mar 11 2018 11:06am
do they work same as yours after the PAS mod or they would need external PAS?
There are two versions. One version puts out two PAS-signals (quadrature) and you have to do the direction detection by yourself. The other version does the detection internally and puts out one PAS signal (speed) and one direction signal.... At aliexpress the desciption of the green and the yellow wire are reversed.
As long as you don't want to use backpadaling for regen, you don't have to modify anything....

Image

regards
stancecoke

casainho   100 MW

100 MW
Posts: 2679
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Mar 11 2018 1:27pm

honya96 wrote:
Mar 11 2018 11:14am
Please can you add "timeout /t -1 /nobreak" to Start Compiling at github?

I have added it manually like 20 times already because if something fails I start with a fresh copy of the fw.
Don't know what you mean. Please send the file with the changes.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

1N4001   10 W

10 W
Posts: 72
Joined: Nov 28 2017 7:55am

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

Post by 1N4001 » Mar 11 2018 1:55pm

honya96 wrote:
Mar 11 2018 10:23am
Even Stock 24fet with 4410's (180nC max per MOSFET) exists. I Have 6,12,18fet and the MOSFET drivers look the same, Gates are parallel.
Wow, that's insane. It can deal with 720nC. What gate drivers are being used? I wonder if one could swap them out for faster ones, thus reducing dead time when switching.

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 11 2018 3:59pm

They are made of discrete components so you can improve them yourself

But I don't see a reason for that yet..

You can measure with oscilloscope if they are fast enough or not and then we can think about that :)

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 11 2018 4:01pm

casainho wrote:
Mar 11 2018 1:27pm
honya96 wrote:
Mar 11 2018 11:14am
Please can you add "timeout /t -1 /nobreak" to Start Compiling at github?

I have added it manually like 20 times already because if something fails I start with a fresh copy of the fw.
Don't know what you mean. Please send the file with the changes.
I mean adding that line to Start_Compiling.bat so we can see if it worked or not.

I think that if I remove ASSIST_LEVEL_PAS_ONLY it doesn't flash and if I change from torque sensor to throttle PAS it flashes but doesn't run.. I am not sure.. it just didn't work today in general.

User avatar
stancecoke   10 kW

10 kW
Posts: 896
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Mar 12 2018 2:56am

honya96 wrote:
Mar 11 2018 4:01pm

Please can you add "timeout /t -1 /nobreak" to Start Compiling at github?
I've added a "pause" command before "exit" in the master branch, I hope this works for you also.

regards
stancecoke

racingame   10 W

10 W
Posts: 95
Joined: Jan 26 2018 9:40am

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

Post by racingame » Mar 12 2018 9:08am

I just unmounted the S12S, but I don't know where I have to put the 4-pin header. There are 2 possible spots where it could fit: one has the name SOFT and the other one LIG. Which one is the correct one?

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 12 2018 9:13am

Lig Is for lights switching from lcd.

casainho   100 MW

100 MW
Posts: 2679
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Mar 12 2018 9:13am

racingame wrote:
Mar 12 2018 9:08am
I just unmounted the S12S, but I don't know where I have to put the 4-pin header. There are 2 possible spots where it could fit: one has the name SOFT and the other one LIG. Which one is the correct one?
SOFT.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

racingame   10 W

10 W
Posts: 95
Joined: Jan 26 2018 9:40am

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

Post by racingame » Mar 12 2018 10:50am

Does anyone know how the Hall sensor connector used in this Sunstar motor is called? I have to buy one to make an adapter for the Kunteng controller.

Image

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 12 2018 1:07pm

racingame wrote:
Mar 12 2018 10:50am
Does anyone know how the Hall sensor connector used in this Sunstar motor is called? I have to buy one to make an adapter for the Kunteng controller.

Image
I don't know that one, just do your search..

Or you can replace them all with xh2.54 you can buy whole set for few bucks

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 12 2018 1:08pm

stancecoke wrote:
Mar 12 2018 2:56am
honya96 wrote:
Mar 11 2018 4:01pm

Please can you add "timeout /t -1 /nobreak" to Start Compiling at github?
I've added a "pause" command before "exit" in the master branch, I hope this works for you also.

regards
stancecoke
Thank you :wink:

Post Reply