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

Electric Motors and Controllers
User avatar
Valopallo   100 W

100 W
Posts: 106
Joined: May 29 2018 1:37pm

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

Post by Valopallo » Mar 28 2021 10:02am

Vbruun wrote:
Mar 28 2021 4:36am
So for poor people, er can power the controller from the charger?
I have a spare 42V charger and I'm stepping it down with LM2596HV -module to 24-36V. It has a limit of 2.0A and the LM2596HV has 3A. Can it survive?
My battery blew it's 30A fuse twice so maybe lower voltage could prevent the mosfet burn right? I wonder if it matters that I test the motor specific angle with 36V because I'm going to eventually use it with 14S battery and higher voltage?

So If I change the controller parameters as undervoltage to 20V, overvoltage to 30V and max current to 3A, with max phase current to 6A, I could use the 24V input and I should see the same load difference but as in proportionally lower values than with 15A max current and 52V battery, probably safely finding the right motor specific angle. Right?
Last edited by Valopallo on Mar 29 2021 10:31am, edited 2 times in total.

sylvain_wm   100 mW

100 mW
Posts: 47
Joined: Feb 02 2020 6:09am

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

Post by sylvain_wm » Mar 28 2021 12:08pm

Hi,
I have a problem with my fatbike.
The max speed I got with a 48V battery was 35km/h.
I decided to get a 72V controller with a 72V battery to increase the max speed, but it doesn't work at all.
The max speed remains at 35km/h.
Does anyone have an idea?
Here is my config.h
config.h
(1.41 KiB) Downloaded 12 times
Another problem : the "battery current max" doesn't work. I set the "assist level 5" to 12 to limit the current.

Have a good day.

atkforever   100 mW

100 mW
Posts: 44
Joined: Sep 25 2019 2:17pm

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

Post by atkforever » Mar 29 2021 10:26am

What is the speed when unloaded (ie wheel in the air)?

I draw about 15A to remain at 38kph on flat so maybe your current limit is too low

User avatar
Valopallo   100 W

100 W
Posts: 106
Joined: May 29 2018 1:37pm

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

Post by Valopallo » Mar 29 2021 10:48am

stancecoke wrote:
Mar 28 2021 4:17am

This may be the speed limiting function. The speed oszillates with no load....
The gear ratio and speed limits were set to 100. Are there some other limiting factors?

I can only input 24V-42V (2.2A) from old charger and LM2596HV if I don't want to use my 52V battery.

EDIT: Ok. I think I found the correct motor specific angle. I used 24V from charger and LM2596HVS and was able to find an angle that was smooth and needed very little load by hand to respond to the low voltage.

I was about to try this parameter with 52V and once again the controller burned a fuse from my battery even though I didn't even had a chance to press the throttle. Something brakes the mosfet(s) and tries to kill the battery. What component I should test/repair to find out the cause?
Last edited by Valopallo on Mar 29 2021 1:35pm, edited 4 times in total.

sylvain_wm   100 mW

100 mW
Posts: 47
Joined: Feb 02 2020 6:09am

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

Post by sylvain_wm » Mar 29 2021 10:55am

atkforever wrote:
Mar 29 2021 10:26am
What is the speed when unloaded (ie wheel in the air)?

I draw about 15A to remain at 38kph on flat so maybe your current limit is too low
Hi, the speed when unloaded is the same (35km/h).
When I reach 35km/h the current decreases and I have no power anymore.
The max current doesn't change anything.

Vbruun   100 W

100 W
Posts: 155
Joined: Sep 26 2019 8:42am

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

Post by Vbruun » Mar 29 2021 1:50pm

Valopallo wrote:
Mar 29 2021 10:48am
stancecoke wrote:
Mar 28 2021 4:17am

This may be the speed limiting function. The speed oszillates with no load....
The gear ratio and speed limits were set to 100. Are there some other limiting factors?

I can only input 24V-42V (2.2A) from old charger and LM2596HV if I don't want to use my 52V battery.

EDIT: Ok. I think I found the correct motor specific angle. I used 24V from charger and LM2596HVS and was able to find an angle that was smooth and needed very little load by hand to respond to the low voltage.

I was about to try this parameter with 52V and once again the controller burned a fuse from my battery even though I didn't even had a chance to press the throttle. Something brakes the mosfet(s) and tries to kill the battery. What component I should test/repair to find out the cause?
Are you sure that your controller is a 48v version?

