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

Electric Motors and Controllers
geofft   1 kW

1 kW
Posts: 324
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 » Aug 17 2018 12:53pm

stancecoke wrote:
Aug 17 2018 11:43am
Good to hear, that the controller is working again and the throttle behaviour is OK with the new gain settings :D
In the config.h there are still 0.5 and 0.2, I think this is an old one?
Yes, I stored that config.h copy just before I made the Gain I/P changes.
You have defined 500 for max battery current (=18,8A) and 800 for max phase current (=48A) I think these are quite high values for a 6 FET....
I arrived at the phase current figure (800) as this seems to restrict the max power drawn by the motor to around 800 watts. This is plenty for my use and equates to about 17.5A drawn from the battery, I may reduce this a little more. I guess the 48A you mention is the instantaneous figure?

The battery current figure (500) was just a bit of a guess really, the controller was originally rated at 20A max so 18-19A seemed reasonable.

I did manage to take a datalog from a short ride today with some 'interesting' results. I'll post the details of this tomorrow, I can't be bothered with this tonight... :wink:
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

geofft   1 kW

1 kW
Posts: 324
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 » Aug 18 2018 4:51am

I did manage to take a datalog from a short ride today with some 'interesting' results. I'll post the details of this tomorrow
The printf line that produced this log was:-

printf("%d, %d, %d, %d, %d\r\n", ui16_setpoint, ui16_motor_speed_erps, ui16_BatteryCurrent,ui8_cheat_state, ui16_SPEED);

...I placed the 'ui16_SPEED' parameter you requested at the end of this line, but I doubt that will be much help in this log. The log consists of a short idle section at the start, after this I entered the brake lever code for 'offroad' mode, then a short test ride.

It was immediately clear when riding that things were not well, with the motor cutting in and out at regular intervals. A look at the log with my untrained eye spotted that LVC was constantly being triggered, hence the drive cutting in/out. Not sure why this is happening, the battery isn't particularly low so I guess the battery voltage is being mis-reported in diagnostics mode - or maybe I've made a mistake, there's also some odd looking characters in the log that don't look right.

Anyway, log attached, perhaps you could see what you think... :wink:
Attachments
blueTerm_20180817_160042.log
(51.42 KiB) Downloaded 19 times
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

User avatar
stancecoke   10 kW

10 kW
Posts: 924
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 » Aug 18 2018 5:17am

OK, it seems, that the controller is reset by the watchdog all the time. I had that issue too, therefore I switched back to the older commit... I don't know, if it's an issue of the newer SDCC3.7.x We can try to increase the watchdog timeout, but I have to have a look how that works...
Please use %u instead of %d as we want to look at unsigned variables. This avoids the negative values in the printout.

regards
stancecoke

geofft   1 kW

1 kW
Posts: 324
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 » Aug 18 2018 7:28am

Ok, no problem, I'll hold on this for now.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

User avatar
stancecoke   10 kW

10 kW
Posts: 924
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 » Aug 18 2018 8:05am

It's not an issue of the watchdog. I had the same phenomena again this morning, I tried to fix it with different timeouts and even with watchdog completely disabled and with SDCC 3.7.0, but nothing helped. Then I switched back to the latest commit at github and it worked properly again :shock: I tried to provoke the issue by changing the code step by step, but it always worked fine. :|
So no idea, what went wrong. Perhaps you can try to start from the latest commit again!
Just one guess is that the BT-module draws too much current and the 5V /3,3V brakes down and force the reset of the processor ?! Can you test that first? Just disconnect the BT-Module and make a test ride...

regards
stancecoke

geofft   1 kW

1 kW
Posts: 324
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 » Aug 18 2018 9:02am

Tried disconnecting the HC-05 5v line (from spare brake connector) but still the same.
I'll try re-downloading and starting again as you suggest.
Please don't spend any more time on this, it all started from from chasing the speedometer error which isn't a great problem in reality.
If I discover any more useful information on this I'll let you know... :)
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

casainho   100 MW

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

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

Post by casainho » Aug 18 2018 9:36am

geofft wrote:
Aug 18 2018 9:02am
Tried disconnecting the HC-05 5v line (from spare brake connector) but still the same.
I'll try re-downloading and starting again as you suggest.
Please don't spend any more time on this, it all started from from chasing the speedometer error which isn't a great problem in reality.
If I discover any more useful information on this I'll let you know... :)
Maybe you can try my branch and see if it works, if works, than that hardware is ok and we will know it works with my code and will be an option. I just say this because you told before that you get not problem with my code.
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, please 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: 324
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 » Aug 18 2018 10:19am

casainho wrote:
Aug 18 2018 9:36am

