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

Electric Motors and Controllers
User avatar
stancecoke   100 kW

100 kW
Posts: 1332
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 » Jan 05 2021 7:00am

mehmetoz1980 wrote:
Jan 03 2021 1:21pm
how use stm8-stvd software?
See the "how to" in the link of my signature. Read carefully, if needed two or three times.
endlessolli wrote:
Jan 04 2021 5:01pm
Based on what output parameter do I adjust the settings of these parameters?
To find the right motor specific angle: Set all speed limits to 100, set Gear Ratio to 100. This makes sure, that no speedlimit cuts the power at high rpms.

Than change the motor specific angle in steps of 5 in both directions starting from zero (0, 5, 10 .... 255, 250, 245) until 20 and 235.
Look at the current draw with wheel in the air at full throttle. The setting with the lowest current is the best. If you found the optimum, you can finetune with steps of 1.

The gear ratio has no effect on the commutation, it only defines the threshold where the motor cuts the power due to the speedlimit. So just check the speed where the motor cuts the power with a normal speedometer, when you set the speedlimits to e.g.25 kmph. Then adjust the gear ration and the wheel circumference.

regards
stancecoke

endlessolli   1 mW

1 mW
Posts: 12
Joined: Jul 31 2020 11:55am

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

Post by endlessolli » Jan 05 2021 9:52am

stancecoke wrote:
Jan 05 2021 7:00am
endlessolli wrote:
Jan 04 2021 5:01pm
Based on what output parameter do I adjust the settings of these parameters?
To find the right motor specific angle: Set all speed limits to 100, set Gear Ratio to 100. This makes sure, that no speedlimit cuts the power at high rpms.

Than change the motor specific angle in steps of 5 in both directions starting from zero (0, 5, 10 .... 255, 250, 245) until 20 and 235.
Look at the current draw with wheel in the air at full throttle. The setting with the lowest current is the best. If you found the optimum, you can finetune with steps of 1.

The gear ratio has no effect on the commutation, it only defines the threshold where the motor cuts the power due to the speedlimit. So just check the speed where the motor cuts the power with a normal speedometer, when you set the speedlimits to e.g.25 kmph. Then adjust the gear ration and the wheel circumference.

regards
stancecoke
Thank you soo much, @stancecoke!! That really helped me a lot.

@geofft: Funny thing: I ended up with almost the default setting, as you recommended. :)
'239' brought me down to minimum measured current (1.3A)

P.S. Would that 'how to' be a good addition for the Wiki?
It could probably help more people like me, who can not 'read' / understand the code ....

geofft   1 kW

1 kW
Posts: 373
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 » Jan 06 2021 4:19am

endlessolli wrote:
Jan 05 2021 9:52am
Thank you soo much, @stancecoke!! That really helped me a lot.

@geofft: Funny thing: I ended up with almost the default setting, as you recommended. :)
'239' brought me down to minimum measured current (1.3A)
.....thought I'd give stancecoke's wheel-in-the-air-current-measurement method a try, had an interesting result.

Found that values around my existing 237 deg gave lowest current but noticed a sharply defined peak in unloaded top speed at 239 deg. Got 22.6mph at this setting but moving just 1deg either side (to 238,240) caused a 1.3mph reduction in speed to 21.3mph. This was a firm and repeatable result.

Not sure if this will translate to any difference in performance out on the road, but at this setting it seemed to pull very strongly from rest across the length of my garage, so if nothing else an interesting diversion from lockdown boredom..... :)
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 6-fet, LCD3, 48v 12s lipo.

endlessolli   1 mW

1 mW
Posts: 12
Joined: Jul 31 2020 11:55am

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

Post by endlessolli » Jan 06 2021 10:26am

geofft wrote:
Jan 06 2021 4:19am
.....thought I'd give stancecoke's wheel-in-the-air-current-measurement method a try, had an interesting result.