User avatar
Valopallo   100 W

100 W
Posts: 106
Joined: May 29 2018 1:37pm

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

Post by Valopallo » Mar 29 2021 2:39pm

Vbruun wrote:
Mar 29 2021 1:50pm
Valopallo wrote:
Mar 29 2021 10:48am
stancecoke wrote:
Mar 28 2021 4:17am

This may be the speed limiting function. The speed oszillates with no load....
The gear ratio and speed limits were set to 100. Are there some other limiting factors?

I can only input 24V-42V (2.2A) from old charger and LM2596HV if I don't want to use my 52V battery.

EDIT: Ok. I think I found the correct motor specific angle. I used 24V from charger and LM2596HVS and was able to find an angle that was smooth and needed very little load by hand to respond to the low voltage.

I was about to try this parameter with 52V and once again the controller burned a fuse from my battery even though I didn't even had a chance to press the throttle. Something brakes the mosfet(s) and tries to kill the battery. What component I should test/repair to find out the cause?
Are you sure that your controller is a 48v version?
Caps are rated 63V so I'd imagine yes.

The model is actually KT24/36SVPR-GLT2F but I have been in that impression that this can handle 59V because the caps are 63V. Am I wrong?

EDIT: I changed the mosfets once again and tried with 42V straight from the charger. I noticed that bluOSEC show a load of 8.5A without throttle, without brake and withtout motor connected. I noticed this also the first time it burned mosfets. Only when I used 24V I did not saw that idle current draw and was able to spin the motor. Even then it felt like there was some sort of limit the controller would reach before resetting and starting over. How to troubleshoot?

I think the motor can't handle 59V because of it's windings are rated to 36V. Could this cause the idle load?

Vbruun   100 W

100 W
Posts: 155
Joined: Sep 26 2019 8:42am

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

Post by Vbruun » Mar 30 2021 4:31am

No. The motor should not see any current when the controller is idle.

I don't know what is wrong, but buy a 48v rated controller and Gry again if you want to get this to work

User avatar
Valopallo   100 W

100 W
Posts: 106
Joined: May 29 2018 1:37pm

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

Post by Valopallo » Mar 30 2021 4:51am

EDIT: Both controllers burned mosfets because of the freaking angle! just right when I was about to go and test the bike. I hate this hobby. Let's continue.

User avatar
Valopallo   100 W

100 W
Posts: 106
Joined: May 29 2018 1:37pm

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

Post by Valopallo » Apr 01 2021 10:50am

Ok. Now that I have chilled a little. Let's buy the 7th and 8th controllers for this project but please help me.
Before doing anything stupid, let me get this workflow straight( and sum up what I have learned this winter):

1. When the new controller arrives, I test the motor with the controller first to find the working phase wire combination with original firmware.
2. I must update both BluOSEC and github files to the newest ones.
3. Once I find the right combination that works I can flash OSEC and refer to that found combination as motor specific angle = 0.
4. Once flashed I can tweak the angle by steps of 5 if needed. To do this I must flash again with lower voltage(24V) because I don't have a lab PSU but a charger and also lower the battery and phase current to somewhere 10A and 20A to help save the mosfets from wrong angle.
5. Once I find the motor specific angle that draws less current than the other angles, I can flash again with normal voltage(14s Battery) and normal currents for battery and phase.
6. If for some reason it happens that the throttle stays on, I can put throttle min higher.
7. If for some reason speed oscillates I may try to lower both Gain values.
(8. anything else to prevent this from happening again?)

Should I buy 12 FET's or should the 6 fet's do fine? If I buy the 12 fet ones, can they operate under 24V and 10A and 20A @ testing conditions if needed? What modifications do I have to do to 12 fet controller to be able to use it with OSEC? I don't use torque, but PAS and throttle only.
Battery is 14S.
Front motor is generic small geared hub motor with ratings of 250W and 36V on label.
Rear motor is Shengyi Hybrid which is rated for 500W and 48V.

Any comments?
Last edited by Valopallo on Apr 01 2021 11:29am, edited 1 time in total.

szkuba   10 mW

10 mW
Posts: 29
Joined: Nov 26 2018 2:56pm

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

Post by szkuba » Apr 01 2021 11:02am

Tepa76 wrote:
Mar 26 2021 2:26am
Hi,

