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

Electric Motors and Controllers
sdobbie   10 W

10 W
Posts: 70
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 23 2021 7:27am

Nope, it's definitely consuming. I have found my watt meter which can register negative flow and it does regenerate a bit when I spin it up as we saw in another graph and then it starts consuming power and creating a noticeable drag. As I said before, changing the cal value to negative makes the wheel turn slowly and if I add speed to that by turning the pedals, it starts consuming power. The least drag was achieved by setting the cal value to zero but I am looking for no noticeable drag. Every other controller I have ever used does not place a drag on the motor when coasting so I don't see why this one should be any different. I also wasn't asking you to be my plotting service, I was only providing the log files YOU asked for.

PWM auto off is a great feature but I need to bring the bike to a stop to get the pwm to turn off if I use the throttle during coasting .

Again, how do I enable the field weakening?
Solder that shunt!

User avatar
stancecoke   100 kW

100 kW
Posts: 1407
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 23 2021 9:29am

sdobbie wrote:
Feb 23 2021 7:27am
if I add speed to that by turning the pedals, it starts consuming power
very strange, the current reading from the internal shunt say's clearly, that there is slight regen. No idea where a positive current should come from, that not passes the shunt :?

I'm using a BionX IGH3 direct drive with a Kunteng 6 FET and this firmware on my bike for my daily commuting, I have no drag at all. So I can't help any further at this point.

Regarding field weakenig: This feature is not implemented in the firmware. It could be implemented easyly by increasing the advance angle with speed and load more than we are doing actually for max torque and min loss. Feel free to do it, make a pull request at github, then I can merge your solution to the master.
I can't see any sense in field weakening. Increasing the battery voltage is the better way to get higher speeds.

Regarding switching PWM on while the wheel is turning: You have to know the kv constant of your motor excactly, then you can preload the PI-control to have the correct dutycyle directly at the start of the PWM. I've implemented something similar to optimize the regen at low speed. But I won't make it a feature in this firmware, as it carries a massive risk to burn your controller.

regards
stancecoke

sdobbie   10 W

10 W
Posts: 70
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 23 2021 10:34am

It is definitely puzzling. Do you think that maybe I should try mechanical calibration on the battery current shunt by fililing away small amounts of material or adding a tiny bit of solder?

Does your 6 fet controller have the phase current sensor? I have a 6 fet which doesn't and could test tonight and see if the issue affects that one too.
Solder that shunt!

User avatar
stancecoke   100 kW

100 kW
Posts: 1407
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 23 2021 12:33pm

sdobbie wrote:
Feb 23 2021 10:34am
Do you think that maybe I should try mechanical calibration on the battery current shunt
No, I guess this would only influence the battery current cal a factor.
sdobbie wrote:
Feb 23 2021 10:34am
Does your 6 fet controller have the phase current sensor?
yes, but I think it's not a matter of the controller, but of your specific motor. A geared motor with regen was never used before in this project, I think.

Perhaps, it would be interesting, what happens with the advance angle during dragging. You could print out ui8_position_correction_value and make a new log.

regards
stancecoke

sdobbie   10 W

10 W
Posts: 70
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 23 2021 3:18pm

Will do. I will make a graph of it too to save you time. I think my hall angles 1 to 6 being slightly off might have something to do with it also. I made a separate topic about that because I was using osec app to look at the hall angles and you don't use the osec app.
Solder that shunt!

atkforever   100 mW

100 mW
Posts: 44
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 23 2021 5:29pm

