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

Where did you get the information, that the LSW1599-4M is a LD-SS03? The ones from Yose power are square wave for sure.
Ah, sorry. I directly compared the parameters of the LSW1599-4M to the product catalog on Lishuis website. Didn't suspect that Lishui did custom orders 😓.

Thank you for the heads up. I alsmot wasted 60€.
Do you happen to know any place to buy the sinewave variant?
 
It has been a long time since I looked into this forum. I see some people have issues with the motor having resistance on coasting. I also noticed this and found this irritating. You need to look at the dutycycle your motor runs at versus the speed and then you can calculate the constant. Originally it is 1.5 and I have it set at 1.85.
I also wanted the controller to be able to restart at speed and I just added the uptime variable in acasetpoint.c and I have restarted my controller at speeds plenty of times.
if ((ui16_aca_experimental_flags & PWM_AUTO_OFF) == PWM_AUTO_OFF) {
controll_state_temp += 512;
//disable PWM if enabled and no power is wanted
if (uint_PWM_Enable && uint32_current_target == ui16_current_cal_b || ui8_BatteryVoltage < (ui8_s_battery_voltage_min-2)) {
TIM1_CtrlPWMOutputs(DISABLE);
uint_PWM_Enable = 0;
}
//enable PWM if disabled and voltage is 6.25% higher than min, some hysteresis and power is wanted
if (ui8_uptime >= 1 && !uint_PWM_Enable && ui8_BatteryVoltage > (ui8_s_battery_voltage_min + (ui8_s_battery_voltage_min >> 4)) && (uint32_current_target != ui16_current_cal_b)) {
TIM1_CtrlPWMOutputs(ENABLE);
uint_PWM_Enable = 1;
}
}
I am now interested in getting a bit more speed out of my bike and I want to select the third harmonic wavetable, as I think this is corresponds to/emulates SVPWM with min/max injection. With that technique your line-line voltage on the motor can be increased by 15% compared to a pure sine wave, without distortion (provided there is an ungrounded starpoint), but I do not know if the wavetable truly represents that. Where can I find more documentation on the wavetables?
 
Anyone without the issue of DD motor resistance at coasting on KT?

Reason to ask is that in my custom FOC controller (nothing related to KT) w/ DD, after board rework, similar issue happens, which was not present earlier.

DC-DC converter of this board did a suicide that killed gate drivers as well. Gate drivers were replaced & board resurrected, controller now works okay, except for the resistance at standstill. At the time of fault, current was very high, which might have caused overvoltage to current shunt amplifier input. Now phase current waveforms have more noise as compared to earlier. Suspecting the issue in my case to be either with the quality of hand soldering or degradation of current shunt amplifier.

EDIT: Slightly rephrased
 
Last edited:
Noise issue in my case is due to processor ADC, and not due to CSA or hand soldering quality.

Attached phase current waveform with different processors on the same board.

Phase current (for 180 degrees) at a certain load & speed as seen by the processor 1 in uP1.png. This one doesn't have resistance at coasting, current waveform is relatively smooth (for the issue at hand, ignore the current not being a proper sinewave, hall interpolation inaccuracy is causing it, it needs improvement)

For the same condition, phase current as seen by processor 2 is in uP2.png. This have resistance at coasting, it have a lot of noise in the current.

Note that current waveform observed in scope is similar (w.r.t noise) in both the cases, i.e. they were smooth.

In my case, processor is STM32F103, both were clones, verified by reading processor JTAG id. On KT, IIUC, processor is STM8.

So there is a possibility that the KT STM processor (clone?) is the culprit for resistance at coasting.
 

Attachments

  • uP1.png
    uP1.png
    22 KB · Views: 2
  • uP2.png
    uP2.png
    46.1 KB · Views: 2
It's been a few years since I've looked at this thread. Can anybody tell me what the overall stability is of this software these days or is it still in a very experimental stage? I would primarily be interested in it for its field strength weakening as a possibility to increase my speed maybe 10% at the top end on my direct drive 20 inch hub motor.
Have there been actual road tests of the field strength weakening for affecting top speed on a direct drive hub motor? I'm talking about actual GPS experimental results with just turning on and turning off field strength weakening.
 
