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

Electric Motors and Controllers
andrea_104kg   1 kW

1 kW
Posts: 333
Joined: Mar 05 2018 5:51pm

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

Post by andrea_104kg » Jan 04 2022 4:55pm

It's not a good things for me :-(
on my controller work only the master branch, the x4 not work, it start at maximum...
Isn't there a solution? maybe a copy-paste from version x4 :-(

Vbruun   100 W

100 W
Posts: 253
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 » Jan 05 2022 2:43am

I think the fix is straight forward if you know how to code. Stancecoke says so However, I don't.

I have been following your endavours and I am not convinced that your controller has a problem with torque from x4 branch, as you had it wired Up incorrectly when you had issues.
But of course there is No guarantee.

What display are you using?

andrea_104kg   1 kW

1 kW
Posts: 333
Joined: Mar 05 2018 5:51pm

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

Post by andrea_104kg » Jan 05 2022 3:48am

I will try the x4 version for one last time, I too am curious to see if anything has changed ....
I use the lcd3 display

geofft   1 kW

1 kW
Posts: 424
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 » Jan 05 2022 3:51am

I have been following your endavours and I am not convinced that your controller has a problem with torque from x4 branch, as you had it wired Up incorrectly when you had issues.
Yes, I think it should now work ok with the X4 branch.
The problem of switching off is the most serious, for the rest you can live with it peacefully. Is this a known problem?
I'm beginning to wonder if your controller is the (required) sine wave type fitted with a current sensor. The lack of a current sensor could explain the non functioning watts display and the inactivity timer being triggered after 15mins. It would also mean the motor does not run efficiently as FOC would not be operating.

I've no personal experience with the current sensor but it has been discussed before on this thread, maybe worth doing a search.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 6-fet, LCD3, 48v 12s lipo, Sempu T4 tqsr.

andrea_104kg   1 kW

1 kW
Posts: 333
Joined: Mar 05 2018 5:51pm

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

Post by andrea_104kg » Jan 05 2022 7:42am

I tried but with x4 not work :( It start at max..
Watt and Speed sensor works on x4... Don't works on master. This Is my controller
IMG_20220105_110308.jpg
IMG_20220105_110308.jpg (4.13 MiB) Viewed 443 times


andrea_104kg   1 kW

1 kW
Posts: 333
Joined: Mar 05 2018 5:51pm

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

Post by andrea_104kg » Jan 05 2022 7:54am

I tried also to do a 20km tour, the system is not really usable. It turned off 4 times and 3 times the assistance went to zero for 3 seconds and then resumed, without turning off anything :-( overflow? Also the display does not show speed, watt, and the battery bars disappear. In short, too many problems to be really usable :-(

geofft   1 kW

1 kW
Posts: 424
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 » Jan 05 2022 12:38pm

Ok, your controller appears to be a fairly generic sine wave type.

I think it's best if you restrict your testing and feedback to the X4 setup, you will have to use this for torquesensor operation eventually anyway. Don't get distracted by battery bars, watts, etc, at the moment, these details can be sorted later. For now just concentrate on the starting at max with pas issue. Could you run through these couple of basic tests and answer the questions. It's probably things you've tried before, but no harm in re-checking... :wink:

1) With the X4 setup, disconnect the white tqsr signal wire from the controller X4 connection, but leave all else connected and switch on.
a) What voltage are you seeing on the controller X4 connection?
b) What voltage are you seeing on the white wire?
c) What happens when you rotate the pedals?

2) Re-connect the white tqsr signal wire and switch on.
a) What voltage are you now seeing on the X4 connection?
a) What happens when you rotate the pedals?

No rush, do it when you feel in a better frame of mind... :)
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 6-fet, LCD3, 48v 12s lipo, Sempu T4 tqsr.

andrea_104kg   1 kW

1 kW
Posts: 333
Joined: Mar 05 2018 5:51pm

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

Post by andrea_104kg » Jan 05 2022 2:58pm