Maybe you can try my branch and see if it works, if works, than that hardware is ok and we will know it works with my code and will be an option. I just say this because you told before that you get not problem with my code.
Casainho, your branch (with my gear motor setup) works pretty much faultlessly and is still the fw I use when I go for a leisure (i.e. non-testing) ride.

Stancecoke's branch also works extremely well, just needs one or two details tidying up then users will have a choice of two very good options.

Obviously there are differences in the way each version operates, e.g. pas/throttle response, extra features, etc, etc. It will be great that users can eventually try both and see which they like best. Who knows, if -dg performs some magic we might even have a third option...:D
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

User avatar
stancecoke   10 kW

10 kW
Posts: 924
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 » Aug 18 2018 10:59am

I'm just coming back from a longer test ride and I'm really satisfied with the setup. Everything is working properly and reliably for me. So I'll stop further development at the moment.
It's very difficult to solve other people's problems that doesn't appear at my setup...
Thank you, geofft, for your restless efforts on the project!

regards
stancecoke

geofft   1 kW

1 kW
Posts: 324
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 » Aug 19 2018 3:01am

stancecoke wrote:
Aug 18 2018 10:59am
I'm just coming back from a longer test ride and I'm really satisfied with the setup. Everything is working properly and reliably for me. So I'll stop further development at the moment.
It's very difficult to solve other people's problems that doesn't appear at my setup...
Thank you, geofft, for your restless efforts on the project!

regards
stancecoke
stancecoke, I am easily able to understand your feelings, trying to resolve issues you are not seeing must be very frustrating and you have shown great patience. Many thanks for all the effort and hours you (and Casainho) have put into this so far.

Just one last small question - do any of the German users (using displays) get the speed readout issue, or is it just me?
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

User avatar
stancecoke   10 kW

10 kW
Posts: 924
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 » Aug 19 2018 6:32am

geofft wrote:
Aug 19 2018 3:01am
do any of the German users (using displays) get the speed readout issue, or is it just me?
The last feedback of two users was, that the LCD3 isn't working at all. I think that's an issue of the last XOR in the checksum. But I can't check it, as I don't know, what their displays are sending....

regards
stancecoke

User avatar
Hwy89   1 kW

1 kW
Posts: 377
Joined: Mar 03 2013 9:52pm
Location: Northern Arizona

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

Post by Hwy89 » Aug 19 2018 9:40am

First of all let me admit that I don't understand most of what I have read in this topic. What I have found out is that several of you have learned a lot about how these controllers operate so I will ask my question here.
I have recently put together a dual motor set up on a Big Dummy cargo bike. I've installed two Q128H 201 Rpm motors, two S12S controllers, two LCD 5 displays and a huge 38 amp hour 52 volt battery. Very nice setup, will only go 20 MPH but lots of low end power for hills and carrying loads.
The problem I'm having is that when the battery is full, above 56 volts, the motors are cutting out. Both motors seem to drop out at the same time. I tried using two separate throttles and found myself using one motor till it stopped then switching to the other till it stopped so I changed back to a single throttle. It isn't a big problem because all I have to do is momentarily release then reapply the throttle and the power comes back on for a minute or two then repeats. When the battery voltage drops below 56 V the problem stops and everything works great.
I have tried various different programing settings on the LCD 5's and also tried discharging the caps in the controllers before plugging in a full 58.8 volt battery.
Is this a high voltage cut off action? Is there a way to change the high voltage limit?
Like I mentioned earlier the topic here is way above my capabilities and I know very little about programing so the simpler the better.

geofft   1 kW

1 kW
Posts: 324
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 » Aug 19 2018 10:38am

Both motors seem to drop out at the same time.
I think this must be the big clue here, if both drop at the same time it must be something common to both motors and controllers. This points towards the battery, is it fitted with a BMS (battery management system)?

If it is, then logically this is the most likely culprit, maybe an overcurrent or thermal trip is cutting out at higher voltages?
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

User avatar
Hwy89   1 kW

1 kW
Posts: 377
Joined: Mar 03 2013 9:52pm
Location: Northern Arizona

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

Post by Hwy89 » Aug 19 2018 11:37am

There is no bms. I balance charge and closely monitor. I had that same thought that it must be something common to the two but found no problems with the battery or connectors. Interesting that the cut outs seem more likely to occur at fairly low speed. I actually tested this by climbing a steep hill expecting it to cut out under heavy load. It didn't but at the top of the hill when i reduced the throttle it cut out. Climbing the hill the voltage dropped to near 56 but at the top it bounced back up to 57+. This is a very big battery with little sag.
I think this is something to do with the way the controllers are programed and since they are the same model ordered at the same time and I have all the same parameters on the two LCD 5's the controllers are just responding the same.

