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

How loud is a motor with the custom firmware FOC, compared to decent commercial options like Lishui or Phaserunner? Are they comparable?
 
@everyone who is using this FW:

It would be nice if you could send me your proven settings based on the current version of the Java tool so that I can add them to the repo.

Please select a filename that contains controller type, system voltage, wheelsize and motortype

You can also add a pull request on github ofc.

Thanks!
 
Xnyle said:
@everyone who is using this FW:

It would be nice if you could send me your proven settings based on the current version of the Java tool so that I can add them to the repo.

Please select a filename that contains controller type, system voltage, wheelsize and motortype

You can also add a pull request on github ofc.

Thanks!

Current torquesensor settings:-

View attachment TQSR,KT36-48svpr,12s,26inch,Q128h.ini

....I also set 'TQ calib' to 1500. For some reason this doesn't seem to restore from the .ini file and defaults to 1000.

My previous THR-PAS settings:-

View attachment THR-PAS,KT36-48svpr,12s,26inch,Q128h.ini
 
gutyex said:
I have an S06S flashed with this firmware, and when I turn on the kit, the motor starts going at a moderate speed and doesn't stop until it's turned off again.

I finished my experiments with the firmware because of the behavior of the thumb throttle that does not suit me, as I wrote above, and returned to the stock firmware (on another controller).
But today my friend got the built-in (for hailong battery case) controller board KTE-9S5-J5 from ebikekit.kom, and asked me to solder the connector for programming.



Waterproof compound is very soft, and the contacts are easily released from it with an ordinary wooden toothpick.
The good news is that the firmware has been launched and is working on this controller. The power supply of the throttle hall sensor on this controller is higher than usual (4.9 volts) and the desired "Throttle min" value is 47-49, otherwise the motor slowly rotates when power on. This is normal and logical.
The bad news is that even with the “Throttle min” 100-180, the motor starts to rotate when turned on and makes 0.5 turns without load, or more than 30 on load, ( if you hold the motor with your hand when turned on). I am at a loss - why turn on PWM, if the value of "trottle min" guaranteed below the minimum?! Checked twice... No PAS or TQS connected - only thumb throttle (without throttle - same behavior). MXUS XF15 gear motor.
This happened on the latest firmware (masher branch).
Fortunately, I had in the archive firmware from October last year with the last commit "Added Tool for State translation stancecoke committed Oct 23, 2018" - and with this firmware, the motor makes only 1/16 turn at a very low power, then stop (or slightly hold it with your hand and the motor will not start to rotate) and does not rotate on an ebike installed in the wheel.
As I know - on the forum there are users of such controllers on the factory firmware, pay attention to this problem.
By the way, the correct value of the "Battery current Cal a" is 100 for this controller, as well as for 6Fet controllers.
 
kkm said:
gutyex said:
I have an S06S flashed with this firmware, and when I turn on the kit, the motor starts going at a moderate speed and doesn't stop until it's turned off again.

Whenever I've had this issue I've usually managed to fix it by making an adjustment to the zero point - this was using stancecoke's advice, I think there may be some reference to it many pages back in this topic.

About halfway down the file adc.c you'll find the line:-

ui16_current_cal_b -= 1;

...try changing the '1' at the end to a higher number maybe 2-4 or possibly even higher. This has always done the trick for me, your problem may be elsewhere of course, but possibly worth a try...
 
....I also set 'TQ calib' to 1500. For some reason this doesn't seem to restore from the .ini file and defaults to 1000.

Fixed.

...throttle - same behavior). MXUS XF15 gear motor.

