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

Electric Motors and Controllers
geofft   1 kW

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

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

Post by geofft » Jun 27 2018 11:33am

I notice Mavabo has got both throttle/pas and torquesensor modes defined:-

#define EBIKE_THROTTLE_TYPE EBIKE_THROTTLE_TYPE_THROTTLE_PAS
#define EBIKE_THROTTLE_TYPE_THROTTLE_PAS_CURRENT_SPEED
#define EBIKE_THROTTLE_TYPE_TORQUE_SENSOR_HUMAN_POWER

...not sure if one of those should be commented out?
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

Mavabo   10 µW

10 µW
Posts: 5
Joined: Jun 24 2018 10:57am
Location: The Netherlands

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

Post by Mavabo » Jun 27 2018 3:56pm

Yes your right geofft..
I thought that when I chose the PAS in the configurator the other possebilities where neglected.. which is not the case obviously.
So I commented the rule by hand in the config.h file. Will check it more careful next time.
Thanks for your comment!

User avatar
stancecoke   10 kW

10 kW
Posts: 896
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 » Jun 28 2018 1:36am

geofft wrote:
Jun 27 2018 11:33am
#define EBIKE_THROTTLE_TYPE_TORQUE_SENSOR_HUMAN_POWER
...not sure if one of those should be commented out?
This entry is not necessary, but it does not harm.

regards
stancecoke

honya96   1 kW

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

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

Post by honya96 » Jun 28 2018 2:42pm

guys do I need sdcc 3.8 to flash current fw? old version flashes

>>> Filling PROGRAM MEMORY image in computer with Blank Value
<<< Filling PROGRAM MEMORY image in computer succeeds

>>> Loading file main.ihx in PROGRAM MEMORY image in computer
(API) ERROR : No such file or directory

casainho   100 MW

100 MW
Posts: 2651
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 » Jun 29 2018 12:09am

stancecoke wrote:
Jun 22 2018 8:43am
So we should clean up the github repository and focus on one tutorial.
My suggestion:
1. Delete all branches except the master and the feature/offroad 5 Step
2. Set all tutorial links (in our signatures and in the first post of this thread) to the windows instructions. I can add a link to the detailed developer area there.
3. Update the first post of this thread with a sceenshot of the recent release of the OSEC tool.
1. So, I put a note on github repo saying it is not being updated anymore and out a link to your repo.
2. I changed my signature, put the link to your instructions.
3. I think I am the only one able to update the first post. Please send me the screeshot and text and I will update.
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: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW

Post by stancecoke » Jun 29 2018 1:10am

OK, sad that we split the activities, but of course I can understand that you want to concentrate on the middrive project.
I'll need some time to update the tutorial. Here is the link to the recent screenshot of the java tool. The user settings are stored in the file settings.ini now, so you don't have to edit all you individual settings each time you start the tool.
I think we can keep the text in the first post, it's still correct.

@honya96: which fork/branch did you try?

regards
stancecoke

honya96   1 kW

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

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

Post by honya96 » Jun 29 2018 10:36am

I am trying Casainho's version but I think your didnt work also.. will try and let you know.

Do you recommend to use your fork now?
I dont like that It hasnt phase current, Soft cutoff, etc.. implemented. But I like linear brake. :wink: if I ever get it working.

User avatar
stancecoke   10 kW

10 kW
Posts: 896
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 » Jun 29 2018 11:20am

honya96 wrote:
Jun 29 2018 10:36am
Do you recommend to use your fork now?
As casainho will give no further support on his code, we can take it only just like it is. I don't understand everything of his algorithms and would have to deep dive into it to "repair" or improve something. So I will stay at my fork and I can support new users, to get started with it. I know, there are less safety features implemented but it works well for me.

Perhaps someone else will be willing and able to continue to maintain Casainho's code

regards
stancecoke

casainho   100 MW

100 MW
Posts: 2651
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 » Jun 29 2018 11:40am

stancecoke wrote:
Jun 29 2018 11:20am
honya96 wrote:
Jun 29 2018 10:36am
Do you recommend to use your fork now?
As casainho will give no further support on his code, we can take it only just like it is. I don't understand everything of his algorithms and would have to deep dive into it to "repair" or improve something. So I will stay at my fork and I can support new users, to get started with it. I know, there are less safety features implemented but it works well for me.

Perhaps someone else will be willing and able to continue to maintain Casainho's code
I would be happy to explain every part of my code for other developers that want to continue developing with that code base. Even because I am using that same base for TSDZ2, most part of the code should be similar, less the FOC calculation part.

But with TSDZ2 I will be even developing KT LCD3 firmware, so specific features like battery watts hour can be measured.
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.