Just received Erider T9 torq sensor to be later added for my Kunteng 6fet controller. Because the rumours of quality issues and broken sensors i did following founding’s.

1. Cadence output has different topology than regular PAS sensor.
T9 Cad output is sourcing 4.1 volt at high state and grounded at low!
Kunteng has also sourcing input to 5v via internal pullup.. right? This might lead to issues? (how is this in Lishuis? pullup to 3.3v?)
This might be solved by removing pullup flag from input and also swich from falling to rising edge might be considered (not necessary).

I had also a parallel project where i use a ESP32 (3.3v) with Zwift game for deliver cad and torq... there i add a n-fet on that input and feed T9 cadence signal through it. Works but needed to change for rising for proper edge detection....

.......
br,
Tep76
Can you please describe what is the standard PAS operation then? I though the way how you described T9 is common to all PAS units?

geofft   1 kW

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

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

Post by geofft » Apr 01 2021 11:55am

Valopallo wrote:
Apr 01 2021 10:50am
Ok. Now that I have chilled a little. Let's buy the 7th and 8th controllers for this project but please help me.
Before doing anything stupid, let me get this workflow straight( and sum up what I have learned this winter):


7. If for some reason speed oscillates I may try to lower both Gain values.
(8. anything else to prevent this from happening again?)

Should I buy 12 FET's or should the 6 fet's do fine? If I buy the 12 fet ones, can they operate under 24V and 10A and 20A @ testing conditions if needed? What modifications do I have to do to 12 fet controller to be able to use it with OSEC? I don't use torque, but PAS and throttle only.
Battery is 14S.
Front motor is generic small geared hub motor with ratings of 250W and 36V on label.
Rear motor is Shengyi Hybrid which is rated for 500W and 48V.

Any comments?
I'd be inclined to use a lower Gain I value to start with, I find that the default of 0.2 gives quite an aggressive current ramp up which caused some issues on my setup. I've now reduced this to 0.05, this means I can slam full throttle from standstill and get smooth pull away with no motor stuttering. Every installation is different of course, but worth bearing in mind, you can always try increasing it later when things are running ok.

I would think that 6-fet should be fine for your motor, I regularly pull 800w plus with mine (at 12s, 44.4v) with no controller issues. This would occasionally blow the 20a battery fuse if I hit full throttle at the bottom of a steep ramp, but reducing Gain I (as above) seems to have prevented this.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 6-fet, LCD3, 48v 12s lipo.

User avatar
Valopallo   100 W

100 W
Posts: 106
Joined: May 29 2018 1:37pm

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

Post by Valopallo » Apr 01 2021 1:23pm

geofft wrote:
Apr 01 2021 11:55am

I'd be inclined to use a lower Gain I value to start with, I find that the default of 0.2 gives quite an aggressive current ramp up which caused some issues on my setup. I've now reduced this to 0.05
Thanks. I will try that. That might save me some hassle in the future. Wikistuff IMO

EDIT: I actually was able to save one controller by changing the mosfets and tried with the lower Gain I = 0.1 and it worked pretty well for a while. At first the motor worked like it was reduced of power on the test run and after 1km it burned mosfets and a fuse from battery. I noticed also that the motor stayed still a few minutes when idle but after that it spun the wheel lightly and moved on it's own. It still feels like there's some current building and after a while, the motor spins and the current is released. Also If I brake hard the controller boots.
All of this happens also with lowered voltage(24V) and lowered amps(battery 7A, phase 14A).
What to print out from blueterm?
How to use dc static zero to find out motor angle?

User avatar
Valopallo   100 W

100 W
Posts: 106
Joined: May 29 2018 1:37pm

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

Post by Valopallo » Apr 03 2021 6:23am

This is what Blueterm returns with parameters:

Code: Select all

ui16_setpoint, uint32_current_target, ui16_BatteryCurrent, ui16_sum_torque, ui16_adc_read_battery_voltage(), ui16_motor_speed_erps
Idle:

Code: Select all

0, 320, 322, 0, 402, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 401, 0
PAS:

Code: Select all

