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

Electric Motors and Controllers
sylvain_wm   100 mW

100 mW
Posts: 44
Joined: Feb 02 2020 6:09am

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

Post by sylvain_wm » Feb 18 2021 5:54am

stancecoke wrote:
Feb 17 2021 3:07pm
Concerning the not working display: have you checked the last XOR of the checksum? See the FAQs in the wiki how to check.
The display works but doesn't display the right information : battery indicator changes if I change the undervoltage value, power changes in an erratic way, the speed remains zero ...
I don't know if it's the XOR.
I can try your suggestion but I don't really know what to do.

Do I have to change the display.c program?

Thank you.

sdobbie   10 W

10 W
Posts: 69
Joined: Dec 14 2013 12:56pm
Location: Fife Scotland

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

Post by sdobbie » Feb 18 2021 6:16am

To be honest, you're getting on my nerves


You know what gets on my nerves? People who release buggy software then make smartarse remarks when people try to get help with said bugs. Going to buy a vesc instead as it seems to be fit for purpose and made by someone a bit more mature.
Solder that shunt!

User avatar
stancecoke   100 kW

100 kW
Posts: 1383
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 » Feb 18 2021 6:36am

sylvain_wm wrote:
Feb 18 2021 4:40am
The problem is that I don't see any change with the BlueTerm app: i16_momentary_throttle remains zero.
Please send "ui8_adc_read_throttle()" in the printf line directly, does that show reaction to the throttle input?
can you post your recent config.h as a textfile, please!
sylvain_wm wrote:
Feb 18 2021 4:40am
0.8V min and 2.9V
so you can calculate throttle min and max approximatly:
0.8*255/5 = 41
2.9*255/5 = 147
sylvain_wm wrote:
Feb 18 2021 5:54am
The display works but doesn't display the right information
OK, then there is no problem with the XOR, perhaps with the noise on the UART line. Which display do you use? KT LCD3?

regards
stancecoke

sylvain_wm   100 mW

100 mW
Posts: 44
Joined: Feb 02 2020 6:09am

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

Post by sylvain_wm » Feb 18 2021 7:12am

stancecoke wrote:
Feb 18 2021 6:36am
can you post your recent config.h as a textfile, please!
Here you are :
config.txt
(1.4 KiB) Downloaded 7 times
I'm starting to wonder if the problem isn't the controller itself ... maybe?
The resistors that heat up a lot (200°C!!) that's weird... the ADC that doesn't work...
I'll try to check the PCB.
Thanks

atkforever   100 mW

100 mW
Posts: 36
Joined: Sep 25 2019 2:17pm

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

Post by atkforever » Feb 18 2021 7:29am

Your voltage calibration is still set to 90? I guess u should use a value around 150 or even more for this kind of controller.

sylvain_wm   100 mW

100 mW
Posts: 44
Joined: Feb 02 2020 6:09am

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

Post by sylvain_wm » Feb 18 2021 7:37am

atkforever wrote:
Feb 18 2021 7:29am
Your voltage calibration is still set to 90? I guess u should use a value around 150 or even more for this kind of controller.
I tried but t doesn't change anything.
Thanks

atkforever   100 mW

100 mW
Posts: 36
Joined: Sep 25 2019 2:17pm

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

Post by atkforever » Feb 18 2021 8:04am

casainho wrote:
Jan 10 2018 4:38pm
honya96 wrote:
Jan 10 2018 3:44pm
s-lcd3 v3,0 72v ( works down to 50v with all my 36,48v controllers)
now I am back with another kt-lcd3 v3.0 0.6F 24-48v and another controller but it has the same board... maybe I will try the 12fet now. its the bmsbattery 40A same as yours.

edit: no brake icon, as i mentioned before. empty battery.
Rotate de motor by hand and see if it is hard to push, when comparing to the controller poweered off.

See that no one ever tested the 72v controller version.

I would say it has different power resistors to measure the battery voltage and so the firmware triggers undervoltage -- try to increase number of cells and there should be a value where it does not trigger.