For now I can answer the first questions because they are tests that I have done several times:
1)
a) on x4 0.0011v
b) on white 1,5014v
c) the motor start at max even with the white wire disconnected from anything ..
the other questions I have to check ...
in the afternoon I tried the x4 throttle branch: with white on x4, the engine does not start.
With white on throttle port it starts and functions as the master branch.
Without the white thread attached, nothing starts, as it should be. In practice, the x4 throttle branch behaves like the master, no watts or speeds are seen, not even if it turns off as the master.
I was hoping that the x4 throttle branch was a derivation of x4 torque, but it looks like a modification of the master, with all its bugs. Unfortunately tomorrow here it is expected rain all day and I will hardly be able to try :-(

geofft   1 kW

1 kW
Posts: 424
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 » Jan 05 2022 6:41pm

c) the motor start at max even with the white wire disconnected from anything ..
...Ok, in that case there is no need to do the second test.
Will reply further tomorrow.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 6-fet, LCD3, 48v 12s lipo, Sempu T4 tqsr.

andrea_104kg   1 kW

1 kW
Posts: 333
Joined: Mar 05 2018 5:51pm

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

Post by andrea_104kg » Jan 05 2022 6:53pm

thanks,
i played with x4throttle, unfortunately it turns off like the master version, the system turned off 2 times with the bike on the stand :-(
with this version at least with the white cable disconnected (or even attached to x4) turning the pedals the engine does not start ...

geofft   1 kW

1 kW
Posts: 424
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 » Jan 06 2022 4:46am

This has now become such a confusing collection of different symptoms with various firmware branches it's difficult to make any sense of it. I'm concentrating on just one symptom here, the motor driving at max on the 'Torque from X4' branch,
For now I can answer the first questions because they are tests that I have done several times:
1)
a) on x4 0.0011v
b) on white 1,5014v
c) the motor start at max even with the white wire disconnected from anything ..
....with 0v on X4 the motor should obviously not be driving. There is no known issue with the 'Torque from X4' branch causing this and the max/min firmware settings seem to have no effect. The only conclusion to draw from this is that there must be some issue with your controller's X4 input, and maybe other problems causing the various odd symptoms.

I think you'll get no further with this until you try a different controller. Maybe try the KT 6fet sinewave controller from PSWpower? These are cheap and are the type I've always used and work faultlessly with the 'Torque from x4' branch.

However it's still nagging me that we're missing something here - it's going round in my head that maybe Kunteng have made some fundamental change to some versions of these controllers, maybe a different processor type or something causing problems running the os firmware, no previous evidence to support this though.

Any thoughts?
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 6-fet, LCD3, 48v 12s lipo, Sempu T4 tqsr.

andrea_104kg   1 kW

1 kW
Posts: 333
Joined: Mar 05 2018 5:51pm

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

Post by andrea_104kg » Jan 06 2022 6:35am

Thanks, my controller it's from pswpower and It was new, never used.
it was bought in the early summer and remained in a drawer until recently. I too think of a hardware problem, but why doesn't it start at max with the master as with x4?
I'd settle for solving the random shutdown problem. yesterday I loaded winmerge, a special program to compare 2 listings highlighting the differences. Then I opened the 2 master and x4 versions in 2 folders. 95% of the files are identical and the others differ by a few bytes. but I don't know in which file the fix for random shutdown is, I can't find the discussion ... I wanted to see if it is possible even for a non-programmer to make changes, but without knowing in which file it is not possible.

User avatar
stancecoke   1 MW

1 MW
Posts: 1596
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 » Jan 06 2022 6:57am

andrea_104kg wrote:
Jan 06 2022 6:35am
but without knowing in which file it is not possible.
Why don't you follow my suggestion to use the diagnostics mode?!
An USB UART converter is not expensive.

regards
stancecoke

andrea_104kg   1 kW

1 kW
Posts: 333
Joined: Mar 05 2018 5:51pm

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

Post by andrea_104kg » Jan 06 2022 8:30am

because my lcd3 has mini din round connector cable. on the control unit I had to cut the connector and put a female mini din. to connect the uart I would have to cut all the cables and then resolder them again, a real job....

Woly   10 mW

10 mW
Posts: 32
Joined: Nov 16 2020 10:32pm

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

Post by Woly » Jan 06 2022 10:03am

to connect the uart I would have to cut all the cables and then resolder them again,
Just get a male din for the uart and plug it in. Or just use bare wires.

Until you run the diagnostic mode and see what the controller is actually doing, you're just blind guessing. You don't know for sure its the x4 input. You don't know for sure its actually max output.

And I'll bet if you post some diagnostic info, stancecoke will answer with some good insight.

