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

Try wiping the EEPROM, maybe some old settings are overwriting something
You mean through the "Write magic byte"? I've tried both doing that and wiping the "DATA MEMORY" tab in STVP myself.

If you somehow enabled ZERO_DC in the aca experimental settings this would also happen. Though unlikely for what you describe as the throttle would not work (I think). Also you might try disabling the throttle and see if the problem still persists.
The "DC static zero" setting doesn't do anything when I turn it on, no matter if I do it by flash or Blueosec, and I also never enabled it in the tool on my "daily" config. As you suggested I tried disconnecting everything except the motor, pas and HC-05 from the controller, but that didn't do anything. I tried downloading a fresh copy of the Master and X4 Torque branch, but that didn't change anything.

I also noticed that the resistance is only present when the controller is powered on. So it's definitely a software problem. And I cannot seem to understand what that may be as everything seems fine.

Blueosec reports the following states:
1|17 while standing still and 1|34 while spinning, which seems fine by me.

Here is my config and a screenshot of the java tool, if that may help.
 

Attachments

  • config.h
    1.4 KB · Views: 4
  • 1708520923532.png
    1708520923532.png
    110 KB · Views: 13
Last edited:
Du meinst durch das „Write Magic Byte“? Ich habe sowohl versucht, dies zu tun als auch die Registerkarte „DATENSPEICHER“ in STVP selbst zu löschen.


Die Einstellung „DC static Zero“ bewirkt nichts, wenn ich sie einschalte, egal ob ich sie über Flash oder Blueosec mache, und ich habe sie auch nie im Tool meiner „täglichen“ Konfiguration aktiviert. Wie Sie vorgeschlagen haben, habe ich versucht, alles außer Motor, Pas und HC-05 vom Controller zu trennen, aber das hat nichts gebracht. Ich habe versucht, eine neue Kopie des Master- und X4-Torque-Zweigs herunterzuladen, aber das hat nichts geändert.

Mir ist auch aufgefallen, dass der Widerstand nur dann vorhanden ist, wenn der Controller eingeschaltet ist. Es handelt sich also definitiv um ein Softwareproblem. Und ich kann anscheinend nicht verstehen, was das sein könnte, da alles in Ordnung zu sein scheint.

Blueosec meldet die folgenden Zustände:
1|17 im Stillstand und 1|34 beim Drehen, was mir gut erscheint.

Hier ist meine Konfiguration und ein Screenshot des Java-Tools, falls das helfen könnte.
Ich habe das gleiche Problem. Aber auch noch keine Lösung gefunden. Ich melde mich wenn ich weiter Bin. Wenn sie den Fehler gefunden haben, würde ich mich über eine Nachricht freuen.
 
Ich habe das gleiche Problem. Aber auch noch keine Lösung gefunden. Ich melde mich wenn ich weiter Bin. Wenn sie den Fehler gefunden haben, würde ich mich über eine Nachricht freuen.
Glad to hear that I'm not alone in this. Unfortunately I haven't had any success with my own searching, I'll continue to try things but it doesn't look bright.
 
Hello!
I seem to have gotten myself into trouble. Recently I decided to fine tune my controller to work better with my motor. I erased the firmware from the microcontroller to start fresh and followed the exact same steps as I did when I initially flashed the firmware, but this time something is off. I selected the same config preset I used on my first flash and only changed the display from KT-LCD3 to Blueosec for easier adjusting. After connecting everything together I pushed the throttle but nothing happened, luckily I soon realized that the option bytes in the java tool not only unlock the controller but also alters the B3,B2,B1 and B0 pins on the MCU. So I flashed the option bytes and tried again, but now I have another strange issue.

The wheel has what it feels like magnetic resistance to it when I try to spin it by hand (no pas or throttle applied). At the same time, everything works as intended. The resistance seems to disappear when throttle or pas is applied or when I turn on the "PWM off @ coast" option in Blueosec.

To me this seems like the rain somehow works while standing still, as Blueosec is registering negative current when I spin the wheel fast enough. But I cannot find any reason to why it would be on, as all regen options are turned off and the "Regen Current Max" is set to 0.

What can I be missing? I've read through the whole wiki and can't really seem to find any hints about this exact behavior.
This is the way the open source firmware works.

the PID is a bit slow and you feel resistance when turning the wheel backwards because computation is never turned off.

