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: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW

Post by honya96 » Sep 30 2018 5:36pm

randysway wrote:
Sep 30 2018 5:20pm
BTW, If you have the pad assignments for Throttle, Hall V+ and Brake Low, written down somewhere, mind sharing them? I'm getting better at tracing leads back to the CPU pins, but I don't think practice is going remedy the headache. :D
Throttle plus - TH
Signal - TS
Gnd - G2

First picture is red,white hall and yellow pas signal

Second picture is hall signal

Third is display

4th is brake.
Attachments
20181001_002950-1134x2016.jpg
20181001_003031-1134x2016.jpg
20181001_002835-1134x2016.jpg
20181001_002706-1134x2016.jpg

Huong Tan Dong   1 µW

1 µW
Posts: 1
Joined: Sep 29 2018 4:56am

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

Post by Huong Tan Dong » Oct 03 2018 5:48am

Hello friends!
I do not understand much about compilers.
I find this project very interesting and useful. I am trying to find the Hex File and the best circuit for this project without seeing. I need some help.
I'm so grateful.
Thank you very much!
My email:
huongtandong2009781@gmail.com

Valopallo   100 mW

100 mW
Posts: 44
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 » Oct 03 2018 6:49am

honya96 wrote:
Sep 19 2018 2:23pm
Valopallo wrote:
Sep 18 2018 8:45am

Ok. Finally got the time to open the battery case. Do these pictures give any information about my BMS or it's overcurrent protection?

https://imgur.com/a/30EvYLc

EDIT: Found it. http://www.spardbattery.com/PW-10SM-30092-2-20
If you need more power, you can connect discharge without bms, just a fuse. And still have safe charging through bms. :wink:
Ok. Interesting. If I bypass the BMS when discharging, how much current can I get out from my cells? The cells are marked as Samsung ICR18650-26F with rating of 5A continuous work current. Is there some way to calculate the discharge current limits for the whole pack then? The BMS specs say peak work current is 60-100A. So how does this relate to the scenario if anything at all? Also, one more question; If I discharge without the bms, I simply just mod the battery pack's discharge line so that the current bypasses the bms and instead passes only through the fuse, right?
BluOSEC@36V|15A|S06S|rear DD|MTB|Hardtail|Tunturi

honya96   1 kW

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

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

Post by honya96 » Oct 03 2018 7:03am

Right, easy.

But I wouldnt push them too much over these 5A..

Install a $1 thermometer on it, temp and voltage drop under load is the only limit.

you can't run 40A.. But more than 15 for sure.

Valopallo   100 mW

100 mW
Posts: 44
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 » Oct 03 2018 10:13am

honya96 wrote:
Oct 03 2018 7:03am
Right, easy.

But I wouldnt push them too much over these 5A..

Install a $1 thermometer on it, temp and voltage drop under load is the only limit.

you can't run 40A.. But more than 15 for sure.
Ok. Just for the clarification; is the S12S's 25A max current too much for these cells?

I calculated the capacity of the battery pack as follows;

Max. Discharge Current: 5200mA
Nominal Capacity: 2600mAh
Battery pack capacity: 10.4Ah

5,2A/2,6Ah=2C
2C*10,4Ah=20,8A

So the maximum draw would be 20,8A for this pack. Is it safe to use the S12S(25A max) -controller or is it still way too overkill compared to the S06S(15A max)?
BluOSEC@36V|15A|S06S|rear DD|MTB|Hardtail|Tunturi

honya96   1 kW

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

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

Post by honya96 » Oct 03 2018 10:24am

Matters only what current you set.. 25 should be ok as peak. But you can't still hold full throttle.

Valopallo   100 mW

100 mW
Posts: 44
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 » Oct 03 2018 10:37am

honya96 wrote:
Oct 03 2018 10:24am
Matters only what current you set.. 25 should be ok as peak. But you can't still hold full throttle.
Yes, I totally forgot that the firmware gives the option to lower the current from the controllers max draw, doh. So I assume that the 20,8A continuous draw that generates 748W is all I got for the maximum power of this S12S setup to hold full throttle and it doesn't really do that much change if I let the BMS be intact on the discharge because the continuous work current is limited to 20A. But, if I want to test my S12S before this firmware, could the S12S work at all or does the BMS shut down the 25A draw? If so, then I have to disconnect the BMS from discharge either way, right?
Last edited by Valopallo on Oct 03 2018 10:57am, edited 1 time in total.
BluOSEC@36V|15A|S06S|rear DD|MTB|Hardtail|Tunturi