OutsMarted   10 mW

10 mW
Posts: 21
Joined: Aug 14 2021 12:44pm

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

Post by OutsMarted » Jan 06 2022 1:21pm

I have determined my cal a value and I calculated it to be 4.5. :shock:
How can that be? The raw ADC value jumped from 314 to 322 when drawing 18A.
This means 0.44 ADC value per amp.
Also when the motor is standing still the raw ADC value is around 318 and the setpoint is zero, so it is not turning the motor.
What is going on? In the gpio.h file I saw there was a second port for current measurement. Filtered current it is called there. Should I use that one?
The stock controller could display the watts on the lcd with low power settings too.

andrea_104kg   1 kW

1 kW
Posts: 333
Joined: Mar 05 2018 5:51pm

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

Post by andrea_104kg » Jan 06 2022 3:46pm

ok but I'm stubborn, you may have noticed :-)
this is the list of the different files in the 2 branches, after removing the same ones
1.jpg
1.jpg (393.13 KiB) Viewed 739 times
let's start with ACAcommons.c
at the beginning there is that I think is the definition of two "variables" I think they are 16bit

I ADD THE DEFINITION OF THE NEW VARIABLES IN THE MASTER VERSION
2.jpg
2.jpg (404.38 KiB) Viewed 739 times
then the only difference is in this image
3.jpg
3.jpg (319.7 KiB) Viewed 739 times
I put the two overlapping images
as you can see the master version uses 8-bit numbers, the x4 16-bit, I think it's the famous problem of "overflow" and perhaps system shutdown?
SIMPLY CHANGE IN THE MASTER VERSION THE 8 INTO 16 LEAVING THE NAME OF THE VARIABLES UNCHANGED (THE MASTER USES THROTTLE, THE X4 OBVIOUSLY X4)
4.jpg
4.jpg (315.23 KiB) Viewed 739 times

the other files I have looked at them all, but I don't understand the logic of the changes, really minimal and therefore I leave them alone, at least for now, it is not wise to make more than one change at a time, then it is not clear where the problems come from: - )
So I'm going to replace the ACAcommons.c file in my master with the modified one and tomorrow I'll try what happens :-)

andrea_104kg   1 kW

1 kW
Posts: 333
Joined: Mar 05 2018 5:51pm

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

Post by andrea_104kg » Jan 06 2022 4:46pm

Okay I'm ignorant :-( everything I would have expected, even an explosion of the ECU, but not a compilation error
"loadingfile main ex" and thereafter
Error: no such file or directory
Why?

geofft   1 kW

1 kW
Posts: 424
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 » Jan 07 2022 4:11am

andrea_104kg wrote:
Jan 06 2022 4:46pm
Okay I'm ignorant :-( everything I would have expected, even an explosion of the ECU, but not a compilation error
"loadingfile main ex" and thereafter
Error: no such file or directory
Why?
@andrea_104kg

Ignoring Stancecoke's advice and playing with the code will get you nowhere. The code is proven, your X4 problems have nothing to do with the code.

I have been re-reading back through this scenario and I'm now fairly certain I know where your X4 problem lies.

You need to concentrate your attention on the resistor that was removed at the start of this story.

If you are willing to restore the code back to the normal 'Torque from X4' branch I can tell you more of what I think...
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 6-fet, LCD3, 48v 12s lipo, Sempu T4 tqsr.

andrea_104kg   1 kW

1 kW
Posts: 333
Joined: Mar 05 2018 5:51pm

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

Post by andrea_104kg » Jan 07 2022 5:36am

thanks, as always, for your patience. Before removing the resistor on x4 there was 5v. and also the engine started at the maximum with the x4 branch, exactly like now. the resistor was removed precisely to avoid this starting at most, but it didn't help. There is to understand why with the master branch it does not start at the maximum. Obviously because it does not use x4 that has a bug on this control unit. They probably get to the 5v processor regardless of the resistor, going through other ways. However it is strange that on the wire connected to x4 there were 5v before and now they are no longer there, but it starts all the same as if they were there.
I agree that my changes on the code are messes, however it helped me to see the differences between the various files that are really minimal, for example I don't understand why the display works on one version and not on the other, because the files are practically the same. .

geofft   1 kW

1 kW
Posts: 424
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 » Jan 07 2022 6:25am