interrupted   100 µW

100 µW
Posts: 9
Joined: Nov 03 2017 10:17am

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

Post by interrupted » Jun 29 2018 1:59pm

is there any way to backup the original firmware?

honya96   1 kW

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

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

Post by honya96 » Jun 29 2018 2:13pm

interrupted wrote:
Jun 29 2018 1:59pm
is there any way to backup the original firmware?
No.

Buy spare controller.

Valopallo   10 mW

10 mW
Posts: 29
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 » Jul 01 2018 6:12am

Just a quick question which might have been answered before but I don't have the time to go through this huge thread at this moment.
I'm planning to buy this s012s https://bmsbattery.com/ebike-kit/721-s1 ... e-kit.html, program it for my liking but not use any display whatsoever. That means also that I don't have the on/off switch either so I have to make one.

What type of manual switch should I buy to switch the controller off/on to reset the "cheat mode"?
Is the switch best to put between the LCDs RED wire and BLUE wire and should the switch be high amperage type or can it be something smaller and stealth like?

casainho   100 MW

100 MW
Posts: 2651
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 » Jul 01 2018 6:19am

Valopallo wrote:
Jul 01 2018 6:12am
Just a quick question which might have been answered before but I don't have the time to go through this huge thread at this moment.
I'm planning to buy this s012s https://bmsbattery.com/ebike-kit/721-s1 ... e-kit.html, program it for my liking but not use any display whatsoever. That means also that I don't have the on/off switch either so I have to make one.

What type of manual switch should I buy to switch the controller off/on to reset the "cheat mode"?
Is the switch best to put between the LCDs RED wire and BLUE wire and should the switch be high amperage type or can it be something smaller and stealth like?
This kind of question are asked again and again. My suggestion is for Stancecoke start a FAQ wiki page on: https://github.com/stancecoke/BMSBatter ... mware/wiki

This way saves a lot of time for developers/project maintainers as also for users. Github because works very well, every developer has a github account and even everyone can submit changes to the wiki via pull requests and developers can do changes directly, even on web without the need to edit on PC and then push to github.

If the Github wiki is used, I will for sure collaborate on 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.

casainho   100 MW

100 MW
Posts: 2651
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 » Jul 01 2018 6:24am

stancecoke wrote:
Jun 29 2018 1:10am
Here is the link to the recent screenshot of the java tool.
Done.
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: KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW

Post by stancecoke » Jul 01 2018 7:09am

casainho wrote:
Jul 01 2018 6:19am
My suggestion is for Stancecoke start a FAQ wiki page on: https://github.com/stancecoke/BMSBatter ... mware/wiki
Good idea, I just started the first page with the most often questions:
https://github.com/stancecoke/BMSBatter ... mware/wiki

@valopallo: you can use something like this:
https://www.ebay.com/itm/20PCS-TOGGLE-S ... SwCtJaOHCb

regards
stancecoke

Steveinator   1 µW

1 µW
Posts: 3
Joined: Jul 02 2018 12:30pm

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

Post by Steveinator » Jul 02 2018 12:37pm

Hi I am new to this forum, and still learning about this project and electric bikes.

I have a KT48 ZWS controller set up with two motors. I see that this controller is not supported by your project. Do you know if there is a KT48 SVP that can support 2 motors? And if so would it take additional coding to get this software running on it?

Steve

User avatar
stancecoke   10 kW

10 kW
Posts: 896
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 » Jul 03 2018 1:18am

Can you post a link to this "two motor controller" or any further information? Are that two controllers, that are sharing one display/PAS/throttle?!

I think in this device, there are just two "normal" controllers in one housing?! There should be a SVP type available also?!
There are two options of simulated sine wave or square wave controller.
regards
stancecoke

Steveinator   1 µW

1 µW
Posts: 3
Joined: Jul 02 2018 12:30pm

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

Post by Steveinator » Jul 03 2018 10:27am

I think in this device, there are just two "normal" controllers in one housing?! There should be a SVP type available also?!
Yes, thats the one. I agree that purchasing the sine wave version would be the SVP option. Would that work with your software? It is one one display/PAS/throttle, one controller, two motors.

User avatar
stancecoke   10 kW

10 kW
Posts: 896
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 » Jul 03 2018 10:51am

I guess, this are two normal controllers that share the peripheral devices by parallel connection. One of them will have the Tx line not connected, so only the other one "speaks" to the display, but both "listen" to it...
Perhaps you can take a look inside the housing, to see if I'm right.

In this case, our firmware should work. You can use two "normal" controllers, too, if you do the wiring like described above.

regards
stancecoke

Steveinator   1 µW