0, 320, 321, 0, 402, 0
0, 320, 321, 0, 402, 5
0, 320, 321, 0, 402, 5
0, 320, 320, 0, 409, 6
0, 320, 320, 0, 440, 7
0, 320, 320, 0, 479, 7
0, 323, 320, 0, 511, 8
7, 336, 320, 0, 522, 8
6, 324, 321, 0, 519, 8
6, 323, 321, 0, 509, 8
8, 323, 320, 0, 499, 8
9, 324, 320, 0, 503, 8
10, 325, 321, 0, 513, 8
12, 326, 321, 0, 535, 9
12, 327, 324, 0, 563, 10
12, 327, 328, 0, 603, 11
12, 327, 326, 0, 638, 11
14, 327, 324, 0, 644, 11
12, 326, 328, 0, 643, 11
13, 327, 327, 0, 623, 11
13, 327, 327, 0, 593, 11
14, 327, 327, 0, 553, 10
13, 327, 328, 0, 511, 10
14, 327, 326, 0, 472, 10
14, 327, 327, 0, 434, 9
11, 326, 330, 0, 406, 8
12, 326, 327, 0, 402, 7
12, 326, 325, 0, 401, 7
11, 326, 327, 0, 402, 7
11, 326, 327, 0, 416, 8
12, 326, 325, 0, 434, 8
12, 326, 325, 0, 455, 8
11, 326, 327, 0, 458, 8
11, 326, 326, 0, 444, 8
12, 327, 326, 0, 422, 8
12, 326, 325, 0, 406, 8
12, 326, 327, 0, 402, 8
11, 326, 327, 0, 405, 7
12, 326, 326, 0, 436, 7
12, 326, 325, 0, 485, 8
12, 326, 325, 0, 528, 9
12, 326, 325, 0, 528, 10
12, 326, 325, 0, 501, 9
13, 327, 326, 0, 441, 8
13, 327, 325, 0, 402, 8
15, 327, 322, 0, 402, 7
18, 329, 321, 0, 402, 7
20, 330, 322, 0, 402, 5
23, 331, 322, 0, 402, 5
24, 325, 321, 0, 401, 4
23, 322, 322, 0, 401, 4
22, 320, 321, 0, 402, 0
22, 320, 321, 0, 402, 0
21, 320, 322, 0, 402, 2
20, 320, 322, 0, 402, 2
20, 320, 322, 0, 402, 0
19, 320, 322, 0, 402, 0
It takes a long time before things go back to the Idle state:

Code: Select all

19, 320, 322, 0, 402, 0
19, 320, 322, 0, 401, 0
18, 320, 322, 0, 401, 0
18, 320, 322, 0, 402, 0
17, 320, 322, 0, 401, 0
16, 320, 322, 0, 402, 0
16, 320, 322, 0, 402, 0
15, 320, 322, 0, 402, 0
15, 320, 322, 0, 402, 0
14, 320, 322, 0, 402, 0
13, 320, 322, 0, 402, 0
13, 320, 322, 0, 402, 0
12, 320, 322, 0, 402, 0
12, 320, 322, 0, 402, 0
11, 320, 322, 0, 402, 0
10, 320, 322, 0, 402, 0
10, 320, 322, 0, 401, 0
9, 320, 322, 0, 402, 0
9, 320, 322, 0, 402, 0
8, 320, 322, 0, 402, 0
7, 320, 322, 0, 402, 0
7, 320, 322, 0, 402, 0
6, 320, 322, 0, 402, 0
6, 320, 322, 0, 402, 0
5, 320, 322, 0, 402, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 402, 0
0, 321, 322, 0, 402, 0
0, 324, 322, 0, 401, 0
5, 328, 322, 0, 402, 0
7, 331, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 401, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 401, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 401, 0
5, 322, 322, 0, 401, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 401, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 401, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 401, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 401, 0
5, 322, 322, 0, 401, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 401, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 401, 0
5, 322, 322, 0, 401, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 401, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 401, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
5, 322, 322, 0, 402, 0
0, 321, 322, 0, 402, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 401, 0
And when I use throttle after that, this happens before the controller boots itself, and supposedly this is also what happens when the mosfet burns at least according to the symptoms.

Code: Select all

