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

Electric Motors and Controllers
honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 12 2018 1:13pm

Guys I've found ZFlasher AVR android app to work for flashing EEPROM of my charging power supply..

Isn't there an app which will enable us to have multiple settings/compiled fw copy's on phone and flash by OTG cable on road?

I've found STM8/32 Bluetooth flashloader, doesn't support our MC.

Edit: ZFlasher STM32 (only) exists, but doesn't recognize my programmer.

Offtopic - for Bluetooth communication (like original kunteng Bluetooth module) can we use SOFT pads, Or some other pins like those which lcd uses?

racingame   10 W

10 W
Posts: 95
Joined: Jan 26 2018 9:40am

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

Post by racingame » Mar 12 2018 10:35pm

honya96 wrote:
Mar 12 2018 1:07pm
racingame wrote:
Mar 12 2018 10:50am
Does anyone know how the Hall sensor connector used in this Sunstar motor is called? I have to buy one to make an adapter for the Kunteng controller.

Image
I don't know that one, just do your search..

Or you can replace them all with xh2.54 you can buy whole set for few bucks
And how would you connect it to the hall sensor female on the motor?

Image

User avatar
stancecoke   10 kW

10 kW
Posts: 896
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Mar 13 2018 2:05am

honya96 wrote:
Mar 12 2018 1:13pm
for Bluetooth communication (like original kunteng Bluetooth module) can we use SOFT pads, Or some other pins like those which lcd uses?
A guy from the german forum posted a photo with the wires from the Kunteng BT module connected to the PCB (Board revision KTE-6S3-D3c) but I don't know the µC-pins, the solder pads are connected to. :-(. But I would suggest to use a simple and cheap HM-10 BT-module and connect it to Rx and Tx of the display connector (like Lishui does). There are many code examples for this module available. I'm not very familiar with BLE-protocols, but the one the original Kunteng-Module uses, is different from the HM-10

Image

regards
stancecoke

racingame   10 W

10 W
Posts: 95
Joined: Jan 26 2018 9:40am

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

Post by racingame » Mar 13 2018 9:47am

I connected phases, hall sensor and throttle to my motor but it spins only for half a second and it stops immediately. What could it be? I tryed all possible 9 combinations of the 3 phases cables.

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 13 2018 9:53am

racingame wrote:
Mar 13 2018 9:47am
I connected phases, hall sensor and throttle to my motor but it spins only for half a second and it stops immediately. What could it be? I tryed all possible 9 combinations of the 3 phases cables.
6 phase cable combinations 6 hall - 36 total. Is it with stock fw?

racingame   10 W

10 W
Posts: 95
Joined: Jan 26 2018 9:40am

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

Post by racingame » Mar 13 2018 11:00am

honya96 wrote:
Mar 13 2018 9:53am
racingame wrote:
Mar 13 2018 9:47am
I connected phases, hall sensor and throttle to my motor but it spins only for half a second and it stops immediately. What could it be? I tryed all possible 9 combinations of the 3 phases cables.
6 phase cable combinations 6 hall - 36 total. Is it with stock fw?
Ok, I found out the combination. Yes, it still has stock fw. Btw, this is STM8, not STM32 right? I guess it will be hard for someone with 0 experience about embedded programming to learn how to program one of these chips :? .

User avatar
stancecoke   10 kW

10 kW
Posts: 896
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Mar 13 2018 2:08pm

racingame wrote:
Mar 13 2018 11:00am
I guess it will be hard for someone with 0 experience about embedded programming to learn how to program one of these chips :? .
I suggest to start with a little development board and an electronic starter set
Then you can play around with basic i/o functions like the classic "blink" example or UART communication.

Of course it is much easier to start with a Atmel or STM32 board on the arduino platform as there are much more examples, but the approach is the same in principle. One hurdle is the makefile you have to build on your own using SDCC but you could just edit the makefile from our firmware.

