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

Electric Motors and Controllers
User avatar
Valopallo   10 W

10 W
Posts: 76
Joined: May 29 2018 1:37pm

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

Post by Valopallo » Nov 22 2019 9:01am

stancecoke wrote:
Nov 22 2019 4:07am
With a blocked motor, the phase current limitation will be active. You could check the control state, to be sure.

Use the brake of the bike to keep the speed at e.g. 10 km/h with full throttle, then you will see full amps. If not, you have to check your throttle settings throttle_min and throttle_max.

regards
stancecoke
:bolt: Thank you. Throttle min was too high and throttle max was too high. Now I know at least that I'm using all the current/power I can get. This tip should go to faq! :bolt:
BluOSEC@36V|AWD|2xS06S|15A rear DD|10A front geared|Hardtail|Tunturi

User avatar
Valopallo   10 W

10 W
Posts: 76
Joined: May 29 2018 1:37pm

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

Post by Valopallo » Nov 22 2019 9:21am

If I want more power to S06S, can I just replace my 36V battery to 48V(52V) and change the undervoltage limit from OSEC? Anything else I need to consider before doing this? Specs at the signature.
BluOSEC@36V|AWD|2xS06S|15A rear DD|10A front geared|Hardtail|Tunturi

User avatar
stancecoke   100 kW

100 kW
Posts: 1199
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 » Nov 22 2019 1:25pm

Valopallo wrote:
Nov 22 2019 9:21am
If I want more power
Do you want more torque uphill or more max speed? Higher voltage only helps for max speed. For more torque, you need more phase current. A 12Fet Controller would be better in this case.
Nexter wrote:
Nov 22 2019 5:47am
soldered directly to the correct location on the controller to flash the fimware
The controller can't be flashed via UART. You have to solder the four wires to the SWIM-Interface and have to use a STLink V2 for flashing.

regards
stancecoke

xyrus   100 µW

100 µW
Posts: 7
Joined: Sep 20 2019 5:14pm

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

Post by xyrus » Nov 25 2019 1:39pm

I converted a bird zero electric scooter for personal use with this firmware. It runs great, almost as good as the original controller. Has more than enough torque and runs silent and smooth from standstill to full throtle. It was trial and error , and I have made mistakes.

First controller I bought popped all the FETS when I had entered a wrong number in battery current limit and forgot to connect the hall sensors.

Second controller runs great, but it was a pain to find the correct motor angle, wiki specifies start with 0 if unsure. Turns out 213 was a better start point. With angle at 213 the motor jerked when switching over to 360 interpolation. After lowering it to 190 degree it is perfect.

I would like to know how I can tune the angle to the best setting, I assume the blueosec app can provide that info?

And what is the best way to tune the correction angle? I left it at default of 127, what can I expect when this value is changed? More torque, more speed, smoothness?

If anybody is interested I can post pictures of the scooter and my config used. Let me know!

qwerkus   1 kW

1 kW
Posts: 489
Joined: Jul 22 2017 4:00am

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

Post by qwerkus » Dec 18 2019 5:26am

xyrus wrote:
Nov 25 2019 1:39pm
And what is the best way to tune the correction angle? I left it at default of 127, what can I expect when this value is changed? More torque, more speed, smoothness?
I believe xyle's phone app displays angle correction. Never tried it myself though.

kgff   100 mW

100 mW
Posts: 44
Joined: Aug 18 2019 1:11pm

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

Post by kgff » Dec 19 2019 7:13pm

Is it possible via firmware to modify the c5 parameter to have higher current/amps, instead of doing a shunt mod?
I have this sensorless controller
36V/48V 500W 9Mosfets 20A Brushless DC Torque Simulation Square Wave Controller

Thanks
Last edited by kgff on Dec 20 2019 7:27am, edited 2 times in total.

User avatar
stancecoke   100 kW

100 kW
Posts: 1199
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 » Dec 20 2019 1:39am

kgff wrote:
Dec 19 2019 7:13pm
Is it possible via firmware to modify the c5 parameter to have higher current/amps
Yes for sensored systems, No for sensorless systems, the firmware doesn't support sensorless control.

regards
stancecoke

kgff   100 mW

100 mW
Posts: 44
Joined: Aug 18 2019 1:11pm

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

Post by kgff » Dec 20 2019 1:58am

stancecoke wrote:
Dec 20 2019 1:39am
kgff wrote:
Dec 19 2019 7:13pm
Is it possible via firmware to modify the c5 parameter to have higher current/amps
Yes for sensored systems, No for sensorless systems, the firmware doesn't support sensorless control.

regards
stancecoke
Is it because no one has written firmware for this specific controller, or because of technical reasons?

