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

A very interesting, great open topic also quite interesting for updating my “old” S06S.
I like this controller but I’m not using it so much du to some programming features.
- motor efficiency with the direct drive motor (not so good at low power)
- no e-brake function though the normal break contact.
- Time reaction with too long ramp-up (PID?)
- Regeneration (e-braking) with too long ramp up and only available at the throttle. (PID?)

It is a not reversible flashing.
So, do you think I can be face to magic smoke with my S06S boosted to (60V 55A) ~3KW* used with a standard direct drive motor?

*I describe shortly modification I made 4 years ago…
https://endless-sphere.com/forums/viewtopic.php?f=6&t=59225&p=928932#p928932
 
Snickers said:
So, do you think I can be face to magic smoke with my S06S boosted to (60V 55A) ~3KW* used with a standard direct drive motor?
Maybe you should try with a new one before testing with your custom version.
 
Updated master branch with the new angle value of FOC. It works and phase voltage is placed 90 degrees ahead of rotor position 0 degrees. The motor has max torque possible at startup. However, the FOC is now at 180 + 60 degrees; were I expected to be 180 degrees.

Would be great if you guys can try. I hope it works just equal as before. I tested with my ebike with Q85, on a short ride.
 
So that you guys know that very first code runs on LCD3:

casainho said:
Very first code to run on LCD3!! This code waits for a press on the DOWN BUTTON to enable/disable the LCD backlight.

Source code is here: https://github.com/OpenSource-EBike-firmware/Kunteng_LCD3_firmware

[youtube]tBtuenKlblk[/youtube]
 
casainho said:
Updated master branch with the new angle value of FOC. It works and phase voltage is placed 90 degrees ahead of rotor position 0 degrees. The motor has max torque possible at startup. However, the FOC is now at 180 + 60 degrees; were I expected to be 180 degrees.

Would be great if you guys can try. I hope it works just equal as before. I tested with my ebike with Q85, on a short ride.

Just tried this, things don't seem quite right.

Initially had rough startup, changed MOTOR_ROTOR_ERPS_START_INTERPOLATION_DEGREES from 20 to 0. This smoothed out startup but motor would frequently startup in reverse. Set this back to 20.

Changed MOTOR_ROTOR_OFFSET_ANGLE from 0 to 20, this again smoothed out startup and ran smoothly, but was noticeably down on torque compared to previous fw version and controller was very hot after a short test ride.

Wasn't sure what else to try at this point, so I'll go back to previous version for now, then out for a nice evening ride..... :D
 
geofft said:
casainho said:
Updated master branch with the new angle value of FOC. It works and phase voltage is placed 90 degrees ahead of rotor position 0 degrees. The motor has max torque possible at startup. However, the FOC is now at 180 + 60 degrees; were I expected to be 180 degrees.

Would be great if you guys can try. I hope it works just equal as before. I tested with my ebike with Q85, on a short ride.

Just tried this, things don't seem quite right.

Initially had rough startup, changed MOTOR_ROTOR_ERPS_START_INTERPOLATION_DEGREES from 20 to 0. This smoothed out startup but motor would frequently startup in reverse. Set this back to 20.

Changed MOTOR_ROTOR_OFFSET_ANGLE from 0 to 20, this again smoothed out startup and ran smoothly, but was noticeably down on torque compared to previous fw version and controller was very hot after a short test ride.

Wasn't sure what else to try at this point, so I'll go back to previous version for now, then out for a nice evening ride..... :D
Thank you for testing.

There isn't much magic for me now. I will later write a sequence of voltages you should measure on hall sensors signals, to make sure they are correctly wired.
Then, after confirmation hall sensors signals, it's time to wire the motor phases correctly: green wire (middle wire on the controller board) from the controller connected to green wire of the motor. Then try to wire yellow to yellow wires and then blue with blue, or exchange the blue to yellow and yellow to blue.
 
today i received a 6 fet controller from risunmotor

it seems like this is a bit different one? i cant find the current sensor, guess i can trash it?
 