1 µW
Posts: 3
Joined: Jul 02 2018 12:30pm

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

Post by Steveinator » Jul 03 2018 3:07pm

Thanks stancecoke,

I'll see if I can get my hands on the sine wave version of this controller and give it a shot. I have a background in software, but the hardware side is new for me.

Steve

lqbweb   100 mW

100 mW
Posts: 47
Joined: Nov 08 2014 10:57pm

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

Post by lqbweb » Jul 04 2018 4:10am

Ey guys, may I ask you something I was wondering myself:

I have a q100h with this controller and a simple PAS. I understand that this works like on/off, with a variable current (depending on your assistance level).

I was thinking how to get higher top speed on my setup. The top speed is limited by the voltage of the battery. The reason why not to go for higher voltage is because then the power would be too high for the motor right? but we could increase the voltage and decrease the current right? Would it be possible to implement in this firmware a limitation on the pas level, not by current like now, but by power(lets say 800w, 500w, 300w, etc). In this way I could simply switch on a second battery module to push up the voltage, right?

I guess any of my assumptions is wrong and this is why there is no variable voltage system like this yet.

casainho   100 MW

100 MW
Posts: 2651
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 » Jul 04 2018 4:23am

lqbweb wrote:
Jul 04 2018 4:10am
Ey guys, may I ask you something I was wondering myself:

I have a q100h with this controller and a simple PAS. I understand that this works like on/off, with a variable current (depending on your assistance level).

I was thinking how to get higher top speed on my setup. The top speed is limited by the voltage of the battery. The reason why not to go for higher voltage is because then the power would be too high for the motor right? but we could increase the voltage and decrease the current right? Would it be possible to implement in this firmware a limitation on the pas level, not by current like now, but by power(lets say 800w, 500w, 300w, etc). In this way I could simply switch on a second battery module to push up the voltage, right?

I guess any of my assumptions is wrong and this is why there is no variable voltage system like this yet.
Since I know, control of power is not implemented yet. I did a quick test for TSDZ2 firmware and it seems to work well -- see the video. I want to control power so to limit power usage to optimize the range for long travels.

So, is technically possible but if anyone is available to implement that, that is the big if.

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.

lqbweb   100 mW

100 mW
Posts: 47
Joined: Nov 08 2014 10:57pm

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

Post by lqbweb » Jul 04 2018 5:30am

casainho wrote:
Jul 04 2018 4:23am
lqbweb wrote:
Jul 04 2018 4:10am
Ey guys, may I ask you something I was wondering myself:

I have a q100h with this controller and a simple PAS. I understand that this works like on/off, with a variable current (depending on your assistance level).

I was thinking how to get higher top speed on my setup. The top speed is limited by the voltage of the battery. The reason why not to go for higher voltage is because then the power would be too high for the motor right? but we could increase the voltage and decrease the current right? Would it be possible to implement in this firmware a limitation on the pas level, not by current like now, but by power(lets say 800w, 500w, 300w, etc). In this way I could simply switch on a second battery module to push up the voltage, right?

I guess any of my assumptions is wrong and this is why there is no variable voltage system like this yet.
Since I know, control of power is not implemented yet. I did a quick test for TSDZ2 firmware and it seems to work well -- see the video. I want to control power so to limit power usage to optimize the range for long travels.

So, is technically possible but if anyone is available to implement that, that is the big if.

So, do you think my assumptions are right? Do you think with this system, I could increase my top speed? Right now it is topping at around 40km/h. But at this point I am only using 400w or so. If at this point I press a switch to connect another battery module to increase the voltage to 72V for instance, I should have another 200W more of reliable power right?

Would there be any problem with the hall sensors? can this controller read so fast the halls?

User avatar
stancecoke   10 kW

10 kW
Posts: 896
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 » Jul 04 2018 12:59pm

Of course we could implement a control of power instead of current. That's quite easy.
But if you switch the volatage while riding you will completely confuse the battery indicator bars and the undervoltage protection....

The rpms are limited by the sine-wave generation. We need enough support points to get a clean sinusodial current waveform.

You can calculate the maximum rpm from the P1 value of you motor.

regards
stancecoke

casainho   100 MW

100 MW
Posts: 2651
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 » Jul 04 2018 5:05pm

lqbweb wrote:
Jul 04 2018 5:30am
So, do you think my assumptions are right? Do you think with this system, I could increase my top speed? Right now it is topping at around 40km/h. But at this point I am only using 400w or so. If at this point I press a switch to connect another battery module to increase the voltage to 72V for instance, I should have another 200W more of reliable power right?

Would there be any problem with the hall sensors? can this controller read so fast the halls?
I don't know. You will have to try and discover and then please share with us.
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