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

Electric Motors and Controllers
tenten8401   1 mW

1 mW
Posts: 16
Joined: Aug 23 2020 12:45am

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

Post by tenten8401 » Sep 20 2020 9:16am

eLsc wrote:
Sep 20 2020 2:33am
Otherwise this open source firmware is really great and has been very reliable in the past 5 months of using it, so great thanks to stancecoke, casahino and all the other contributers of this awesome firmware.
Out of curiosity how do you like it compared to the stock? Is it worse in any way? Still trying to decide if I want to take the one way trip on my kit when it shows uo

eLsc   10 µW

10 µW
Posts: 5
Joined: Jun 22 2020 1:20pm

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

Post by eLsc » Sep 20 2020 10:27am

@tenten4801

This firmware runs way more efficient/quieter than the stock rom, also the ability to change most of the parameters at runtime through the BluOESC app such as the top speed, the individual speeds of just Throttle, throttle with pas and only the pas is amazing. The only thing I'm missing out at the moment ist regen l, but having read that it works quite well, this should work on your Controller, as I haven't read about anyone having the same problem as I have

Regards

Slipy   10 mW

10 mW
Posts: 24
Joined: Mar 19 2020 6:22pm

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

Post by Slipy » Sep 21 2020 4:20pm

stancecoke wrote:
Sep 18 2020 10:28am
Corrida victim wrote:
Sep 17 2020 6:35pm
my code change will set the target power for walk assist to ±500w and limit the speed to 20km/h (to make it legal in Europe for speed pedelecs)
:thumb:
geofft wrote:
Sep 18 2020 3:31am
but just wondered if you have any plans to add walk assist to the 'Torque_from_X4' branch?
You could have made the few changes yourself, but here you go :wink: (not tested):
https://github.com/stancecoke/BMSBatter ... 8db04c547d

regards
stancecoke
Hi, i have problem with regen, its brake very slow and nothing go back to battery and any reaction on regen current max

szkuba   10 mW

10 mW
Posts: 26
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 » Sep 24 2020 3:19am

stancecoke wrote:
Sep 13 2020 1:15pm
sylvain_wm wrote:
Sep 13 2020 3:48am
because I was trying to pore over every single ligne of the program to figure out where I had to change the code....
I've implemented the walk assist in the new branch "Walk_Assist":
https://github.com/stancecoke/BMSBatter ... alk_Assist

It's just quick and dirty and not tested yet. When the walk assist bit is set, the current target is simply set to 1 amp (for the 6FET calibration).

Code: Select all

if (ui8_walk_assist) uint32_current_target = 10 + ui16_current_cal_b;
If someone can confirm that it works properly, I can push it to the master branch.

regads
stancecoke
I am building junior MTB with torque sensor without throttle.
1. How to activate walk assist? Is it working by holding "down" button on display? Or will it support startup by engaging the motor at zero cadence? I very courious about it :)
2. The dynamic assist mode: what is the assit variation here? Can we compare IT to dynamic modes od Trail in Shimano or eMTB on Bosch?
Looking forward for your answer

User avatar
stancecoke   100 kW

100 kW
Posts: 1381
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 » Sep 24 2020 9:28am

Slipy wrote:
Sep 21 2020 4:20pm
i have problem with regen, its brake very slow and nothing go back to battery and any reaction on regen current max
Please log the data in debug mode and look at the duty cycle during regen. I guess, the motor-constant has to be adjusted to your motor.
szkuba wrote:
Sep 24 2020 3:19am
Is it working by holding "down" button on display?
With a Kunteng-Display, yes.
szkuba wrote:
Sep 24 2020 3:19am
The dynamic assist mode: what is the assit variation here?
Sorry, this feature was added by @Xnyle. I have no idea, what it does, I don't use it.

regards
stancecoke

geofft   1 kW

1 kW
Posts: 375
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 » Sep 24 2020 11:27am

