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

Electric Motors and Controllers
geofft
100 W
100 W
Posts: 148
Joined: Nov 09, 2012 9:41 am
Location: Berkshire UK

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

Post by geofft » Dec 18, 2017 4:47 pm

I've been trying out your firmware for a short time on the road today, I've a few early observations, will give some more detail when I get a bit more time.
Geoff.
Stancecoke, a bit more info on what I found today with the Torque Simulation firmware branch. My setup is Q128H, S06S, SLCD3, 48v 12s lipo. I'm using the PSWpower version of the S06S, this is very similar to the BMS version and seems to operate in exactly the same way. I tried three of the four modes:-

Ride Mode Throttle.
This worked very well, noticed some oscillation in motor assist during acceleration but once up to speed was smooth and quiet.

Throttle and PAS
This not so good - motor gave no response to either throttle or PAS input. Whilst trying smelt something burning and realised controller was seriously hot and hit the battery switch before any damage done, definitely something not right here. A bit of a disappointment as this is the mode I normally like to ride.

Torque Simulation
This mode worked but with some rather fierce and alarming motor surges. These happened 1) At initial switch on from the SLCD3, 2) If pedals rotated even slightly backwards, 3) If the cycle was pushed backwards. These surges were quite short (around 1 sec duration) but were powerful and could pull the bike from your hands if you weren't expecting them. When finally out on the road however it worked well, and the torque simulation feature built the motor power up in a pleasantly gradual manner as you increased cadence.

Didn't try the Torque Sensor mode as I don't have one fitted.

...so a bit of a mixed bag, some good, some not so good. Obviously early days though and shows great promise but clearly needs a little more developement and testing, which I'm sure is what you expected.... :)
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

casainho
100 kW
100 kW
Posts: 1470
Joined: Feb 14, 2011 2:43 pm

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

Post by casainho » Dec 18, 2017 5:12 pm

You really need go with my firmware as you seem to mention issues that seem potential deadly to your controller and that I improved already and I think Stancecoke version lacks behind:
- some small issues on the motor controller, like on startup and while accelerating
- motor protection to avoid being stuck and powered
- PAS and throttle works well with PAS detection of backward pedals rotation

And I am using almost the same components as you: Q85, 24v battery, LCD3 and S06S. I can fast help you getting a main.h file for your hardware configuration.
Developer of the Flexible OpenSource firmware for EBike motor controllers:
- Kunteng/BMSBattery VLR FOC motor controller: https://opensourceebikefirmware.bitbucket.io/
- TongSheng TSDZ2 mid drive motor controller: https://opensourceebikefirmware.bitbuck ... ment_tsdz2

User avatar
KingQueenWong
100 mW
100 mW
Posts: 38
Joined: Dec 18, 2016 7:07 am

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

Post by KingQueenWong » Dec 19, 2017 1:39 am

MCU:STM32F103C8T6
OP:LM324
MOSFET:FBM100N80
DRIVER:FAN7842
LINK:https://detail.1688.com/offer/559010270 ... 0.0.B5qtH0
LINK:http://www.nerch.xin/
Attachments
15136649995a38b1e74100a.jpg
15136650985a38b24a7e08c.jpg
15136651595a38b287d203d.jpg
15136652415a38b2d9e1350.jpg

User avatar
stancecoke
10 kW
10 kW
Posts: 558
Joined: Aug 02, 2017 2:56 pm

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

Post by stancecoke » Dec 19, 2017 2:32 am

geofft wrote:
Dec 18, 2017 4:47 pm
Stancecoke, a bit more info on what I found today with the Torque Simulation firmware branch.
Thank you for your feedback! I think that's a great success!
It took me several days/weeks to get the motor turning the first time, you did it at just one day :-).

Due to the missing direction detection it's normal, that the motor starts running forewards if you push your bike backwards. In torque-sensor-mode this will be no problem, as the motor power will be zero as long as the torque is zero.
The only strange thing is the THROTTLE+PAS behaviour. In this mode, the motor should behave in the same way as in THROTTLE mode, the only difference is, that the motor should stop, if you are not pedaling. I never tried that mode on the street.
casainho wrote:
Dec 18, 2017 5:12 pm
I think Stancecoke version lacks behind
That's right for some safety issues and the direction detection, but it's miles in front in easy and intuitive usage and in documentation/parameter explanation.

