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

stancecoke said:
kgff said:
Is it because no one has written firmware for this specific controller, or because of technical reasons?

You would have to implement 6 step (block) commutation. Casainho had done it in one of his very early commits.

regards
stancecoke
I couldn't find info about what actually needs to be done to achieve it
Does it require firmwaring/adding components the controller/modding the motor? my motor has no hall sensor
btw the controller isn't sine wave, it's:
Brushless DC Torque Simulation Square Wave Controller

Thank you :thumb: :bigthumb:
 
kgff said:
Does it require firmwaring/adding components the controller/modding the motor?

It needs just software, no additional hardware. You could copy the code from casainhos commit. But you will need some basic understanding of the firmware to get it work.

regards
stancecoke
 
stancecoke said:
kgff said:
Does it require firmwaring/adding components the controller/modding the motor?

It needs just software, no additional hardware. You could copy the code from casainhos commit. But you will need some basic understanding of the firmware to get it work.

regards
stancecoke
How different it is to do the firmware with the "casainhos commit"? I just wonder if there is available instructions for my own sensorless setup.. is it just those github files/text that you linked that should be installed instead of other ones?

Should I follow this (your?) website for instructions? https://opensourceebikefirmware.bitbucket.io/windows_instructions/index4.html
WHAT IS NOT WORKING:
6-Step commutation at start from standstill
I noticed that my motor get stuck/choked when I pull the throttle "too fast" from standstill, (I can avoid it easily though),but does this issue indicate anything about the motor's/controller compatibility with firmware flashing?

and about this:
"Write Option Bytes" once. Attention! If this function is selected, the original Kunteng firmware will be irretrievably deleted! Please make sure to find out the correct phase and Hall sensor assignment on the complete system with the original firmware before deleting
-Does it mean I that I need to disassemble the motor? because I know nothing about it, it also has no hall sensor cable
-It's not possible to backup the original firmware?
 
kgff said:
-Does it mean I that I need to disassemble the motor?

No, the sensorless controller has a little additional PCB that generates the hall-signal from the Back-EMF of the floating phase.
You would have to start the motor in open loop until the Hall-signals are proper, than you can switch to closed loop 6-step commutation.
It's not witchcraft, but you need a deep understanding of the code to make it work. I suggest to read some papers about sensorless BLDC six-step control.

regards
stancecoke
 
stancecoke said:
kgff said:
-Does it mean I that I need to disassemble the motor?

No, the sensorless controller has a little additional PCB that generates the hall-signal from the Back-EMF of the floating phase.
You would have to start the motor in open loop until the Hall-signals are proper, than you can switch to closed loop 6-step commutation.
It's not witchcraft, but you need a deep understanding of the code to make it work. I suggest to read some papers about sensorless BLDC six-step control.

regards
stancecoke
Thanks a lot, If it takes some code learning,waiting for the st-linkv2 shipment(can take 3 months with my local postal service) and a lot of room for mistake.. maybe a shunt mod is preferable after all, do you know if it can be adjusted with a trimmer potentiometer on my specific controller ?
Is there anywhere info about the controller's (KT36/48ZWSRMH) shunt resistance, or an electric diagram of it?
I emailed pswpower, but I doubt that they will answer.. and I only have a voltmeter and oscilloscope, no watt meter & icharger
 
kgff said:
stancecoke said:
kgff said:
-Does it mean I that I need to disassemble the motor?

No, the sensorless controller has a little additional PCB that generates the hall-signal from the Back-EMF of the floating phase.
You would have to start the motor in open loop until the Hall-signals are proper, than you can switch to closed loop 6-step commutation.
It's not witchcraft, but you need a deep understanding of the code to make it work. I suggest to read some papers about sensorless BLDC six-step control.