Attachments

  • photo_2018-05-05_18-08-50.jpg
    photo_2018-05-05_18-08-50.jpg
    109.3 KB · Views: 2,300
  • photo_2018-05-05_18-09-04.jpg
    photo_2018-05-05_18-09-04.jpg
    146 KB · Views: 2,300
  • photo_2018-05-05_18-09-07.jpg
    photo_2018-05-05_18-09-07.jpg
    152.6 KB · Views: 2,300
geofft said:
Just tried this, things don't seem quite right.

Initially had rough startup, changed MOTOR_ROTOR_ERPS_START_INTERPOLATION_DEGREES from 20 to 0. This smoothed out startup but motor would frequently startup in reverse. Set this back to 20.

Changed MOTOR_ROTOR_OFFSET_ANGLE from 0 to 20, this again smoothed out startup and ran smoothly, but was noticeably down on torque compared to previous fw version and controller was very hot after a short test ride.
Please try the following process. I wrote it to install firmware instructions and if they are ok to you, I will put online:

Hall sensor connections

With the motor phase wires disconnected (it is recommended to insulate with tape the phase wires) and the hall sensor wires connected to the motor controller, use a multimeter to measure the voltage of each hall sensor wires.

Rotate the wheel slowly by hand in the backward direction and the motor will rotate (if you are using a geared motor, it is the only direction which the motor will rotate).

For the hall sensors to be correctly connected, you must make sure the voltages sequence is the following (and repeats over and over) - if not, you will need to exchange the wires up to get the right sequence:

Position | Blue wire: hall sensor C | Green wire: hall sensor B | Yellow wire: hall sensor A
2 | 0 volts | 5 volts | 0 volts
6 | 5 volts | 5 volts | 0 volts
4 | 5 volts | 0 volts | 0 volts
5 | 5 volts | 0 volts | 5 volts
1 | 0 volts | 0 volts | 5 volts
3 | 0 volts | 5 volts | 5 volts

Phase wires connections

Yellow wire: motor phase A
Green wire: motor phase B
Blue wire: motor phase C

After having hall sensors with the right sequence and with the motor controller turned off, connect the motor controller green wire phase B (middle wire on controller board, being the yellow and blue on the extreme to run the sides) to the motor green wire. Now connect the other wires with the same colors and finally try to run the motor starting with a low throttle value and with a protected lab power supply or battery pack with a BMS. If the motor don't work, makes noise, ask to much current, etc, exchange the yellow and blue wires between them, keeping the green wire - try again to run the motor.
If the previous ways was not ok for running the motor, you can try other motor phases combinations.
 
I'm happy to give this a try, but I'm not convinced that I will find a better hall/phase combination though, as generally (other than the last fw download), the motor has always run quietly and smoothly.

One thing I have noticed with my installation however is that the controller is running noticeably hotter than with the stock fw. To put some numbers to it, with new fw today after a 5km ride the controller had reached 75C, too hot to hold. I immediately replaced it with the stock controller and repeated the ride, this reached only a warm 43C, so some cause for concern here.

Anyway, as I say, I'm happy to give your process a try, will let you know the results.
 
geofft said:
I'm happy to give this a try, but I'm not convinced that I will find a better hall/phase combination though, as generally (other than the last fw download), the motor has always run quietly and smoothly.

One thing I have noticed with my installation however is that the controller is running noticeably hotter than with the stock fw. To put some numbers to it, with new fw today after a 5km ride the controller had reached 75C, too hot to hold. I immediately replaced it with the stock controller and repeated the ride, this reached only a warm 43C, so some cause for concern here.
If the motor get's hot but still runs, I would say that phases can be ok and maybe hall sensors sequence are not correct, can be something like 60 degrees advanced. I hope that with passing on this process will make it running well for you.
 
dr_lulz said:
today i received a 6 fet controller from risunmotor
it seems like this is a bit different one? i cant find the current sensor, guess i can trash it?
Yes, if it doesn't has the phase current sensor that it is the square wave version where our firmware doesn't run.
 
Geofft, here is the code with a scale factor on config.h (see config-example.h) for the value sent to LCD:

https://github.com/OpenSource-EBike-firmware/BMSBattery_S_controllers_firmware/commit/7a51bdf5623a2b1b1973d07ab8e76952826aafca