0, 320, 322, 0, 401, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 402, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 401, 0
0, 320, 322, 0, 402, 0
0, 324, 322, 0, 402, 0
0, 330, 322, 0, 402, 0
7, 335, 322, 0, 402, 0
6, 324, 322, 0, 402, 0
6, 323, 322, 0, 402, 0
6, 323, 322, 0, 402, 0
6, 323, 322, 0, 402, 0
7, 323, 322, 0, 402, 0
7, 323, 322, 0, 401, 0
7, 323, 322, 0, 402, 0
8, 324, 322, 0, 401, 0
9, 324, 322, 0, 402, 0
9, 324, 322, 0, 402, 0
10, 325, 322, 0, 402, 0
11, 326, 322, 0, 402, 0
13, 326, 322, 0, 402, 0
14, 327, 322, 0, 402, 0
17, 328, 322, 0, 402, 0
19, 330, 322, 0, 401, 0
22, 332, 322, 0, 402, 0
26, 333, 322, 0, 402, 0
30, 336, 323, 0, 401, 0
35, 338, 323, 0, 401, 0
41, 341, 323, 0, 401, 0
48, 345, 324, 0, 401, 0
56, 349, 326, 0, 401, 0
63, 354, 329, 0, 400, 0
68, 356, 339, 0, 400, 0
69, 357, 347, 0, 400, 0
75, 360, 343, 0, 400, 0
83, 365, 341, 0, 399, 0
91, 368, 344, 0, 399, 0
99, 373, 347, 0, 230, 0
83, 320, 342, 0, 235, 0
Throttle didn't spin the wheel at all before booting.

This test was made 24V and Battery current 7A, Phase current 14A so that I don't burn more mosfets or fuses from the battery.
I'm not sure should I be still looking for the different motor specific angle or something else, because I think that this angle I have found works. At least there's no bad start and also I have made a test run with this angle.
Here's also the parameter screenshot of the testing situation:
testing24V_7A.jpg
testing24V_7A.jpg (499.62 KiB) Viewed 290 times
What's happening here?

User avatar
Valopallo   100 W

100 W
Posts: 106
Joined: May 29 2018 1:37pm

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

Post by Valopallo » Apr 03 2021 8:34am

It seems I have to dig in to this deeply so I might as well learn how to properly use the firmware then. :D
wiki wrote:Hall Angle 4: Defines the rotor angle assigned to Hall pattern 4. (Hall patterns shown here) Usually does not need to be changed. This can be used to compensate for manufacturing inaccuracies in the Hall sensor positioning, which can manifest themselves, for example, in noisy running or vibrations. In the BluOsec App, the phase current display indicates in which direction the angle must be changed in order to achieve a smoother run. In the hall order diagram there are also suggestions on how to change the angles (left column) based on actual pwm cycles in each phase (right column)
Screenshot_20210403-162028.png
Screenshot_20210403-162028.png (371.48 KiB) Viewed 277 times
This is a screenshot I took while using PAS. So my angle correction is 23(degrees) What does that mean? I can also see the numbers on both sides but I don't have a clue.

What should I be able to read from this. I have tried every single thing I can come up with but no improvement to the motor idle load/spinning on it's own and system booting when braking.
Last edited by Valopallo on Apr 05 2021 4:26pm, edited 8 times in total.

sylvain_wm   100 mW

100 mW
Posts: 47
Joined: Feb 02 2020 6:09am

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

Post by sylvain_wm » Apr 03 2021 1:20pm

Hi,
I'm a bit lost...
the max speed I get with the BluOSEC app or in diagnostics mode is 66km/h and the max speed is 37km/h with the KT-LCD3... as if the display interferes with the controller.
I spent days trying to find a solution but I didn't find anything...

Does anyone have an idea?

Have a good day.

I got rid of a few lines from the display.c :
if (lcd_configuration_variables.ui8_max_speed != ui8_speedlimit_kph) {
ui8_speedlimit_kph = lcd_configuration_variables.ui8_max_speed;
eeprom_write(OFFSET_MAX_SPEED_DEFAULT, lcd_configuration_variables.ui8_max_speed);
}

And it works well now.

User avatar
Valopallo   100 W

100 W
Posts: 106
Joined: May 29 2018 1:37pm

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

Post by Valopallo » Apr 06 2021 7:24pm

For those who want to optimize the waveform of their firmware, I've made a short tutorial. Once I figured this out life got better. It took a bit of tinkering and I also realized that some beginners might find this helpful.
diagram.jpg
diagram.jpg (56.91 KiB) Viewed 177 times
In this diagram of BluOSEC app we can see there is some correction needed although the wave looks pretty decent. The angles at the bottom are lined in order of states; HALL5, HALL4, HALL6, HALL2, HALL3 ,HALL1, HALL5. We can also find from the BluOSEC app our correction value and in this situation it's 23 degrees but we don't know to what direction that correction happens. So let's look for the bottom row of angles, let's call them true angles for the sake of explanation;
319,21,84,136,203,262,319