We should work on that, if you put all user relevant parameters in the config.h I can update the Javatool for the master branch, as I have offered before.

regards
stancecoke

casainho
100 kW
100 kW
Posts: 1470
Joined: Feb 14, 2011 2:43 pm

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

Post by casainho » Dec 19, 2017 2:39 am

stancecoke wrote:
Dec 19, 2017 2:32 am
That's right for some safety issues and the direction detection, but it's miles in front in easy and intuitive usage and documentation/parameter explanation.

We should work on that, if you put all user relevant parameters in the config.h I can update the Javatool for the master branch, as I have offered before.
I will in some hours. So I think I will create a config.h file for Q85 motor, etc and put a lot of comments to help users. Try to structure the file in a way that is logic to understand and have only there the options needed but keep some defines on main.h that are for developers. And try keep always that config file updated and to be a reference, I will not change everytime I change to my personal configs.

I hope that will be ok for the Java tool. Let me finnish so than we can talk again.
Developer of the Flexible OpenSource firmware for EBike motor controllers:
- Kunteng/BMSBattery VLR FOC motor controller: https://opensourceebikefirmware.bitbucket.io/
- TongSheng TSDZ2 mid drive motor controller: https://opensourceebikefirmware.bitbuck ... ment_tsdz2

User avatar
stancecoke
10 kW
10 kW
Posts: 558
Joined: Aug 02, 2017 2:56 pm

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

Post by stancecoke » Dec 19, 2017 5:06 am

OK, that sounds good!

I found an error with THROTTLE + PAS Mode. The JavaTool writes

Code: Select all

#define THROTTLEANDPAS
to the config.h, but the code expects

Code: Select all

#define THROTTLE_AND_PAS
I can fix this bug this evenig.
@geofft: you can edit the config.h by hand, save the changes and double click on start_compiling.bat for flashing, if you are impatient :wink:.

regards
stancecoke

geofft
100 W
100 W
Posts: 148
Joined: Nov 09, 2012 9:41 am
Location: Berkshire UK

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

Post by geofft » Dec 19, 2017 5:28 am

stancecoke wrote:
Dec 19, 2017 5:06 am
I can fix this bug this evenig.
@geofft: you can edit the config.h by hand and double click on start_compiling.bat for flashing, if you are impatient :wink:.
Thanks for digging out this bug but there's absolutely no hurry. I'm sure you'll appreciate that there's other firmware out there that I'm trying but I'll certainly come back to this and retest it when time permits.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

casainho
100 kW
100 kW
Posts: 1470
Joined: Feb 14, 2011 2:43 pm

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

Post by casainho » Dec 19, 2017 5:41 am

stancecoke wrote:
Dec 19, 2017 5:06 am
OK, that sounds good!
Just created and tested a config.h file for the following hardware combination:

// This file is the firmware configuration for the following hardware combination:
// - throotle and PAS; using motor current/torque and/or wheel speed controller
// - PAS with 8 magnets and with configured max cadence of 90 RPM
// - LCD3
// - battery pack Li-ion 24V
// - BMSBattery S06S 24/36V motor controller
// - BMSBattery Q85 motor 328RPM (direct drive motor)

I think may be easy to understand for Geofft (and also for Stancecoke to adapt Java tool):
Image

Stancecoke, you will need to do some good changes to Java tool as I am using less options and some that are now different.
Also, can you please make the tool and needed files in one specific folder like "firmware_configuration_tool"?
And I think would be great if the Java tool had help explanation information for each field, just like I did in the config.h.
If you start, I can then go and also help to keep the tool updated.

The firmware is almost finished, now is time for documentation :-)
Maybe we could put the main page with the current project information (advantages, status e history) + information on how to install the firmware. And keep the current notes as a separated file for developers - this file could be linked from the main file/site.
Would you help to write that notes files, for Windows and maybe in EN?
Developer of the Flexible OpenSource firmware for EBike motor controllers:
- Kunteng/BMSBattery VLR FOC motor controller: https://opensourceebikefirmware.bitbucket.io/
- TongSheng TSDZ2 mid drive motor controller: https://opensourceebikefirmware.bitbuck ... ment_tsdz2

geofft
100 W
100 W
Posts: 148
Joined: Nov 09, 2012 9:41 am
Location: Berkshire UK

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

