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

Electric Motors and Controllers
haiyi911   10 mW

10 mW
Posts: 24
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 » Oct 20 2018 11:30am

stancecoke wrote:
Oct 20 2018 3:50am
haiyi911 wrote:
Oct 19 2018 10:04am
i have tried again and again,something maybe be still wrong.
the motor specific angle is not 212 as recommented in your screenshot?!

Please download the latest commit of the firmware from github. The (latest commit of) BluOsec App will only work with this release.

If this doesn't help please switch to Diganostics mode and look at the first number that is sent, with this we can see what the controller is doing:
https://opensourceebikefirmware.bitbuck ... ndex6.html
haiyi911 wrote:
Oct 19 2018 10:04am
where can i choose the ride mode on the tool- "OSEC Parameter Configurator. jar"
The former ride modes are defined in a different way now.
Throttle and PAS are supported by default as long as you don't choose "torquesensor".
To have throttle response with no limitation, you have to set "Speed limit" and "Without PAS" to 100 kph e.g.

regards
stancecoke
Diganostics mode;ui8_control_state=1,IS IT RIGHT?
Attachments
1233.jpg
234.png

User avatar
stancecoke   10 kW

10 kW
Posts: 885
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 » Oct 20 2018 11:52am

Please tell us which commit you are using and post the content of your config.h. Otherwise we can't help you.

The loop state is "1" in the screenshot. That means "linear regen". Please delete the line #define REGEN in the config.h

regards
stancecoke

haiyi911   10 mW

10 mW
Posts: 24
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 » Oct 20 2018 12:08pm

i use the newest firmware and didnot change anything.there arenot #define REGEN in the config.h
i change the parameters and compilling / downloading the firmware by 'OSEC Parameter Configurator.jar'.
Attachments
config.h
(1.48 KiB) Downloaded 9 times
235.png

User avatar
stancecoke   10 kW

10 kW
Posts: 885
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 » Oct 20 2018 1:03pm

OK, with the recent commit "1" means power in PAS ramp mode, so normal at startup. Does the number change if you open the throttle?

You have to set the max phase current to a much higher value than the max battery current. Try e.g. 300.

regards
stancecoke

haiyi911   10 mW

10 mW
Posts: 24
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 » Oct 20 2018 7:21pm

the number changed when i opened the throttle.please look at the pictures.when i selected the election"torquesensor" model'', receiving messy code.in the last picture
Attachments
Screenshot_20181021-071247.jpg
Screenshot_20181021-071333.jpg
Screenshot_20181021-071343.jpg
Screenshot_20181021-071350.jpg
Screenshot_20181021-071442.jpg
Screenshot_20181021-071449.jpg
Screenshot_20181021_081153.jpg

qrisonline   100 µW

100 µW
Posts: 8
Joined: Oct 09 2018 1:42pm

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

Post by qrisonline » Oct 21 2018 4:31am

Hi Stancecoke,

I got the firmware installed and the Bluosec app and KTLCD3 are responding.
The only thing is that I can't get the motor to run. I first thought maybe the MOSFET's are fried but when hooking up to the scope I have no PWM signal on the Gate. Also when I measure the MCU pwm pin I have a high signal only.
I hooked up a thumb throttle but still nothing on the motor.

How can I force the motor to run without Pass only using the throttle.

I have eclipse running and can compile and flash the firmware.
My board is a KTE-SVP5-A. My motor is a MXUS XF07 250W

I tried just setting the pwm duty cycle by just setting it from the mainloop.

Code: Select all

pwm_set_duty_cycle(100);

User avatar
Xnyle   10 mW

10 mW
Posts: 29
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 » Oct 21 2018 5:54am

What does the App Display at "State"? If you don't see state, swipe vertically where the trip infos are, it changes between trip infos, phase/hall diagramm and details.

State is documented here:
https://www.pedelecforum.de/forum/index ... st-1069941

Feel free to add that info to the Wiki!
Last edited by Xnyle on Oct 21 2018 6:01am, edited 1 time in total.

User avatar
stancecoke   10 kW

10 kW
Posts: 885
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 » Oct 21 2018 5:58am

haiyi911 wrote:
Oct 20 2018 7:21pm
the number changed when i opened the throttle.please look at the pictures.
So you get control state 145 this means PAS, Throttle override and Phase current limitation. What is your recent setting for phase current limit?

Image

regards
stancecoke

User avatar
stancecoke   10 kW

10 kW
Posts: 885
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 » Oct 21 2018 6:02am

qrisonline wrote:
Oct 21 2018 4:31am