Stancecoke says that the PID is fine when moving fast and there is no extra resistance when coasting using this method.

If you have a direct drive, just leave it as it is and wait with turning on the controller until you dont need to push the bike backwards :)
 
This is the way the open source firmware works.

the PID is a bit slow and you feel resistance when turning the wheel backwards because computation is never turned off.

Stancecoke says that the PID is fine when moving fast and there is no extra resistance when coasting using this method.

If you have a direct drive, just leave it as it is and wait with turning on the controller until you dont need to push the bike backwards :)
I suppose that makes sense. But the problem is that the resistance persists no matter the direction of the spin. I cannot say if it's stronger backwards but it's definitely not normal when I push forwards.

I'm a bit hesistant to use it as is, and I'm feeling that turning "PWM auto off" on would be equal to ignoring the original issue.
 
The "DC static zero" setting doesn't do anything
Good, keep it off and don't try biking with it turned on, that's not good. It was to check it was off.

Resistance is always there a (tiny) bit, you will only get rid of it by using AUTO_PWM_OFF. If it's so much you have to really work to spin the wheel it's something else.
 
I have also noticed small resistance when free wheling with controller on on DD motor. When i switch off the controller then it dissapear. I think you can try to enable "pwm off @ idle" however from what i read somewhere in the thread you need to precisely measure the inductunce of the motor :unsure:
 
If it's an FOC controller, it should be able to do that itself--but some of them don't do a great job of "autotune" and detection, so either getting this info from the motor manufacturer, or being able to measure it yourself, can be helpful in those cases.
 
if this controller can be implemented by sensorless and reverse?
The Kuntengs are doing sensorless in square wave mode only, they use an additional PCB, that emulates the hall signals. Reverse is possible, but not implemented in the open firmware.

precisely measure the inductunce of the motor
Not the inductance, but the motor's KV constant.
It is needed to avoid a current peak, when activating the PWM while the motor is turning. The drag (when turning the wheel by hand) can be reduced with bigger p- and i- control factors, this will speed up the control, but has the risk, that the control loop starts to oscillate.

regards
stancecoke
 
The drag (when turning the wheel by hand) can be reduced with bigger p- and i- control factors, this will speed up the control, but has the risk, that the control loop starts to oscillate.
Thank you stancecoke, I'll tinker with these factors and report back if it helped.

On that note, wouldn't it help to add this information to the github wiki?
 
I'll tinker with these factors and report back if it helped.
So either I can't feel any difference or the P and I factors don't seem to have that great of an influence on the idle drag. I tried increasing the factors by 0.1 up until 1 and I couldn't feel any difference.

If I am to assume that this is a normal drag. Would it be a safe option to just enable "PWM auto off" on an everyday basis?

As the Blueosec app describes it as "Turn Off PWM if no power is requested", which to me appears as a function that almost should be enabled by default, wouldn't disabling PWM at idle make the controller waste less power?
 
by 0.1 up until 1 and I couldn't feel any difference.
I wasn't aware, that @Xnyle has rewritten the PI control and uses floats now also:eek:

You can try even bigger values. And you can try bigger maximum steps, @Xnyle has limited it to 5.

But be careful, this could end in magic smoke ;)

wouldn't disabling PWM at idle make the controller waste less power?
No, the current is controlled to be zero when no power is requested. So the consumption is minimal. As it is marked, the auto off function is experimental and without the right setting of the KV constant there is a risk to burn your mosfets due to heavy current spikes, when switching on the PWM.

regards
stancecoke
 
The Kuntengs are doing sensorless in square wave mode only, they use an additional PCB, that emulates the hall signals. Reverse is possible, but not implemented in the open firmware.


Not the inductance, but the motor's KV constant.
It is needed to avoid a current peak, when activating the PWM while the motor is turning. The drag (when turning the wheel by hand) can be reduced with bigger p- and i- control factors, this will speed up the control, but has the risk, that the control loop starts to oscillate.

regards
stancecoke
thanks, for the DD motor KV seems straight forward, but how about for gear motors? Shall we take reduction gear into account?
 
But be careful, this could end in magic smoke ;)
I'd like to avoid that 😓 It's quite hard to put it back in 😅

I'll try to do it in steps of 0.2, up to 5 on each of the factors.