regards
stancecoke
Thanks a lot, If it takes some code learning,waiting for the st-linkv2 shipment(can take 3 months with my local postal service) and a lot of room for mistake.. maybe a shunt mod is preferable after all, do you know if it can be adjusted with a trimmer potentiometer on my specific controller ?
Is there anywhere info about the controller's (KT36/48ZWSRMH) shunt resistance, or an electric diagram of it?
I emailed pswpower, but I doubt that they will answer.. and I only have a voltmeter and oscilloscope, no watt meter & icharger
Just buy a new compatible controller, they are cheap anyway and you should take advantage on that.
 
casainho said:
kgff said:
stancecoke said:
kgff said:
-Does it mean I that I need to disassemble the motor?

No, the sensorless controller has a little additional PCB that generates the hall-signal from the Back-EMF of the floating phase.
You would have to start the motor in open loop until the Hall-signals are proper, than you can switch to closed loop 6-step commutation.
It's not witchcraft, but you need a deep understanding of the code to make it work. I suggest to read some papers about sensorless BLDC six-step control.

regards
stancecoke
Thanks a lot, If it takes some code learning,waiting for the st-linkv2 shipment(can take 3 months with my local postal service) and a lot of room for mistake.. maybe a shunt mod is preferable after all, do you know if it can be adjusted with a trimmer potentiometer on my specific controller ?
Is there anywhere info about the controller's (KT36/48ZWSRMH) shunt resistance, or an electric diagram of it?
I emailed pswpower, but I doubt that they will answer.. and I only have a voltmeter and oscilloscope, no watt meter & icharger
Just buy a new compatible controller, they are cheap anyway and you should take advantage on that.
I' am limited to a relatively small one that also supports sensorless motor,it took me a lot of time to find the current one.. if you can recommend anything that is about 13x4x7cm that would be great :bigthumb:
 
kgff said:
I' am limited to a relatively small one that also supports sensorless motor,it took me a lot of time to find the current one.. if you can recommend anything that is about 13x4x7cm that would be great :bigthumb:

There are several small controllers for sensorless motors available:
https://www.groetech.de/index.php?main_page=product_info&cPath=44&products_id=908
https://www.groetech.de/index.php?main_page=product_info&cPath=27&products_id=1057

even with FOC:
https://www.groetech.de/index.php?main_page=product_info&cPath=27&products_id=1057

But all these small controllers are limited in power. How much power do you want to get out of the controller? Even the 20 amps of your 9FET is quite a lot.

You could modify the feedback resistor R17 of the opamp circuit to get more power, but you will kill your mosfets if you increase the current too much.

regards
stancecoke
 
stancecoke said:
kgff said:
I' am limited to a relatively small one that also supports sensorless motor,it took me a lot of time to find the current one.. if you can recommend anything that is about 13x4x7cm that would be great :bigthumb:

There are several small controllers for sensorless motors available:
https://www.groetech.de/index.php?main_page=product_info&cPath=44&products_id=908
https://www.groetech.de/index.php?main_page=product_info&cPath=27&products_id=1057

even with FOC:
https://www.groetech.de/index.php?main_page=product_info&cPath=27&products_id=1057

But all these small controllers are limited in power. How much power do you want to get out of the controller? Even the 20 amps of your 9FET is quite a lot.

You could modify the feedback resistor R17 of the opamp circuit to get more power, but you will kill your mosfets if you increase the current too much.

regards
stancecoke
Thanks a lot!I highly appreciate your support :bolt:
Do you know if that diagram is close enough to my controller?
 
I'm new to this, but trying to read a lot. I'm very interested in building a bike specifically to use this firmware. I'm looking for something between 350 and 500W on either 36 or 48V. Can someone point me to a good hub motor which is easily compatible with this firmware?

Also: is regenerative breaking really useful? And if so, I need to have direct drive, correct? Are direct drive 500W motors interesting or are they too low power?
 
speedfreak said:
Are direct drive 500W motors interesting or are they too low power?
What is your main riding profile? High speed in a flat area or high assistance in the mountains?

regards
stancecoke
 
speedfreak said:
Can someone point me to a good hub motor which is easily compatible with this firmware?
all common bldc hubmotors are compatible; the motor itself has nothing to do with firmware compatibility.