Found that values around my existing 237 deg gave lowest current but noticed a sharply defined peak in unloaded top speed at 239 deg. Got 22.6mph at this setting but moving just 1deg either side (to 238,240) caused a 1.3mph reduction in speed to 21.3mph. This was a firm and repeatable result.

Not sure if this will translate to any difference in performance out on the road, but at this setting it seemed to pull very strongly from rest across the length of my garage, so if nothing else an interesting diversion from lockdown boredom..... :)
If I optimize for speed I get a different setting from what I stated earlier ('5' instead of '297') - but in that value-area, the current quickly increases drastically and the motor gets pretty hot (wheel-in-the-air setup). So, I stayd at 297.
But I am happy now with my 'lowest current' optimum: Motor starts reliably, runs smooth and is responsive to the throttle.

Now a different question:
I am using the excellent BluOSEC App to do parameter optimization.

@Xnyle, @stancecoke: Is there anywere more detailed explanation for this App than in https://github.com/stancecoke/BMSBatter ... ndroid-App?
I.e:
- What is the meaning of the different 'State Symbols'?
- What is the meaning of the ifferent wave tables? (Mid Clamp, Nip&Tuck, ....?)
- When I look at the Phase B current diagram: I can make the curve flatter by slight adjustments of the 6 Hall-Angle values (in std. riding mode, not in 'DC static Zero'). Is this the right approach to fine-tune the angles?

Thanks again for all the work you guys did here!

endlessolli   1 mW

1 mW
Posts: 12
Joined: Jul 31 2020 11:55am

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

Post by endlessolli » Jan 07 2021 8:28am

stancecoke wrote:
Jan 05 2021 7:00am
endlessolli wrote:
Jan 04 2021 5:01pm
Based on what output parameter do I adjust the settings of these parameters?
To find the right motor specific angle: Set all speed limits to 100, set Gear Ratio to 100. This makes sure, that no speedlimit cuts the power at high rpms.

Than change the motor specific angle in steps of 5 in both directions starting from zero (0, 5, 10 .... 255, 250, 245) until 20 and 235.
Look at the current draw with wheel in the air at full throttle. The setting with the lowest current is the best. If you found the optimum, you can finetune with steps of 1.

The gear ratio has no effect on the commutation, it only defines the threshold where the motor cuts the power due to the speedlimit. So just check the speed where the motor cuts the power with a normal speedometer, when you set the speedlimits to e.g.25 kmph. Then adjust the gear ration and the wheel circumference.

regards
stancecoke
I added that information in the bottom of 04 The Java Tool chapter in the Wiki.
https://github.com/stancecoke/BMSBatter ... -Java-Tool
I hope, thats ok

User avatar
stancecoke   100 kW

100 kW
Posts: 1332
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 » Jan 07 2021 2:30pm

endlessolli wrote:
Jan 07 2021 8:28am
I hope, thats ok
of course, thank you very much! :thumb:

endlessolli wrote:
Jan 07 2021 8:28am
If I optimize for speed
with a too large advance angle, you'll get flux weakening. The motor spins faster but with high losses which lead to heat...

regards
stancecoke

szkuba   10 mW

10 mW
Posts: 24
Joined: Nov 26 2018 2:56pm

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

Post by szkuba » Jan 12 2021 1:25pm

I do have Bafang motor with 6 magnets for speed reading. How to setup this properly so i can get real time speed read? Shall i select "external" speed sensor? How about defining six magnets? Appreciate any response.

geofft   1 kW

1 kW
Posts: 373
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 » Jan 13 2021 9:25am

szkuba wrote:
Jan 12 2021 1:25pm
I do have Bafang motor with 6 magnets for speed reading. How to setup this properly so i can get real time speed read? Shall i select "external" speed sensor? How about defining six magnets? Appreciate any response.
I think if you select 'External speed sensor' and then divide your wheel circumference figure by 6 (in the configurator) it may work.