honya96   1 kW

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

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

Post by honya96 » Oct 03 2018 10:48am

Valopallo wrote:
Oct 03 2018 10:37am
honya96 wrote:
Oct 03 2018 10:24am
Matters only what current you set.. 25 should be ok as peak. But you can't still hold full throttle.
Yes, I totally forgot that the firmware gives the option to lower the current from the controllers max draw, doh. What happens if I full throttle then?
You will overheat the battery or hit low voltage cutoff even if the battery still has charge at lower draw.

If you want to push limits, you have to watch the temperature.

Even stock fw can be set to half the full current.

geofft   1 kW

1 kW
Posts: 351
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 » Oct 03 2018 10:49am

Had some time spare today so gave the latest master branch a try. On first testing I shot up the road like a scalded cat, then realised that Battery and Phase Current max are now calculated differently and need much lower numbers than before. After putting this right everything calmed down and seemed to work well.

The only issue I noticed was the PAS detection, which seems unable to detect reverse pedalling and triggers the motor fully in either pedal direction. Changing the 'PAS Threshold' setting seemed to have no effect whatsoever. Was riding in throttle/pas mode, config.h attached below.

Other than this all seemed to work well, with some 'interesting' new settings to play with I see.... :D
Attachments
config.h
(1.29 KiB) Downloaded 74 times
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

Valopallo   100 mW

100 mW
Posts: 44
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 » Oct 03 2018 11:00am

honya96 wrote:
Oct 03 2018 10:48am
Valopallo wrote:
Oct 03 2018 10:37am
honya96 wrote:
Oct 03 2018 10:24am
Matters only what current you set.. 25 should be ok as peak. But you can't still hold full throttle.
Yes, I totally forgot that the firmware gives the option to lower the current from the controllers max draw, doh. What happens if I full throttle then?
Even stock fw can be set to half the full current.
How is this done?
BluOSEC@36V|15A|S06S|rear DD|MTB|Hardtail|Tunturi

honya96   1 kW

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

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

Post by honya96 » Oct 03 2018 11:03am

Valopallo wrote:
Oct 03 2018 11:00am
honya96 wrote:
Oct 03 2018 10:48am
Valopallo wrote:
Oct 03 2018 10:37am
honya96 wrote:
Oct 03 2018 10:24am
Matters only what current you set.. 25 should be ok as peak. But you can't still hold full throttle.
Yes, I totally forgot that the firmware gives the option to lower the current from the controllers max draw, doh. What happens if I full throttle then?
Even stock fw can be set to half the full current.
How is this done?
Read manual for lcd3

User avatar
stancecoke   100 kW

100 kW
Posts: 1036
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 » Oct 03 2018 12:45pm

geofft wrote:
Oct 03 2018 10:49am
Changing the 'PAS Threshold' setting seemed to have no effect whatsoever.
Thank you for testing and the feedback!
Have you tried the android app already? You can get the PAS ratio displayed there, so can see the values for foreward and reverse pedaling.

regards
stancecoke

geofft   1 kW

1 kW
Posts: 351
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 » Oct 03 2018 2:31pm

stancecoke wrote:
Oct 03 2018 12:45pm
geofft wrote:
Oct 03 2018 10:49am
Changing the 'PAS Threshold' setting seemed to have no effect whatsoever.
Have you tried the android app already?
..not yet, but will do soon.
You can get the PAS ratio displayed there, so can see the values for foreward and reverse pedaling.
I tried values from 1.0 to 2.8 for 'PAS Threshold' - strangely, none of these settings made any difference, I think the answer to this lies elsewhere..?
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

User avatar
Xnyle   10 W

10 W
Posts: 74
Joined: Sep 03 2018 1:05pm

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

Post by Xnyle » Oct 03 2018 3:18pm