without the right setting of the KV constant there is a risk to burn your mosfets due to heavy current spikes, when switching on the PWM.
I cannot seem to find any KV variables in the Java tool, nor the blueosec app. Is it something that needs to be set in the code? Or am I supposed to convert the KV to any of the available parameters?

If so, would setting the KV value for my motor make the "PWM AUTO OFF" setting safe to use?
 
Last edited:
but how about for gear motors?
For geared motors this function is not relevant at all. It would only be relevant, if you push your bike backwards. But who cares about the litte drag when pushing half a meter backwards when maneuvering out of a gap? You can activate the PWM Auto off without danger with a motor with freewheel, as the motor is not turning anyway, if the PWM is off.

I cannot seem to find any KV variables
The motor constant flt_s_motor_constant is initialized to 1.5


It seems, it can be set in the BluOsec app, but I'm not sure, I've never used the app.

BTW: The Kunteng hardware ist completely outdated and the open source project is not maintained any longer. ;)

regards
stancecoke
 
It is just that Kunteng in some countries are easily available. Also have higher power models than Lishui does. Controllers not beig potted and cool BlueOSEC app for fine tuning controller and motor perimeters. Of course Lishui is more advanced and works with torque sensor off the shelf.
 
The motor constant flt_s_motor_constant is initialized to 1.5
So I just need to set flt_s_motor_constant to my motors KV value? No conversion or anything?

BTW: The Kunteng hardware ist completely outdated and the open source project is not maintained any longer. ;)
Yeah, I've noticed that. I've seen your EBiCS firmware. Does that support all Lishui controllers? I've been figuring if I instead should move to Lishui, as the idea of the KT-LCD3 having the same MCU as all Kunteng motor controllers is bizarre to me.

What holds me back is the maturity of the project, as even the incomplete wiki of this firmware gives more useful information for newcomers.

What are the main advantages of Lishui compared to Kunteng? (Except the obvious more powerful 32 bit MCU)
 
Last edited:
No conversion or anything?
I don't know, how this constant has to be calculated, you have to ask @Xnyle

What are the main advantages of Lishui compared to Kunteng
It's not only Lishui, that offers much better controllers than Kunteng. Kelly, Sabvoton, ASI, VESC .... offer up to date products with FOC, four quadrant operation, field weakening etc.
There is no need to tinker with hobby open source projects ;)
But of course, from my point of view, the Lishuis in combination with the EBiCS firmware have the best price-performance ratio.:cool:

regards
stancecoke
 
I don't know, how this constant has to be calculated, you have to ask @Xnyle
Well that's unlucky. I suppose I can contact him via this forum?

It's not only Lishui, that offers much better controllers than Kunteng. Kelly, Sabvoton, ASI, VESC .... offer up to date products with FOC, four quadrant operation, field weakening etc.
I'm aware of their existence, It's just that I prefer for the controller to be as hidden as possible, which as far as I know can only be achieved by either building a bike frame for a specific controller (which most hobbyists cannot do), or using the "Hailong" controllers as I am doing now. That leaves, as far as I know, Kunteng and Lishui as the only available options. Of course there is the Baserunner from Grin tech, but it's just not worth the tax and customs to import it to Sweden.

There is no need to tinker with hobby open source projects ;)
But of course, from my point of view, the Lishuis in combination with the EBiCS firmware have the best price-performance ratio.:cool:
I do have the courage and interest in tinkering with hobby projects, mostly as I (after I understand the codebase) can add additional features, and or modify existing.

I've seen your EBiCS firmware. Does that support all Lishui controllers?
As these replies aren't really fitting this thread I'll keep it short. Do you think that the EBiCS firmware will fit the Lishui LSW1599-4M (LD-SS03)?
 
That leaves, as far as I know, Kunteng and Lishui as the only available options.
There is a Bafang controller for the Hailong Housing also.

Do you think that the EBiCS firmware will fit the Lishui LSW1599-4M (LD-SS03)?
Is that the model that is selled with the Yose-Kits? That doesn't work with EBiCS, as it is a simple square wave controller. But there is an open source project for it also ;)

regards
stancecoke
 
That's strange, Lishui sells it as a sine wave
Where did you get the information, that the LSW1599-4M is a LD-SS03? The ones from Yose power are square wave for sure.
index.php
 
Last edited:
Back
Top