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

Electric Motors and Controllers
casainho   100 MW

100 MW
Posts: 2661
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 » Oct 31 2018 5:31am

I know that you guys are going more to Bluetooth and mobile app, still I think LCDs can complement. This is an invitation if you guys would like to use Bafang 850C color LCD (I just got first firmware printing to LCD) with KT motor controllers.

Bafang 850C color LCD -- Flexible OpenSource firmware
casainho wrote:
Oct 31 2018 5:24am
Finally I got Bafang 850C color LCD working!!!

My plan is to make it working for the TSDZ2 mid drive motor running our flexible OpenSource firmware (see here), as I did for KT-LCD3. But I think would be great if other developers want to join and use this LCD for other motor controllers.

- firmware is here: https://github.com/OpenSource-EBike-fir ... C_firmware
- wiki page with tecnhical details: https://github.com/OpenSource-EBike-fir ... afang-850C

Image

Image

Image
By the way, I got the KT-LCD8 color LCD -- tech details here: https://github.com/OpenSource-EBike-fir ... g-KT-LCD8H

Image

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.

L3chef   1 W

1 W
Posts: 54
Joined: Jul 27 2018 12:27pm
Location: Finland

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

Post by L3chef » Nov 05 2018 5:25am

Is it possible to use both PAS and a throttle together with this controller?


L3chef   1 W

1 W
Posts: 54
Joined: Jul 27 2018 12:27pm
Location: Finland

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

Post by L3chef » Nov 05 2018 8:47am

Thanks! This is all new for me, and didn't find a straight answer on google so thought I would ask :)

reset   10 mW

10 mW
Posts: 29
Joined: Aug 23 2018 4:01am

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

Post by reset » Nov 05 2018 10:59am

hi all finally got a good setup running lower voltages but i'm curious what the option is above the pas setting on latest build.

battery voltage c...

I'm running 5s battery with setup but when system shuts down after set time it won't restart unless I recharge the battery above 75%
I've tried numerous values in the low voltage cutoff set at 55 not quite sure what the figure for above option should be set at for 5 s battery.

I'd ideally like to run battery down to 3.2v per cell to preserve life of battery. any guidance for setup would be appreciated.

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 » Nov 05 2018 12:01pm

reset wrote:
Nov 05 2018 10:59am
battery voltage c...
See chapter four of the tutorial:
Battery Voltage Calibration: Used for internal calculation of the voltage from the 8bit ADC value. Must only be changed if the calibration with the preset values obviously does not fit.
You can adjust the voltage that is shown in the BluOSEC app.
reset wrote:
Nov 05 2018 10:59am
I've tried numerous values in the low voltage cutoff set at 55 not quite sure what the figure for above option should be set at for 5 s battery.
There are 2Volts hysteresis hardcoded, so the voltage has to be 2V higher than defined by undervoltage limit to start the PWM.
Undervoltage limit: Undervoltage cutoff value. Calculation: Value in volts times 3.7. example: 34.3V * 3.7 = 127