On this branch (already with latest changes to FOC angle): https://github.com/OpenSource-EBike-firmware/BMSBattery_S_controllers_firmware/tree/scale_current_value_to_lcd
 
If the motor get's hot but still runs, I would say that phases can be ok and maybe hall sensors sequence are not correct, can be something like 60 degrees advanced. I hope that with passing on this process will make it running well for you.
Geofft, here is the code with a scale factor on config.h (see config-example.h) for the value sent to LCD:

Ok, will play with these various things over the next couple of days or so. Thanks for doing all this work.
 
So I have 2x 72v controllers running stock but they are doing something weird I am running a 18s rclipo pack and the LVC should be perfect
The controller was running fine for 2 weeks but now it keeps thinking the battery is empty, even though its fully charged and I have a xiaoxing bluetooth bms showing a fine voltage.

I've tried c12 and p5 to no real avail

Should I jump over to this firmware? should I expect any issues with 18fet? both my boards are fitted with the big phase current senor
 
just wondering whats the max current the 0.001 ohm shunt +OP Amp can measure before we hit 5v?
phase current measurement is limited by acs712 +-30A right? (at least for 6 fet version)
so if i want to go for 70A with the 6fet then this wont work even if fets have zero resistance?

btw i have opened my LCD6 72V:
 

Attachments

  • photo_2018-05-06_16-26-11.jpg
    photo_2018-05-06_16-26-11.jpg
    193.9 KB · Views: 2,220
dr_lulz said:
just wondering whats the max current the 0.001 ohm shunt +OP Amp can measure before we hit 5v?
phase current measurement is limited by acs712 +-30A right? (at least for 6 fet version)
so if i want to go for 70A with the 6fet then this wont work even if fets have zero resistance?

btw i have opened my LCD6 72V:

Theres no problem to add a shunt and paralel resistor to phase sensor but I dont think 70A is possible.

Theres no MOSFET which can do much more then 100A. That means you are limited to 100A phase current, so you cant benefit from 70A battery because it will have extremely slow power build up.

What youre looking for is a 12Fet.
 
dr_lulz said:
btw i have opened my LCD6 72V:
Thanks for sharing. The microcontroller is the STM8S105C6T6. Seems there are 2 LCD driver ICs with label “CP1621” and they probably are HT1621.

LCD5 and LCD3, they both use HT1622: https://opensourceebikefirmware.bitbucket.io/development/Motor_controllers--BMSBattery_S_series--LCD_control_panel.html

Here is the board of LCD3 for which I am trying to develop firmware: https://opensourceebikefirmware.bitbucket.io/kunteng_lcd3
 
casainho said:
For the hall sensors to be correctly connected, you must make sure the voltages sequence is the following (and repeats over and over) - if not, you will need to exchange the wires up to get the right sequence:

Position | Blue wire: hall sensor C | Green wire: hall sensor B | Yellow wire: hall sensor A
2 | 0 volts | 5 volts | 0 voltsa
6 | 5 volts | 5 volts | 0 volts
4 | 5 volts | 0 volts | 0 volts
5 | 5 volts | 0 volts | 5 volts
1 | 0 volts | 0 volts | 5 volts
3 | 0 volts | 5 volts | 5 volts
Geofft, I would like to confirm that I also put TSDZ2 motor running using the same hall sensor: 2, 6, 4, 5, 1, 3. I just use the original TSDZ2 hall sensor connector, I didn't changed the wires. Also the BMSBattery controllers seem to use the wires colors connection.

[youtube]O9shbfQ9hHk[/youtube]

There is although one thing: exchanging 2 phases should invert motor rotation direction, I think this works for 6 steps but not for sinevawe/FOC as when motor rotates on the other direction, I think phase current B will have some angle change and FOC angle reading will need to be on another angle.

As soon you confirm that you can get it working, I will use the same code for TSDZ2 motor...
 
Today I tried again my controller on a real ride. P5 set to 0 and the battery indicator was displaying emtpy, even though the battery was full. So same behavior as with my power supply at home.

Again, when the voltage drops under 30v, it starts blinking. But otherwise it says always empty if P5=0, or always full if P5=5 for instance.