stancecoke wrote:
Sep 24 2020 9:28am
szkuba wrote:
Sep 24 2020 3:19am
The dynamic assist mode: what is the assit variation here?
Sorry, this feature was added by @Xnyle. I have no idea, what it does, I don't use it.

regards
stancecoke
Not sure if you've seen this, but there is some reference to it in the wiki, copied below:-

Ride Options:
Dynamic Assist Level: Using the throttle for a longer period of time will automatically increase the assist factor a bit. After the throttle is released, the assist factor will slowly ramp down again.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 6-fet, LCD3, 48v 12s lipo.

szkuba   10 mW

10 mW
Posts: 26
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 » Sep 25 2020 12:50am

geofft wrote:
Sep 24 2020 11:27am
stancecoke wrote:
Sep 24 2020 9:28am
szkuba wrote:
Sep 24 2020 3:19am
The dynamic assist mode: what is the assit variation here?
Sorry, this feature was added by @Xnyle. I have no idea, what it does, I don't use it.

regards
stancecoke
Not sure if you've seen this, but there is some reference to it in the wiki, copied below:-

Ride Options:
Dynamic Assist Level: Using the throttle for a longer period of time will automatically increase the assist factor a bit. After the throttle is released, the assist factor will slowly ramp down again.
I saw that , Thanks. I was wondering what is the variation. So for instance going uphill it will increase the assit but how much? It says "a bit" so would it be 10%-20%?. Nevertheless i asked Xnyle directly but no response do far since few months ;)

I have the DC/DC for powering Sempu T4. Does anyone knows what is the EN pin for?
Attachments
IMG_20200925_074902.jpg
IMG_20200925_074902.jpg (351.34 KiB) Viewed 797 times

User avatar
stancecoke   100 kW

100 kW
Posts: 1381
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 » Sep 25 2020 1:55am

szkuba wrote:
Sep 25 2020 12:50am
Does anyone knows what is the EN pin for?
This is the enable pin. It has to be on TTL high to enable the 12V output.
You can just short it to the VIN+ pad to enable the output permanently.

regards
stancecoke

szkuba   10 mW

10 mW
Posts: 26
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 » Sep 25 2020 2:15am

stancecoke wrote:
Sep 25 2020 1:55am
szkuba wrote:
Sep 25 2020 12:50am
Does anyone knows what is the EN pin for?
This is the enable pin. It has to be on TTL high to enable the 12V output.
You can just short it to the VIN+ pad to enable the output permanently.

regards
stancecoke
Thanks :D

szkuba   10 mW

10 mW
Posts: 26
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 » Sep 26 2020 2:56am

I have not found na answer anywhere do here the very basic(dumny ) question:
When flashing the firmware the controller schould or schould not be connected:
1. To a battery?
2. To other peripherals like LCD, Pas etc.?
3. Powered on or off?

geofft   1 kW

1 kW
Posts: 375
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 » Sep 26 2020 3:40am

szkuba wrote:
Sep 26 2020 2:56am
I have not found na answer anywhere do here the very basic(dumny ) question:
When flashing the firmware the controller schould or schould not be connected:
1. To a battery?
2. To other peripherals like LCD, Pas etc.?
3. Powered on or off?
With the Kunteng controllers, if you have connected the 5v +ve from the STlink to the controller you don't require main battery or any other connection to flash.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 6-fet, LCD3, 48v 12s lipo.

Tommm   100 kW

100 kW
Posts: 1165
Joined: Apr 03 2018 2:32am

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

Post by Tommm » Sep 26 2020 5:51am

Does anyone know does the KT controller original software have the feature of power rollback, basically, when coming close to LVC it starts taking less power from the battery?

szkuba   10 mW

10 mW
Posts: 26
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 » Sep 30 2020 6:28am

I am flashing the firmware for junior MTB on 24wheels with AKM 85 motor with torque sensor. What i would to achieve is kimś od soft start do the motor powr does increase over 0.5 to 1 sec. I read the manual but cannot clearly determine which Ramp schould i define and what value pit there. Can you help to specify?