it is the controller that needs to be compatible, and for that you need to look at the info at the start of the thread and/or in posts within the thread.

Also: is regenerative breaking really useful?
see here
https://endless-sphere.com/forums/viewtopic.php?f=2&t=7891
https://endless-sphere.com/forums/viewtopic.php?f=3&t=90319
and in similar threads in this list (most of which is not relevant but some are, you can tell which by title), and other posts about regen over the years on the forum:
https://endless-sphere.com/forums/search.php?keywords=regen*&terms=all&author=&sc=1&sf=titleonly&sr=topics&sk=t&sd=d&st=0&ch=300&t=0&submit=Search
And if so, I need to have direct drive, correct?
yes. whether middrive or hubmotor ina wheel, there can be no freewheels between ground and motor.
Are direct drive 500W motors interesting or are they too low power?
that depends on what you want to do. since you have given us too little information to answer usefully, you can go to http://ebikes.ca/simulator, read the entire page so you know what everythign there is and how it works and how to use it, then experiment with different systems to see how everything interacts.

also see this page
https://www.ebikes.ca/learn/power-ratings.html

it's not the motor alone; it's the entire system, that determines what you can do with it. the simulator above is what you will need to use to see this directly.
 
amberwolf said:
the motor itself has nothing to do with firmware compatibility.

We had several reports that there are heavy vibrations with the Kuntengs in combination with some cheap chinese 1kW direct drives. I guess it's a matter of resonances due to bad L/C ratio.

regards
stancecoke
 
Thank you all for the valuable information!
I'm going for a 500-ish rear wheel drive hub motor (non-direct) since I'm more fan of the stealthy look and will maybe use a single speed chain drive (to make it all really minimalistic).

I'll be mostly riding on very flat terrain (Belgium) and it's my goal to still do some pedaling myself as exercise on my commute.

Will any hub motor marked as 500W on Amazon/Aliexpress do it or are there still serious quality differences between the likes of Bafang and a no-brand hub motor? I will go for a 48V setup with a KT controller of at least 15 Amps. The LCD3 is probably the best one to use with this firmware (i don't really care about color LCD i think).

Is this (budgety) setup OK or do you guys have suggestions for improvements?
 
Does anyone run LCD8H with this fw? If so, which fw should I used? I saw only Bafang LCD fw in Github.
 
Hi, I'm new in the forum.

Congratulations for all the people involved in developing this great FOS Firmware project !!! :bigthumb:
I've been reading and learning all that I could from these web sites:

https://opensourceebikefirmware.bitbucket.io/
https://github.com/hurzhurz/tsdz2/
https://www.eco-ebike.com/collections/tsdz2-open-source-firmware-osf-products

But still have some doubts so I've finally decided to write on this thread , asking for your advice:

- First of all, I've read it here but still don't quite get it:
What is the way to disable simplified FOC in the code, in order to load FOS firmware on a KT ZWS controller ?

- Second and last :
Is it possible ( using FOS firmware ) to set "max speed limit" as low as 6 km/h ( walking speed ) ?
( because now using stock firmware on my KT48ZWS controller and KT LCD3 display, it only lets me set it as low as 10km/h )

Your help will be much appreciated,
Regards and thanks in advande for any comments! :)
 
fratto said:
I've been reading and learning all that I could from these web sites:

Then you missed the main information page :)
https://github.com/stancecoke/BMSBattery_S_controllers_firmware/wiki

You can disable the simplified FOC by commenting out line 126 of the motor.c
Code:
//ui8_foc_enable_flag = 1;

All other questions are self explaining with the wiki, I think.

regards
stancecoke
 
Hi,

Does anyone else on the thread tried to use a KT-LCD1 display with this firmware? I flashed the firmware on a KT48ZWS controller, but the display shows nothing apart from the assist level. The battery indicator is showing as empty and all numbered fields shows zeroes.

