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

haiyi911 said:
I want to add a protection function
Thank you for your effort.
I don't know, if this solves your problem, but zero current means

Code:
ui16_setpoint = ui16_current_cal_b;

regards
stancecoke
 
stancecoke said:
haiyi911 said:
I want to add a protection function
Thank you for your effort.
I don't know, if this solves your problem, but zero current means

Code:
ui16_setpoint = ui16_current_cal_b;

regards
stancecoke
Thanks! but :( the same result.
another question, when i twest the throttle at first time,the speed show after 5 seconds on the LCD3. then twest throttle again,the speed show immediately.is there delay-code?
 
Uups, your code was right, ui16_setpoint is the duty-cycle, not the current target. The delay of the speed information is an issue of the display, not of our firmware.

Regards
stancecoke
 
Status of the OpenSource firmware for Bafang 850C color LCD

The configuration menu is now fully implemented and is well structured that is easy and fast to add/remove items to the menu. This LCD would be a good tool for KT motor controllers, for the ones that do prefer an LCD. In future I want to implement graphs so the LCD can show a graph of real time value of variables like motor current, rider pedals human power, etc.

[youtube]Gd5KbbFnz6Y[/youtube]
 
casainho said:
Status of the OpenSource firmware for Bafang 850C color LCD

The configuration menu is now fully implemented and is well structured that is easy and fast to add/remove items to the menu. This LCD would be a good tool for KT motor controllers, for the ones that do prefer an LCD. In future I want to implement graphs so the LCD can show a graph of real time value of variables like motor current, rider pedals human power, etc.

Nice work Casainho, some useful options on those menus.

I'm a little confused though, as to where this fits in with the KT controllers - I guess this isn't currently compatible with your KT (S06S etc) fw branch, do you have plans to upgrade the KT controller fw to work with this?
 
geofft said:
I'm a little confused though, as to where this fits in with the KT controllers - I guess this isn't currently compatible with your KT (S06S etc) fw branch, do you have plans to upgrade the KT controller fw to work with this?
This would fit very well, because I developed the firmware and I did structure and program with the same logic I did for KT. Also the development tools are just the same! The good of this LCD is that is very flexible:
- 320x480 pixels, color
- has a clock that can keep date and time when system is powered off (1)
- very fast, running at 125Mhz, 32 bits ARM cortex M3
- has a LOT of program memory (0.5 mega byte and I am using 30% of it, while the firmware is at about 80% complete)

I wish I could make it for KT, but I can't do more because lack of time (I take already a LOT of my personal time for this projects!!). Time for other developers to join...

(1) I hate when riding and I have to slow down to look at my watch to see the hours, to see if I am late -- LCD3 do not have such clock and date.
 
It's working for the very first time!!

I have an special ride on Saturday, and I decide to take the risk and use this fresh firmware that may have bugs and be a problem while I will be on the mountains...

[youtube]-eZXLgWD96o[/youtube]
 
stancecoke said:
Uups, your code was right, ui16_setpoint is the duty-cycle, not the current target. The delay of the speed information is an issue of the display, not of our firmware.

Regards
stancecoke

ok.thanks , stancecoke.
and what is the ACA meaning? " #define ACA 4760""
 
I have read the instructions, but I don´t understand where to solder the wires for the st link. I have an 18 fet controller. Is it on J1?

4aGqNKvl.jpg
 
It seems like there are a few users of the 18 fet controllers here, so there should be some people that knows I think. The second hole from the left is ground, but I don´t see any obvious 5v connection. At least it is not connected to the other 5v that exit the controller to pas, throttle etc.
If this is not theright spot, what markings should I look for?

Edit, I hooked it up and measured. There is 5v at the 4th hole from the left, so I guess it is the same as in the instructions. Just that it is wired the other way round.
 
haiyi911 said:
and what is the ACA meaning? " #define ACA 4760""

In this value the initial settings of some parameters are stored.

Code:
typedef enum {
	ASSIST_LVL_AFFECTS_THROTTLE = ((uint16_t) 1),
	OFFROAD_ENABLED = ((uint16_t) 2),
	BRAKE_DISABLES_OFFROAD = ((uint16_t) 4),

	DIGITAL_REGEN = ((uint16_t) 8),
	SPEED_INFLUENCES_REGEN = ((uint16_t) 16),
	SPEED_INFLUENCES_TORQUESENSOR = ((uint16_t) 32),
	PAS_INVERTED = ((uint16_t) 64),

	DUMMY_ALWAYS_ON = ((uint16_t) 128),

	BYPASS_LOW_SPEED_REGEN_PI_CONTROL = ((uint16_t) 256),

	DYNAMIC_ASSIST_LEVEL = ((uint16_t) 512),
	
	TQ_SENSOR_MODE = ((uint16_t) 2048),
	ANGLE_CORRECTION_ENABLED = ((uint16_t) 4096)
} ACA_FLAGS;

It is transferred to the variable that can be changed at runtime during the init-procedere:

Code:
ui16_aca_flags = ACA;

regards
stancecoke
 
Would it be possible to make the brake shift and throttle work separately? When you press the shift:idle. When you press the throttle: regeneration.
Need for a e-kickscooter ebrake.
 
IgorsLog said:
Would it be possible to make the brake shift and throttle work separately?

Yes, of course. You can do what ever you want :wink:

regards
stancecoke
 
Hello friends :)