User avatar
stancecoke   100 kW

100 kW
Posts: 1381
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 » Sep 30 2020 6:47am

szkuba wrote:
Sep 30 2020 6:28am
I read the manual but cannot clearly determine which Ramp schould i define and what value pit there.
The ramp settings are for "torque-simulation" mode only. With a torque-sensor, they have no function.
For slower respond you have to reduce the Gain P and Gain I settings of the PI-control.

eg.
Gain P = 0.05
Gain I = 0.01

regards
stancecoke

szkuba   10 mW

10 mW
Posts: 26
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 » Sep 30 2020 10:52am

stancecoke wrote:
Sep 30 2020 6:47am
szkuba wrote:
Sep 30 2020 6:28am
I read the manual but cannot clearly determine which Ramp schould i define and what value pit there.
The ramp settings are for "torque-simulation" mode only. With a torque-sensor, they have no function.
For slower respond you have to reduce the Gain P and Gain I settings of the PI-control.

eg.
Gain P = 0.05
Gain I = 0.01

regards
stancecoke
Okay all clear now. :D thanks a lot!

szkuba   10 mW

10 mW
Posts: 26
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 » Sep 30 2020 2:08pm

Just run first test. It works just great. I have set the Gain P on 0.10 and Gain I on 0.02. Are those perimeters also responsible for the speed of power decrease?
The lower values seemed to sluggish and we need some reactivity for offroad riding. Tomorrow next test :D

szkuba   10 mW

10 mW
Posts: 26
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 » Oct 02 2020 4:38am

I have set the PAS threshold on 1.5 for Sempu T4 with 48pulses per rotation.

Is it correct given the readouts for forward rotation in BlueOsec (bakward is just zero):?

PAS status - PAS fraction
2,44 - 8/3
2,4 - 9/3
2,4 - 9/3
1 - 7/4
1,68 - 5/3
2,58 - 7/3
1,66 - 8/4
1,77 - 5/3
2,48 - 7/3
1,65 - 7/4
1,66 - 3/1
1,66 - 3/1
2,54 - 5/2
1 - 1/1


Please advise

User avatar
stancecoke   100 kW

100 kW
Posts: 1381
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 » Oct 03 2020 3:17am

szkuba wrote:
Oct 02 2020 4:38am
I have set the PAS threshold on 1.5 for Sempu T4
Please advise
The PAS threshold is irrelevant in torque sensor mode. It's not used in the code.

regards
stancecoke

szkuba   10 mW

10 mW
Posts: 26
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 » Oct 03 2020 5:31am

stancecoke wrote:
Oct 03 2020 3:17am


The PAS threshold is irrelevant in torque sensor mode. It's not used in the code.

regards
stancecoke
Okay but then is it PAS irrelevant at all. I though cadence is affecting the power calculation ? so then i am looking for the reson why sometimes the motor does not star from idle. It may takie few to 10 seconds before it start again from coasting or idle. Appreciate your response.

PS The torque output is OK. Could it be something obout P and I settings?

User avatar
stancecoke   100 kW

100 kW
Posts: 1381
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 » Oct 03 2020 10:09am

szkuba wrote:
Oct 03 2020 5:31am
Okay but then is it PAS irrelevant at all.
No, just the direction detection via the PAS fraction is irrelvant.

Code: Select all