The only thing is that I can't get the motor to run.
So as every time: please tell us your setup, Battery Voltage, Config.h content, Control state at running.

regards
stancecoke

haiyi911   10 mW

10 mW
Posts: 24
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 » Oct 21 2018 6:45am

stancecoke wrote:
Oct 21 2018 5:58am
haiyi911 wrote:
Oct 20 2018 7:21pm
the number changed when i opened the throttle.please look at the pictures.
So you get control state 145 this means PAS, Throttle override and Phase current limitation. What is your recent setting for phase current limit?

Image

regards
stancecoke
phase current max:150 ------- control state:145
now i connect pas. phase current max:300 ------- control state:17
but the motor still donnot run.
Attachments
235.png
235.png (221.44 KiB) Viewed 263 times
Screenshot_20181021-201734.jpg
QQ截图20181021203727.png

User avatar
stancecoke   10 kW

10 kW
Posts: 885
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 » Oct 21 2018 7:58am

haiyi911 wrote:
Oct 21 2018 6:45am
now i connect pas. phase current max:300 ------- control state:17
but the motor still donnot run.
Seems that there's something wrong with your hardware, dutycyle goes to high values, current stays at zero.
Last try: edit the line 630 from pwm.c from TIM1_CtrlPWMOutputs(DISABLE); to TIM1_CtrlPWMOutputs(ENABLE);
And let print out uint_PWM_Enable in the printf line in the main.c

regards
stancecoke

geofft   1 kW

1 kW
Posts: 317
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 » Oct 21 2018 9:02am

I've been having a play with the 'streetmode' (i.e. non-offroad) speed limits but seem to be struggling to get them to work correctly.

With Speed sensor 'external' selected (my normal setting) neither the 6kph (non pas) or the legal 25kph limits are applied and the motor runs up to it's natural maximum speed.

With Speed sensor 'Internal' selected the 6kph limit operates ok but the 25kph limit still doesn't work. I'm currently using the latest commit but I'm fairly sure this was happening on recent previous commits also.

Have also noticed that the wattmeter has gone a little cranky, showing some very high readings and 'zeroing' when idle at around 200-250w. This has only happened on the latest commit.

Otherwise all seems to be working well for me and with some great new features being developed - keep up the good works guys.. :)

Screenshot (3).png
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

haiyi911   10 mW

10 mW
Posts: 24
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 » Oct 21 2018 9:07am

stancecoke wrote:
Oct 21 2018 7:58am
haiyi911 wrote:
Oct 21 2018 6:45am
now i connect pas. phase current max:300 ------- control state:17
but the motor still donnot run.
Seems that there's something wrong with your hardware, dutycyle goes to high values, current stays at zero.
Last try: edit the line 630 from pwm.c from TIM1_CtrlPWMOutputs(DISABLE); to TIM1_CtrlPWMOutputs(ENABLE);
And let print out uint_PWM_Enable in the printf line in the main.c

regards
stancecoke
Last try: edit the line 630 from pwm.c from TIM1_CtrlPWMOutputs(DISABLE); to TIM1_CtrlPWMOutputs(ENABLE);
thanks,Stancecoke
the motor is runing,but not continuously. when i change the throttle ,the speed maybe change anything.
LM317 IS hot。

User avatar
Xnyle   10 mW

10 mW
Posts: 29
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 » Oct 21 2018 9:45am

LM317 is always hot because it's a cheap Chinese design ;-)

Besides, if you want help, try to be precise as possible "doesn't work" tells us nothing. What's the controll state telling, what are the power, duty cycle settings, the more info the better.

Also you can now translate the controll state yourself here, no need to throw numbers @us so we have to do all the work;-)

https://github.com/stancecoke/BMSBatter ... leshooting

Regarding the latest commit, make sure "PWM auto off" is not enabled, that's highly experimental.

Besides: I think we desperately are in need for someone to create a "how to get this thing running" flowchart /cheat sheet/youtube tutorial, something like that. So anyone who want's to contribute is welcome. What's not so welcome are ppl that produce a constant stream of support requests :)

Valopallo   10 mW

10 mW
Posts: 25
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 » Oct 22 2018 2:22am

Ok. After flashing the open source fw I'm not able to run the motor at all. I have tested the whole system before flashing so I know everything should work. What would be the best route to start troubleshooting my situation?

User avatar
stancecoke   10 kW

10 kW
Posts: 885
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 » Oct 22 2018 4:21am

No infos about battery, controller setup, diagostics output—> no help

sorry
stancecoke

Antenor   100 W

100 W
Posts: 114
Joined: May 09 2016 9:38am

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

Post by Antenor » Oct 22 2018 5:21am