User avatar
Hwy89   1 kW

1 kW
Posts: 377
Joined: Mar 03 2013 9:52pm
Location: Northern Arizona

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

Post by Hwy89 » Aug 19 2018 11:45am

Another clue is that when I ran it with two separate throttles each of the motors exibited the same cut off problem. On that occaision I thought the problem was solved but it was only because my pack voltage had dropped to below 56V. As soon as I recharged it came back.

User avatar
stancecoke   10 kW

10 kW
Posts: 924
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 » Aug 19 2018 12:03pm

Hwy89 wrote:
Aug 19 2018 9:40am
a huge 38 amp hour 52 volt battery.
52V ??? How many cells in series and which kind of cells?

regards
stancecoke

User avatar
Hwy89   1 kW

1 kW
Posts: 377
Joined: Mar 03 2013 9:52pm
Location: Northern Arizona

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

Post by Hwy89 » Aug 19 2018 12:21pm

168 recycled Tesla 18650 cells in 14s 12p configuration.

User avatar
stancecoke   10 kW

10 kW
Posts: 924
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 » Aug 19 2018 12:58pm

I think the controller doesn't know 14s batteries. Only 24, 36, 48, 60 and 72V are expected.
http://risunmotor.com/24v-36v-48v-60v-7 ... oller.html

It thinks it's an 13s (48V) and stops working for overvoltage protection.

regards
stancecoke

User avatar
Hwy89   1 kW

1 kW
Posts: 377
Joined: Mar 03 2013 9:52pm
Location: Northern Arizona

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

Post by Hwy89 » Aug 19 2018 1:53pm

Do you think if I bleed the controller caps and initally install a 15s pack (about 63v) I could fool it into thinking it had a 60 volt pack. Then hook my 52v pack up? I know that this will mess up my battery gauge and raise the LVC by a couple of volts but I don't pay much attention to the gauge and seldom run down to LVC.


User avatar
Hwy89   1 kW

1 kW
Posts: 377
Joined: Mar 03 2013 9:52pm
Location: Northern Arizona

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

Post by Hwy89 » Aug 19 2018 3:32pm

Welding together a 15s 1p fooler pack to try that out. Will be tomorrow before I have results because both it and the main pack will need to be charged.
Am I right in thinking that once I connect a 63 volt battery the controllers will remember and I won't have to do this each time?
Thanks for the tip

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 » Aug 19 2018 5:43pm

Hwy89 wrote:
Aug 19 2018 3:32pm
Welding together a 15s 1p fooler pack to try that out. Will be tomorrow before I have results because both it and the main pack will need to be charged.
Am I right in thinking that once I connect a 63 volt battery the controllers will remember and I won't have to do this each time?
Thanks for the tip
Don't waste your time on this.. I am having this problem with 14s battery also. At high power it happens even below 50v. If you decrease max power, you will get less cutouts. C5 parameter - 00-02 is soft start. That helps too..

I was pretty sure that it's because of phase current exceeding some set limit, but bridging the hall sensor does not seem to help..

With custom FW you don't get this issue, as there is no hard cut-off phase current limit.

User avatar
Hwy89   1 kW

1 kW
Posts: 377
Joined: Mar 03 2013 9:52pm
Location: Northern Arizona

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

Post by Hwy89 » Aug 19 2018 6:17pm

The hard part is already done. The 1P 15S battery is charged. All I have to do is top off the bike pack and try it.
It doesn't seem like it is an over current problem though. Most of the time when it happens I'm only pulling 3 or 4 amps per motor cruising on the flat at 12 to 15 mph.
I have an ampmeter and volt meter mounted on the dash.

User avatar
Hwy89   1 kW

1 kW
Posts: 377
Joined: Mar 03 2013 9:52pm
Location: Northern Arizona

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

Post by Hwy89 » Aug 19 2018 9:42pm

So, Honya96 you were right. The experiment did not make any difference.
So tell me, how would someone like me who is basicly clueless when it comes to programing or coding, what ever it is called, be able to take advantage of this custom firm ware?

geofft   1 kW

1 kW
Posts: 324
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 » Aug 20 2018 2:52am

Hwy89 wrote:
Aug 19 2018 9:42pm
So, Honya96 you were right. The experiment did not make any difference.
So tell me, how would someone like me who is basicly clueless when it comes to programing or coding, what ever it is called, be able to take advantage of this custom firm ware?
I'm wondering if your best option would be to reconfigure your battery to 13S? You would then only need to add one more cell to make a 13s13p battery.
13s is a fairly 'standard' configuration for (nominal) 48v use and would hopefully solve your issue with just a small power reduction?
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

Post Reply