else { // torque sensor mode

			float_temp = (float) ui16_sum_torque;
			float_temp *= ((float) ui8_assist_percent_actual / 100.0);

			if (flt_torquesensorCalibration != 0.0) {
				
				float_temp *= flt_torquesensorCalibration / ((float) ui16_time_ticks_between_pas_interrupt_smoothed); // influence of cadence
				

			}
szkuba wrote:
Oct 03 2020 5:31am
so then i am looking for the reson why sometimes the motor does not star from idle.
Please log the output in debug mode, then we can see what happens.

regards
stancecoke

Corrida victim   10 mW

10 mW
Posts: 23
Joined: Feb 27 2020 8:45am

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

Post by Corrida victim » Oct 03 2020 8:02pm

Hi! Just wondering which settings I could play around with to attempt to improve efficiency.
Right now the power consumption sits at 14-16amps (700-800w) at 35km/h. I average between 23 and 26wh/km, which is rather high compared to my previous speed-pedelec which averaged 12wh/km at similar speeds on the same trip.
Untitled.png
Untitled.png (207.43 KiB) Viewed 529 times

glennb   10 µW

10 µW
Posts: 5
Joined: Dec 07 2010 7:56pm

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

Post by glennb » Oct 04 2020 7:13am

Hi,

If I've understood the interactions of this software's features correctly then there seems to be an obvious way to effectively adjust "assistance level" without using a display.

But I'd really like to know for sure before launching into my first e-bike build on false assumptions and being disappointed.

As I understand it there’s three* means to modulate hub motor power on-the-fly with this firmware:

1. Varying “Assistance level” over UART
2. Varying pulse frequency on “PAS sensor” input
3. Varying voltage on “Throttle” input

If you want a sleek control system without display, throttle, or torque sensor, you need only retain PAS and accept the compromise of regulating power via cadence. It's too much of a compromise though, without a way to scale power to account for fatigue, weather conditions and terrain.

So how to scale power?

Conceivably by operating in "torque sensor mode" and using "throttle input" as a proxy for "assistance level" .

With the default “assistance level” set at 100% and “torque sensor mode” activated, wouldn't voltage on the "throttle input" be conceptually equivalent to "assistance level", due to power being mediated by cadence? i.e. assuming a hypothetical valid input range from 1-4V, 0V would equate to no assistance, and 4V to full assistance

(FWIW, I’d adjust the voltage signal by ditching front chainring shifting and use a spring return linear position sensor or cable-actuated hall throttle mechanism controlled by the ratcheting left gear shifter, in my case with a Campagnolo shifter resulting in nine distinct locked positions across 15mm of cable pull).

* not including the ability to move the motor into different parts of its power band by altering wheel RPM via rider power input and/or aerodynamic profile

User avatar
stancecoke   100 kW

100 kW
Posts: 1381
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 » Oct 05 2020 4:31am

Corrida victim wrote:
Oct 03 2020 8:02pm
Just wondering which settings I could play around with to attempt to improve efficiency.
The main parameter is the motor specific angle. You can vary it e.g. in steps of 5 to find the best setting.

If you have a ZWS type or a 12 or even 18 FET controller, that has the ACS712 sensings pads shortened, you have to disable the option Enable rotor angle correction. You can solder in the phase current sensor / remove the solder bridge from the sensor for best efficiency of course.

glennb wrote:
Oct 04 2020 7:13am
If I've understood the interactions of this software's features correctly...
Honestly I don't understand your post. Do you have a specific question?!

regards
stancecoke

glennb   10 µW

10 µW
Posts: 5
Joined: Dec 07 2010 7:56pm

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

Post by glennb » Oct 05 2020 9:15am

Sorry, I can ask differently …

Is it correct that in “torque sensor mode”, voltage seen on the controller’s throttle input is converted into a weighting factor or multiplier?

I was imagining a use case without display or torque sensor, where the rider regulates this voltage with a handlebar-mounted static control such as a potentiometer. That way you could ride in whatever cadence is comfortable, and command more or less "assistance" by adjusting this voltage.

User avatar
stancecoke   100 kW

100 kW
Posts: 1381
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 » Oct 05 2020 10:48am

glennb wrote:
Oct 05 2020 9:15am
That way you could ride in whatever cadence is comfortable, and command more or less "assistance" by adjusting this voltage.
OK, still the motor power would be depending on the cadence. This sounds like a very strange setup. :?
I suggest to remove the spring from a normal thumb throttle. Then you get your wanted behaviour even with the stock firmware.

regards
stancecoke

Post Reply