That row should look like this ideally. We'll call them target angles because we are targeting to the smoothest possible waveform;
300,0,60,120,180,240,300

So we see that our angles are a bit in advance rather than late. So in order to make those angles match we need to turn the angles backwards(subtract) in our math and we already know that we must turn all of them 23 degrees because the correction angle is fixed.
So we subtract 23 degrees from all of the true angles and we are left with this row which obviously has no ideal waveform:
296, -2, 61, 113, 180, 239, 296

You might already notice that only one of these subtractions left us with a target angle value. That's our correction angle. In this case mine was the fifth number from the left, HALL state 3 @ 180 degrees.
The correction angle is fixed so we cannot put individual correction angles to every HALL but we can turn the individual HALL angles so that they match the 23 degree correction angle waveform.
So we compare each HALL's target angle and true angle individually.

296+4 =300 -> angle must be changed +4 degrees
-2+2=0 -> angle must be changed +2 degrees
61-1=60 -> angle must be changed -1 degrees
113+7=120 -> angle must be changed +7 degrees
180+/-0=180 -> angle must be changed 0 degrees
239+1=240 -> angle must be changed +1 degrees
296+4=300 -> angle must be changed +4 degrees

We cannot just input the angles straight to the Javatool/BluOSEC so we must first convert these to ADC values(8bit). When you want to convert angles to ADC(8bit) values use this formula to get the multiplier: 255/360=0,708 = ADC value of 1 degree. Then round the decimals to the closest . So the calculations go as:

(255/360) x 4 = 2,8 = 3
(255/360) x 2 = 1,416 = 2
(255/360) x 1 = 0,708 = 1
(255/360) x 7 = 4,9 = 5
(255/360) x 0 = 0
(255/360) x 1 = 0,708 = 1
(255/360) x 2,8 = 3

Now we simply have to add or subtract these ADC values with/from the default values as follows. Remember when to add and when to subtract according to the direction that goes from the true angle to the target angle!
So finally in this case the optimal values should look like this.

213+3=216
0+3= 3
43-1= 42
86+5=91
127+0=127
171+1= 172
213+3=216

You can double check the angles by converting the ADC values to angles with the formula: 360/255= 1,411.
Also, there are some interpolation settings that may help smoothen the ride. For myself changing the interpolation from 60 degrees to 360 degrees did a huge improvement. Please correct me if you found an error here so we spread only valid information.

EDIT: Removed the relation to mosfet burn.
Last edited by Valopallo on Apr 07 2021 2:26am, edited 1 time in total.

User avatar
stancecoke   100 kW

100 kW
Posts: 1407
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

Post by stancecoke » Apr 07 2021 1:25am

Valopallo wrote:
Apr 06 2021 7:24pm
For those who want to optimize the waveform of their firmware
Thank you for your feedback!
Valopallo wrote:
Apr 06 2021 7:24pm
find this helpful before burning a truck load of mosfets
Sorry, but the fine tuning of the Hall angles has nothing to do with burned mosfets.
The critical parameter is the motor specific angle.

I don't know, if the graph looks still the same, but in the post before you see clearly the correction value is directly running to nirvana.
correction angle.JPG
correction angle.JPG (28.36 KiB) Viewed 164 times
This indicates, the motor specific angle is completly wrong, or the phase current sensor isn't working properly.
The BluOSEC app offers a procedure, how to find the motor specific angle, see the wiki. There is the hint also, that in some controllers the phase current sensor is shortened by a solder blob.

As I don't use the BluOsec-app, I recomment this procedure:
Disable the rotor angle correction first. Find the motor specific angle, where the motor draws the least current at idle run. Then reactivate the angle correction. Now the correction value should vary a little with speed and load, but not run to the limit directly.

If it still runs to the limit, there is something wrong with your phase current sensor...

regards
stancecoke

Manbeer   100 W

100 W
Posts: 161
Joined: Aug 07 2020 5:59pm

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

Post by Manbeer » Apr 07 2021 7:27am

I tried to find more information on whether or not this works with the 6fet Hailong internal controllers And I found a few people that mentioned doing it but nobody ever really posted whether or not it worked for the outcome from what I saw. Anyone running this first hand that can say whether or not it's a go?

User avatar
Valopallo   100 W

100 W
Posts: 106
Joined: May 29 2018 1:37pm

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