Post by geofft » Dec 19, 2017 6:39 am

Speaking here as your average dumb end user, it would be good if you guys worked within a common framework of easy to understand installation proceedures. This would hopefully still allow you to develop your own individual firmware but would make it easier to attract non-coders like myself to give it a try and do some testing for you. I guess with so many motor/battery/controller options out there, the more testers the better...
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

User avatar
stancecoke
10 kW
10 kW
Posts: 558
Joined: Aug 02, 2017 2:56 pm

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

Post by stancecoke » Dec 19, 2017 7:03 am

geofft wrote:
Dec 19, 2017 6:39 am
it would be good if you guys worked within a common framework of easy to understand installation proceedures.
I already tried to keep the installation procedere as simple as possible for the windows solution :) . And as you managed it even with a tutorial that's written in german, I hope it's OK (even for a less experienced pc-users than you?!). Had you any trouble within the installation? Would a proper english translation of the tutorial bring an improvement?

There's no common platform like arduino available for the STM8, yet. There are only some experimental approaches, that won't help us at the moment, I guess.

regards
stancecoke

User avatar
stancecoke
10 kW
10 kW
Posts: 558
Joined: Aug 02, 2017 2:56 pm

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

Post by stancecoke » Dec 19, 2017 9:23 am

I've just done a quick and dirty update of the Java-Tool in the master branch. It's not perfect yet, but it should work.
There are no comments in the created config.h file, but I've added some "mouse over" pop-up online help to a few parameters, as most of them are self-explaining, further online help will be added later. As long as you don't use the Java Tool, casainhos commented original config.h won't be touched.
I left the Cheat time definitions in the tool, as casainho mentioned, that he plans to implement the cheat soon :wink: .
The tool has to be located in the main folder actually, as there is no path information in the Java-Code yet.

regards
stancecoke

C#ROME_B_Master.png
C#ROME_B_Master.png (61.44 KiB) Viewed 543 times
Attachments
config.h
(1.1 KiB) Downloaded 37 times

User avatar
stancecoke
10 kW
10 kW
Posts: 558
Joined: Aug 02, 2017 2:56 pm

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

Post by stancecoke » Dec 19, 2017 1:16 pm

I've updated the german wiki now and referenced everything to the master branch. The bugfix for the Throttle+PAS mode in the torque-simulation branch is done, also. I won't do further development on this branch.

@casainho: can you check the explanation of the parameters in the wiki and give suggestions for an improvement if necessary, please.
https://www.pedelecforum.de/wiki/doku.p ... ool_master
I don't know, if you want to place an english translation on bitbucket...

Regards
stancecoke

RC23
10 µW
10 µW
Posts: 6
Joined: Jul 07, 2014 11:21 pm

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

Post by RC23 » Dec 19, 2017 2:23 pm

Did anyone use an LCD2 display? The Wiki speaks only from the models LCD3 and LCD5. The LCD2 is smaller and owns all needed functions.
Munich, Germany

casainho
100 kW
100 kW
Posts: 1470
Joined: Feb 14, 2011 2:43 pm

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

Post by casainho » Dec 19, 2017 2:39 pm

RC23 wrote:
Dec 19, 2017 2:23 pm
Did anyone use an LCD2 display? The Wiki speaks only from the models LCD3 and LCD5. The LCD2 is smaller and owns all needed functions.
I buy my components from BMSBattery and the cheaper is LCD5.
Developer of the Flexible OpenSource firmware for EBike motor controllers:
- Kunteng/BMSBattery VLR FOC motor controller: https://opensourceebikefirmware.bitbucket.io/
- TongSheng TSDZ2 mid drive motor controller: https://opensourceebikefirmware.bitbuck ... ment_tsdz2

casainho
100 kW
100 kW
Posts: 1470
Joined: Feb 14, 2011 2:43 pm

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

Post by casainho » Dec 19, 2017 2:49 pm

stancecoke wrote:
Dec 19, 2017 1:16 pm
@casainho: can you check the explanation of the parameters in the wiki and give suggestions for an improvement if necessary, please.
https://www.pedelecforum.de/wiki/doku.p ... ool_master
I don't know, if you want to place an english translation on bitbucket...
My girlfriend bought a new computer that will take 4 weeks to arrive, so no mobile app soon.