Ok, this is what I think, unfortunately I don't have a schematic that shows the X4 connection, but I'm reasonably confident in my thinking here.

Firstly, any voltages you measured back then were taken without the ground coupling (-ve connections) in place, so would likely be false and misleading. It was assumed at the time from your readings that a pullup resistor was in circuit, this may still be the case but needs to be re-checked now the ground couplings are in place.

Secondly, the resistor you have removed does not appear to be a pullup/pulldown resistor. Pullup/down resistors in Kunteng controllers usually are 10K (103) or more. The resistor you have removed is a 2.2k resistor, this looks to be the coupling resistor between the X4 connection and the processor pin, meaning that the X4 connection probably now goes nowhere.

My advice is you first replace the resistor you have removed and re-check the controller X4 voltage (white wire disconnected). If it is still high (near 5v) then there is a pullup and you need to investigate which is the correct resistor to remove...

...or...

....if X4 now measures near 0v then it's probable that there is no pullup. Reconnect the white wire (from the tqsr) and check you have 1.5v. If ok then hopefully the controller should now respond correctly to the tqsr signal.

I realise replacing the 2.2k resistor may be difficult, but take care with this, use a magnifier and make sure you have no shorted tracks, etc. If you have lost the original resistor you may find it easier to use a small wire ended resistor in it's place.

This would only help with X4 problem, the other issues you had would probably still need investigation, but at least it will have removed one more potential problem. As always, taking Stancecoke's help with diagnostics logging would be the best way forward.

Good luck.
Last edited by geofft on Jan 07 2022 9:36am, edited 2 times in total.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 6-fet, LCD3, 48v 12s lipo, Sempu T4 tqsr.

andrea_104kg   1 kW

1 kW
Posts: 333
Joined: Mar 05 2018 5:51pm

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

Post by andrea_104kg » Jan 07 2022 7:11am

We had the same doubt. In fact, I went to remove the wire on x4 and from the image you can see that it is the only track that carries a signal to x4. There remains the problem of understanding which then is the pull up resistor .... I have no idea maybe the "103" one ?. Replacing the resistor is practically impossible, the images are enlarged dozens of times :-( the number "222" means 2.2k ohm?
you can try to short with a drop of tin and put a 2.2k resistor along the output wire ..
20212326102358.jpg
20212326102358.jpg (851.15 KiB) Viewed 701 times
20223407123403.jpg
20223407123403.jpg (908.96 KiB) Viewed 701 times
20222607122618.jpg
20222607122618.jpg (1.09 MiB) Viewed 701 times

geofft   1 kW

1 kW
Posts: 424
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 » Jan 07 2022 8:11am

There remains the problem of understanding which then is the pull up resistor .... I have no idea maybe the "103" one ?
Possibly, but as requested you need to replace the 2.2k (222) resistor and then re-check the X4 voltage before you remove any other components.
you can try to short with a drop of tin and put a 2.2k resistor along the output wire ..
Please don't do this, it's a bit crude and there may be other connections to the X4 pad that you are not seeing. Unfortunately the layout of your pcb is very different to the PSWpower controllers I have, so I can't make comparisons with my units. Wait till you get a 2.2k miniature wire resistor and maybe that will be easier.

Is the bottom end (nearest the '3') of the 103 resistor connected to 0v or +5V?
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 6-fet, LCD3, 48v 12s lipo, Sempu T4 tqsr.

andrea_104kg   1 kW

1 kW
Posts: 333
Joined: Mar 05 2018 5:51pm

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

Post by andrea_104kg » Jan 07 2022 10:48am

nothing, I thought I had found the fault but nothing. I soldered the old 2.2k resistor, I measured at the output of the resistor 103 and there was 5v ... so I removed the resistor 103 ... result? it starts at the maximum exactly as before, only by turning the pedals ... even with x4 detached. Just give up. It's not that I don't want to follow the stancecoke advice, but what would the result be? always the ECU that is wrong or the code to change, and it is evident that I am not capable. Maybe in a few months if I feel like I will buy a new control unit, but the feeling I have is the same as a gambler who reacts to the loss by playing again. If the odds of losing against the dealer are higher the more you play the more you lose ... :-( I'm glad that someone works, but I say this for new users there is no guarantee that it will work, even with pswpower control unit because mine is :-(

Post Reply