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

Electric Motors and Controllers
casainho   100 MW

100 MW
Posts: 2861
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Feb 13 2019 4:38am

apple2 wrote:
Feb 12 2019 5:29pm
stancecoke wrote:
Feb 09 2019 4:02pm
apple2 wrote:
Feb 09 2019 7:33am
I've looked at the svm table and I am wondering what tool is used to generate it?
Also would it be more efficient to disable pwm on the low phase?
There are several approaches how to calculate the SVPWM pattern.
You can't switch off any channel as we are using center aligned PWM. Zero in the lookup table does not mean zero DutyCycle on the phase wire. Look at the figure 31 of ST's User Manual 1052.

Glad to hear, that you are happy with our firmware :D

regards
stancecoke
Ok, I read the document and although I didn't understand all of it it seems that all phases are centered around 50% duty cycle when the commanded duty is 0. Is there any good reason behind this?
I actually tried changing this so that 0 duty is actually 0 duty on the phase and the controller seems to work fine. That way 1/3 of the mosfets are not switching which should increase efficiency... I have tested this on a 6 fet (because I didn't want to mess up my 18fet) and tried it up to 20A and works ok. So I have ben getting good results from the firmware on both 6 fet and 18fet. The pwm off when idle feature also works fine although its mentioned as experimental.

Another thing I tried is decreasing the dead time (from 16 to 8) which happily didn't cause burnt mosfets but caused something strange that I have no explanation for: the duty cycle (setpoint) never drops below 20 even with no torque request and throttle at 0. Requested current and actual current values are both 0 (or -0.1) so I don't see where that duty is coming from. The wheel is actually rotating slowly.. until I stop it with the brakes and duty goes to 0. Then after the next throttle application it is stuck at 20. I am only using throttle and no pas or torque sensor. Any ideas why that could be happening or how to debug?
Read all the tecnhical information here: https://opensourceebikefirmware.bitbuck ... velopment/

https://opensourceebikefirmware.bitbuck ... mware.html
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

User avatar
stancecoke   10 kW

10 kW
Posts: 942
Joined: Aug 02 2017 2:56pm

Re: OpenSource firmware BMSBattery Sxxx/Kuteng controllers S

Post by stancecoke » Feb 13 2019 8:54am

kkm wrote:
Feb 12 2019 12:30pm
Today also uncomment line in main.c
// pwm_set_duty_cycle ((uint8_t) ui16_sum_throttle);
You are really brave :shock: With this you put the throttle input directly to the PWM. With no safety feature like battery- or phase current limitation active....

regards
stancecoke

sascha121985   10 µW

10 µW
Posts: 5
Joined: Jan 10 2019 7:15am

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

Post by sascha121985 » Feb 13 2019 9:02am

j bjork wrote:
Feb 09 2019 8:26am
Interesting, it seems like we have a very simular setup apple2.

But some settings are very different, I have battery current 500 (as I understood in the instructions should mean 50A) and battery voltage cal 70.
Did you have to swap any phase or hall wires with the new firmware?

For me the bluosec app freezes all the time, so I don´t really get any live numbers. I can mostly try to have the bike running stedy for a while, and then look at the values after some time.
Hello at all,

i have a simmular setup with a 1000W 48V 28inch rear hub and the KT36/48 6 FET 10A Controller with the custom firrmware.
At the moment i have only a KT-LCD3 Display, but i habe ordered a bluetooth modul and a 5V DC voltage regulators.

Can you send me your config ini from the java tool. So, that i have a base for my settings.

At the moment the drive is running smooth, but it is pulsing very strong to the max speed then stop and start again. Also the controller will be handwarm after 2 or 3 Minutes run. My second Kt36/48 with the original firmware is cold after 5 Minutes.

best regards
Sascha

casainho   100 MW

100 MW
Posts: 2861
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Feb 13 2019 12:26pm

You guys may be interested, as seems we may have a Bluetooth LCD that is small, "cheap" and flexible:
casainho wrote:
Feb 13 2019 5:54am
Tiny LCD with bluetooh

PSWPower is selling the SW102 LCD for Bafang that seems a version of the eggrider LCD, for 45€. Seems a decent price.

Eggrider seems to use a Nordic microcontroller that includes Bluetooth.

SW102 listing on PSWPower and other online shops on aliexpress never mention Bluetooth but I found only a listing saying:

At present, this display does not have bluetooth function. If the bluetooth function is needed, it can only be customized with a batch order

Since they use a Nordic microcontroller that includes Bluetooth, I guess all this LCDs supports Bluetooth but it may be disabled/not implemented in firmware on some models.

I am being developing firmware for another ebike LCD (commercial project, not OpenSource) that uses Nordic microcontroller with Bluetooth, so I am familiar with this systems. They support the ARM GCC compiler, so would be more or less easy for me to develop for this LCD.

But the programming using bootloader on this LCD should be locked like on 850C so I think the only option is open the LCD and try solder the programming wires... let's see if is possible... I just bought 1 unit from PSWPower and should take 2 weeks to arrive.

This LCD has some characteristics many has being asking:
- small size
- Bluetooth
- cheap/medium price

Let's see if we can program it....

Image
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

j bjork   100 W

100 W
Posts: 106
Joined: Aug 31 2018 3:01pm
Location: Linköping, Sweden

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

Post by j bjork » Feb 13 2019 1:02pm

sascha121985
I don´t think my setup is much use for you, I have an 18fet controller and my setup does´nt really work very good.
I have violent cogging if I´m not very gentle at the trottle until I am up at maby 20km/h.

It is nice weather here today, and I was able to test outside. That is how I noticed it seems to be ok at speed. It was a bit weak, but it was only using about 25A. I set the batt amp value to 500, but it seems to have changed itself to 244. Changing PID Gain I to 0.1 did not seem to make much differens.( on the cogging)

If you still want my settings, I presented them a page or 2 back

sascha121985   10 µW

10 µW
Posts: 5
Joined: Jan 10 2019 7:15am

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

Post by sascha121985 » Feb 14 2019 1:59am

@j bjork

Thanks for your answer. I found your setting 2 pages before.
You write there, that you have no function with the KT-LCD3. Did you solve this problem?
I have the same issue. Only the voltages is displayed. No Battery Symbol,.. and the assistant value has no effect.


@apple2

Are you happy with your settings for the 6fet controller?
Can you share them?

best regards
Sascha

j bjork   100 W

100 W
Posts: 106
Joined: Aug 31 2018 3:01pm
Location: Linköping, Sweden

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

Post by j bjork » Feb 14 2019 2:13am

No, I don´t know anything about programming. So I have no idea where to start to solve that problem.

I tried to use casainho:s fw yesterday, it seems to write, but there did not seem to be any differens. It still ran about the same, LCD3 did not work and so on.
Then I tried to just use the erase original fw on that tool, but the motor still ran after. So I guess it did not work. I don`t know if I can´t have both on the computer at the same time or something?

apple2   100 µW

100 µW
Posts: 8
Joined: Mar 28 2016 8:08am

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

Post by apple2 » Feb 14 2019 4:55am

@sascha

the settings are basically what the wiki says..

Image

The max current is a bit high and goes >20A at max throttle, when the controller is rated at 17A peak..
If you experience push- pull, or other "instability" try lowering the undervoltage limit, raising the phase current limit, and raising the speed limits to make sure you are not hitting any of these "restrictions".
Also to test different motor angles, what I do is disable angle correction and try starting from standstill (not at full throttle) and check how much cogging I get.. then change and try again, no need to get up to speed because the motor angle related cogging is most evident at start. Once you get smooth starts, reenable angle correction and it should change the angle automatically when it picks up speed.. thats good and you shouldn't change the motor angle any more trying to match anything..

User avatar
stancecoke   10 kW

10 kW
Posts: 942
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 14 2019 10:02am

Can you describe the meaning of „cogging“ or even better post a video?

regards
stancecoke

j bjork   100 W

100 W
Posts: 106
Joined: Aug 31 2018 3:01pm
Location: Linköping, Sweden

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

Post by j bjork » Feb 14 2019 10:21am

Well, I think it is that it gets out of synk. It is like the motor does not pull forward all the time, some times it pulls backwards. Or like if the engine in a car stops, but you don´t release the clutch. When the car stops you feel every compression stroke. That is how I can describe it I think.
It happens as soon as I give it some trottle at low speed.If I am very gentle on the throttle it can be ok. At higher speed it seems to be ok, or nearly so.

User avatar
stancecoke   10 kW

10 kW
Posts: 942
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 14 2019 10:43am

OK. Do you have the phase current sensor installed and working?
The advice of apple2 is exactly right. Disable the automatic angle correction and try to find the correct motor specific angle. Swap Hall and motor wires, if you can‘t find a satisfying angle setting.

regards
stancecoke

sascha121985   10 µW

10 µW
Posts: 5
Joined: Jan 10 2019 7:15am

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

Post by sascha121985 » Feb 15 2019 3:56am

j bjork wrote:
Feb 02 2019 3:45pm
But the only ting working on the lcd3 is battery voltage, no speed, no symbols for braking, no battery indicator.
It also seems like changing assist level has no effect. I havent tested on the road, but it works on assist 0 with the wheel in the air.
And it has a delay when I release the trottle before it stops pulling.
I can solve the problem with the help from stancecoke in the german forum.
The Problem was the checksum from the UART messages to the display

You must edit the display.c.
At the moment i don't know which value ist the correct one, because i change yesterday all 5 to 5 new at one step.
One of them solve the problem. ;-)

Code: Select all

// see if CRC is ok
        if (((ui8_crc ^ 10) == ui8_rx_buffer [5]) || // some versions of CRC LCD5 (??)
                ((ui8_crc ^ 5) == ui8_rx_buffer [5]) || // CRC LCD3 (tested with KT36/48SVPR, from PSWpower)
                ((ui8_crc ^ 9) == ui8_rx_buffer [5]) || // CRC LCD5
                ((ui8_crc ^ 3) == ui8_rx_buffer [5]) || // CRC LCD5 Added display 5 Romanta
                ((ui8_crc ^ 2) == ui8_rx_buffer [5])) // CRC LCD3
        {

i change 10 to 1| 5 to 4 | 9 to 6 | 3 to 7 and 2 to 8.

Code: Select all

// see if CRC is ok
        if (((ui8_crc ^ 1) == ui8_rx_buffer [5]) || // some versions of CRC LCD5 (??)
                ((ui8_crc ^ 4) == ui8_rx_buffer [5]) || // CRC LCD3 (tested with KT36/48SVPR, from PSWpower)
                ((ui8_crc ^ 6) == ui8_rx_buffer [5]) || // CRC LCD5
                ((ui8_crc ^ 7) == ui8_rx_buffer [5]) || // CRC LCD5 Added display 5 Romanta
                ((ui8_crc ^ 8) == ui8_rx_buffer [5])) // CRC LCD3
        {

Today or tomorow i will test which one was the correct one and come back to you.

Now I can dedicate myself to the unround engine run.
I have disable the rotor angle correction and increase the motor spec. angel from 0 to 213 like in the screenshot.
But now, the motor is breaking all the time. When i try to turn it without the pas, it turns like a brake is closed.

When the bike hanging, it will run without any problem with the throttle. But when i load it with my weight, is it juddering.
Maybe the Phase Current max: and Battery Current max: is to low.

Sunny greeting from Germany
Sascha

User avatar
stancecoke   10 kW

10 kW
Posts: 942
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 15 2019 4:13am

Thank you for your feedback! I've just updated the master branch at github, all numbers from 1 - 10 are checked now in the checksum procedere.

For your troubleshooting: I think most problems are reported with 12 and 18 FET controllers with high amps settings. Please start with a battery current limit of 10 Amps and a phase current limit of 20 Amps.
Increase / decrease the motor specific angle from zero in both directions in steps of 5. (0, 5, 10, 15 etc. and 0, 250, 245, 240 etc.)
If you found a satisfiying motor specific angle, you can increase the currents step by step (keep the ratio of battery and phase current limits) and adapt (decrease) the values of gain_I and gain_P, if the motor starts juddering.

regards
stancecoke

j bjork   100 W

100 W
Posts: 106
Joined: Aug 31 2018 3:01pm
Location: Linköping, Sweden

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

Post by j bjork » Feb 15 2019 1:48pm

I did not understand how to get only the display c file, so I downloaded the whole thing. I unzipped and replaced only the display c file, and wrote the firmware again with the tool. But still nothing on the display, did I do something wrong?

I disabled the angle correction and lowered batt and phase amps. I tried a bunch of angles, and settled on 247. As long as I don´t go over 150 in batt amps, and 250 in phase amps it is fine. As soon as I go over (I only tried to change 50 at a time) the violent cogging is back. It dosen´t seem to make much differens if I enable angle correction or not. I also tried lowering both gain I and P, but I have not played around with them. But so far not really any obvious differens.

Is it a good idea to try to mount pull down resistors on the hall signal wires? 1k ohm or something? I mean, if it is interferens from the magnetic field in the phase windings.

The strange trottle behavior is still there, even at lower amp settings. Sometimes it does not react to throttle, or with a big delay. And sometimes it does not react when i release throttle, and sometimes it keeps pulling even after I have stopped it with the brakes.

apple2   100 µW

100 µW
Posts: 8
Joined: Mar 28 2016 8:08am

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

Post by apple2 » Feb 15 2019 6:02pm

It sounds to me you are always testing with full throttle?
When you say if you increase the batt current by 50 the coggng is back, are you testing with full throttle? Maybe its a good test to try a smooth slow application of the throttle so you don't actually hit the limit?
Also did you lower the undervoltage protection so that when you apply full throttle it doesn't hit it and suddenly disable pwm...
I doubt pull down resistors will have any effect. I am also pretty sure your phase and hall combinations are spot on otherwise it wouldn't move at all.

I have seen some strange throttle behavior, though. Sometimes if you apply throttle to move a few feet and release shortly after, it doesn't stop instantly but continues applying torque for a while...
Another time it just decides to keep duty cycle at 20-30 for no reason.

Does the app logging feature work and how?

User avatar
stancecoke   10 kW

10 kW
Posts: 942
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 16 2019 3:10am

apple2 wrote:
Feb 15 2019 6:02pm
Does the app logging feature work and how?
In the BluOSEC app, the logging works, but the created file is not easy to analyse, as the infos are at different time bases and you have to sort everything first.
For debugging you better use the diagnostics mode.

regards
stancecoke

j bjork   100 W

100 W
Posts: 106
Joined: Aug 31 2018 3:01pm
Location: Linköping, Sweden

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

Post by j bjork » Feb 16 2019 6:03am

It is kind of working now :D

It seems like it was the undervoltige protection. I lowered it to 50, then this violent cogging stopped. I tested to raise my batt amps to 500 and phase amps to 1200 again, now it works, but i get small vibrations and humming when pulling hard at low speed. I will test some more with the gain P and I, and see if that will help.

I don´t think it should reach undervoltage limit yet. My battery is getting low, but at full throttle it reads 41.5V now after some more riding and pulling more amps then I did when I had that problem.
Is that how the undervoltige protection is supposed to work? It seems very violent, I thout I was going to blow some mosfets or something sometimes. And I did blew 40A fuses with maby 20A settings.

Thank you for your help so far :thumb:

User avatar
stancecoke   10 kW

10 kW
Posts: 942
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 16 2019 7:09am

j bjork wrote:
Feb 16 2019 6:03am
And I did blew 40A fuses with maby 20A settings.
I guess your problem with undervoltage protection and blown fuses is caused by overshoots of the PI-Control. You get very short high amps peaks and voltage drops. You have to decrease Gain_I and Gain_P to avoid this. Try 0.01 or even 0.001 and see what happens. You have to find a compromise of satisfying response time and acceptable overshoots. Perhaps for that high currents the implementation of casainho with a pure I-fraction control in the fast loop is better.

regards
stancecoke


Image
Image

casainho   100 MW

100 MW
Posts: 2861
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Feb 16 2019 7:43am

stancecoke wrote:
Feb 16 2019 7:09am
Perhaps for that high currents the implementation of casainho with a pure I-fraction control in the fast loop is better.
Yes, I remember to read in a few sources that current controller is done on PWM fast loop (with PI controllers but in our case we do not have processing power for that) and speed controller (an others like torque sensor, throttle, etc) is done on outer loop, slower, like at 10ms.

My code is better developed on TSDZ2 mid drive firmware, that has now much more users than the firmware for KT (it is being used also on a OEM/commercial company) and everyone is happy -- although the currents are much lower, like 20 battery amps.

Please note that KT controllers has specific hardware to control phase current separated from battery current (unlike TSDZ2 motor controller) and my code does that but not the implementation of Stancecoke. I think for big controllers and such big currents, controlling well the phase current should be important to avoid damage of the mosfets and maybe even the motor coils.
I did read that powerful low inductance motors can easily burn mosfets because then can pull fast and very high phase currents peaks.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

sascha121985   10 µW

10 µW
Posts: 5
Joined: Jan 10 2019 7:15am

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

Post by sascha121985 » Feb 18 2019 2:37am

j bjork wrote:
Feb 15 2019 1:48pm
I did not understand how to get only the display c file, so I downloaded the whole thing. I unzipped and replaced only the display c file, and wrote the firmware again with the tool. But still nothing on the display, did I do something wrong?
I have tested the new display.c file with the values 1-10with sucess.
So for me it is working.
But maybe your Display has an other cecksum value? You can try to change the values 1-10 to 11-20.

j bjork wrote:
Feb 16 2019 6:03am
It is kind of working now :D

It seems like it was the undervoltige protection. I lowered it to 50, then this violent cogging stopped. I tested to raise my batt amps to 500 and phase amps to 1200 again, now it works, but i get small vibrations and humming when pulling hard at low speed. I will test some more with the gain P and I, and see if that will help.
It's working for me,too. I have decrease the undervoltige protection to 50 and now it stop cogging.
Thank you

But what i noticed is that Assist level 0 doesn't switch off the engine, but probably corresponds to level 1.
Maybe there is some false allocation inside the source?

The second problem is the pulling down of the voltage during the startup and acceleration.
The controller ist getting warm after a one minute ride.
Probably i have to reduce the values gain P and gain I. At the moment i'm at 0.1 and 0.4.
I think the current is to high and that is the reason why the undervoltage protection started before a decrease the value.

best regards
Sascha

j bjork   100 W

100 W
Posts: 106
Joined: Aug 31 2018 3:01pm
Location: Linköping, Sweden

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

Post by j bjork » Feb 19 2019 8:46am

I still don´t have any functions on the display, and I have´nt got rid of the humming and smaller vibrations at accelaration. I tried to change the whole folder of files, not just the display c, but it did´nt make any differens.

I tried a tool in casainos fork that did´nt work, but then I found another that did. With that fw i have the display working, but some other strange behaviors. The motor is pulling of it´s own if I don´t pull the brake or pedal a little backwords. When riding it brakes of its own when I let go of the trottle.
I only seem to get 300w on the display, but I would guess about 600w in reality. I doubled the amp, but it seems like it did´nt make any differens. Then I started doing other things and haven´t looked at the bike since then.

User avatar
stancecoke   10 kW

10 kW
Posts: 942
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 19 2019 10:03am

j bjork wrote:
Feb 19 2019 8:46am
I still don´t have any functions on the display,... I tried to change the whole folder of files, not just the display c, but it did´nt make any differens.
Please follow the suggestion of sascha121985 and try the numbers from 11 - 20 in the display.c. See the code snippet here. You can use any texteditor to do the changes.

regards
stancecoke

sascha121985   10 µW

10 µW
Posts: 5
Joined: Jan 10 2019 7:15am

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

Post by sascha121985 » Feb 19 2019 6:22pm

Must I reduce gain P and I at the same time and the same value? So when I go to 0.01 the other value must be 0.04?

And again, do you have any idea why assist level 0 at the lcd3 corresponds to level 1 at the java tool?

Greeting from the lovely Germany ;-).
Sascha

User avatar
stancecoke   10 kW

10 kW
Posts: 942
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 20 2019 4:59am

sascha121985 wrote:
Feb 19 2019 6:22pm
Must I reduce gain P and I at the same time and the same value? So when I go to 0.01 the other value must be 0.04?
Gain_I and Gain_P are completely independent. Just play around with both. (You should have in mind, how a PI-Control works...)
sascha121985 wrote:
Feb 19 2019 6:22pm
And again, do you have any idea why assist level 0 at the lcd3 corresponds to level 1 at the java tool?
As I don't use any display I can't confirm nor contradict your finding. The code seems to be OK.

Code: Select all

// convert static defines to volatile vars
	ui8_a_s_assistlevels[0] =0;
	ui8_a_s_assistlevels[1] =LEVEL_1;
	ui8_a_s_assistlevels[2] =LEVEL_2;
	ui8_a_s_assistlevels[3] =LEVEL_3;
	ui8_a_s_assistlevels[4] =LEVEL_4;
	ui8_a_s_assistlevels[5] =LEVEL_5;
But I must confess that I don't really understand what XNYLE does with his percent_wanted/smoothed assist levels...

Code: Select all

// >=8 means levels are switched of, use wanted percentage directly instead
	ui16_assist_percent_smoothed -= ui16_assist_percent_smoothed >> 4;
	if ((ui8_assistlevel_global & 15) < 8) {
		ui16_assist_percent_smoothed += ui8_a_s_assistlevels[ui8_assistlevel_global & 15];
	} else {
		ui16_assist_percent_smoothed += ui8_assist_percent_wanted;
	}
	ui8_assist_percent_actual = ui16_assist_percent_smoothed >> 4;
regards
stancecoke

haiyi911   100 mW

100 mW
Posts: 41
Joined: Oct 13 2017 5:35am

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

Post by haiyi911 » Mar 01 2019 9:37am

kkm wrote:
Jan 23 2019 4:34am
j bjork wrote:
Jan 05 2019 4:56pm

A question, how is the trottle response compeared to the standard fw? I think it is a bit slow on the kt fw.
Almosty all “factory” firmware (including KT original fw) uses “speed (rpm) control”, and not “torque (current) control” for the throttle. That is, by shifting the knob on 2-3 mm, the motor (unloaded wheel) turns will be 5-10 rpm, moving another 1 mm - 30-50 rpm, etc.
This behavior allows you to stably maintain the desired speed, especially at low speeds (5-8 km / h), the current speed depends little on small changes in the terrain, it is stable.
And yes, this mode feels like a "quick response" knob.
Unfortunately, this firmware uses a "dumb" throttle control method - "Torgue (current)". An unloaded wheel immediately starts at full speed, driving at low speeds is difficult and unstable, the throttle response is perceived as "viscous", and the acceleration speed and speed change is unpredictable even with slight inclines/rises of 0.5-1 degrees.

Unfortunately, this is the only reason why I cannot use this excellent firmware.
on the road when i turn the throttle to the end,the motor may take a 3-4 seconds and increase slowly to the max speed,not a quick response.do you?

Post Reply