I have a problem with the LCD display KT-3

Well, the question is because LCD KT-3 in the old version work with the KT48ZWSRL controller, where there are only basic settings and type P. setting "C " not included.

I ordered new displays on aliexpress KT-LCD3 and they don't want to work with my old controllers, but with new sinusoidal controllers they work. What and where to upload for displays to work with an older version of the driver?

I don't know what it's all about, because I have KT-LCD-3 displays provided by the manufacturer of the software version V3.0 and I also bought the KT-LCD3 version V3.0 on aliexpress and these no longer work with old ones. They do not display, do not show speed, do not show watts, do not change settings.
 
Hi,stancecoke
whats the following lines meaning? calculate average? and how to calculate it?
in ACAsetPoint.c
“”ui32_erps_accumulated -= ui32_erps_accumulated >> 3;
ui32_erps_accumulated += ui16_motor_speed_erps;
ui32_erps_filtered = ui32_erps_accumulated >> 3;“”
 
haiyi911 said:
Hi,stancecoke
whats the following lines meaning? calculate average? and how to calculate it?
in ACAsetPoint.c
“”ui32_erps_accumulated -= ui32_erps_accumulated >> 3;
ui32_erps_accumulated += ui16_motor_speed_erps;
ui32_erps_filtered = ui32_erps_accumulated >> 3;“”
I did that code and I can explain:
1. ui32_erps_accumulated = ui32_erps_accumulated - (ui32_erps_accumulated / 8 );
2. ui32_erps_accumulated = ui32_erps_accumulated + ui16_motor_speed_erps;
3. ui32_erps_filtered = ui32_erps_accumulated / 8;

Yes, it is the average using fast shifting register operations -- you know, it is very important to save the very limited processor time.

First we remove 1/8 of the accumulator and then we add our new value, finally the average value is 1/8 of the accumulator.
 
casainho said:

First we remove 1/8 of the accumulator and then we add our new value, finally the average value is 1/8 of the accumulator.

this is what i cannot understand.
1:why is 1/8?why not 1/16?
2:
a. ui32_erps_accumulated = ui32_erps_accumulated - (ui32_erps_accumulated / 8 )=ui32_erps_accumulated*7/8
b. ui32_erps_accumulated = ui32_erps_accumulated + ui16_motor_speed_erps;
c. ui32_erps_filtered = ui32_erps_accumulated / 8=ui32_erps_accumulated*7/64 + ui16_motor_speed_erps/8
i still couldnot understand how to find out the average when ui32_erps_accumulated is not equal to 0. :(
 
Hi,
the motor didnot run smoothly when the motor was overspeed.[youtube]https://youtu.be/FXm6dFyo3hI[/youtube]
maybe it is strange when i ride the bicycle. so i want to keep the speed(the limit speed) as the default speed ,when the motor is overspeed,the speed is still keep as the limit speed.
which code should i do some change? Thanks!
 
haiyi911 said:
Hi,
the motor didnot run smoothly when the motor was overspeed.[youtube]https://youtu.be/FXm6dFyo3hI[/youtube]
maybe it is strange when i ride the bicycle. so i want to keep the speed(the limit speed) as the default speed ,when the motor is overspeed,the speed is still keep as the limit speed.
which code should i do some change? Thanks!

Running the motor in the test stand, completely unloaded, will not give you any useful or meaningful results. I suggest that you get the motor installed into a wheel and repeat your tests on the road. You'll find the results will then be completely different and will probably work as you expect. :wink:
 
Hi, it has been a bit silent in this tread for a while :wink:
Has there been any progress?

A question, how is the trottle response compeared to the standard fw? I think it is a bit slow on the kt fw.
I have got the most parts for a conversion, but it seems i have bought a bluetooth module without the blutooth bord..
It is still winter with snow and ice here, and I want to try the controller a bit more before changing fw, so it has been slow at my end.
 
Hi,stancecoke.
Did you drive by direct drive motor ?when i started the motor,there were some noise and the motor was shaking . then i changed the "motor special angle " as "160"(the best number),but i could still feel that the motor is shaking.are there any parameters to adjust? :D
 
j bjork said:
Hi, it has been a bit silent in this tread for a while :wink:
Has there been any progress?

A question, how is the trottle response compeared to the standard fw? I think it is a bit slow on the kt fw.
I have got the most parts for a conversion, but it seems i have bought a bluetooth module without the blutooth bord..
It is still winter with snow and ice here, and I want to try the controller a bit more before changing fw, so it has been slow at my end.
From my experience the throttle (with both Casainho's and Stancecoke's fw) works well with smooth and progressive response. I seem to remember stock fw throttle was rather jerky? The open source fw is a great improvement on this.

I don't think there has been any further progress lately, but both Casainho's and Stancecoke's fw work very well in thr/pas mode and could probably be perceived as 'finished' products. I'm currently running a Sempu T4 torquesensor using Stancecoke's fw in tqsr mode and this also works extremely well, pretty much faultless in fact.

Please bear in mind that my comments only apply to my gearmotor setup, I have no experience with direct drive motors.
 
Back
Top