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

stancecoke said:
Have you checked the battery consumption with a powermeter? Perhaps just the current calibration is not correct.
Happy to hear FOC seems to work :)
My bms has a calibrated ammeter which unfortunately reports values ±50% higher than the controller reports.
I'll map some values on my ride to school today. Aside from the high consumption, it's an excellent commuter!

stancecoke said:
It is known, that the firmware freezes sometimes with BluOsec.
Good to hear. At least my hardware is fine ;)
 
Hi yesterday I installed the open source firmware on my controller

It seems to run fine, but I can't make the motor spin from PAS sensor.

I took some screendumps to show you what is Up.

I get pas fraction of 2,7 when pedaling forwards and 0 when pedaling backwards.
I have tried PAS thresholds from 1 to 2,9 in 0,2 increments.

As far as I can ser, the halls are correct and if I spin the motor backwards by hans, I can see a sine wave back EMF.

What to do now?







- Victor
 
Success! I found out what was wrong. I had "enable power assist" ticked. When I unticked that, it started working.
I must say that the simplified FOC makes the bike feel stronger at higher speeds. It felt like a rocketship!

I had three issues though. Maybe some og you cam help me fix them?
From a standstill, the acceleration was a bit jerky. I tried messing with the PID parameters and I think it helped. Does anyone mind sharing their settings?

Also, the current read high in the app compared to actual draw. To change this, should I change current cal A?

And finally, when I stopped pedaling and applied the brakes (No brakes sensors), the bike would still pull slightly and draw ~ 1,5 amps until I lifted the rear wheel and it spun for a second and then stopped.
 
Vbruun said:
I had three issues though. Maybe some og you cam help me fix them?
From a standstill, the acceleration was a bit jerky. I tried messing with the PID parameters and I think it helped. Does anyone mind sharing their settings?
I find having Gain I too high can cause this - I usually reduce Gain I to 0.1, your setup may be different though..
And finally, when I stopped pedaling and applied the brakes (No brakes sensors), the bike would still pull slightly and draw ~ 1,5 amps until I lifted the rear wheel and it spun for a second and then stopped.
Find this line of code (adc.c about halfway down):-

ui16_current_cal_b -= 1;

...and try changing the '1' at the end to '2'. This was a fix given to me by Stancecoke for this problem some while back, seems that it alters the zero point and works for me every time :wink:
 
Hey man, thanks! I Will try that ASAP.

I see you run the q128 as well. How much current (phase and batt) do you run in it?
 
I see you run the q128 as well. How much current (phase and batt) do you run in it?

I'm using configurator values of 150/500 for battery and phase current max. These settings seem to draw around 800-900 watts max from the battery (measured with inline ammeter), seems about right for this motor. In fact the motor never gets any more than barely lukewarm so it could probably handle a bit more if the plastic gears would stand it.

Runs up to about 20-21mph on the road, enough for me these days and has good torque for such a physically small motor. Serious off-roaders and speed freaks would probably be a bit underwhelmed though.. :)
 
Do you use the 6- or 9-fet controller?

For me the motor is also plenty powerful. I am making a bike, afterall ;)
 
Vbruun said:
Do you use the 6- or 9-fet controller?

I'm using the 6-fet. One minor downside of the o/s firmware is that the controller runs a bit hotter than stock and doesn't like being enclosed in a saddlebag. The small size of the 6-fet means I can mount it under the rear rack, here it's hidden from sight but has sufficient airflow to stay reasonably cool.
 
Alright. Awesome!

I am running the 9-fet for the hailong case, so I might have to experiment a bit even with your values.
 
Just posting here to say massively thank you to stancecoke, casainho and everyone else who have contributed to this awesome firmware.

I just installed a torque sensor in my setup yesterday and finally, the bike feels like it is complete. To be able to get this kind of feel with cheap generic KT hardware (and an expensive torque sensor) is absolutely amazing. Thank you All.
 
Well done! It sometimes takes a bit of patience and experiment to get it to run how you want, but it's worth the effort in the end.
Like you say the feel of a torquesensor bike is quite special, getting back on my BBS02 equipped bike just doesn't feel the same any more.... :(
 
Got a bit of a weird issue.. So I ended up settling on a 1500W Voilamart kit and then swapped the controller for the KT one from my old kit so I could run this firmware as well as soldering up the 50A bidirectional phase current sensor for sine wave functionality.

My issue is that it makes this weird grinding noise on startup that only this controller does, the one included with the kit starts completely silently and runs well. Is this a hall angle issue with this motor? Anyone know what I can adjust to fix it?

I Messed with the per motor angle and went from 0-250 in increments of 10 with nothing seeming to help and sometimes reversing or not running at all. Also tried all 6 hall sensor cable combos and it didn't help either.

Here's a short video of the noise it's making: https://streamable.com/1qcwwk (the noise at the end is me hitting a box)
It mostly runs fine but sometimes it'll desync going up a hill.

If anyone has any suggestions or known good Voilamart 1500w rear hub settings it'd be greatly appreciated :)
 
