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

honya96 said:
I have 20s14p pack of used laptop 18650. Calculate with using max 6A per cell for really short bursts or 4A for a bit longer. Best to install 1$ lcd with temp sensor to keep battery under 60°C if you want to push it.

72v 40A 12fet controller can't handle hallomotor 48v 1000w motor (no load rpm at 20s is around 1150, so its asking too much phase current.) So look it up and get lower rpm motor than this one or/+ 72v 45A 18fet on Aliexpress for around 82$ it can handle 45A for much longer than 12fet its 40A rating.

25$ taxfree EU limit is not including shipping so you can ask seller to declare 22$ product + 38$ shipping and send you invoice with these prices so it can pass tax free even if they stop it.

I will make it 20s20p with tesla fuses to be super safe. Good idea to put 1$ lcd sensor now its in my todo list.

Can you give me a link from aliexpress for kt controllers because i want to use opensource firmware.

Our customs is really hard to trick. But if they stop my package i can pay for tax its not big deal.

Thank you
 
I strongly suggest you to buy BMSBattery controller if possible, as the probability to work well with our OpenSource firmware is high.
Honya96 is having difficulties running our OpenSource firmware on his no BMSBattery controller.
 
Tesla fuses make sense with tesla cell which have no PTC, CID protection. Here In 20p It may be worth it, but if one cell fails it will (90%) not blow the fuse, just slowly take down all other paralel cells. Fuse will blow only if you mechanicaly damage some cells. Then it will save you.

Your battery, motor and this controller

http://s.click.aliexpress.com/e/IIQFqNf?fromSns=Copy

Should be ok even for 80A short peaks, but you will have to change controller power wires and traces. + add capacitors.

72v LCD3 here:
http://s.click.aliexpress.com/e/2RNzJYV?fromSns=Copy

I will get commission credit if you buy through the links :D

@Casainho - this controller has the same board number as bms s12xx only difference is the 12 / 18.
Works for me easily with main branch. Only issue is wrong power measurement which you can correct by soldering your second shunt back and testing. And adding shunt number option to java app.

Here with 72v may be problem with lvc (same will be with bmsbattery controller) can be corrected by changing one smd resistor to the same which 48v version uses, or by firmware option.

Anyway you should add lvc setting not depending on liion cell number set. Some people use 2.5v, some use 3.2v.
 
honya96 said:
Tesla fuses make sense with tesla cell which have no PTC, CID protection. Here In 20p It may be worth it, but if one cell fails it will (90%) not blow the fuse, just slowly take down all other paralel cells. Fuse will blow only if you mechanicaly damage some cells. Then it will save you.

Your battery, motor and this controller

http://s.click.aliexpress.com/e/IIQFqNf?fromSns=Copy

Should be ok even for 80A short peaks, but you will have to change controller power wires and traces. + add capacitors.

72v LCD3 here:
http://s.click.aliexpress.com/e/2RNzJYV?fromSns=Copy

I will get commission credit if you buy through the links :D

@Casainho - this controller has the same board number as bms s12xx only difference is the 12 / 18.
Works for me easily with main branch. Only issue is wrong power measurement which you can correct by soldering your second shunt back and testing. And adding shunt number option to java app.

Cannot deliver to turkey :)

I think i will get in touch to bmsbattery
 
infernomer said:
Cannot deliver to turkey :)

I think i will get in touch to bmsbattery

But you cant use your battery potencial power with the 12fet. It overheat's fast at 40A and has no protection. :? Think about what continuous power you expect.

You can contact the seller about shipping, once they added my country shipping quote to the listing after contacting them.

For me it shows 30$ fedex to Czech republic and 48$ standard shipping to Turkey

Edit: try both mobile app and desktop, they give different quotes sometimes.
 
Or another option if you are ok with 4kw max, 70kph is to go with 14s battery and ordering motor/controller kit from https://risunmotor.com you will save a lot of money this way. They have special tax free shipping to EU.. don't know what about Turkey.
 
@honya96: Can you please measure the voltage on pin 15 (AIN7). That's the input for the regen throttle. I checked the code and found, that it isn't initializied to be an input pin but it works on the 6FET nevertheless.
index.php


And can you please check, if there's a solderpad marked as X4 on the PCB of the 18 FET

Before the code processes the throttle signal, there are several conditions being checked:
1. regen throttle
2. low voltage
3. brake lever signal
4. erps limit
5. pedals turning (disabled in THROTTLE mode)

regards
stancecoke
 
@stancecoke - I have added connector to X4 to fit my regen thumb throttle. Not connected yet. Will measure that voltage when I get home :wink:
 
I started to play with the PI controller and tested it for speed controller only, and this time controlling the wheel speed and not motor ERPS as before.

I did follow what I saw for STM32 FOC, using only integer operations and just multiplication, no division or floats:



I tested the code and seems to work as expected -- I tested for the speed controller. I also had to restructure the code, as now wheel speed and motor current controllers will go to inside of ebike_app.c and not like before, inside motor.c. This is more like what Stancecoke does, on his update_setpoint.c.
Here is current PI controller code:


And the initialization of KP and KI, for speed controller - was structure in a way that when finished the implementation, the user will be able to change them on the firmware configuration tool:
 
@Stancecoke
4.928v on pin 15, same at x4 pad.
4.527v at throttle 5v input
0v at throttle signal input

Seems that my pin 15 voltage is wrong?
 
nieles said:
there is a bug in your snapshot.

casainho said:

you assign the value of DIVIDENT to DIVISOR for the KI parameter
Thanks for the code review!! Got it :)
 
no problem.. really eager to play around with this.. just waiting on the stlink V2 dongle to get started.

do have one question. where is the ERPS limit of 520 coming from? is this a hardware/mcu restriction?
 