XF15 probably not the problem, working fine with current FW and a 12FET controller (yes I know total overkill but it's what I had lying around :)

ui16_current_cal_b -= 1;

If this turns out to be the problem on 6FET controllers I should make that a configurable option as well.
 
I'm building a 2wd e-bike. For the rear motor I have S06S and for the front motor I have KT36ZWS. Both systems have individual batteries(36V) but share the signals of throttle, PAS and brakes. I'm using either two individual HC-05 bluetooth modules or just a single one with a manual dipswitch to change the RX and TX terminals of the module when needed and don't want to use any LCDs. This way I can operate both controllers by BluOSEC -app.

I also need to shut down the system's both controllers to reset the offroad mode fast and would like to use only one switch for both. I have already mounted the main switch that connects the blue and red of the s06s to the body of my battery holder and now I'm wondering could I use the same switch to power on/off both of the controllers?

TL;DR: Can I safely connect both reds and both blues of the controllers to the same manual switch or am I definitely going to burn something up if I do this?

Another question: KT36ZWS has this unknown red and black wire. If it has 5V output, could I use that safely to power the HC-05 module or should the power come always from the red terminal of the main harness with a DC-DC reg?
 
No, please don't do that. It's clearly stated in the wiki as well. For every additional watt you pull out of the 5V rail the linear voltage regulator inside the controller has to !burn! ~5 watts (depending what kind of resistor the poor chinese guy had at hand botching together your very controller :) On top of that there is also a high chance you get all sorts of weird bugs because of voltage drops (I tried to isolate software bugs last year which turned out to be hardware bugs because I connected the BT module where it wasn't supposed to be connected.

Use a cheap xl7015 based buck converter and everything will be fine.
 
Xnyle said:
No, please don't do that. It's clearly stated in the wiki as well. For every additional watt you pull out of the 5V rail the linear voltage regulator inside the controller has to !burn! ~5 watts (depending what kind of resistor the poor chinese guy had at hand botching together your very controller :) On top of that there is also a high chance you get all sorts of weird bugs because of voltage drops (I tried to isolate software bugs last year which turned out to be hardware bugs because I connected the BT module where it wasn't supposed to be connected.

Use a cheap xl7015 based buck converter and everything will be fine.

Ok. I have a spare LM2596 module laying around for the bluetooth so that's not a big problem. How about my other question; is it ok to connect the reds and blues of both controllers to the same on/off switch? Would that mean that the red 36V rails become parallel and don't add up the voltage or do they? And if the blue wires are only getting the 36V signal it would not matter where it comes from, right?
 
How can I set throttle to 0km/h when NOT in Offroad -mode? The bluosec -app's minimum is 1km/h. Update maybe?
 
No update, technical restriction on how "not set" == 0 is handled in eeprom settings. I see no practical use case where 1km/h is a problem that would justify a complete refactoring.

.. although 255 == "not set" might have been a better choice, but as written, no incentive to change that now that everything is working.
 
Xnyle said:
No update, technical restriction on how "not set" == 0 is handled in eeprom settings. I see no practical use case where 1km/h is a problem that would justify a complete refactoring.

So I have to use the Java tool and put 0 to the "Without PAS" -section, flash again and I'm set?
 
So which one of the torque sensors on Aliexpress would you recommend for use with the Open Source controller? The Sempu T4? The Eunorau type?

thx in advance
 
BTW in Torquesensor mode 0 will cause a division by zero, as the Java tool doesn't check anything anyway, it's your responsibility not to enter 0 there :)

Code:
float_temp *= (1 - (float) ui16_virtual_erps_speed / 2 / (float) (ui16_speed_kph_to_erps_ratio * ((float) ui8_speedlimit_kph))); //ramp down linear with speed. Risk: Value is getting negative if speed>2*speedlimit

Apart from that It currently doesn't really matter anyway, as power gets cut off only after you reach the limit, so power is applied at first anyway.

See latest commit for a workaround
 
vulcanears said:
So which one of the torque sensors on Aliexpress would you recommend for use with the Open Source controller? The Sempu T4? The Eunorau type?

thx in advance

I'm using the Sempu T4 with stancecoke's firmware, this works just fine for me. Don't bother with the T2 type, these give an output with any pressure on the pedals, this gets to be annoying very quickly.... :shock:
 
Yes, the Sempu T4 is the better choice. My experience with the Bafang sensor (eunorau) is very bad, see the german forum:

https://www.pedelecforum.de/forum/index.php?threads/funktionsprinzip-bafang-drehmomentsensor.56636/

regards
stancecoke
 
I've just tried out the current github download, maybe I should mention that there seems to be some problem.

Some of the 'Proven settings' seem to build and flash ok, others don't. Neither of the proven settings provided by myself will flash and there appears to be an error during the build that will make more sense to you than it does to me... :wink:

I've attached the cmd dump.

Edit to add: I'm using SDCC3.7.2 - I can see there is a newer version, maybe this is my problem?
 

Attachments

  • cmd dump 13-4-19.txt
    5.3 KB · Views: 70
stancecoke said:
Yes, the Sempu T4 is the better choice. My experience with the Bafang sensor (eunorau) is very bad, see the german forum:

https://www.pedelecforum.de/forum/index.php?threads/funktionsprinzip-bafang-drehmomentsensor.56636/

regards
stancecoke
Why don't you guys write resume working torque sensors on wiki?

I remember to use the BMSBattery ones and being problematic because they broke. Would be so nice if I could try that Sempu Y4 on that time.
 
@geofft because Overvoltage is not set so you get a compile error. I didn't check you settings, that's why I asked for ones matching the CURRENT Java tool :)

I checked in corrected versions
 
Xnyle said:
@geofft because Overvoltage is not set so you get a compile error. I didn't check you settings, that's why I asked for ones matching the CURRENT Java tool :)