So there is a possibility that the KT STM processor (clone?) is the culprit for resistance at coasting.
That's a great observation! The new "as" clones are probably not as good as their original. I should have a 9 FET KT controller with the original stm8 mcu laying around somewhere. I'll solder a makeshift adapter for my dd motor and see if the resistance is as noticeable on the 9 FET.

EDIT:
If I should judge based on the effort I have to put in by turning the shaft of the dd motor about half a turn, then my 6 FET with the (as) clone seems to have a slightly higher resistance than the original 9 FET.
 
Last edited:
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
Hi, we also have e-bike conversion kits with integrated sine wave controller. If there is anything we can assist you with, please do not hesitate to reach out to us at service@yosepower.com. Thank you very much.
 
Someone made a fork with support for the LCD8, and combines nice features from different forks aswell. It does work! awesome
I would be very interested in this (esp for BluOsec App use and for the "all fixed point arithmetic conversion) - but if I download the linked repository, the included OSEC Parameter Configurator.jar (from folder "tooling") does not even start. Also, the entire file structure looks a bit different. @vastLos: Can you give some insight how to get this running?
PS: I tried this on Windows (W8 32bit and W11 64bit)
 
Last edited:
Hi, we also have e-bike conversion kits with integrated sine wave controller.
Yes, I know, but they seem to be only available in the UK shop?! And they seem to have simple speed levels, not power levels.

The JYT controllers are clones of the Lishui FOC controllers. There is a branch of the EBiCS firmware for the JYTs.

regards
stancecoke

index.php
 
Last edited:
Yes, I know, but they seem to be only available in the UK shop?! And they seem to have simple speed levels, not power levels.

The JYT controllers are clones of the Lishui FOC controllers. There is a branch of the EBiCS firmware for the JYTs.

regards
stancecoke

index.php
Hello Stancecoke,

This shop has e-bike kits with integrated sine wave controller as well.
For any questions regarding our products, please feel free to contact the technical support team at service@yosepower.com. We appreciate your understanding and cooperation.

Kindest regards
 
This shop has e-bike kits with integrated sine wave controller as well.
Can you ask JYTCon for a firmware, that controls the current with the levels, not the speed. Or make this option settable in the display, like Kunteng does with the parameter P3
Screenshot_20240427-080004~2.png
 
Last edited:
Someone made a fork with support for the LCD8, and combines nice features from different forks aswell. It does work! awesome

I would be very interested in this (esp for BluOsec App use and for the "all fixed point arithmetic conversion) - but if I download the linked repository, the included OSEC Parameter Configurator.jar (from folder "tooling") does not even start. Also, the entire file structure looks a bit different. @vastLos: Can you give some insight how to get this running?
PS: I tried this on Windows (W8 32bit and W11 64bit)

If anyone could give a hint - as stated I can not get the java Configurator (of the above linked fork) to run.
(I also went to the fork owners GitHub Page, but see no way to contact the creator or raise an issue there.)
Any help would be appreciated.
Maybe this gives a hint to someone more knowledgeable:
When I run it from command line, I get this output:

Code:
C:\BMSBattery_S_controllers_firmware_1st\tooling>java -jar "OSEC Parameter Configurator.jar"
java.lang.NullPointerException
        at OSEC.<init>(OSEC.java:360)
        at OSEC$1.run(OSEC.java:162)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
 
Thanks @stancecoke . I tried using the bat file, but it throws a bunch of errors after compiling.
(Just to clarify - I talk about the fork from 'consp' - compiling your version works w/o issues)
-> I guess I stay with the 'Torque from X4' Version in your github for my BlusOsec setup.
(I was curious about this new Fork, because 'Power based Control' does not work in the X4 Version and I was hoping that that was fixed in consp's fork)
 
OK, you will have to update the windows makefile I guess. We had a discussion at GitHub, if someone will maintain this project in future, but nobody was found. :(
 
Last edited:
That is sad, if there will be no maintainer - esp w/ the last improvements by consp, which will be then lost for the public.
I am too clueless with c and github to volunteer myself.
 
Back
Top