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

qrisonline said:
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
 
stancecoke said:
haiyi911 said:
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?

fetch.php


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
    68.8 KB · Views: 3,096
  • Screenshot_20181021-201734.jpg
    Screenshot_20181021-201734.jpg
    82 KB · Views: 3,085
haiyi911 said:
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
 
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
 
stancecoke said:
haiyi911 said:
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。
 
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/BMSBattery_S_controllers_firmware/wiki/08-Control-State-and-Troubleshooting

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 :)
 
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?
 
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.
 
stancecoke said:
qrisonline said:
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:
#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
 
haiyi911 said:
stancecoke said:
haiyi911 said:
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.
 
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
 
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.
 
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 said:
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:
Kunteng_KT-LCD8H-02.jpg


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


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.

Kunteng_KT-LCD8H-05.jpg


Kunteng_KT-LCD8H-06.jpg


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-firmware/Color_LCD/wiki/Bafang-850C
- Kunteng KT-LCD8H: https://github.com/OpenSource-EBike-firmware/Color_LCD/wiki/Kunteng-KT-LCD8H
 
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!
 
Xnyle said:
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
 
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.
 
Xnyle said:
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.

Okay sorry for being slow. My state was 537
That means
- torquesimulation and pedaling slower than ramp end
- throttle / torquesensor factor is influenced by speed
- throttle / torquesensor currently overrides torque simulation / cadence
- experimental PWM power of is enabled

I only use throttle and put some load on the wheel to have it not run free entirely.
But is it possible to make it faster even if it is not a high speed hub. And what makes a high speed hub faster than a normal hub?
 
throttle / torquesensor factor is influenced by speed

That's incorrect, is influenced by assist level would be correct. So maybe your assist level is just to low to support more speed.

Please turn off experimental PWM power off, without setting correct motor constant you might damage your equipment.

I'm not sure why this is on in the first place, did you uncheck the "clear eeprom" checkbox?
 
Xnyle said:
I'm not sure why this is on in the first place, did you uncheck the "clear eeprom" checkbox?

Better explanation of the checkbox function would be needed. This might be obvious but to make things clear, you have to leave it checked or uncheck it when flashing new settings to the controller?
 
It is checked by default. It shouldn't be unchecked unless you know what you are doing.

Leaving it checked ensures the eeprom is cleared at first start. If you don't clear the eeprom after a firmware change you might read in garbage as settings, cause some storage addresses might have changed.

Settings are all the grey/orange fields. As long as you don't clear the eeprom and previously changed them via the App (or never cleared the garbage) those changed/garbage settings stored in the eeprom override whatever you flash.

If you flash manually, you also have to change the magic byte in config.h whenever doing so.

Again, feel free to extend the Wiki with that information in a beginner friendly way.
 
I am being thinking and listening other users, for TSDZ2 we may go with KT-LCD7 because it has Bluetooth, is cheap (26 euros), has USB charger and is low profile. We already have our own OpenSource firmware for KT-LCD3, should be fast to port/develop to KT-LCD7.
Buy here.

I was looking for Android apps and I found BluOSEC developed by Xnyle that is not OpenSource - I was expecting it was OpenSource and maybe we could cooperate and have a common Android app. Although we are using TSDZ2, we would use common technology from KT the KT-LCD7 and the Android app.

HTB1-Qnp-Ok-Ma-TBu-Nj-Sszfq6xgfp-Xa-K.png
 
I already explained it, but ok then I'll explain it again:

It is intended to be kind of open source, but it's also my wish that nobody makes money out of it.

GPL v3 would make it impossible to not open source a fork. But this is only the theory.

In practice If it's public I can't ensure that nobody makes money out of it.
There is no such license and even if, I couldn't enforce it.

So I've decided to only hand it out to developers who present a reasonable claim.

Unless someone has a better idea how to enforce "nobody makes money out of it" it'll stay that way.
 
qrisonline said:
Okay sorry for being slow. My state was 537

For your convenience I've built a little tool to translate the status:
https://github.com/stancecoke/BMSBattery_S_controllers_firmware/raw/Master/OSEC%20State%20Translator.jar

fetch.php


regards
stancecoke
 
Xnyle said:
I already explained it, but ok then I'll explain it again:

It is intended to be kind of open source, but it's also my wish that nobody makes money out of it.

GPL v3 would make it impossible to not open source a fork. But this is only the theory.

In practice If it's public I can't ensure that nobody makes money out of it.
There is no such license and even if, I couldn't enforce it.

So I've decided to only hand it out to developers who present a reasonable claim.
See my message as an opportunity to work together. If you do not intend to work in an OpenSource way, then we can not collaborate.
 
Back
Top