I say 'may' work, but there might be a problem. Your speed pulses will be arriving at the controller at 6 times the usual rate and they may get blocked by the firmware low pass filter at a fairly low road speed. If that proves to be the case it may be easiest to buy an external single magnet speed sensor and use that instead.
Last edited by geofft on Jan 13 2021 3:47pm, edited 1 time in total.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 6-fet, LCD3, 48v 12s lipo.

szkuba   10 mW

10 mW
Posts: 24
Joined: Nov 26 2018 2:56pm

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

Post by szkuba » Jan 13 2021 1:30pm

geofft wrote:
Jan 13 2021 9:25am


I think if you select 'External speed sensor' and then divide your wheel circumference figure by 6 (in the configurator) it may work.

I say 'may' work, but there might be a problem. Your speed pulses will be arriving at the controller at 6 times the usual rate and they may get blocked by the firmware low pass filter at a fairly low road speed. If that proves to be the case it may easiest to buy an external single magnet speed sensor and use that instead.
Thanks
Just had run a test with the wheel in the air. My impression is: i can confirm speed readout overflow with real max speed of 33km/h the readout was 54km/h :? (should be 33 x 6 => 198 :roll: ) . From the other side i heard some poeple remove the excessive (five) speed magnets from the motor and then it works.

User avatar
stancecoke   100 kW

100 kW
Posts: 1332
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 » Jan 14 2021 2:38am

szkuba wrote:
Jan 13 2021 1:30pm
From the other side i heard some poeple remove the excessive (five) speed magnets from the motor and then it works.
Are you crazy? :shock:

You just have to add a "*6" to one line of code!

ACAcommons.c line 98:

Code: Select all

ui32_speed_sensor_rpks_accumulated += (((uint32_t)ui16_pwm_cycles_second)*1000) / ((uint32_t) (ui16_time_ticks_between_speed_interrupt*6));
regards
stancecoke

szkuba   10 mW

10 mW
Posts: 24
Joined: Nov 26 2018 2:56pm

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

Post by szkuba » Jan 15 2021 1:49am

stancecoke wrote:
Jan 14 2021 2:38am
szkuba wrote:
Jan 13 2021 1:30pm
From the other side i heard some poeple remove the excessive (five) speed magnets from the motor and then it works.
Are you crazy? :shock:

You just have to add a "*6" to one line of code!

ACAcommons.c line 98:

Code: Select all

ui32_speed_sensor_rpks_accumulated += (((uint32_t)ui16_pwm_cycles_second)*1000) / ((uint32_t) (ui16_time_ticks_between_speed_interrupt*6));
regards
stancecoke
Not really crazy :wink: to me it is hardware mod. Looking at the MXUS 01C motor we can ser one magnet there but also space for additional 5. Thanks for your reply for now i do not feel confident to modify the code, although would like to learn more in future as this firmware works really great.
Attachments
IMG_20210115_074312.jpg
IMG_20210115_074312.jpg (245.66 KiB) Viewed 51 times

User avatar
stancecoke   100 kW

100 kW
Posts: 1332
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 » Jan 15 2021 6:20am

szkuba wrote:
Jan 15 2021 1:49am
to me it is hardware mod
Of course it works to remove the additional 5 magnets, but it takes at least 2h to disassemble the motor, remove the magnets and reassemble the motor. It only takes 2s to type "*6" :lol:

regards
stancecoke

szkuba   10 mW

10 mW
Posts: 24
Joined: Nov 26 2018 2:56pm

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

Post by szkuba » Jan 15 2021 12:41pm

stancecoke wrote:
Jan 15 2021 6:20am

Of course it works to remove the additional 5 magnets, but it takes at least 2h to disassemble the motor, remove the magnets and reassemble the motor. It only takes 2s to type "*6" :lol:

regards
stancecoke
Then it is really faster, although i do not know where is the main code :oops:

Post Reply