Do you guys think it is a hardware problem or software? Is the battery blinking action controlled by the controller or the lcd firmware?

I don't know what else to try, the PE8 port seem to be getting like 3V, so I think it is fine. I think the software just went crazy. Perhaps it needs a full discharge cycle?
 
Geofft, I would like to confirm that I also put TSDZ2 motor running using the same hall sensor: 2, 6, 4, 5, 1, 3. I just use the original TSDZ2 hall sensor connector, I didn't changed the wires. Also the BMSBattery controllers seem to use the wires colors connection.

I'm hoping to get a chance to do this tomorrow or Tues.
Maybe it will become clear when I do this, but reading your instructions now, I don't think I fully understand the 'Position' number in the first column. I'm presuming these relate to 60 deg. steps in the motor rotation, so, if I start from 0 deg,

Position 1 = 0 (360)deg
Position 2 = 60 deg
Position 3 = 120 deg
Position 4 = 180 deg
Position 5 = 240 deg
Position 6 = 300 deg

.....or have I got that completely wrong? Maybe you could explain 'position' a little more... :?
 
geofft said:
Geofft, I would like to confirm that I also put TSDZ2 motor running using the same hall sensor: 2, 6, 4, 5, 1, 3. I just use the original TSDZ2 hall sensor connector, I didn't changed the wires. Also the BMSBattery controllers seem to use the wires colors connection.

I'm hoping to get a chance to do this tomorrow or Tues.
Maybe it will become clear when I do this, but reading your instructions now, I don't think I fully understand the 'Position' number in the first column. I'm presuming these relate to 60 deg. steps in the motor rotation, so, if I start from 0 deg,

Position 1 = 0 (360)deg
Position 2 = 60 deg
Position 3 = 120 deg
Position 4 = 180 deg
Position 5 = 240 deg
Position 6 = 300 deg

.....or have I got that completely wrong? Maybe you could explain 'position' a little more... :?
Hmmm, you don't need to worry about that. But it is binary coding of the signal, like 5 is 101, 3 is 010, etc. Where 1 is 5 volts and 0 0 volts.
 
lqbweb said:
Today I tried again my controller on a real ride. P5 set to 0 and the battery indicator was displaying emtpy, even though the battery was full. So same behavior as with my power supply at home.

Again, when the voltage drops under 30v, it starts blinking. But otherwise it says always empty if P5=0, or always full if P5=5 for instance.

Do you guys think it is a hardware problem or software? Is the battery blinking action controlled by the controller or the lcd firmware?

I don't know what else to try, the PE8 port seem to be getting like 3V, so I think it is fine. I think the software just went crazy. Perhaps it needs a full discharge cycle?

I think its caused by the dc-dc converter. I have it too, but havent tried battery indicator yet.
I am looking at voltage only.
 
Hmmm, you don't need to worry about that. But it is binary coding of the signal, like 5 is 101, 3 is 010, etc. Where 1 is 5 volts and 0 0 volts.

Ah...ok, now I understand.
 
honya96 said:
lqbweb said:
Today I tried again my controller on a real ride. P5 set to 0 and the battery indicator was displaying emtpy, even though the battery was full. So same behavior as with my power supply at home.

Again, when the voltage drops under 30v, it starts blinking. But otherwise it says always empty if P5=0, or always full if P5=5 for instance.

Do you guys think it is a hardware problem or software? Is the battery blinking action controlled by the controller or the lcd firmware?

I don't know what else to try, the PE8 port seem to be getting like 3V, so I think it is fine. I think the software just went crazy. Perhaps it needs a full discharge cycle?

I think its caused by the dc-dc converter. I have it too, but havent tried battery indicator yet.
I am looking at voltage only.

Why do you think that? which dc dc regulator have you put? Have you tried at least to turn it on?
Thanks!
 
lqbweb said:
Why do you think that? which dc dc regulator have you put? Have you tried at least to turn it on?
Thanks!

I have the one which geofft suggested to you. It works, runs ok, LVC is ok. But I dont remember if it shows battery with stock FW. I just dont look at it.

And now I am running this FW and battery indicator works
 
Back
Top