Does anyone know what's the shunt's resistance of this controller:
KT36/48ZWSRMH-20A 500W 9Mosfets 20A
http://www.pswpower.com/ven.php?cargo.2016-3f-3vm4
www.pswpower.com/ures/cargo/2016/3f-3vm ... hj576t.jpg

User avatar
stancecoke   100 kW

100 kW
Posts: 1199
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 » Dec 20 2019 6:46am

kgff wrote:
Dec 20 2019 1:58am
Is it because no one has written firmware for this specific controller, or because of technical reasons?
You would have to implement 6 step (block) commutation. Casainho had done it in one of his very early commits.

regards
stancecoke

kgff   100 mW

100 mW
Posts: 44
Joined: Aug 18 2019 1:11pm

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

Post by kgff » Dec 20 2019 7:47am

stancecoke wrote:
Dec 20 2019 6:46am
kgff wrote:
Dec 20 2019 1:58am
Is it because no one has written firmware for this specific controller, or because of technical reasons?
You would have to implement 6 step (block) commutation. Casainho had done it in one of his very early commits.

regards
stancecoke
I couldn't find info about what actually needs to be done to achieve it
Does it require firmwaring/adding components the controller/modding the motor? my motor has no hall sensor
btw the controller isn't sine wave, it's:
Brushless DC Torque Simulation Square Wave Controller
Thank you :thumb: :bigthumb:

User avatar
stancecoke   100 kW

100 kW
Posts: 1199
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 » Dec 20 2019 11:00am

kgff wrote:
Dec 20 2019 7:47am
Does it require firmwaring/adding components the controller/modding the motor?
It needs just software, no additional hardware. You could copy the code from casainhos commit. But you will need some basic understanding of the firmware to get it work.

regards
stancecoke

kgff   100 mW

100 mW
Posts: 44
Joined: Aug 18 2019 1:11pm

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

Post by kgff » Dec 20 2019 3:12pm

stancecoke wrote:
Dec 20 2019 11:00am
kgff wrote:
Dec 20 2019 7:47am
Does it require firmwaring/adding components the controller/modding the motor?
It needs just software, no additional hardware. You could copy the code from casainhos commit. But you will need some basic understanding of the firmware to get it work.

regards
stancecoke
How different it is to do the firmware with the "casainhos commit"? I just wonder if there is available instructions for my own sensorless setup.. is it just those github files/text that you linked that should be installed instead of other ones?

Should I follow this (your?) website for instructions? https://opensourceebikefirmware.bitbuck ... ndex4.html
WHAT IS NOT WORKING:
6-Step commutation at start from standstill

I noticed that my motor get stuck/choked when I pull the throttle "too fast" from standstill, (I can avoid it easily though),but does this issue indicate anything about the motor's/controller compatibility with firmware flashing?

and about this:
"Write Option Bytes" once. Attention! If this function is selected, the original Kunteng firmware will be irretrievably deleted! Please make sure to find out the correct phase and Hall sensor assignment on the complete system with the original firmware before deleting
-Does it mean I that I need to disassemble the motor? because I know nothing about it, it also has no hall sensor cable
-It's not possible to backup the original firmware?

User avatar
stancecoke   100 kW

100 kW
Posts: 1199
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 » Dec 20 2019 4:11pm

kgff wrote:
Dec 20 2019 3:12pm
-Does it mean I that I need to disassemble the motor?
No, the sensorless controller has a little additional PCB that generates the hall-signal from the Back-EMF of the floating phase.
You would have to start the motor in open loop until the Hall-signals are proper, than you can switch to closed loop 6-step commutation.
It's not witchcraft, but you need a deep understanding of the code to make it work. I suggest to read some papers about sensorless BLDC six-step control.

regards
stancecoke

kgff   100 mW

100 mW
Posts: 44
Joined: Aug 18 2019 1:11pm

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

Post by kgff » Dec 20 2019 4:34pm

stancecoke wrote:
Dec 20 2019 4:11pm
kgff wrote:
Dec 20 2019 3:12pm
-Does it mean I that I need to disassemble the motor?
No, the sensorless controller has a little additional PCB that generates the hall-signal from the Back-EMF of the floating phase.
You would have to start the motor in open loop until the Hall-signals are proper, than you can switch to closed loop 6-step commutation.
It's not witchcraft, but you need a deep understanding of the code to make it work. I suggest to read some papers about sensorless BLDC six-step control.

regards
stancecoke
Thanks a lot, If it takes some code learning,waiting for the st-linkv2 shipment(can take 3 months with my local postal service) and a lot of room for mistake.. maybe a shunt mod is preferable after all, do you know if it can be adjusted with a trimmer potentiometer on my specific controller ?
Is there anywhere info about the controller's (KT36/48ZWSRMH) shunt resistance, or an electric diagram of it?
I emailed pswpower, but I doubt that they will answer.. and I only have a voltmeter and oscilloscope, no watt meter & icharger