Not sure, if 2.8 is enough.

For me it's 3.2 when pedalling normal. Although my sensor does not send any signal when pedaling backwards so I can't test that detection functionality at all.

geofft   1 kW

1 kW
Posts: 351
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 » Oct 03 2018 4:02pm

Xnyle wrote:
Oct 03 2018 3:18pm
Not sure, if 2.8 is enough.

For me it's 3.2 when pedalling normal. Although my sensor does not send any signal when pedaling backwards so I can't test that detection functionality at all.
Ok, I'll try some higher values tomorrow.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

geofft   1 kW

1 kW
Posts: 351
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 » Oct 04 2018 7:17am

geofft wrote:
Oct 03 2018 4:02pm
Xnyle wrote:
Oct 03 2018 3:18pm
Not sure, if 2.8 is enough.

For me it's 3.2 when pedalling normal. Although my sensor does not send any signal when pedaling backwards so I can't test that detection functionality at all.
Ok, I'll try some higher values tomorrow.
It seems that whatever value is entered for 'Pas Threshold' has no effect on this, even stupid stuff like 0 or 100. It would appear that this setting is being totally ignored by the firmware....?
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

User avatar
stancecoke   100 kW

100 kW
Posts: 1036
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 » Oct 04 2018 9:55am

geofft wrote:
Oct 04 2018 7:17am
It would appear that this setting is being totally ignored by the firmware....?
Hm, it should work in the same way as in the older commits...

Code: Select all

if (ui8_PAS_Flag == 1) {
		ui8_PAS_Flag = 0; //reset interrupt flag

		ui16_time_ticks_between_pas_interrupt = ui16_time_ticks_for_pas_calculation; //save recent cadence
		ui16_PAS_High = ui16_PAS_High_Counter;

		if ((0 == (ui16_aca_flags & PAS_INVERTED)) && ((float) ui16_time_ticks_between_pas_interrupt / (float) ui16_PAS_High > flt_s_pas_threshold)) {
			if (PAS_act < 7) {
				PAS_act++;
			}
		} else if ((PAS_INVERTED == (ui16_aca_flags & PAS_INVERTED)) && ((float) ui16_time_ticks_between_pas_interrupt / (float) ui16_PAS_High < flt_s_pas_threshold)) {
			if (PAS_act < 7) {
				PAS_act++;
			}
		} else {
			if (PAS_act > 0) {
				PAS_act--;
			}
		}
Please install the BluOsec app and check the values of PAS ratio (choose the item pasFraction in the dropdown in one of the fields of the most left screen)

Screenshot_2018-10-04-16-30-13.png
Screenshot_2018-10-04-16-30-43.png
regards
stancecoke

geofft   1 kW

1 kW
Posts: 351
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 » Oct 04 2018 10:37am

stancecoke wrote:
Oct 04 2018 9:55am
geofft wrote:
Oct 04 2018 7:17am
It would appear that this setting is being totally ignored by the firmware....?
Hm, it should work in the same way as in the older commits...
Very strange, I rechecked the previous commit I was using (downloaded 5th Sept), the PAS detection with this works just fine.
Please install the BluOsec app and check the values of PAS ratio (choose the item pasFraction in the dropdown in one of the fields of the most left screen)
Ok, but away on holiday at the weekend, so may be a while before I get back to you on this.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

geofft   1 kW

1 kW
Posts: 351
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 » Oct 05 2018 6:43am

stancecoke wrote:
Oct 04 2018 9:55am
geofft wrote:
Oct 04 2018 7:17am
It would appear that this setting is being totally ignored by the firmware....?
Hm, it should work in the same way as in the older commits...

Code: Select all

if (ui8_PAS_Flag == 1) {
		ui8_PAS_Flag = 0; //reset interrupt flag

		ui16_time_ticks_between_pas_interrupt = ui16_time_ticks_for_pas_calculation; //save recent cadence
		ui16_PAS_High = ui16_PAS_High_Counter;

		if ((0 == (ui16_aca_flags & PAS_INVERTED)) && ((float) ui16_time_ticks_between_pas_interrupt / (float) ui16_PAS_High > flt_s_pas_threshold)) {
			if (PAS_act < 7) {
				PAS_act++;
			}
		} else if ((PAS_INVERTED == (ui16_aca_flags & PAS_INVERTED)) && ((float) ui16_time_ticks_between_pas_interrupt / (float) ui16_PAS_High < flt_s_pas_threshold)) {
			if (PAS_act < 7) {
				PAS_act++;
			}
		} else {
			if (PAS_act > 0) {
				PAS_act--;
			}
		}
Please install the BluOsec app and check the values of PAS ratio (choose the item pasFraction in the dropdown in one of the fields of the most left screen)
....just had a quick play with this, Pas Fraction (forwards) is 1.8, reverse is 2.3

Same situation for me though, setting 'Pas Threshold' at 1.8 (or any other number) results in motor drive in either pas direction.

Nice app though! Looks professional and works well, will play more with this when time permits... :D
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

User avatar
stancecoke   100 kW

100 kW
Posts: 1036
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 » Oct 05 2018 6:56am

OK, thank you for testing!
A value of 2.1 for threshold should work.

I checked Xnyles code again. He processes the direction signal different now. The motor is not stopped when pedaling in reverse, but the speed limit is set to 6 km/h.

Can you confirm this behaviour?
I think this is not a good solution, as the motor can start working, if you are pushing your bike backwards?!

Code: Select all

// first select current speed limit

	} else if (ui16_time_ticks_for_pas_calculation > timeout ||!PAS_is_active) {
		ui8_speedlimit_actual_kph = ui8_speedlimit_without_pas_kph;
	}
	
regards
stancecoke

geofft   1 kW

1 kW
Posts: 351
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 » Oct 05 2018 9:20am

stancecoke wrote:
Oct 05 2018 6:56am
OK, thank you for testing!
A value of 2.1 for threshold should work.

I checked Xnyles code again. He processes the direction signal different now. The motor is not stopped when pedaling in reverse, but the speed limit is set to 6 km/h.

Can you confirm this behaviour?
I think this is not a good solution, as the motor can start working, if you are pushing your bike backwards?!

Code: Select all

// first select current speed limit

	} else if (ui16_time_ticks_for_pas_calculation > timeout ||!PAS_is_active) {
		ui8_speedlimit_actual_kph = ui8_speedlimit_without_pas_kph;
	}
	