this post is a bit too technical for my level of knowledge :)

But thanks if anyone could answer a small question ... one of the things I do not like in this type of controller is the smooth start, that is, that acceleration ramp smooth when using the accelerator.
With this software is it possible to change this feature?

Thank you in advance for your attention.

qrisonline   100 µW

100 µW
Posts: 8
Joined: Oct 09 2018 1:42pm

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

Post by qrisonline » Oct 22 2018 7:03am

stancecoke wrote:
Oct 21 2018 6:02am
qrisonline wrote:
Oct 21 2018 4:31am

The only thing is that I can't get the motor to run.
So as every time: please tell us your setup, Battery Voltage, Config.h content, Control state at running.

regards
stancecoke
Okay got it :-)

I went through the posts and used some settings I found there. After setting the gear ratio to 44 the motor started spinning. The throttle values are: min 43; max 182. But only the very first part of the throttle is used so the motor spins up verry rappidly. My min voltage is 0,866 and max voltage is 3,4 so after calculating the values I think 43 and 182 are pretty good. Still it does nut use the whole throttle range. Is there a way to use the whole throttle range? And how do you tune the angle to make the motor produce less noise? Is this try and error?

greetings
Michiel

My config:

Code: Select all

#define NUMBER_OF_PAS_MAGS 12
#define limit 25
#define timeout 3125
#define wheel_circumference 2230L
#define limit_without_pas 6
#define ADC_THROTTLE_MIN_VALUE 43
#define ADC_THROTTLE_MAX_VALUE 182
#define BATTERY_VOLTAGE_MIN_VALUE 111
#define BATTERY_CURRENT_MAX_VALUE 150L
#define PHASE_CURRENT_MAX_VALUE 300L
#define REGEN_CURRENT_MAX_VALUE 50L
#define MOTOR_ROTOR_DELTA_PHASE_ANGLE_RIGHT 213
#define current_cal_a 10
#define TEMP_CAL_A 1.6
#define TEMP_CAL_B -110.4
#define LEVEL_1 12
#define LEVEL_2 21
#define LEVEL_3 30
#define LEVEL_4 59
#define LEVEL_5 100
#define MORSE_TIME_1 50
#define MORSE_TIME_2 50
#define MORSE_TIME_3 50
#define RAMP_END 1500
#define P_FACTOR 0.5
#define I_FACTOR 0.2
#define GEAR_RATIO 44L
#define BATTERY_LI_ION_CELLS_NUMBER 10
#define PAS_THRESHOLD 1.9
#define RAMP_START 64000
#define limit_with_throttle_override 25
#define CORRECTION_AT_ANGLE 86
#define PWM_CYCLES_SECOND 20833L
#define SPEEDSENSOR_INTERNAL
#define ANGLE_4_0 1
#define ANGLE_6_60 43
#define ANGLE_2_120 86
#define ANGLE_3_180 128
#define BLUOSEC
#define ANGLE_1_240 171
#define ANGLE_5_300 213
#define TQS_CALIB 0.0
#define ACA 4766
#define EEPROM_INIT_MAGIC_BYTE 107 // makes sure (chance of fail 1/255) eeprom is invalidated after flashing new config
#define ADC_BATTERY_VOLTAGE_K 70

qrisonline   100 µW

100 µW
Posts: 8
Joined: Oct 09 2018 1:42pm

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

Post by qrisonline » Oct 22 2018 7:11am

haiyi911 wrote:
Oct 21 2018 9:07am
stancecoke wrote:
Oct 21 2018 7:58am
haiyi911 wrote:
Oct 21 2018 6:45am
now i connect pas. phase current max:300 ------- control state:17
but the motor still donnot run.
Seems that there's something wrong with your hardware, dutycyle goes to high values, current stays at zero.
Last try: edit the line 630 from pwm.c from TIM1_CtrlPWMOutputs(DISABLE); to TIM1_CtrlPWMOutputs(ENABLE);
And let print out uint_PWM_Enable in the printf line in the main.c

regards
stancecoke
Last try: edit the line 630 from pwm.c from TIM1_CtrlPWMOutputs(DISABLE); to TIM1_CtrlPWMOutputs(ENABLE);
thanks,Stancecoke
the motor is runing,but not continuously. when i change the throttle ,the speed maybe change anything.
LM317 IS hot。
Did you try increase the gear ratio, it worked for me last night.

greetings
Michiel.

User avatar
stancecoke   10 kW

10 kW
Posts: 885
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 » Oct 22 2018 7:15am

Be aware that the throttle controls the battery current, not the speed. If your wheel is in the air, it will spin up to max speed with almost no throttle