Even better, measure with a multimeter your battery voltage and also the voltage at STM8 pin, then I can update the firmware for 72v version. Try also to read the resistors value.
I've found this message from Casainho, if it can help...

sylvain_wm   100 mW

100 mW
Posts: 44
Joined: Feb 02 2020 6:09am

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

Post by sylvain_wm » Feb 18 2021 8:50am

stancecoke wrote:
Feb 18 2021 6:36am
so you can calculate throttle min and max approximatly:
0.8*255/5 = 41
2.9*255/5 = 147
I don't know why, but the throttle is reading now and I have 37 min and 180 max....

sdobbie   10 W

10 W
Posts: 69
Joined: Dec 14 2013 12:56pm
Location: Fife Scotland

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

Post by sdobbie » Feb 18 2021 9:11am

I tried but t doesn't change anything.
Thanks

Watch out dude, you might piss stancecoke off with all that help you're trying to get. 😆
Solder that shunt!

User avatar
stancecoke   100 kW

100 kW
Posts: 1383
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 » Feb 18 2021 9:12am

sylvain_wm wrote:
Feb 18 2021 8:50am
I don't know why,
have you checked the stability of the 5V rail? We had often problems with unexpected controller behaviour, when the current on the 5V rail was to high and the voltage dropped. (don't connect a BT-Module to the 5V rail for example, use an extra DC/DC converter)

If the throttle reading is OK, you should try, if uint32_current_target changes, if you twist the throttle.

regards
stancecoke

Edit:
@sdobbie: sylvain_wm provides senseful logging data, so I can help to find the problem. You only say "Mimimi ... doesn't work" and spread around in several parallel threads that the firmware sucks....
Last edited by stancecoke on Feb 18 2021 1:38pm, edited 1 time in total.

sylvain_wm   100 mW

100 mW
Posts: 44
Joined: Feb 02 2020 6:09am

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

Post by sylvain_wm » Feb 18 2021 9:54am

I unsoldered a wire that I assumed was the input to the SPEED sensor and soldered it to the pin X5 of my KT controller and now the speed is read on pin 30 of the microcontroller. The speed is displayed on my KT LCD3 ...
Small steps ....
Now the motor spins !!! Always ... and the speed is 62km/h
I have to change parameters in the config.h and I'll see if it works well.
Last edited by sylvain_wm on Feb 18 2021 10:06am, edited 1 time in total.

sylvain_wm   100 mW

100 mW
Posts: 44
Joined: Feb 02 2020 6:09am

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

Post by sylvain_wm » Feb 18 2021 10:04am

stancecoke wrote:
Feb 18 2021 9:12am
have you checked the stability of the 5V rail? We had often problems with unexpected controller behaviour, when the current on the 5V rail was to high and the voltage dropped.
I think you're right, there must be a problem with the 5V.
I tried to supply my controller with another power supply, the bluetooth communication works well until 40V.
Beyond 40V, the communication is really bad.
The two LM317 are maybe the cause of the problem.

sylvain_wm   100 mW

100 mW
Posts: 44
Joined: Feb 02 2020 6:09am

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

Post by sylvain_wm » Feb 18 2021 1:33pm

The bluetooth communication is now perfect. I got rid of the two LM317s and the two resistors.
I used instead a DC/DC converter 90V/12V.
LM317 to DC_DC converter.jpg
LM317 to DC_DC converter.jpg (125.64 KiB) Viewed 242 times
It doesn't heat up anymore. And the system is stable.
I can now study the behavior of my bike with the bluetooth diagnostic.
Everything works now. The motor spins when I pedal.
I still have problems :
- When I stop pedaling, the motor takes time to stop... too much time. Can we change this?
- I'd like to limit the motor current to 20 amps, how can I be sure it's 20 amps?

atkforever   100 mW

100 mW
Posts: 36
Joined: Sep 25 2019 2:17pm

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

Post by atkforever » Feb 18 2021 4:52pm

I own exactly the same controller except the fact it's labeled KT56-90..., hardware is the same, I havn't tested it yet as my new motor is still between China and France. I'll use 16S battery so I might have the same issue as you.
You said you solved it by replacing the line with DC/DC 90V-12V converter, it's not rather 90V-5V?

Woly   1 µW

1 µW
Posts: 3
Joined: Nov 16 2020 10:32pm

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

Post by Woly » Feb 18 2021 5:03pm

I'll use 16S battery so I might have the same issue as you.
You said you solved it by replacing the line with DC/DC 90V-12V converter, it's not rather 90V-5V?
The FET circuit is designed to operate with 15V. 12V is a little low and might not be optimal for the FET's.

A 16S battery will have a maximum voltage of 67.2V so I don't think you'll run in to the same problem. I would try it first.

sylvain_wm   100 mW

100 mW
Posts: 44
Joined: Feb 02 2020 6:09am

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

Post by sylvain_wm » Feb 19 2021 3:01am

Woly wrote:
Feb 18 2021 5:03pm
The FET circuit is designed to operate with 15V. 12V is a little low and might not be optimal for the FET's.
The MOSFET for this board is an IRFB4110 (instead of a TK150E09NE for KT 48V)
You are right, the output voltage of the second LM317 is Vout=15V. But the Gate Threshold Voltage of the MOSFET is less than 4V. So there are chances that VGS is enough to saturate the transistor : there is no need to have VGS=10V to saturate the transistor.
I picked a 90V/12V because I had one at home and didn't want to wait.
I'll try to measure the VGS with an oscilloscope.
Last edited by sylvain_wm on Feb 19 2021 5:53am, edited 1 time in total.

sylvain_wm   100 mW

100 mW
Posts: 44
Joined: Feb 02 2020 6:09am

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

Post by sylvain_wm » Feb 19 2021 3:46am

My board is dead!!
While measuring VGS, I made a shortcut!!
3 MOSFETs are dead.It's not that bad.
I have now an arm with only two transistors instead of six.
I'll send you scopes later.
Last edited by sylvain_wm on Feb 19 2021 5:52am, edited 1 time in total.

sylvain_wm   100 mW

100 mW
Posts: 44
Joined: Feb 02 2020 6:09am

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

Post by sylvain_wm » Feb 19 2021 5:48am

Here are the VGS signals with the 90V/12V.
VGS signals.jpg
VGS signals.jpg (250.54 KiB) Viewed 182 times

sylvain_wm   100 mW

100 mW
Posts: 44
Joined: Feb 02 2020 6:09am

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

Post by sylvain_wm » Feb 19 2021 1:33pm

Hello,
I still have problems :
- When I stop pedaling, the motor takes time to stop... too much time. Can we change this?
- I'd like to limit the motor current to 20 amps, how can I be sure it's 20 amps?

Does anyone know how to solve these problems?

Have a good day.

sdobbie   10 W

10 W
Posts: 69
Joined: Dec 14 2013 12:56pm
Location: Fife Scotland

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

Post by sdobbie » Feb 19 2021 3:04pm

You only say "Mimimi ... doesn't work"
No, I actually provided details of my setup and steps I took to troubleshoot, so don't put words in my mouth. You are being very childish. If we all work together on this rather than making smartarse remarks to people without an electronics laboratory and a degree in C++ who are trying to get support, we can turn something which is pretty buggy and difficult to set up into something pretty awesome. I can see the project has potential.

So, if you want me to give as much info as I can and list all the problems I am having so that we can get these bugs sorted for everyone's benefit, that would be great. Otherwise, I will just move on to the vesc project.
Solder that shunt!

User avatar
stancecoke   100 kW

100 kW
Posts: 1383
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 » Feb 19 2021 3:41pm

sylvain_wm wrote:
Feb 19 2021 1:33pm
- When I stop pedaling, the motor takes time to stop... too much time. Can we change this?
please read the wiki carefully!!! :wink: Keyword: PAS timeout
sylvain_wm wrote:
Feb 19 2021 1:33pm
- I'd like to limit the motor current to 20 amps, how can I be sure it's 20 amps?
You probably have to adjust the battery current cal a value. You have to check the setting with a lab power supply or a wattmeter or any other suitable multimeter.

@sdobbie: feel free to provide us meaningful log data and a short but precise description of your problem. Tell us your setup as good as possible, e.g. find out the number of pole pairs and the mechanical gear ratio of your motor.

regards
stancecoke


sdobbie   10 W

10 W
Posts: 69
Joined: Dec 14 2013 12:56pm
Location: Fife Scotland

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

Post by sdobbie » Feb 19 2021 6:43pm

feel free to provide us meaningful log data and a short but precise description of your problem. Tell us your setup as good as possible, e.g. find out the number of pole pairs and the mechanical gear ratio of your motor.
Thanks, sorry if any hard feelings earlier.
I will get proper log data to you tomorrow when I am back at my other house. What data would you like me to log from the list of options in the app?

The motor has 18 stator coils and 20 magnets, so I'd imagine 6 poles for the stator.

It is a planetary reduction drive with 78 teeth on the wheel, 30 teeth on each planetary gear and 16 teeth on the motor giving a 39 to 8 ratio.
Clipboard01.png
Clipboard01.png (443.85 KiB) Viewed 131 times
The two main issues are:
1: Some limit is being hit before field weakening gets a chance to kick in and give me the highest speed possible so I am getting about the same speed as the old KU63 controller that was on the bike. I suspect that it could be the erps limit. I was playing around with the ratio and wheel circumference settings and the motor hits some limit when the speed in the app is showing 70km/h at full throttle when I set it to 100 in the Java tool. I made sure not to change any settings in the app as you mentioned an overflow bug which causes it to loop back to 20.

2: Motor drag and high power consumption when coasting with no throttle input.
I did an experiment yesterday and spun the pedals by hand with a watt meter connected. My watt meter can only register current in one direction so the power is definitely flowing into the controller and not back into the battery. This issue is not due to regen being active as I disabled regen for the test to make sure. Here is a video, controller was consuming 40 watts just with me pedalling by hand.

The motor starts and runs smoothly and quietly when propelling the bike so my motor angle settings should be okay.

Many thanks,

Solder that shunt!

User avatar
stancecoke   100 kW

100 kW
Posts: 1383
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 » Feb 20 2021 3:54am

sdobbie wrote:
Feb 19 2021 6:43pm
What data would you like me to log from the list of options in the app?
As I've written before, I don't use the BluOSEC app, so I'm not familiar with it.
Please flash in Diagnostics mode and log with Bluterm e.g.:

https://github.com/stancecoke/BMSBatter ... stics-Mode

This parameters are interesting for your problem:
ui8_control_state, uint32_current_target, ui16_BatteryCurrent, ui32_SPEED_km_h, ui16_motor_speed_erps, ui16_current_cal_b

Please log one run with full throttle with the wheel in the air and one run with closed throttle and turning the pedals by hand, like in the video. Please post the content of the config.h you have used for the tests.
sdobbie wrote:
Feb 19 2021 6:43pm
20 magnets, 78 teeth on the wheel, 16 teeth on the motor
so your correct gear ratio should be 20/2*78/16 = 48,75 ~ 49, you can fine tune the system with the wheel circumference.

regards
stancecoke

sylvain_wm   100 mW

100 mW
Posts: 44
Joined: Feb 02 2020 6:09am

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

Post by sylvain_wm » Feb 20 2021 7:29am

Hello,
in diagnostic mode, when I print out ui16_control_state, ui16_BatteryCurrent, ui16_current_cal_b
I get : 28 316 315 without pedalling, weird???
when I pedal and brake, only ui16_BatteryCurrent increases.
Is that normal?
It doesn't seem correct.
To tell the truth, I'm a bit lost...
I don't have the same current sensor on KT 72V than on the KT 48V. It can be the reason?
config.h
(1.39 KiB) Downloaded 7 times
Thanks

Post Reply