regards
stancecoke
Ok, a bit more success. The firmware works as you suggest above, but only with Speed Sensor 'Internal' selected. If 'External' is selected the 'Pas Threshold' setting has no effect and you always get unrestricted motor drive in either pas direction... :?
Last edited by geofft on Oct 05 2018 10:09am, edited 1 time in total.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

User avatar
Xnyle   10 W

10 W
Posts: 74
Joined: Sep 03 2018 1:05pm

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

Post by Xnyle » Oct 05 2018 9:39am

Actually PAS activity was ignored, had nothing to do with speedlimit.

Probably fixed with latest commit, although speedsensor setting has nothing to do with it.

geofft   1 kW

1 kW
Posts: 351
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 » Oct 05 2018 12:14pm

Xnyle wrote:
Oct 05 2018 9:39am

Probably fixed with latest commit,
Pas now all working as it should - thanks!
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

haiyi911   1 W

1 W
Posts: 58
Joined: Oct 13 2017 5:35am

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

Post by haiyi911 » Oct 12 2018 12:30pm

hi,all
i have some problem while "run sdcc batch",how to solve it?
QQ截图20181013012720.png

Valopallo   100 mW

100 mW
Posts: 44
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 » Oct 12 2018 12:48pm

Finally my S06S arrived! I soldered everything in place. Now, the throttle works but even that my PAS sensor unit shows with a red led that it picks up the signal correctly the wheel doesn't turn when I turn the magnets. I soldered the PAS connector as follows; red(from the PAS) to brown(of the controller), black(PAS) to black (S06S) and white(PAS) to yellow(S06S). I'm trying to find out if the connections are right. What terminals should the PAS wires connect at the pcb of S06S? I'm using the original KT firmware for testing purposes.
BluOSEC@36V|15A|S06S|rear DD|MTB|Hardtail|Tunturi

Post Reply