Hi guys, what max phase motor current can I configure? I have a 18fet KT (stock hardware, didn't mod the fets or caps), running at 16S. My battery is limited to 50A so I though that 120A would be an OK value. is there any risk to burn the fets ? What is the absolute max phase amp in stock configuration?

sylvain_wm   100 mW

100 mW
Posts: 47
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 24 2021 8:46am

Hi,
atkforever wrote:
Feb 23 2021 5:29pm
My battery is limited to 50A so I though that 120A would be an OK value.
I don't know what kind of motor you have, but 20 amps in a motor winding is already a lot.
If your motor is a 1000W, a 16S battery provides 60V
power = voltage times current => current = power / voltage = 1000/60 = 16.7A
I would start testing 15 amps max for the battery current.
If the wires don't heat up at all, I would increase the value little by little.
Only the battery current is limited by the program.

atkforever   100 mW

100 mW
Posts: 44
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 24 2021 9:19am

My motor is a MXUS 3K rated at 3000W nominal (90N.M torque and 800RPM at 60V)

Image

Image

sdobbie   10 W

10 W
Posts: 70
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 24 2021 9:49am

I did another motor drag test and noted ui8_position_correction_value and it stayed at 127 constantly. I also connected an old analog ammeter up to the controller just in case my digital wattmeter was getting confused. The ammeter showed 1 amp power consumption while the motor was dragging.

Surely it must be possible to disable pwm when one lets off the throttle as the rotor position can be sensed with the hall sensors so when power is needed again, the pwm can switch on with correct timing. Every other controller does this. I sadly don't have any programming skills so I can't implement that feature.
Solder that shunt!

sylvain_wm   100 mW

100 mW
Posts: 47
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 24 2021 9:55am

atkforever wrote:
Feb 24 2021 9:19am
My motor is a MXUS 3K rated at 3000W nominal (90N.M torque and 800RPM at 60V)
There are something wrong with your table :
speed = radius times angular velocity (speed in m/s radius in meter and angular velocity in rad/s)
With your values : 26 inch wheel : speed = 27.4 m/s = 98 km/h !!!
Mechanical power = torque times angular velocity (power in W, torque in N.m and angular velocity in rad/s)
With your values :
Mechanical power = 90 x 800 x 2 x pi /60 = 7500W !!!!

3000W is the electrical power of the motor (if it's correct)
The battery provides 3000/60 = 50 amps for the rated power. it sounds a lot.
In my opinion, I would start with 20 amps. You risk nothing and if everything works well, I would increase gradually.

User avatar
stancecoke   100 kW

100 kW
Posts: 1407
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 24 2021 10:05am

sylvain_wm wrote:
Feb 24 2021 8:46am
Only the battery current is limited by the program.
This is not correct. The motor current is limited also. You can detect the motor current limitation by the 7th bit of the motor state.
sdobbie wrote:
Feb 24 2021 9:49am
as the rotor position can be sensed with the hall sensors so when power is needed again, the pwm can switch on with correct timing.
Not the rotor position is the problem but the BEMF. You have to start the PWM with the right duty cycle, that's matching the BEMF, otherwise, you'll get magic smoke.

regards
stancecoke

atkforever   100 mW

100 mW
Posts: 44
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 24 2021 10:17am

sylvain_wm wrote:
Feb 24 2021 9:55am
atkforever wrote:
Feb 24 2021 9:19am
My motor is a MXUS 3K rated at 3000W nominal (90N.M torque and 800RPM at 60V)
There are something wrong with your table :
speed = radius times angular velocity (speed in m/s radius in meter and angular velocity in rad/s)
With your values : 26 inch wheel : speed = 27.4 m/s = 98 km/h !!!
Mechanical power = torque times angular velocity (power in W, torque in N.m and angular velocity in rad/s)
With your values :
Mechanical power = 90 x 800 x 2 x pi /60 = 7500W !!!!

3000W is the electrical power of the motor (if it's correct)
The battery provides 3000/60 = 50 amps for the rated power. it sounds a lot.
In my opinion, I would start with 20 amps. You risk nothing and if everything works well, I would increase gradually.
You are correct but the RPM is given for no load. 98KPH is obviously unreachable due to the wind resistance (aprox 6000w at this speed), furthermore 3000W is the rated power, it means it can run at 3000W for a long period without getting hot, you can push the motor to 7000W if you use ferrofluid (statorade) or other cooling device.

My motor winding is 3T which means 11.9Kv, here is the simulation out from ebikes.ca, as you can see the top speed (ie crossing point between load and power) is 68kph. Winding is kind of overkill for my bike, I should have orderer a 4T motor instead (I have a 24inch wheel). Image

sylvain_wm   100 mW

100 mW
Posts: 47
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 24 2021 10:36am

atkforever wrote:
Feb 23 2021 5:29pm
My battery is limited to 50A
I got it.
You can limit you battery current to 50 amps, it's no matter for the 18fet KT.
Each mosfet supports 150 amps and there are 3 mosfets in parallel.
But it could be damaging to your motor.

Regards

sdobbie   10 W

10 W
Posts: 70
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 24 2021 10:38am

I think we are getting close. My motor specific angle for the smoothest and most efficient operation is 215. When I changed it to 200, the motor will not start but there is no resistance at all when turning the pedals. Any ideas?
Solder that shunt!

User avatar
stancecoke   100 kW

100 kW
Posts: 1407
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 25 2021 6:58am

sdobbie wrote:
Feb 24 2021 10:38am
When I changed it to 200, the motor will not start but there is no resistance at all when turning the pedals.
Hm, are you sure, that the PWM is on? Is the controller drawing current, if you open the throttle?

regards
stancecoke

sdobbie   10 W

10 W
Posts: 70
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 26 2021 8:07am

Yeah everything was on. I have to turn the wheel a little to get the motor motor to start but once started it runs fine with no resistance when coasting. I think it may just be the hall angles being a bit off as I did fit the sensors myself. I am not sure how to get the exact angles for the sensors though as in osec app hall angle 5 and 2 are missing
Screenshot_20210222-222108_BluOsec.jpg
Screenshot_20210222-222108_BluOsec.jpg (424.76 KiB) Viewed 367 times
Solder that shunt!

User avatar
stancecoke   100 kW

100 kW
Posts: 1407
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 26 2021 8:53am

sdobbie wrote:
Feb 26 2021 8:07am
it runs fine with no resistance when coasting
:thumb: Great, nice to hear!
sdobbie wrote:
Feb 26 2021 8:07am
I am not sure how to get the exact angles for the sensors
you can print out uint8_t_60deg_pwm_cycles[0] ... uint8_t_60deg_pwm_cycles[5] This are durations between the hall state changes.
Run the motor at a contant speed and look at the values. All values should be nearly the same at constant speed. If certain values are significant different, you can calculate the offset for the angle setting by the ratio of the values. I wonder, why @Xnyle uses an 8-bit variable here, this should only work at high speeds, at lower speeds, there must be overflows :?

by the way, you should not use pure sine, this leads to lower max speeds. I think mid clamp is the SVPWM waveform. I don't know, why @Xnyle implemented this options, they are confusing for newbies (and even for me :wink: ).

regards
stancecoke

sylvain_wm   100 mW

100 mW
Posts: 47
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 26 2021 9:54am

Hi,
is there a way to use the firmware without a throttle and without a torque sensor?

My torque sensor is the problem of my system. The PAS works well but the torque sensor signal is dead.
I don't want to use a thumb throttle.
I'd like to know if it's possible to use my bike without a thumb throttle : I mean, as soon as I pedal, the motor starts and I can adjust the power assist with my LCD display... like a bafang.

Thanks
Last edited by sylvain_wm on Feb 26 2021 10:57am, edited 1 time in total.

sdobbie   10 W

10 W
Posts: 70
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 26 2021 10:46am

Awesome, thanks. With the angle setting that gives no resistance the bike runs really well and regen is brilliant, just will not work from standstill. Is pure sine the most efficient option? I would also like to find out how to enable field weakening too so I can really kick the arse out it and go fast if need be. I can't use a higher voltage battery as that would require me to buy a new bms and charger.
Solder that shunt!

sylvain_wm   100 mW

100 mW
Posts: 47
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 26 2021 1:22pm

Hi,
how to activate this driving mode? PAS sensor with torque simulation and reverse step detection
In this mode, I just need a PAS. No Torque sensor, no Thumb Throttle. Am I wrong?
What are the most important parameters in this mode?

Regards

User avatar
stancecoke   100 kW

100 kW
Posts: 1407
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 27 2021 3:43am

sylvain_wm wrote:
Feb 26 2021 1:22pm
What are the most important parameters in this mode?
Again: read the wiki carefully!!! If you disable the torquesensor mode, the controller runs in "torque simulation mode" automatically. but it expects a duty cycle of the PAS signal different from 0.5 by default.
I don't know, why the ERider T9 / T13 torquesensor always dies on a Kunteng controller. One guy in the german forum wasted three sensors this way. Now he uses a Lishui Controller and everything works well :shock:
sdobbie wrote:
Feb 26 2021 10:46am
Is pure sine the most efficient option?
no, the SVPWM has the same efficieny, but you get higher phase voltages with it, so you get higher speeds.

Image

regards
stancecoke

sylvain_wm   100 mW

100 mW
Posts: 47
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 27 2021 4:38am

Thank you stancecoke for your patience... and for sharing your experience.
stancecoke wrote:
Feb 27 2021 3:43am
but it expects a duty cycle of the PAS signal different from 0.5 by default.
I can't change the duty cycle of the PAS signal. Do I have to create an additional circuit?
stancecoke wrote:
Feb 27 2021 3:43am
One guy in the german forum wasted three sensors this way.
That's weird. I'm going to put a non-inverter follower circuit between the controller and the torquesensor.

Regards.

User avatar
stancecoke   100 kW

100 kW
Posts: 1407
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 27 2021 5:13am

sylvain_wm wrote:
Feb 27 2021 4:38am
I can't change the duty cycle of the PAS signal.
Have you read the wiki??? Or do you think, asking stancecoke is much easier than reading all the stuff? :lol:
You have just to set the right value for PAS threshold.
sylvain_wm wrote:
Feb 27 2021 4:38am
I'm going to put a non-inverter follower circuit between the controller and the torquesensor.
Good idea! But I don't know, if the failure is caused by the torque signal line, or by interferences of the power supplies, or whatever... :confused:

regards
stancecoke

sylvain_wm   100 mW

100 mW
Posts: 47
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 27 2021 6:25am

stancecoke wrote:
Feb 27 2021 5:13am
Have you read the wiki??? Or do you think, asking stancecoke is much easier than reading all the stuff?
I have read it for a long time and I don't want to bother you stancecoke.

Thanks a lot.

chilau2000   100 mW

100 mW
Posts: 42
Joined: Apr 27 2014 6:38pm

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

Post by chilau2000 » Feb 27 2021 4:12pm

https://www.aliexpress.com/item/1000042 ... qP2NT&mp=1

Will these KT controllers from Ali work with the opensource firmware ?

Thanks

Post Reply