casainho   10 GW

10 GW
Posts: 4355
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Dec 20 2019 5:07pm

kgff wrote:
Dec 20 2019 4:34pm
stancecoke wrote:
Dec 20 2019 4:11pm
kgff wrote:
Dec 20 2019 3:12pm
-Does it mean I that I need to disassemble the motor?
No, the sensorless controller has a little additional PCB that generates the hall-signal from the Back-EMF of the floating phase.
You would have to start the motor in open loop until the Hall-signals are proper, than you can switch to closed loop 6-step commutation.
It's not witchcraft, but you need a deep understanding of the code to make it work. I suggest to read some papers about sensorless BLDC six-step control.

regards
stancecoke
Thanks a lot, If it takes some code learning,waiting for the st-linkv2 shipment(can take 3 months with my local postal service) and a lot of room for mistake.. maybe a shunt mod is preferable after all, do you know if it can be adjusted with a trimmer potentiometer on my specific controller ?
Is there anywhere info about the controller's (KT36/48ZWSRMH) shunt resistance, or an electric diagram of it?
I emailed pswpower, but I doubt that they will answer.. and I only have a voltmeter and oscilloscope, no watt meter & icharger
Just buy a new compatible controller, they are cheap anyway and you should take advantage on that.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

kgff   100 mW

100 mW
Posts: 44
Joined: Aug 18 2019 1:11pm

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

Post by kgff » Dec 20 2019 5:14pm

casainho wrote:
Dec 20 2019 5:07pm
kgff wrote:
Dec 20 2019 4:34pm
stancecoke wrote:
Dec 20 2019 4:11pm
kgff wrote:
Dec 20 2019 3:12pm
-Does it mean I that I need to disassemble the motor?
No, the sensorless controller has a little additional PCB that generates the hall-signal from the Back-EMF of the floating phase.
You would have to start the motor in open loop until the Hall-signals are proper, than you can switch to closed loop 6-step commutation.
It's not witchcraft, but you need a deep understanding of the code to make it work. I suggest to read some papers about sensorless BLDC six-step control.

regards
stancecoke
Thanks a lot, If it takes some code learning,waiting for the st-linkv2 shipment(can take 3 months with my local postal service) and a lot of room for mistake.. maybe a shunt mod is preferable after all, do you know if it can be adjusted with a trimmer potentiometer on my specific controller ?
Is there anywhere info about the controller's (KT36/48ZWSRMH) shunt resistance, or an electric diagram of it?
I emailed pswpower, but I doubt that they will answer.. and I only have a voltmeter and oscilloscope, no watt meter & icharger
Just buy a new compatible controller, they are cheap anyway and you should take advantage on that.
I' am limited to a relatively small one that also supports sensorless motor,it took me a lot of time to find the current one.. if you can recommend anything that is about 13x4x7cm that would be great :bigthumb:

User avatar
stancecoke   100 kW

100 kW
Posts: 1199
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 » Dec 21 2019 2:58am

kgff wrote:
Dec 20 2019 5:14pm
I' am limited to a relatively small one that also supports sensorless motor,it took me a lot of time to find the current one.. if you can recommend anything that is about 13x4x7cm that would be great :bigthumb:
There are several small controllers for sensorless motors available:
https://www.groetech.de/index.php?main_ ... cts_id=908
https://www.groetech.de/index.php?main_ ... ts_id=1057

even with FOC:
https://www.groetech.de/index.php?main_ ... ts_id=1057

But all these small controllers are limited in power. How much power do you want to get out of the controller? Even the 20 amps of your 9FET is quite a lot.

You could modify the feedback resistor R17 of the opamp circuit to get more power, but you will kill your mosfets if you increase the current too much.

regards
stancecoke
Attachments
OPamp.PNG
OPamp.PNG (23.03 KiB) Viewed 2424 times

kgff   100 mW

100 mW
Posts: 44
Joined: Aug 18 2019 1:11pm

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

Post by kgff » Dec 22 2019 4:29am

stancecoke wrote:
Dec 21 2019 2:58am
kgff wrote:
Dec 20 2019 5:14pm
I' am limited to a relatively small one that also supports sensorless motor,it took me a lot of time to find the current one.. if you can recommend anything that is about 13x4x7cm that would be great :bigthumb:
There are several small controllers for sensorless motors available:
https://www.groetech.de/index.php?main_ ... cts_id=908
https://www.groetech.de/index.php?main_ ... ts_id=1057

even with FOC:
https://www.groetech.de/index.php?main_ ... ts_id=1057

