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

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?
 
szkuba said:
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.
 
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?
 
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?
 
szkuba said:
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
 
stancecoke said:
szkuba said:
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!
 
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
 
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
 
szkuba said:
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
 
stancecoke said:
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?
 
szkuba said:
Okay but then is it PAS irrelevant at all.

No, just the direction detection via the PAS fraction is irrelvant.

Code:
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 said:
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
 
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
 
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
 
Corrida victim said:
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 said:
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
 
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.
 
glennb said:
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
 
stancecoke said:
No, just the direction detection via the PAS fraction is irrelvant.

Code:
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 said:
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
Okay so cadence does have proportional influence on the assist.
In regards to motor not starting i think it could be low voltage protection but also the use LCD4 display (need to test it more). During the testing i did not noticed how low is the battery and now on full charge and bluOSEC adapter there is no cut off on .

I do have similar question to what @Corrida victim has mention about power consumption. The current limits are:
Batt- 7A
Phase - 20A
Assit 1 - 20%
Dynamic assist - enabled
So how it is possible that on Assit1 the battery curent can go up 3-4A if this is 20%? Is the assist level based on Phase current then? Should i lower the Phase current to 10-15A to get best results with Batt current limit @ 7A?
 
szkuba said:
So how it is possible that on Assit1 the battery curent can go up 3-4A if this is 20%?
Please don't mix up torque-simulation mode and torquesensor-mode! In torque-simulation you define specific current steps with the assist level. In torquesensor-mode, you define the gain of your human power with the assist level. So even in level 1 you can reach the Battery Current max value if you are pedaling hard enough.

regards
stancecoke
 
I seem to have a different sensor.
The markings I seem to spot are: A 750 1932 865A

For some reason I feel no difference when it comes to noise and power consumption when I disable "motor angle correction". Probably means FOC didnt work from the start, explaining my poor efficiency?

IMG_20201006_111936_compress60.jpg
 

Attachments

  • IMG_20201006_120924_compress59.jpg
    IMG_20201006_120924_compress59.jpg
    200.9 KB · Views: 1,160
  • IMG_20201006_111841_compress27.jpg
    IMG_20201006_111841_compress27.jpg
    224.8 KB · Views: 1,160
Hi guys

Today, I installed the custom firmware in my controller! It was pretty successful, I managed to get the firmware on the board and the app working.

However, I am using the potted 9-fet controller from topbikekit, so I was unable to access the backside og the board for soldering. Unfortunately, I destroyed one of the eyelets of the board when I tried to solder. I managed to get the firmware on there by just sticking in a Wire and and running the program, but I would like to repair it.

Dora anyone know how to repair such a board?
 
Corrida victim said:
I seem to have a different sensor.
The markings I seem to spot are: A 750 1932 865A
Yes, this seems to be an Allegro ACS72981 like sensor:

acs72981-product-image.ashx


You can try to desolder the 0.5 mOhm resistor (marked with "0m50"), then the ACS "sees" more current. But you have to consider the maxmium rating auf the ACS.

Have you looked at the waveform of the phase current in the BluOSEC-app?

regards
stancecoke
 
stancecoke said:
You can try to desolder the 0.5 mOhm resistor (marked with "0m50"), then the ACS "sees" more current. But you have to consider the maxmium rating auf the ACS.
That's the brand indeed! Thanks for sending me in the right direction! I'll try finding the correct datasheet. But I'm afraid I'll have to leave the resistor as my phase current is currently set at 140amps.
stancecoke said:
Have you looked at the waveform of the phase current in the BluOSEC-app?
I did indeed! Sometimes there is a nice waveform, sometimes there isn't, not sure what to make out of it.

On a sidenote, sometimes my bike just accelerates forward without pedaling. Braking with the brake that's connected doesn't seem to have an effect for at least a couple seconds. Not sure if it's hardware or software related.
 

Attachments

  • Screenshot_20201006-164049.jpg
    Screenshot_20201006-164049.jpg
    81.8 KB · Views: 1,127
  • Screenshot_20201006-164009.jpg
    Screenshot_20201006-164009.jpg
    87.7 KB · Views: 1,127
Corrida victim said:
Sometimes there is a nice waveform, sometimes there isn't, not sure what to make out of it.

The waveform looks good and the correction value is varying with speed and load. That seems to be OK.

Have you checked the battery consumption with a powermeter? Perhaps just the current calibration is not correct.

Corrida victim said:
On a sidenote, sometimes my bike just accelerates forward without pedaling
It is known, that the firmware freezes sometimes with BluOsec. In the branch "Torque from X4" we have replaced the computationally intensive float operations with integer arithmetic and shifts. This solves the problem, but we have never merged it to the master...

regards
stancecoke
 
Back
Top