I am buying components to finish my 3 ebikes, using on all of them, the torque sensor. I will also buy S06S-BT because I think we will go with Bluetooth in future, mainly to configure the specific features of our firmware.

So now I want to focus on documentation, but only in EN. I will not check the DE wiki (sorry) but use instead my time to make EN documentation. I think germans can translate from EN, as anyone else. And the Java tool seems very important and Windows install process. I would like to help improve Java tool and I would like to know which IDE are you using to design the user interface.

Also the cheat mode, maybe we could use the same terms others are using: street legal mode and offroad mode. The sequence on the brakes is just a way to select one of that 2 modes, since with LCD we can't do it.
Developer of the Flexible OpenSource firmware for EBike motor controllers:
- Kunteng/BMSBattery VLR FOC motor controller: https://opensourceebikefirmware.bitbucket.io/
- TongSheng TSDZ2 mid drive motor controller: https://opensourceebikefirmware.bitbuck ... ment_tsdz2

User avatar
stancecoke
10 kW
10 kW
Posts: 558
Joined: Aug 02, 2017 2:56 pm

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

Post by stancecoke » Dec 19, 2017 3:17 pm

RC23 wrote:
Dec 19, 2017 2:23 pm
Did anyone use an LCD2 display?
I assume, that the LCD2 uses the same protocol as the LCD3/5, so just try if it works :wink:
casainho wrote:
Dec 19, 2017 2:49 pm
I will not check the DE wiki
That is really a pity, I think google translate would give you 85% for an english documentation on bitbucket. But that's your decision of course.
casainho wrote:
Dec 19, 2017 2:49 pm
I would like to help improve Java tool and I would like to know which IDE are you using to design the user interface.
That is very simple, I use Eclipse for Java-Developers with the WindowBuilder plugin. You can find the recent sourcecode of C#ROME-B in the tools folder of the master branch on github. 8)

regards
stancecoke

RC23
10 µW
10 µW
Posts: 6
Joined: Jul 07, 2014 11:21 pm

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

Post by RC23 » Dec 19, 2017 3:26 pm

And here another online translate tool which works better than Google translate with a better language quality. Please try it.

https://www.deepl.com/translate
Munich, Germany

casainho
100 kW
100 kW
Posts: 1470
Joined: Feb 14, 2011 2:43 pm

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

Post by casainho » Dec 19, 2017 4:20 pm

stancecoke wrote:
Dec 19, 2017 3:17 pm
That is really a pity, I think google translate would give you 85% for an english documentation on bitbucket. But that's your decision of course.
I mean I will use all the resources available, including translation, but I will not comment for improvements on that wiki in DE.
Developer of the Flexible OpenSource firmware for EBike motor controllers:
- Kunteng/BMSBattery VLR FOC motor controller: https://opensourceebikefirmware.bitbucket.io/
- TongSheng TSDZ2 mid drive motor controller: https://opensourceebikefirmware.bitbuck ... ment_tsdz2

User avatar
stancecoke
10 kW
10 kW
Posts: 558
Joined: Aug 02, 2017 2:56 pm

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

Post by stancecoke » Dec 20, 2017 2:10 am

:?: :?: :?:
casainho wrote:
Dec 19, 2017 5:41 am
Would you help to write that notes files, for Windows and maybe in EN?
Of course, but where do you want to place the note files? I'll need write access there.

RC23 wrote:
Dec 19, 2017 3:26 pm
And here another online translate tool which works better than Google translate with a better language quality. Please try it.
https://www.deepl.com/translate
Thank you for that hint! After a few tests I would say, that the results are better than on google translate!

regards
stancecoke

geofft
100 W
100 W
Posts: 148
Joined: Nov 09, 2012 9:41 am
Location: Berkshire UK

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

Post by geofft » Dec 20, 2017 6:10 am

Was asked earlier this week for some photos of the bike I'm using for trying out the firmware these guys are working hard on.

Bike is a Trek Fuel 90 (ebay purchase) which I have converted with different handlebars, seat, mudguards, rack and pannier, etc to be a multi purpose street and trail bike, also a more comfortable ride for my advancing years. Motor is a BMS Q128H which draws up to 800w with the lipo 12s battery mounted in the front of the pannier.