Hello. It's been a while. I made a mistake with my 2wd setup(2X KT S06S). I connected the e-brake connections of both controllers parallel to the same e-brake sensor and realized a second too late that I should have not done that. The throttle signal was also shared between the controllers(powered by the rear engines controller), but now neither of the controllers don't seem to react to throttle at all. PAS does work normally though so the damage might not be at the 5V rail. The rear motor/controller's Bluosec shows full 15A draw when the throttle is connected, but the wheel does not spin nor react to throttle movement whatsoever. The front motor does not have this max amp draw behaviour but does not react to throttle pull either. I have tested this with two different throttles. I then flashed both of the controllers with diagnostics setting and ran BlueTerm with this line added to row 193 of main.c:

Code:
printf("%u,%u, %u, %u, %u, %u\r\n", ui16_control_state, ui16_setpoint, ui16_motor_speed_erps, ui16_BatteryCurrent, (uint16_t) uint32_current_target, ui16_momentary_throttle);

The output of BlueTerm app:

Front motor:
1.0.0.324.322.0 (no reaction to throttle)
Rear motor:
1.0.0.316.314.0 (no reaction to throttle)

How to troubleshoot if these are any good before spending 70€ for new ones?
 
tenten8401 said:
If anyone has any suggestions or known good Voilamart 1500w rear hub settings it'd be greatly appreciated

It is well known, that the Kunteng Controllers have bad resonances with the cheap china directdrives. That's a hardware issue, you can't fix it with software settings.

Valopallo said:
How to troubleshoot if these are any good before spending 70€ for new ones?
Have you checked the output of throttle singal wire, is it 0.8 ... 4.2 V?
If yes, it seems you have killed the ADC-Input pin for the throttle. You could try, if the ADC input on X4 still works. Simply connect the throttle signal wire to X4 and add ui16_adc_read_x4_value() to the print line to see if somethings alive on x4.

regards
stancecoke
 
stancecoke said:
It is well known, that the Kunteng Controllers have bad resonances with the cheap china directdrives. That's a hardware issue, you can't fix it with software settings.

That sucks.. wish I had known before I spent so many hours messing with it to try to get it to go away :p

Think it'd be a pain to get this firmware running on the Voilamart controller, or has it already been done? It doesn't do any stutter and seems like a more high quality product (silicone wires, nicer looking PCB & manufactured recently). It's got a Generalplus GPM8F3132C 8-bit processor in it and judging by the fact I've never heard of it it sounds like it might be a pain to figure out.. Just want to adjust the pedal assist strength :/

I get the feeling my best option may just be to buy a VESC and link it to an ESP32 board and write the code myself for pedal assist and some others..
 
tenten8401 said:
and link it to an ESP32 board and write the code myself for pedal assist and some others..
There are already several "precontrollers", no need to develop a new one...
e.g. https://github.com/jenkie/Arduino-Pedelec-Controller

I don't know, if the VESC is suited for a big direct drive....

regards
stancecoke
 
stancecoke said:
tenten8401 said:
and link it to an ESP32 board and write the code myself for pedal assist and some others..
There are already several "precontrollers", no need to develop a new one...
e.g. https://github.com/jenkie/Arduino-Pedelec-Controller

I don't know, if the VESC is suited for a big direct drive....

regards
stancecoke

The cheaper ones ($70ish) go up to 13S (60v spikes) lipo 50amp continuous which should be perfect for the hub motor I've got.. unsure about the higher voltage stuff though... I'm sure there's a vesc for higher voltages but I haven't looked.

Thanks for the precontroller link, I may have to take a look into that
 
stancecoke said:
Have you checked the output of throttle singal wire, is it 0.8 ... 4.2 V?

Yes. No output voltage. Seems like PAS has given up also. I guess I have to buy two new ones. To rid the misery I might as well buy new S06S's and beef up my bike with 52V battery :D These (bmsbattery.com) controllers can run 52V without problem, yes?
 
Does someone know where I can get the original KT Bluetooth software, or something better if it exists?

At KT I am directed to a Chinese page that wants me to install a download client on my computer, you know I am not going to do something like that...

cheers
 
anotherkiwi said:
Does someone know where I can get the original KT Bluetooth software

https://www.file-upload.net/download-14303628/android-release20180623.rar.html

regards
stancecoke
 
Hello guys,

I'm new here. I compiled and flashed the firmware on a KT36/48SVPRD-HRD01 controller. I get no error at compiling (with proven setting: THR-PAS,KT36-48svpr,12s,26inch,Q128h + Diagnostics), the hex file is created just fine, I flashed it with the STVP. I get the message that the program memory was written and checked successfully.
However when I power it (36V battery) and try to run it with the throttle (I don't have PAS yet because the parts are not installed on the bike) nothing happens. I connected a HM-10 bluetooth module to the LCD pins. All that I am getting on the terminal app is this character� when I short the blue and red wires of the LCD.

The controller/motor combination was working fine with the factory firmware (I checked it even after I soldered programing pins)

Any ideas about what I should try to troubleshoot it?
 
Back
Top