Post by Valopallo » Apr 07 2021 9:41am

stancecoke wrote:
Apr 07 2021 1:25am
If it still runs to the limit, there is something wrong with your phase current sensor...
How can I test the sensor operation?

I found a new motor specific angle that felt good with lowered amps(7A,14A) and the correction value remained normal straight line now. I got my correction angle changed to 7 degrees from 23 on it's own. So this means, I'm closer to the correct motor specific angle I assume.

There is still some problems with the phase currents because when I raised them up to 15A battery and 30A phase the motor won't spin at all. It actually locks on it's place and tries to turn backwards a bit. Is this because of the faulty phase current sensor or because of the wrong motor specific angle? When i lowered them back to 10A and 20A the motor works but the BluOSEC crashes sometimes.

There's still some slow wheel spinning left when I brake and if I brake heavily the system boots itself. What parameters I should be looking to solve this symptom. Or could this also be because of the faulty phase current sensor or wrong motor specific angle?

User avatar
stancecoke   100 kW

100 kW
Posts: 1407
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

Post by stancecoke » Apr 07 2021 1:25pm

Valopallo wrote:
Apr 07 2021 9:41am
I raised them up to 15A battery and 30A phase the motor won't spin at all.
What do you get for the control state in this case?
https://github.com/stancecoke/BMSBatter ... leshooting

regards
stancecoke

Vbruun   100 W

100 W
Posts: 155
Joined: Sep 26 2019 8:42am

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

Post by Vbruun » Apr 07 2021 2:33pm

Manbeer wrote:
Apr 07 2021 7:27am
I tried to find more information on whether or not this works with the 6fet Hailong internal controllers And I found a few people that mentioned doing it but nobody ever really posted whether or not it worked for the outcome from what I saw. Anyone running this first hand that can say whether or not it's a go?
I did the 9 fet hailong controller - that worked beatifully

User avatar
Valopallo   100 W

100 W
Posts: 106
Joined: May 29 2018 1:37pm

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

Post by Valopallo » Apr 07 2021 3:37pm

stancecoke wrote:
Apr 07 2021 1:25pm
Valopallo wrote:
Apr 07 2021 9:41am
I raised them up to 15A battery and 30A phase the motor won't spin at all.
What do you get for the control state in this case?
https://github.com/stancecoke/BMSBatter ... leshooting

regards
stancecoke
Thanks for the help once again! I had changed my GAIN I and GAIN P values 10x smaller than what I had previously at 42V. So it seems now that the bike operates as it has been operating for 3 years at least @ 30V voltage. I'll try tomorrow with the 14S battery and see how it reacts. All the symptoms are gone, Hall angles are fine tuned, correct motor specific angle was found and learned a bunch of new in depth lessons about this firmware along the way.

Only thing is I might have to buy one more(5th) controller for the front motor or try to troubleshoot the damage it has. It released this magical blue smoke of death when testing 78L05 on board but I think I might be able to locate the part and replace it. Any guesses what look from it? I applied 12V to the 78L05 vin and gnd pins to test it's output and once I hooked the power something popped in front of the mosfets. I think it's one of those small surface mounted red ones with black stripe and thick gel. I'll snap a photo tomorrow if I decide to attempt to repair it.

Manbeer   100 W

100 W
Posts: 161
Joined: Aug 07 2020 5:59pm

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

Post by Manbeer » Apr 07 2021 7:13pm

Vbruun wrote:
Apr 07 2021 2:33pm
Manbeer wrote:
Apr 07 2021 7:27am
I tried to find more information on whether or not this works with the 6fet Hailong internal controllers And I found a few people that mentioned doing it but nobody ever really posted whether or not it worked for the outcome from what I saw. Anyone running this first hand that can say whether or not it's a go?
I did the 9 fet hailong controller - that worked beatifully
awesome, thats just what i wanted to hear! thank you

Vbruun   100 W

100 W
Posts: 155
Joined: Sep 26 2019 8:42am

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

Post by Vbruun » Apr 08 2021 1:21am

[/quote]

awesome, thats just what i wanted to hear! thank you
[/quote]

Just be careful when removing the potting compound. I would try an adjustable soldering iron at 100c. Personally, I drilled the stuff away, but I destroyed one of the through hole eyelets in the process because my drill was a little too large.
It still worked though, just straight up poking a wire into the mess I made ;)

Post Reply