There are commercial toolchains for STM8 (like Cosmic, that's free for STM8) available, but I have no experience with this.

This link gives a good entry I think.

regards
stancecoke

monsterguy   1 µW

1 µW
Posts: 2
Joined: Feb 26 2018 10:49am

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

Post by monsterguy » Mar 15 2018 2:56pm

I thought I better ask some advice, just to make sure I'm not definitely buying the wrong thing :)

I have a Giant Syncdrive Hub - 36V 250W with Hall Sensors. I can't find much of anything about it, so I have no idea what it's real ratings are.

I'm going to buy an LCD5 and I've been looking at this 36V 350W Sine Wave Controller from PSWPower.

The rated power power seems rather low, at 8A. Is that something I should worry about or will it *probably* be fine?

...and the main point of asking in this thread, it's likely to work with this firmware, right?

I'm fairly certain it's right, but I'd rather not wait 5-6weeks for delivery, more than once :)

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 16 2018 4:21am

monsterguy wrote:
Mar 15 2018 2:56pm
will it *probably* be fine?
Yes, that controller works.

racingame   10 W

10 W
Posts: 95
Joined: Jan 26 2018 9:40am

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

Post by racingame » Mar 16 2018 9:30am

How do I load the S12S settings while writing the firmware? I'd like to write it for 36V10A battery.

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 16 2018 7:04pm

racingame wrote:
Mar 16 2018 9:30am
How do I load the S12S settings while writing the firmware? I'd like to write it for 36V10A battery.
?write?

I guess that if you want to go with main branch you need older version to get it working now, then it's "easy" by Java tool.

Set 10s battery and start with setting less than half the current you want.

If you need "high speed motor" - stancecoke's branch then start by clicking link at his signature and there "alternative"

best is to read this thread a lot, back where I was trying it. There are solutions to all problems you can get I believe :lol:

Keep in mind both versions are not perfect yet and you will need to spend a lot of time with it, while still far from what I would call "writing"

monsterguy   1 µW

1 µW
Posts: 2
Joined: Feb 26 2018 10:49am

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

Post by monsterguy » Mar 16 2018 8:47pm

honya96 wrote:
Mar 16 2018 4:21am
monsterguy wrote:
Mar 15 2018 2:56pm
will it *probably* be fine?
Yes, that controller works.
Thanks!

I guess I'll be back in a month or so, with more questions :)

racingame   10 W

10 W
Posts: 95
Joined: Jan 26 2018 9:40am

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

Post by racingame » Mar 19 2018 8:48am

honya96 wrote:
Mar 16 2018 7:04pm
racingame wrote:
Mar 16 2018 9:30am
How do I load the S12S settings while writing the firmware? I'd like to write it for 36V10A battery.
?write?

I guess that if you want to go with main branch you need older version to get it working now, then it's "easy" by Java tool.

Set 10s battery and start with setting less than half the current you want.

If you need "high speed motor" - stancecoke's branch then start by clicking link at his signature and there "alternative"

best is to read this thread a lot, back where I was trying it. There are solutions to all problems you can get I believe :lol:

Keep in mind both versions are not perfect yet and you will need to spend a lot of time with it, while still far from what I would call "writing"
I meant in the Java executable, there is no option for the S12S while being among the 2 tested controllers for this firmware. I just wanted the defalt settings for it.

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 19 2018 2:52pm

racingame wrote:
Mar 19 2018 8:48am
I meant in the Java executable, there is no option for the S12S while being among the 2 tested controllers for this firmware. I just wanted the defalt settings for it.
I think, just set half the current you want. Otherwise it works for all controllers as it is.

But now you can't flash by Java tool, and I think it doesn't work with throttle/pas. It's not tuned yet.

You need the older version or high-speed branch, which is hard to set.

geofft   1 kW

1 kW
Posts: 319
Joined: Nov 09 2012 9:41am
Location: Berkshire UK

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

Post by geofft » Mar 19 2018 3:40pm

honya96 wrote:
Mar 19 2018 2:52pm
and I think it doesn't work with throttle/pas. It's not tuned yet.
...are you talking about the master branch here? I recently downloaded the latest github master branch and after I corrected my mistake (had Torque Sensor set in config.h... :roll: ) it seemed to work 'Throttle_PAS' pretty well, certainly useable. This is with my geared motor of course, not sure about direct drive.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 19 2018 3:52pm

geofft wrote:
Mar 19 2018 3:40pm
honya96 wrote:
Mar 19 2018 2:52pm
and I think it doesn't work with throttle/pas. It's not tuned yet.
...are you talking about the master branch here? I recently downloaded the latest github master branch and after I corrected my mistake (had Torque Sensor set in config.h... :roll: ) it seemed to work 'Throttle_PAS' pretty well, certainly useable. This is with my geared motor of course, not sure about direct drive.
Ok, that may be my mistake somewhere.. I had no reaction to throttle

casainho   100 MW

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

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

Post by casainho » Mar 19 2018 4:39pm

Anyone knows if the BMSBattery torque sensor can work with Bafang BBS02 mid drive motor or any other cheap and popular mid drive motor?
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, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 19 2018 4:43pm

casainho wrote:
Mar 19 2018 4:39pm
Anyone knows if the BMSBattery torque sensor can work with Bafang BBS02 mid drive motor or any other cheap and popular mid drive motor?
I am pretty sure it's stock controller is only throttle/pas but a lot of people use BBSHD with external controller and torque sensor through CA v3

User avatar
stancecoke   10 kW

10 kW
Posts: 896
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Mar 20 2018 4:23am

honya96 wrote:
Mar 19 2018 4:43pm
but a lot of people use BBSHD with external controller and torque sensor through CA v3
Hm, how can you mount a commerially available torque sensor to a middrive where the crankshaft is integrated in the motor housing?!
Do you have an example/photo?

regards
stancecoke

casainho   100 MW

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

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

Post by casainho » Mar 20 2018 8:40am

Seems that the most cheap mid drive motor, that also includes a torque sensor (unlike Bafang mid drive motors), is the Tongsheng TSDZ2 mid drive motor.
BMSBattery sells this motors as also many others online shops. There is a lot of technical information shared by users, on forums like Endless sphere here -- please see here the notes page with a repair manual, etc: https://opensourceebikefirmware.bitbuck ... otors.html

The motor controller seems to use the same microcontroller STM8S105C6T6 as S06S and S12S motor controllers, as seen on this youtube video. This means we should be able to develop firmware with minor efforts!!
But we can also just skip the original controller and use an S06S running our firmware. Anyway, we would need to test the original torque sensor as it may be different from the BMSBattery torque sensor.

Here a screenshot showing the microcontroller used:
Image

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, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

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

Post by honya96 » Mar 20 2018 10:51am

stancecoke wrote:
Mar 20 2018 4:23am
honya96 wrote:
Mar 19 2018 4:43pm
but a lot of people use BBSHD with external controller and torque sensor through CA v3
Hm, how can you mount a commerially available torque sensor to a middrive where the crankshaft is integrated in the motor housing?!
Do you have an example/photo?

regards
stancecoke
Ok, my bad.

I just meant that CA v3 has the function, and people use CA v3.

wasnt thinking about HW compatibility...

User avatar
stancecoke   10 kW

10 kW
Posts: 896
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Mar 20 2018 3:48pm

casainho wrote:
Mar 20 2018 8:40am
Anyway, we would need to test the original torque sensor as it may be different from the BMSBattery torque sensor.
I've analyzed that middrive unit already 8) , see here.

You have to put a carrier frequency on the primary coil and amplify the current in the primary ciruit to get the torque signal. So it is much more elaborately to get a usable torque value from this sensor than from the BMS-Sensor....

regards
stancecoke

casainho   100 MW

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

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

Post by casainho » Mar 21 2018 4:32am

stancecoke wrote:
Mar 20 2018 3:48pm
I've analyzed that middrive unit already 8) , see here.

You have to put a carrier frequency on the primary coil and amplify the current in the primary ciruit to get the torque signal. So it is much more elaborately to get a usable torque value from this sensor than from the BMS-Sensor....
GREAT!! Seems you did a LOT of work, I really appreciate.

Well, I believe the square wave on primary will "transport" energy to secondary coil and then for the circuit of torque sensor. I would say the torque sensor will change in some way the amplitude of the square wave on the primary coil... and that way would be easy to measure the signal change...

Why aren't you using that motor? what do you think about it?
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, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

User avatar
stancecoke   10 kW

10 kW
Posts: 896
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Mar 21 2018 5:46am

casainho wrote:
Mar 21 2018 4:32am
I would say the torque sensor will change in some way the amplitude of the square wave on the primary coil... and that way would be easy to measure the signal change...
You can see the change of torque in the current only, see the oszillograph. The difference is just a little peak in the signal.

Image
casainho wrote:
Mar 21 2018 4:32am
Why aren't you using that motor? what do you think about it?
I buyed it just for analysing the torque-sensor and have sold it again some time ago. I rode just very few kilometers with it. I live in a flat area, so I have no need for a middrive. I prefer a noiseless directdrive hubmotor.
I think this middrive is not suited for heavy duty in the mountains, due to plastic gearwheels. But all relevant spare parts are available easily.

regards
stancecoke

casainho   100 MW

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

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

Post by casainho » Mar 21 2018 6:03am

stancecoke wrote:
Mar 21 2018 5:46am
I buyed it just for analysing the torque-sensor and have sold it again some time ago. I rode just very few kilometers with it. I live in a flat area, so I have no need for a middrive. I prefer a noiseless directdrive hubmotor.
I think this middrive is not suited for heavy duty in the mountains, due to plastic gearwheels. But all relevant spare parts are available easily.
Ok, thanks. I don't plan to buy this motor soon, so I will keep focus on current motors and controller.

I just saw a new version of SDCC that support STM8 but unfortunately, that issue of not being able to initialize static variables inside functions, still persist :-(
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, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

Post Reply