Code: Select all

			//enable PWM if disabled and voltage is 2V higher than min, some hysteresis
			if (!uint_PWM_Enable && ui8_BatteryVoltage > BATTERY_VOLTAGE_MIN_VALUE + 8) { 
				TIM1_CtrlPWMOutputs(ENABLE);
				uint_PWM_Enable = 1;
regards
stancecoke

reset   10 mW

10 mW
Posts: 29
Joined: Aug 23 2018 4:01am

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

Post by reset » Nov 05 2018 12:12pm

reset wrote:
Nov 05 2018 10:59am
hi all finally got a good setup running lower voltages but i'm curious what the option is above the pas setting on latest build.

battery voltage c...

I'm running 5s battery with setup but when system shuts down after set time it won't restart unless I recharge the battery above 75%
I've tried numerous values in the low voltage cutoff set at 55 not quite sure what the figure for above option should be set at for 5 s battery.

I'd ideally like to run battery down to 3.2v per cell to preserve life of battery. any guidance for setup would be appreciated.
The battery will run the motor fine but the whole system won't restart if it is shut down or if it times out and voltage falls below 19v. The display still shows battery with a 3 or 4 bars static or 1 bar on display if under load. Any clues would be appreciated.

reset   10 mW

10 mW
Posts: 29
Joined: Aug 23 2018 4:01am

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

Post by reset » Nov 05 2018 12:23pm

stancecoke wrote:
Nov 05 2018 12:01pm
reset wrote:
Nov 05 2018 10:59am
battery voltage c...
See chapter four of the tutorial:
Battery Voltage Calibration: Used for internal calculation of the voltage from the 8bit ADC value. Must only be changed if the calibration with the preset values obviously does not fit.
You can adjust the voltage that is shown in the BluOSEC app.
reset wrote:
Nov 05 2018 10:59am
I've tried numerous values in the low voltage cutoff set at 55 not quite sure what the figure for above option should be set at for 5 s battery.
There are 2Volts hysteresis hardcoded, so the voltage has to be 2V higher than defined by undervoltage limit to start the PWM.
Undervoltage limit: Undervoltage cutoff value. Calculation: Value in volts times 3.7. example: 34.3V * 3.7 = 127

Code: Select all

			//enable PWM if disabled and voltage is 2V higher than min, some hysteresis
			if (!uint_PWM_Enable && ui8_BatteryVoltage > BATTERY_VOLTAGE_MIN_VALUE + 8) { 
				TIM1_CtrlPWMOutputs(ENABLE);
				uint_PWM_Enable = 1;
regards
stancecoke
so for this setting if I want to run battery to 16v it should be 18 x 3.7 = 66.6

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 » Nov 05 2018 1:29pm

please use the DIAGNOSTICS mode or the BluOSEC app to see what the controller is doing. (controlstate, raw values of ADC Voltage reading.

regards
stancecoke

reset   10 mW

10 mW
Posts: 29
Joined: Aug 23 2018 4:01am

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

Post by reset » Nov 08 2018 9:22am

stancecoke wrote:
Nov 05 2018 1:29pm
please use the DIAGNOSTICS mode or the BluOSEC app to see what the controller is doing. (controlstate, raw values of ADC Voltage reading.

regards
stancecoke
Thanks for advice again, received Uart yesterday but unable to read any Data I think I might have blown uart by connecting 5v from controller. Originally connected via com 3 but now no longer shows in drop down. I've followed connection diagram connecting black yellow and green to corresponding controller display output. I then stupidly connected red uart cable to controller red pin and the Uart no longer works.

Image

these are my latest settings to try and use 18v battery low volt cutoff 16v. The system works great unless it times out and shuts down. Or is switched off by mistake when voltage falls below 19v. have tested battery down to 17v with continuous use but there must be another line of code that stops system from restarting if it switched off after voltage falls below 19v. Will try again when uart arrives but if anyone has any interest in helping a tech newbie. you would be preserving what little hair I have left... :lol:
Attachments
Screenshot (7).png

haiyi911   10 mW

10 mW
Posts: 28
Joined: Oct 13 2017 5:35am

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

Post by haiyi911 » Nov 08 2018 10:16am

36v,0.48A,the motor runs smoothly,but the motor sound maybe strange.does the motor commutation cause?
[youtube]https://youtu.be/7yqjS6frUGc[/youtube]

User avatar
Xnyle   10 mW

10 mW
Posts: 31
Joined: Sep 03 2018 1:05pm

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

Post by Xnyle » Nov 08 2018 12:16pm

No wonder if you use my experimental config with non standard hall angles in it.

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 » Nov 08 2018 12:18pm

Can you check if the advance angle is stable?

regards
stancecoke
reset wrote:
Nov 08 2018 9:22am
I then stupidly connected red uart cable to controller red pin.
:shock:

The tutorial says:
Never connect VCC directly to the red wire of the display connector, this will destroy the module!

haiyi911   10 mW

10 mW
Posts: 28
Joined: Oct 13 2017 5:35am

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

Post by haiyi911 » Nov 09 2018 2:48am

stancecoke wrote:
Nov 08 2018 12:18pm
Can you check if the advance angle is stable?

thanks,i have set motor special angle :237,the motor sound quietly.

throttle min-max:43---245
gear ratio :44.2
without pas limit speed:25km/h
(the newest fw)when the throttle is full ,the BLUOSEC app shows the speed 15.4km/h.
i measured the revolution is 183RPM. wheel size is 18' . so the actual speed 15.7km/h.

1:when the throttle is full, the speed should be 25km/h???
2:i rotated the motor not easily while the power 36v was turned on and no throttle.when the power 36v was turned off,i
rotated the motor smoothly.so how to make it run unhindered ?

reset   10 mW

10 mW
Posts: 29
Joined: Aug 23 2018 4:01am

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

Post by reset » Nov 09 2018 4:46am

stancecoke wrote:
Nov 08 2018 12:18pm
Can you check if the advance angle is stable?

regards
stancecoke
reset wrote:
Nov 08 2018 9:22am
I then stupidly connected red uart cable to controller red pin.
:shock:

The tutorial says:
Never connect VCC directly to the red wire of the display connector, this will destroy the module!
Lesson Learnt... :flame:
The part won't arrive until Monday, I'm not sure what advance angle stability is...
I'm new to all of this and only have a few hours spare each week to look into this due to work and family commitments but I appreciate your patience.

The motor runs fine the only thing I've noticed is when testing with bike on workstand the motor when set to assist 5 seems to pulse a little I'm guessing this is the speed limit I've set. As the speed on the display only appears when the motor has power going to it so I guess it's the ramp on and off kicking in and out. Not sure this will ever be a problem in normal use as the max power i'm looking for is 180w so i'm sure the max speed will ever be reached on the flat or uphills.

reset   10 mW

10 mW
Posts: 29
Joined: Aug 23 2018 4:01am

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

Post by reset » Nov 09 2018 4:53am

stancecoke wrote:
Nov 08 2018 12:18pm
Can you check if the advance angle is stable?

regards
stancecoke
reset wrote:
Nov 08 2018 9:22am
I then stupidly connected red uart cable to controller red pin.
:shock:

The tutorial says:
Never connect VCC directly to the red wire of the display connector, this will destroy the module!
Did you have any thoughts on the system not restarting when under 19v, do you know if anyone has tested this with a variable power supply. The system runs fine down to 17v unless it times out and shuts itself down or if the power is switched off by the user.

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 » Nov 09 2018 5:59am

reset wrote:
Nov 09 2018 4:53am
Did you have any thoughts on the system not restarting when under 19v, do you know if anyone has tested this with a variable power supply.
What is the problem? Do you use display and the display is not starting? Or is the display working and the PWM doesn't start, in this case please check the voltage on the blue wire. Or do you use a jumper from red to blue and the PWM doesn't start?

What is the value of the big resistor on the left of the board?

regards
stancecoke

haiyi911   10 mW

10 mW
Posts: 28
Joined: Oct 13 2017 5:35am

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

Post by haiyi911 » Nov 09 2018 6:56am

Hi,stancecoke.I have set motor special angle :237,the motor sound quietly.

throttle min-max:43---245
gear ratio :44.2
without pas limit speed:25km/h
(the newest fw)when the throttle is full ,the BLUOSEC app shows the speed 15.4km/h.
i measured the revolution is 183RPM. wheel size is 18' . so the actual speed 15.7km/h.

1:when the throttle is full, the speed should be 25km/h???
2:i rotated the motor not easily while the power 36v was turned on and no throttle.when the power 36v was turned off,i
rotated the motor smoothly.so how to make it run unhindered ?

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 » Nov 09 2018 7:52am

haiyi911 wrote:
Nov 09 2018 6:56am
(the newest fw)when the throttle is full ,the BLUOSEC app shows the speed 15.4km/h.
i measured the revolution is 183RPM. wheel size is 18' . so the actual speed 15.7km/h.
1:when the throttle is full, the speed should be 25km/h???
Can you check the duty cycle at top speed in the App? If it is already 255, you will need a higher voltage to get more speed....
haiyi911 wrote:
Nov 09 2018 6:56am
2:i rotated the motor not easily while the power 36v was turned on and no throttle.when the power 36v was turned off,i
rotated the motor smoothly.so how to make it run unhindered ?
That's normal, you will not recognize it while cycling or pushing your bike. The control loop needs some time to contol the battery current to zero

regards
stancecoke

haiyi911   10 mW

10 mW
Posts: 28
Joined: Oct 13 2017 5:35am

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

Post by haiyi911 » Nov 09 2018 8:42am

Thanks,stancecoke.
The duty cycle at top speed is 255 in the App. the top speed is 16.9km/h by the KT' original firmware,so maybe different arithmetic has different effects. The motor is fairly quiet. :bigthumb:
btw,hall angle4 ---angle6---angle2--- angle3 ---angle1 ---angle5,how to set these parameters with my motor?

reset   10 mW

10 mW
Posts: 29
Joined: Aug 23 2018 4:01am

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

Post by reset » Nov 09 2018 9:09am

stancecoke wrote:
Nov 09 2018 5:59am
reset wrote:
Nov 09 2018 4:53am
Did you have any thoughts on the system not restarting when under 19v, do you know if anyone has tested this with a variable power supply.
What is the problem? Do you use display and the display is not starting? Or is the display working and the PWM doesn't start, in this case please check the voltage on the blue wire. Or do you use a jumper from red to blue and the PWM doesn't start?

What is the value of the big resistor on the left of the board?

regards
stancecoke
Yip it's the display no longer comes to life if it's switched off during use. It's continues to work below 19v if not switched off.
not sure if it does this without lcd.

resistor bands from nearest board is gold,black,red,grey. grey resistor.

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 » Nov 09 2018 3:10pm

reset wrote:
Nov 09 2018 9:09am
Yip it's the display no longer comes to life if it's switched off during use.
So it's a problem of the LCD, not of our firmware.

You can try to pimp your LCD, there seems to be the possibility to tune the shut off voltage, see here:
viewtopic.php?t=94070&start=25#p1382956
Perhaps you should ask casainho or nieles how to do the mod. I'm not familiar with these LCDs...

regards
stancecoke

tomtom50   10 W

10 W
Posts: 97
Joined: Jun 18 2018 10:09am

9 mosfet KT sinewave controllers

Post by tomtom50 » Nov 09 2018 10:35pm

I have found two 22A KT controllers that claim to be sinewave

http://www.topbikekit.com/kt-36v48v-9mo ... p-712.html

https://www.aliexpress.com/store/produc ... 7239kWHHiy

Should I expect the KT open source firmware will work with these controllers?

casainho   100 MW

100 MW
Posts: 2661
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 » Nov 10 2018 3:06am

stancecoke wrote:
Nov 09 2018 3:10pm
reset wrote:
Nov 09 2018 9:09am
Yip it's the display no longer comes to life if it's switched off during use.
So it's a problem of the LCD, not of our firmware.

You can try to pimp your LCD, there seems to be the possibility to tune the shut off voltage, see here:
viewtopic.php?t=94070&start=25#p1382956
Perhaps you should ask casainho or nieles how to do the mod. I'm not familiar with these LCDs...
I don´t have such knowledge. If you get it done, please share the information. Thank you.
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
Xnyle   10 mW

10 mW
Posts: 31
Joined: Sep 03 2018 1:05pm

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

Post by Xnyle » Nov 10 2018 11:04am

Should I expect the KT open source firmware will work with these controllers?
Second one yes, first one, I doubt it, don't see a STM8 on there.

Edit: Second one only limited support for the ZWS type, @see FAQ here:
https://github.com/stancecoke/BMSBatter ... mware/wiki

Post Reply