I checked in corrected versions

Ahh....ok, my mistake. Thanks for correcting the files.
 
Hello,

Is it worth to try OSEC with KT36-ZWSRT (KTE-6S5-A) + LCD5 + MXUS XF08 rear geared wheel? Will it work?

My goal is to use OSEC BT app along with controller without LCD5.

Upd:
Can't find spoiler tag, sorry
 
Hey there,
I've the KT9 in the hailong dock.
I have two issues:
-it NEVER worked correctly with original firmware and my modded GT-Direct drive (similar to bionx motor) with 120° halls since I changed them to ss41
-the power resistor gets hot as hell 😅🔥🙈. Did anybody had this? All seems quite cold on the board, but as soon as I start the controller, even with nothing plugged except display, it becomes VERY hot (I have measured 80mA which makes about 4,5W... Don't know if it's "normal" though.
I got some very partial success while tweaking the phase motor correction (and hall angle..etc), but it seems to get havoc as soon as the motor gets a few rpm too much.
This apply only to my direct drive motor, a small geared works well, and the motor itself works well with for instance a bbshd controller or small sine Bafang. I'm at lost, no idea what I should check at this point 😅☝️
Gruß,
H.
**Edit**
I have replaced the LM317 as it was the only thing getting warm. Well.. no luck unfortunately. The controller is just pulling too much current. Don't know if it's hardware or software related, and the reason I ask here 😅☝️
 
dodjob said:
Hey there,


**Edit**
I have replaced the LM317 as it was the only thing getting warm. Well.. no luck unfortunately. The controller is just pulling too much current. Don't know if it's hardware or software related, and the reason I ask here 😅☝️

I've only had experience with the KT36/48 type controllers, with these the series resistor and LM317 also get very hot, I'm guessing your controller has similar circuitry here. I fretted about this myself but it's the way it's meant to work and seems to be surprisingly reliable. If you check page 126 of this thread you'll see a mod I did that gets this heat out to the casing and away a lot quicker, has worked totally reliably for me.
 
Thanks Geoff.. well mine went real bad, melted the coat and started to weld to the capacitor 😅 (remember it's a hailong controller) I will probably change this by adding a small dc-dc or route it outside
I suspect the openspurce firmware sucks a bit more, and this bit more is over the very very short limit of the LM 🙈🔥🔥
 
nox said:
Is it worth to try OSEC with KT36-ZWSRT (KTE-6S5-A) + LCD5 + MXUS XF08 rear geared wheel? Will it work?
What about frame vibrations / resonances when using a rear geared motor with an original firmware? I tried the rear engines Mxus XF15R (Gear 50, 1:5 reduction rate), XF08 (1:4.4), as well as Bafang SWX02 500w (1:5). And they all have the same breakdown on the original firmware (6-step ZWS and sinewave SVPR) and on the open source. Unpleasant resonances and vibrations of the frame, pedals, even the KT-LCD3 display on the steering wheel rattles, and strong vibration peaks in the range of ~11-12 km / h and ~ 20-23 km / h. The feeling that you are riding on an old crumbling clunker, and not on a new motor.
I do not know, therefore, the firmware is so poorly compatible with gear motors. Yes - the user of the front engines may not notice the problems - the front fork softens the vibrations and does not allow them to be rigidly up to the aluminum “ringing” bikeframe.
Yes, without a load, the motors behave perfectly on 6 steps and a sine - but if you sit down and go - everything becomes bad.
I had to buy and install a cheap standalone Chinese controller https://ru.aliexpress.com/store/pro...?spm=a2g0v.12010612.8148356.42.616218beQneQ7v with a “real” meander. Yes, without a load, the engine's itching is louder, but when driving it behaves perfectly - quietly, smoothly, there are not the slightest vibrations. I do not know the reason. Perhaps the KT firmware are optimized for working with DD? Does open source not take into account any features of gear motors? Or are these motors wound so as to perfectly work only with a pure meander, not 6-step and not sine?
 
Back
Top