nieles said:
no problem.. really eager to play around with this.. just waiting on the stlink V2 dongle to get started.

do have one question. where is the ERPS limit of 520 coming from? is this a hardware/mcu restriction?
Code:
#define MOTOR_OVER_SPEED_ERPS 520 // motor max speed, protection max value | 30 points for the sinewave at max speed
At PWM frequency 64us, sinewave will be draw using the 30 points and lot less. Using not less than 30 points seems a good value, like the original firmware seems to do.
And yes, we can increase a bit the PWM freq to get higher ERPs... but not much more due to microcontroller speed limit as also hardware...

What controller version do you have to play?
 
honya96 said:
@Stancecoke
4.928v on pin 15, same at x4 pad.
4.527v at throttle 5v input
0v at throttle signal input

Seems that my pin 15 voltage is wrong?

Yes, this will be the reason, why the motor doens't run, but that's no problem hopefully. You can try to pull X4 down to gnd with a resistor about 10k. I will upload a new commit soon, that sets AIN7 to input. If there's no external pullup on the board, pin 15 shoul show 0V then. (perhaps the internal pullup is active at the moment....)

edit: I've just pushed the changes to the HighSpeedMotors branch on github. You can try if there are still 5V on X4, or if it's zero now.

@casainho: fine, that you are following this way for the PI-controller now :) The code is quite confusing with all the shift operations :shock: , but I understand, that you have the technical ambition to avoid floating point arithmetics :wink: ...

regards
stancecoke
 
casainho said:
And yes, we can increase a bit the PWM freq to get higher ERPs... but not much more due to microcontroller speed limit as also hardware...

Whats the theoretical microcontroler max PWM freq? I was thinking how hard it will be to mod all whats needed to run 23K rpm / 10pole motor (60khz?) Maybe replacing by stm32 will help? I am able to do it..

@Stancecoke - will test now.

4.918v at pin 15. Still not running

Should I try cutting the trace near pin 15 to see if the voltage goes in or from the microcontroller?

Well looks like from the pin. From what i see its going through smd capacitor to pin 13 + through capacitor somewhere + to the otherside of pcb ?directly to x4?
 
honya96 said:
4.918v at pin 15. Still not running
Should I try cutting the trace near pin 15 to see if the voltage goes in or from the microcontroller?

No, try to pull down x4 with a 1k resistor to gnd first. There is an external pullup obviously.
I've just uploaded a new commit, with regen disabled. You can try, if the motor runs with this .

regards
stancecoke
 
Not 100% sure what controller I have. I can't find the top cover of the controller housing. It has the phase current sensor and the STM MCU. But looks a bit different than the photos on the bitbucket website. But I am confident I will get it working.

Good to know I can up the PWM freq a bit. I will dive in to the datasheet to see what's possible. What's the next limitation? The amount of processing that can be done in the PWM period?
 
stancecoke said:
honya96 said:
4.918v at pin 15. Still not running
Should I try cutting the trace near pin 15 to see if the voltage goes in or from the microcontroller?

No, try to pull down x4 with a 1k resistor to gnd first. There is an external pullup obviously.
I've just uploaded a new commit, with regen disabled. You can try, if the motor runs with this .

regards
stancecoke

Runs with regen disabled. 1k or 10k? Then the regen should work??

Now with basic setting motor speed oscilates. At full throttle
 
honya96 said:
Runs with regen disabled. 1k or 10k? Then the regen should work??
No, you have to find and remove the component that connects pin 15 to Vcc (the pull-up resistor).

But you can look for another unused pad, that's labeled with x... and check the voltage on that. If you find one with 0V, you can try to find the pin it is connected to.

honya96 said:
Now with basic setting motor speed oscilates. At full throttle
Without load? That's no problem, it won't oszillate with enough load...

regards
stancecoke

p.s. I've reactivated regen at github again...
 
nieles said:
Good to know I can up the PWM freq a bit. I will dive in to the datasheet to see what's possible. What's the next limitation? The amount of processing that can be done in the PWM period?
Yes, the limitation is that amount of processing/time used on each PWM cycle, if we can reduce it, we can increase the frequency up to some limit of the hardware (which may be something like 1.5x). We are using the same frequency as original firmware.
Stancecoke already did code with increased PWM frequency.

Do we need faster PWM?? If so, which controllers are on the market that do 2, 3 or 4 times the 16khz PMW from this base controllers??

JinHui controllers have STM32 but I bet the hardware do only the standard 16khz -- they should do FOC and sensorless:
https://opensourceebikefirmware.bitbucket.io/development/Motor_controllers--Other_controllers--JinHui_motor_controllers.html
 
stancecoke said:
But you can look for another unused pad, that's labeled with x... and check the voltage on that. If you find one with 0V, you can try to find the pin it is connected to.

Seems like better solution, if we find pad which we both have at 0V so it will work stock for everyone.
 
yes, that's the better solution...

regards
stancecoke

p.s.
honya96 said:
From what i see its going through smd capacitor to pin 13

I think this is not a capacitor but the pull up resistor, as pin13 is VDDA (the analog power supply, see datasheet) = +5V....
so you can remove this component, if we don't find another available AIN pin.

edit: on my 6FET there is a unused pad "XS" that's connected to AIN3, pin 19.
 
To X4 there is 104 resistor to GND and 222 resistor to 5V

X5,6,7 is over 5v only X8 is 0.9v (original blue cruise wire) and empty XS1 is 0v

I cant see any other "X" pad

The pin for regen has to be AIN 6,5,4..?
 
see my last edit, XS is AIN3 / Pin 19 on the 6FET, can you check this with your board and your XS1

regards
stancecoke
 
Back
Top