The diminutive size of the S06S meant I was able to mount it under the rack, this works well as it keeps it in the airflow and doesn't take up space in the pannier. The cables from the controller pass through a hole in the bottom of the pannier so the connections can be made inside - this is also convenient for placing the test S06S inside the pannier and connecting in the same way without having to remove the stock controller.
Geoff.

Hmm....for some reasons those photos haven't attached, I'll try again...
Ah...files too big it seems, will try to reduce somehow..
Attachments
IMG_20171220_102739151reduced.jpg
Trek Fuel 90
IMG_20171220_102825806reduced.jpg
Controller under rack
IMG_20171220_102619408reduced.jpg
Battery and test controller space.
Last edited by geofft on Dec 20, 2017 6:33 am, edited 1 time in total.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

casainho
100 kW
100 kW
Posts: 1470
Joined: Feb 14, 2011 2:43 pm

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

Post by casainho » Dec 20, 2017 6:21 am

I use postimage.com, works very well.
Developer of the Flexible OpenSource firmware for EBike motor controllers:
- Kunteng/BMSBattery VLR FOC motor controller: https://opensourceebikefirmware.bitbucket.io/
- TongSheng TSDZ2 mid drive motor controller: https://opensourceebikefirmware.bitbuck ... ment_tsdz2

geofft
100 W
100 W
Posts: 148
Joined: Nov 09, 2012 9:41 am
Location: Berkshire UK

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

Post by geofft » Dec 20, 2017 6:45 am

casainho wrote:
Dec 20, 2017 6:21 am
I use postimage.com, works very well.
A right-click on the photo and 'Edit in 3D Paint' did the job... :wink:
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

User avatar
stancecoke
10 kW
10 kW
Posts: 558
Joined: Aug 02, 2017 2:56 pm

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

Post by stancecoke » Dec 20, 2017 9:29 am

We could prepare a free homepage for the documentation, something like this:
https://crome-b.jimdo.com/

edit: I've discarded that idea.

regards
stancecoke
Last edited by stancecoke on Dec 20, 2017 11:34 am, edited 3 times in total.

casainho
100 kW
100 kW
Posts: 1470
Joined: Feb 14, 2011 2:43 pm

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

Post by casainho » Dec 20, 2017 9:33 am

stancecoke wrote:
Dec 20, 2017 9:29 am
We could prepare a free homepage for the documentation, something like this:
https://crome-b.jimdo.com/
Better to go with github or bitbucket pages. Please look at cherrytree 🍒 software, install and test, to write the documentation.
Developer of the Flexible OpenSource firmware for EBike motor controllers:
- Kunteng/BMSBattery VLR FOC motor controller: https://opensourceebikefirmware.bitbucket.io/
- TongSheng TSDZ2 mid drive motor controller: https://opensourceebikefirmware.bitbuck ... ment_tsdz2

casainho
100 kW
100 kW
Posts: 1470
Joined: Feb 14, 2011 2:43 pm

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

Post by casainho » Dec 20, 2017 9:50 am

stancecoke wrote:
Dec 20, 2017 2:10 am
Of course, but where do you want to place the note files? I'll need write access there.
I think we should use github or bitbucket pages to host the documentation web page. I am being using bitbucket because some limitations.

On there github or bitbucket, we just can have one public URL per project and so I am using already the http://opensourceebikefirmware.bitbucket.io/

For notes/documentation, I am using CherryTree (OpenSource and good note taking software, for the 3 OSs). I take my notes fast there then I export to HTML from there and then I put the HTML page + source file on the bitbucket. I think should keep doing like this, even if this is not collaborative as a wiki.... but at least is very fast to copy-paste information from forum, web, etc.

So, I think I can create a directory like: http://opensourceebikefirmware.bitbucke ... umentation and you could put the HTML there. Then I would link on the main documentation page, to that one. Anyway, let's go and later we can reorganize better.

Please go to https://github.com/giuspen/cherrytree/ and download the software and start writing the documentation in EN. Then I can help you to export, etc.
Also create your account on bitbucket so I can add you there to have write access.
Developer of the Flexible OpenSource firmware for EBike motor controllers:
- Kunteng/BMSBattery VLR FOC motor controller: https://opensourceebikefirmware.bitbucket.io/
- TongSheng TSDZ2 mid drive motor controller: https://opensourceebikefirmware.bitbuck ... ment_tsdz2

Post Reply