The controller is responding to throttle commands (wheel turns), but the display is not showing any data.

I've selected KT-LCD3 as the display on the Java configuration tool.
 
simpletech said:
..tried to use a KT-LCD1 display ... I've selected KT-LCD3 as the display on the Java configuration tool.

I don't know the communication protocol of the KT-LCD1. I guess it "speaks" a different protocol, as it only knows the P-parameters. Can you log the bytes sent by the display with a USB-TLL converter? (Hex values, logged with hterm e.g.)

regards
stancecoke
 
I'm working my AWD setup. Both motors are using OSEC with S06S controllers and sharing a 36V/20A BMS battery. 7A front geared hub motor/ 12A rear DD motor. Can someone confirm that these parameters are ok to flash;

Front motor S06S
Battery current max = 70 (as for 7A when battery current cal. a value = 100)
Phase current max = 140 (as for 14A when battery current cal. a value = 100)
Battery current cal. a = 100

Rear motor S06S
Battery current max = 120 (as for 12A when battery current cal. a = 100)
Phase current max = 240 (as for 24A when battery current cal. a = 100)
Battery current cal. a = 100

From wiki:
Battery Current cal a: Factor a in the calibration function. 1A = a/10 * ADC value. Required for internal calculation of the current from the 10bit ADC value. For a 6FET and 12FET controller the value has to be something around 100, for the 18FET about 50.

Has anyone calculated the exact value here or is 100 close enough value to work with S06S?
 
stancecoke said:
Can you log the bytes sent by the display with a USB-TLL converter? (Hex values, logged with hterm e.g.)

Hi,

Here's the hterm log file with the bytes sent by the display (hex values). Used 9600 as baud rate.

EDIT: I was able to get some different patterns when changing assist levels on the display:

0C00E557299B0E - Assist lvl 0
0C01E557299A0E - Assist lvl 1
0C02E55729990E - Assist lvl 2
0C03E55729980E - Assist lvl 3
0C04E557299F0E - Assist lvl 4
0C05E557299E0E - Assist lvl 5

Apparently the 2nd byte sends the Assist level to the controller.
 

Attachments

  • output_2020-01-20_22-56-56.log
    2.1 KB · Views: 75
Valopallo said:
Has anyone calculated the exact value here or is 100 close enough value to work with S06S?
You have to verify the battery current with a ammeter. The calibration factor may vary slightly from controller to controller due to resistance-tolerances of the shunt and the feedback-resistor of the opamp.
I think the "100" is exact enough for your purpose.


simpletech said:
I was able to get some different patterns when changing assist levels on the display:
0C 00 E5 57 29 9B 0E - Assist lvl 0

So this protocol is different to the LCD3 protocol.

You would have to listen to the "answer" of the controller with the stock firmware and implement the protocol in the open source firmware.

It's much easier to buy an already supported display. :)

regards
stancecoke
 
Front motor S06S
Battery current max = 70 (as for 7A when battery current cal. a value = 100)
Phase current max = 140 (as for 14A when battery current cal. a value = 100)
Battery current cal. a = 100
Voltage calib = 50
Undervoltage limit = 164

Whenever I plug in the Hall sensors the 5V rail drops to 4.20V and motor doesn't respond to throttle. Tested from throttle also and it's the same 4.20V. The s06s is brand new. Motor has had a hall sensor burn before. Recently I changed all the HALL sensors. The sensor type I'm using is A3144E. Sensors work as they should, but they get only 4.20V when powered by the controller. I have tested them with external 5V power supply plugged and rotated the wheel to confirm switching from 0 to 5V properly. I've also tested the windings in case of shorts by grounding them to each other and rotating the wheel. Everything seems to be ok. No continuity to axle either. What could cause this?
 
Valopallo said:
What could cause this?

Hm, can you check the value of the big resistor next to the LM317? There are several reports about trouble with the voltage supply lately.

index.php


In the schematic the value is 82 Ohm.

regards
stancecoke
 
Back
Top