But all these small controllers are limited in power. How much power do you want to get out of the controller? Even the 20 amps of your 9FET is quite a lot.

You could modify the feedback resistor R17 of the opamp circuit to get more power, but you will kill your mosfets if you increase the current too much.

regards
stancecoke
Thanks a lot!I highly appreciate your support :bolt:
Do you know if that diagram is close enough to my controller?

speedfreak   1 µW

1 µW
Posts: 2
Joined: Jan 05 2020 4:25am

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

Post by speedfreak » Jan 05 2020 4:28am

I'm new to this, but trying to read a lot. I'm very interested in building a bike specifically to use this firmware. I'm looking for something between 350 and 500W on either 36 or 48V. Can someone point me to a good hub motor which is easily compatible with this firmware?

Also: is regenerative breaking really useful? And if so, I need to have direct drive, correct? Are direct drive 500W motors interesting or are they too low power?

User avatar
stancecoke   100 kW

100 kW
Posts: 1199
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 05 2020 2:12pm

speedfreak wrote:
Jan 05 2020 4:28am
Are direct drive 500W motors interesting or are they too low power?
What is your main riding profile? High speed in a flat area or high assistance in the mountains?

regards
stancecoke

User avatar
amberwolf   100 GW

100 GW
Posts: 29821
Joined: Aug 17 2009 6:43am
Location: Phoenix, AZ, USA, Earth, Sol, Local Bubble, Orion Arm, Milky Way, Local Group
Contact:

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

Post by amberwolf » Jan 05 2020 2:15pm

speedfreak wrote:
Jan 05 2020 4:28am
Can someone point me to a good hub motor which is easily compatible with this firmware?
all common bldc hubmotors are compatible; the motor itself has nothing to do with firmware compatibility.

it is the controller that needs to be compatible, and for that you need to look at the info at the start of the thread and/or in posts within the thread.
Also: is regenerative breaking really useful?
see here
viewtopic.php?f=2&t=7891
viewtopic.php?f=3&t=90319
and in similar threads in this list (most of which is not relevant but some are, you can tell which by title), and other posts about regen over the years on the forum:
search.php?keywords=regen*&terms=all&au ... mit=Search
And if so, I need to have direct drive, correct?
yes. whether middrive or hubmotor ina wheel, there can be no freewheels between ground and motor.
Are direct drive 500W motors interesting or are they too low power?
that depends on what you want to do. since you have given us too little information to answer usefully, you can go to http://ebikes.ca/simulator, read the entire page so you know what everythign there is and how it works and how to use it, then experiment with different systems to see how everything interacts.

also see this page
https://www.ebikes.ca/learn/power-ratings.html

it's not the motor alone; it's the entire system, that determines what you can do with it. the simulator above is what you will need to use to see this directly.

User avatar
stancecoke   100 kW

100 kW
Posts: 1199
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 05 2020 2:38pm

amberwolf wrote:
Jan 05 2020 2:15pm
the motor itself has nothing to do with firmware compatibility.
We had several reports that there are heavy vibrations with the Kuntengs in combination with some cheap chinese 1kW direct drives. I guess it's a matter of resonances due to bad L/C ratio.

regards
stancecoke

User avatar
amberwolf   100 GW

100 GW
Posts: 29821
Joined: Aug 17 2009 6:43am
Location: Phoenix, AZ, USA, Earth, Sol, Local Bubble, Orion Arm, Milky Way, Local Group
Contact:

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

Post by amberwolf » Jan 05 2020 2:44pm

oh, ok. sorry, i didn't know about that. :oops:

speedfreak   1 µW

1 µW
Posts: 2
Joined: Jan 05 2020 4:25am

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

Post by speedfreak » Jan 08 2020 3:23pm

Thank you all for the valuable information!
I'm going for a 500-ish rear wheel drive hub motor (non-direct) since I'm more fan of the stealthy look and will maybe use a single speed chain drive (to make it all really minimalistic).

I'll be mostly riding on very flat terrain (Belgium) and it's my goal to still do some pedaling myself as exercise on my commute.

Will any hub motor marked as 500W on Amazon/Aliexpress do it or are there still serious quality differences between the likes of Bafang and a no-brand hub motor? I will go for a 48V setup with a KT controller of at least 15 Amps. The LCD3 is probably the best one to use with this firmware (i don't really care about color LCD i think).

Is this (budgety) setup OK or do you guys have suggestions for improvements?

deeph46   1 mW

1 mW
Posts: 18
Joined: Jan 04 2020 9:53pm

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

Post by deeph46 » Jan 09 2020 9:30pm

Does anyone run LCD8H with this fw? If so, which fw should I used? I saw only Bafang LCD fw in Github.

Post Reply