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

Just thought I'd see what you guys make of this. Just recently received a new Sempu torque sensor (Gen1) and have noticed some erratic behaviour from it. Eventually decided to monitor the torque sensor o/p and realised that there was no signal o/p for a quarter turn of the pedal shaft.

What you're seeing on the video is monitoring the torque sensor (white wire) o/p. The meter needle at half scale is 1.5v, the normal rest voltage. You'll notice that for the bottom right quarter of rotation the o/p disappears.

This looks wrong to me, but may be normal - would be grateful if anyone with a sempu could just run this check and see if theirs does the same.... :?

https://youtu.be/Pje2ESLvfCs

Edit: To change generation type.
 
Sorry, yours seems to be a Sempu of the first generation, as you are using a normal chainwheel with crank. The third generation has a spider (I don't know if this part is called spider in english... ) where the chainwheel is fixed, the crank has to be an extra part.

index.php


I don't have my 1.gen Sempu any longer, so I can't check if it has the same strange behaviour...
regards
stancecoke
 
stancecoke said:
Sorry, yours seems to be a Sempu of the first generation, as you are using a normal chainwheel with crank. The third generation has a spider (I don't know if this part is called spider in english... ) where the chainwheel is fixed, the crank has to be an extra part.

Ah..ok. The seller called it the 'latest version' which I rather assumed made it gen3 - clearly this is not so.

To be specific, it's the T2 version, middle wire, 10-60v.
 
So it seems to be a enhanced release of the first generation, where the torque-signal is generated by measuring the bending of the shaft...
Is the zero value appearing, if you are pedaling forwards, too? Perhaps it's a kind of direction detection signal.

regards
stancecoke
 
stancecoke said:
So it seems to be a enhanced release of the first generation, where the torque-signal is generated by measuring the bending of the shaft...
Is the zero value appearing, if you are pedaling forwards, too? Perhaps it's a kind of direction detection signal.

The quarter turn dead spot (zero value) occurs in either pedal direction. With casainho's torque-only torque sensor fw this creates a 90 deg section of pedal rotation where the motor won't start with pedal pressure, this is how I first noticed the issue.

Anyway, thanks for the information, I obviously need to do some homework on the different types. I thought all the Sempu's worked by shaft bending (as opposed to twisting..?), it sounds like the later generations are a better option..
 
I've implemented the assistance from standstill in torquesensor-mode, after a user in the german forum asked for a similar function in PAS+THROTTLE mode, too. Now the throttle works as push assistant up to 6 km/h in all ride modes. For correct 6km/h the gear ratio has to have the correct value.
I've not tested the "Torque-Override" in torquesensor-mode on the street yet, only with my testbench.
geofft, perhaps you can try it and give feedback.
I've published it in a new fork, to avoid conflicts with the newer commits of Xnyle:
https://github.com/stancecoke/BMSBattery_S_controllers_firmware/tree/Torque_Override

As I used an older commit as starting point, the java tool is older, too.
I hope we can come back to a common master with Xnyles activies soon.

regards
stancecoke
 
I bought a KT36SVPR controller after all and after investigating it for a while and finding out the read out protection was enabled, decided to go for it and flashed it with this firmware and presumably a safe configuration to begin with and then: Boom! Nothing happens...

Well, I was kinda expecting this. Not that your firmware sucks, but I always tend to miss some crucial bits of information and obvious steps and break things while assembling them :D Well, at least the LCD shows full battery so at least the program is running. I think I need to check the parameters and probably the circuit board as well.

EDIT:
Ok now I feel really stupid, this is exactly what I was talking about. Immediately after hitting submit for this post, I thought about the "Throttle and PAS" option and decided to quickly try the Torque-Simulation and ta-da, it's alive! You see, the bike with the factory parts never required me to hit the throttle before pedaling so that's what threw me off the trail. This is just beautiful and it seems to run with no problems.
 
mutetus said:
I thought about the "Throttle and PAS" option and decided to quickly try the Torque-Simulation and ta-da, it's alive! You see, the bike with the factory parts never required me to hit the throttle before pedaling so that's what threw me off the trail. This is just beautiful and it seems to run with no problems.

Well done for getting it up and running, it's all a bit confusing when you first start. Have you played with 'offroad mode' yet? This will give you always-on throttle in Torque-sim mode... :wink:
 
I've not tested the "Torque-Override" in torquesensor-mode on the street yet, only with my testbench.
geofft, perhaps you can try it and give feedback.

stancecoke, I seem to be having all sorts of torque sensor issues at the moment, all hardware related I think. I'm giving up with this for the time being and have gone back to using torque-sim fw for now.
Will re-visit this sometime in the future and hopefully give you some useful feedback.
 
geofft said:
Well done for getting it up and running, it's all a bit confusing when you first start. Have you played with 'offroad mode' yet? This will give you always-on throttle in Torque-sim mode... :wink:
No, haven't got into that part yet, I was so tired last night after getting it to work in the first place :) I'm gonna study the features a bit more now and see how the code works. Hoping to be of some help for this project somehow. I could immediately see few spots for code optimization at least (which the programmers probably know already, even I don't begin the coding by optimizing :D ). Not sure about the code formatting though, it seemed to vary anyways.
I also now have LCD7 with usb port for bluetooth-module, I already ordered more crap (like my wife thinks about it) to build the bt transceiver.
 
geofft said:
stancecoke, I seem to be having all sorts of torque sensor issues at the moment, all hardware related I think. I'm giving up with this for the time being and have gone back to using torque-sim fw for now.

It looks like you're really out of luck with your torquesensors :(
Where did you buy them?

You can try the new fork anyway, as it enables the push assistance from standstill in torque-simulation mode now, too. Perhaps that's useful for you.

I'll try the torquesensor-mode this weekend probably.

regards
stancecoke
 
It looks like you're really out of luck with your torquesensors :(

Partly unlucky and also a large dose of stupidity on my part. The first one I received had the torque o/p stuck on 3.0v (should be 1.5v) with no reaction to pedal torque - but it was over 3 months after purchase before I tested it, so unsurprisingly the seller wasn't interested in helping.

The second one I made a stupid careless mistake when installing and without thinking spun the collar on the wrong side to finally tighten the sensor in the bottom bracket. This rotated the entire unit inside the bottom bracket and wrenched the cable off... :oops:
Managed to splice and reconnect the cable and initially all appeared to be working well with your software, but now I seem to have further problems. I'm guessing that wrenching the cable has caused other issues inside the sensor.

So at the moment I'm feeling pretty pissed off with myself for being so clumsy, so best to give this a rest for now. When I'm in a better frame of mind I'll remove and try to dismantle this sensor to see what damage is done and hopefully make a repair.

Seller was Phoebeliu - they seem to have provided many of these sensors without issue and I don't really hold them responsible for my mistakes - I'll probably have to 'write this off to experience' as the English saying goes.... :(
 
OK, I hope you'll be able to repair one of the sensors :)
It is a pity that there is no European dealer who sells the Sempus at a fair price.
I only know one german offer in bundle with a controller and display...

regards
stancecoke
 
Question to you guys,
I have got the controller KT48ZWSRL and I've found the information "T36/48 ZWS types have no phase current sensor mounted, so you can't use the simplified FOC with them!" Does it mean that Sinewave mode just doesn't work ?
Are there any advantages of flexible opensource firmware for KT48ZWS controllers ? Is worth to install it ?
Thanks for the response in advance.
Jerzy
 
gulczas said:
Are there any advantages of flexible opensource firmware for KT48ZWS controllers ?

Main advantages:
- less noise (sinusodial commutation)
- possibility to connect a torquesensor directly

But you have to disable the simplified FOC in the code with a ZWS and you have to use the hallsensors.

Xnyle was very hardworking during the last weeks, we are very proud to present the beta release of the Android app now! We are looking for betatesters, if interested please contact Xnyle via PM or just here in the thread!

In the video you can see the Java tool for basic settings and flashing the firmware. The greyed parameters can be set with the app afterwards also. Next you can see the app and the push assistance function with the throttle up to 6 km/h and finally the motor working in torque simulation mody by turning the "pedals" :wink:
Offroad mode can be activated by the brake lever as known or by a "magic" touch to the smarthphone screen 8)

regards
stancecoke




[youtube]ONkSIJ55qi0[/youtube]
 
stancecoke said:
Xnyle was very hardworking during the last weeks, we are very proud to present the beta version of the Android app now! We are looking for betatesters, if interested please contact Xnyle via PM or just here in the thread!
What a nice looking app!!

Seems it has very tecnhical information, good for developers debug -- I assume it is not targeted for non tecnhical users.
 
It would be easy to create another non technical dashboard screen.

But then its main purpose is to know and change what's going on inside that black or silver box.

For me it will replace the original display, there are cheap smartphones for under 50€/$ out there so i will just mount one of them and have more flexibility and insight than any commercially available display could ever provide.

For almost the same price that is.

Just have to find one that looks really crappy, so it doesn't get stolen :wink:
 
Xnyle said:
It would be easy to create another non technical dashboard screen.

But then its main purpose is to know and change what's going on inside that black or silver box.

For me it will replace the original display, there are cheap smartphones for under 50€/$ out there so i will just mount one of them and have more flexibility and insight than any commercially available display could ever provide.

For almost the same price that is.

Just have to find one that looks really crappy, so it doesn't get stolen :wink:
Can you please give the link to github where the code is?
 
I will not put it on Github as long as it's considered beta.

If you tell me your Gitlab handle I'll invite you though (and everyone else who asks).
 
As ebike market grows, more users and developers are joining!! Now a developer did the firmware for XH18LCD (currently only for working with TSDZ2 original, but should be simple to add support for other firmwares. This LCD also uses the same STM8 microcontroller as KT motor controllers, TSDZ2 motor controller and KT LCDs).

I wish firmware for KT could be developed further to support this LCDs.

hurzhurz said:
I have now started a collection for information that are needed to develop custom firmware for the XH18LCD:
https://github.com/hurzhurz/xh18lcd

And I have also created a example firmware that supports most features of the original firmware.
https://github.com/hurzhurz/xh18lcd/tree/master/development
custom-firmware.jpg

Though, it is made with an Arduino port for STM8. Probably not very efficient and not the best code style.
Probably better to make a one version from scratch than to enhance this one.
 
Hi everyone,
I’m a new user/participant of this open-source ebike project. Thanks to all the instructions of Casainho and Stancecoke after working out for about a few hours I could luckly manage to compile and adjust de parameters to my needs in the java parameter configurator. My ebike configuration is as follows:
- 28” with AKM 100SX (q100 equivalent) front wheel motor
- KT24/36SVP Controller
- PAS sensor with 5 magnets
- 10 Cell 8A Lipo Battery (2X 5cell HK battery in series)
- KT-LCD3 Display
- Using ‘only PAS’ with the Torque-Simulation mode
- Max. speed with full battery is around 30Km/h

I could get a smooth run only with ‘high’ PAS timeout '15000' and Ramp end '5000' values. Any other suggestions over these values are appreciated.


I also made my own Bluetooth module as described and tested it with success. I guess BT software communication with the controller needs to be improved. For the moment I prefer LCD3 for the convenience of use.

I have a small issue with the battery indicator on LCD3. It seems that my cutoff voltage setting is not correct, it shuts down the controller at about 35V. How can I improve the accuracy of reading on LCD3.

My programming skills are limited but I’ll be happy to test and report any new improvement.

Best Regards,
Cencen
 
stancecoke said:
Xnyle was very hardworking during the last weeks, we are very proud to present the beta release of the Android app now! We are looking for betatesters, if interested please contact Xnyle via PM or just here in the thread!

In the video you can see the Java tool for basic settings and flashing the firmware. The greyed parameters can be set with the app afterwards also. Next you can see the app and the push assistance function with the throttle up to 6 km/h and finally the motor working in torque simulation mody by turning the "pedals" :wink:
Offroad mode can be activated by the brake lever as known or by a "magic" touch to the smarthphone screen 8)

regards
stancecoke


BluOSEC.png

[youtube]ONkSIJ55qi0[/youtube]
Hi stancecoke,
I would very much like to test the beta version of new android app. Thanks and regards.
Cencen
 
Xnyle was very hardworking during the last weeks, we are very proud to present the beta release of the Android app now! We are looking for betatesters, if interested please contact Xnyle via PM or just here in the thread!

More good work from Xnyle.... 8)

Unfortunately I'm having to catch up on some diy/home improvements, etc, at the moment :( so haven't got too much time available. Hopefully that will soon change and I can help with some testing on this.
 
stancecoke said:
cencen said:
I would very much like to test the beta version of new android app.

welcome to the project! Xnyle has added the apk-file to the github repo today. Just copy it to your smartphone and install it.

regards
stancecoke

You forget to add the name of the file " BluOsec-release.apk"

This is great news for me, there will be an opportunity to observe the behavior of the controller.
One more note for the configurator, if you do not plan to start from the throttle later, then probably this option should be removed from the menu to exclude the torment of people with an attempt to ride a bicycle from their place without help of the pedals :)
Since my hopes to make a good electric car with this firmware firmware probably never come true :(
 

Attachments

  • 41XkMMUcatL.jpg
    41XkMMUcatL.jpg
    24.6 KB · Views: 3,728
Back
Top