regards
stancecoke

User avatar
Xnyle   10 mW

10 mW
Posts: 29
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 » Oct 22 2018 8:09am

GEAR_RATIO Is only for correct speed calculation, an incorrect setting doesn't stop the motor from spinning up.

It might cause the motor to immediately spin down cause the controller thinks the motor is spinning to fast.

So that was certainly not the problem if it didn't turn :)

Furthermore, why do you "use some config you found somewhere". Those configs are probably totally outdated.

There is a Wiki that explains every setting. If you want to use this firmware, you really should read it and make sure you understand it before flashing anything. Otherwise you're just fishing in murky waters.

casainho   100 MW

100 MW
Posts: 2600
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 22 2018 10:49am

I got the Kunteng KT LCD8H color LCD and I did open and compared to other popular color LCD. There are a lot of potential if we can implement our own firmware, if not, it is just a replica of KT-LCD3 but with a color LCD :-( :-(
casainho wrote:
Oct 22 2018 10:46am
Color LCD:Kunteng KT LCD8H VS Bafang 850C

I got the Kunteng KT LCD8H color LCD and here are a picture of the main board:
Image

And a picture of ¨Bafang 850C¨ (http://www.aptdevelop.com) color LCD main board:
Image

The KT LCD is cheaper but also lacks some piece of hardware that is relevant to me: 1. RTC real time clock (although seems the board was development for it, components were not assembled); 2. USB charger. Also, Bafang LCD has 512kb flash memory while Kunteng LCD has half, 256kb.

Image

Image

I can´t understand how a so powerful microcontroller 32 bits 72MHz with 256kb flash memory has a so poor interface, it just replicate LCD3 interface :-( -- seems this companies are just putting fast undeveloped products to market, in this case color LCDs just because seems popular to have a color LCD!!

As for development, the programming/flash/debug header is available the the microcontroller is the same as on Bafang 850C LCD. This are very popular microcontrollers!! very good for development. The big issue is equal to both LCDs, no documentation for which LCD driver is used so until we find out what version is, firmware can simple be developed.

If I had to choose, I would go with Bafang 850C because it has RTC. Also with double of memory, we would be able to implement advanced features for sure.

More pictures and info:
- Bafang 850C: https://github.com/OpenSource-EBike-fir ... afang-850C
- Kunteng KT-LCD8H: https://github.com/OpenSource-EBike-fir ... g-KT-LCD8H
Developer of the Flexible OpenSource firmware for EBike motor controllers and LCD3:
- Unlock and get more power with the TSDZ2 Flexible OpenSource firmware: https://github.com/OpenSource-EBike-fir ... _wiki/wiki
- Kunteng/BMSBattery VLR FOC motor controller: https://github.com/stancecoke/BMSBatter ... mware/wiki

haiyi911   10 mW

10 mW
Posts: 24
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 » Oct 22 2018 12:23pm

hi,casainho
the motor run ok when i download your kt'firmware.
select 'throttle' mode and 'pwm duty',when i turn off the throttle,the motor keep moving,donnot stop.should something be change? thanks!

qrisonline   100 µW

100 µW
Posts: 8
Joined: Oct 09 2018 1:42pm

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

Post by qrisonline » Oct 22 2018 1:10pm

Xnyle wrote:
Oct 22 2018 8:09am
GEAR_RATIO Is only for correct speed calculation, an incorrect setting doesn't stop the motor from spinning up.

It might cause the motor to immediately spin down cause the controller thinks the motor is spinning to fast.

So that was certainly not the problem if it didn't turn :)

Furthermore, why do you "use some config you found somewhere". Those configs are probably totally outdated.

There is a Wiki that explains every setting. If you want to use this firmware, you really should read it and make sure you understand it before flashing anything. Otherwise you're just fishing in murky waters.
Yes you are right, just checked it using my saved ini files and it seemed to be the number of cells that kept my motor from spinning up.
The throttle is verry responsive becouse my wheel was only driviven in air , thanks stancecoke for pointing that out.
But I did read the docs but settings like Phase Current max and Regen Current max are not that obvious to me, so I started reading the posts and using some settings from there.

Another point is that my motor does not exceed 28.8 km/h. I take it this is a motor spec that can not be overrulled by the controller?

greetings Michiel

User avatar
Xnyle   10 mW

10 mW
Posts: 29
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 » Oct 22 2018 2:12pm

Again, what is the state (what does the state variable tell) when running at 28kph?

If you had problems understanding the explanations:

Now that you have understood them, please edit/extend them in the wiki in a way so that you would have understood them the first time you read them.

Post Reply