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

BluOSEC seems to act weird.
I changed my battery Voltage Min Value and it returns 0, not 116 what I intended. Also Battery Voltage Max changed on it's own to 0 because of this (from 153). I changed the battery voltage calibration to 70 (from 50) and added new values accordingly to min and max just to try it out but the same behaviour remains. Only Battery voltage calibration remains where I changed it(70) recently. Also DC static zero setting remains ON all the time(I haven't changed that at all). Do I have to flash again with javatool to be sure the values are correct? I guess it's not safe to drive like this, altough I cannot tell if the DC static zero has been like that all the time :shock:

EDIT: I went to take a test lap(even though it's not feasible to do so with DC static zero = ON) and I didn't notice anything funny even though battery voltage limits are both 0 and dc static zero is ON. There are also several other settings that do not react to whatever I try to do at BluOSEC. They are not greyed out but the switch slides to the left(OFF) but after a short while the slider moves back to right (ON). How can my bike still work normally? It seems the changes I try to make at bluOSEC has no effect and that's weird because I can still change some variables normally like the cadence and speedlimits etc... If I remember correctly I've had similar misbehavior from BluOSEC when some core settings have been wrong but this time I haven't set anything different than the battery voltage min value. It seems like the connection between controller and BluOSEC gets corrupted somehow and I believe I have to flash again to make it work. That would be a bummer because I just finished my casings and insulation work and I need to start all over from the start. Nothing new with my projects though
 
Hi, i'm having an issue with my controller powering down randomly while in use. I'm using the x4throttle branch with a KT36ZWSRTB-SJT02LB controller.

Does anyone know if it's advisable to power my DCDC (used to power my Sempu torque sensor 12v and my BT module 5v) from the blue cable of the LCD display?

I've used this cable since I use the screen to turn on my controller and also because the screen automatically turns off after a short while. This prevents my battery from being drained by the controller or the DCDC i added.

I'm wondering if me drawing current from this blue cable is causing the issue. My next test is to use a transistor to open the gate and take the positive from a more direct source to the battery +ve.

If anyone has any other good ideas to power things like DCDC or lights from the controller that would be great (so they switch on/off with the controller). I've seen some controllers have dedicated light outputs, but mine is missing this.

Thanks,
David.
 
Hi everyone and congratulations at casainho and stancecoke for the firmware development, you have shared an great job. :D
I tried to upload the fw on my s06s BL controller
I am using controller without display and I have also tried bluosec app but it crashes at every start (android 7) but this is not my main problem.
the main problem is when the motor stops the regen keeps always enable and if I start pedaling the controller regenerates without my input.(I tried also a directdrive hub)
The brake switch works properly.
the controller draws 120mA with the motor stopped. if I turn on the controller while the brake lever
is squeezed the current is around 0.05mA but this condition does not return if then I release the lever and sqeeze it again.
At the moment I am using 30v power supply, throttle , no display, no pas and disassembled bafang swxk motor (only stator and rotor to work on the table).
I also try analogic regeneration with another throttle to x4 pin input and work fine but the motor is everithing in regen status when is stopped (hard to rotate).
Where am I doing wrong?
These are my parameters;
 

Attachments

  • osec.JPG
    osec.JPG
    90.2 KB · Views: 2,810
  • hterm.JPG
    hterm.JPG
    53.8 KB · Views: 2,811
Does anyone know if it's advisable to power my DCDC (used to power my Sempu torque sensor 12v and my BT module 5v) from the blue cable of the LCD display?

You'll find the Sempu tqsr's are fairly power hungry devices. I originally tried powering mine by tapping the 15v internal controller supply, this kinda worked but was giving random shutdowns and mosfet failures, usually when applying heavy pressure to the pedals.

Eventually I realised this was overloading the controller supply, so I then powered the Sempu from the main battery feed and the problems stopped. So it's probably fair to say that the Sempu draws a lot of current and you need a robust supply.
 
Dani85 said:
but the motor is everithing in regen status when is stopped (hard to rotate)
First, welcome to the project :)! Please do not test the standstill resistance with the motor on the desk (and a Lab supply, that doesn't allow negative currents). The power control needs to "see" a significant delta current to control the current to zero.
You will recognize the effect, if you push your bike with a direct drive. You will feel a small resistance at the start, then the control loop stars working and the resistance disappears.

regards
stancecoke.
 
stancecoke said:
Dani85 said:
but the motor is everithing in regen status when is stopped (hard to rotate)
First, welcome to the project :)! Please do not test the standstill resistance with the motor on the desk (and a Lab supply, that doesn't allow negative currents). The power control needs to "see" a significant delta current to control the current to zero.
You will recognize the effect, if you push your bike with a direct drive. You will feel a small resistance at the start, then the control loop stars working and the resistance disappears.

regards
stancecoke.


Thanks to you stancecoke for the quick reply.
I tried to use the controller on the bike with 36v battery and it happens as you say. After a ride the resistance disappears.
Regard the current absorption of the controller, 120mA seems to me many when the motor is stopped.
R58 heats up a lot more than usual. It's normal?
 
Dani85 said:
120mA seems to me many when the motor is stopped.
We never switch off the PWM, therefore the controller heats up a little more with the motor in standstill.
You can try the experimental setting "PWM off @ coast" but you have to adjust a motor specific parameter (flt_s_motor_constant) to avoid current peaks with a direct drive.

regards
stancecoke
 
Slipy said:
R58 heats up a lot more than usual. It's normal?
if this resistor same as on KingQween scheme 3k i think you can to unsolder (i use without this resistor)


I don't think they are the same.
R58 in my s06 controller is the big resistor before the lm317..
 
stancecoke said:
Dani85 said:
120mA seems to me many when the motor is stopped.
We never switch off the PWM, therefore the controller heats up a little more with the motor in standstill.
You can try the experimental setting "PWM off @ coast" but you have to adjust a motor specific parameter (flt_s_motor_constant) to avoid current peaks with a direct drive.

regards
stancecoke

I hadn't tried pwm off because on the wiki it says "not implemented"..
Now I have try this option and the draw current has dropped to 0.06mA and there is no friction ..
The important thing for me was to understand that there was no current draws by short circuit or another things.
Pwm on that's fine for me. Thank's Stancecoke for your help. :thumb:
 
Hello! I hope this is not too off-topic. Earlier in this thread there was a mention of a similar KZQW22A controller, which I also have. The most annoying thing about that controller is that there is a hard power cutoff after 25km/h which makes the riding experience horrible. That is, there's no PID or anything like that to keep the speed at 25km/h, it just stops assisting altogether once you reach the speed. Thanks to the help from Aleksandr Boldin we managed to reverse-engineer the firmware and remove the speed limit (in my country there's no speed limit for 250W bikes anyway). The bicycle didn't get significantly faster (it can only reach around 30km/h without the software limit), but the riding experience is much better now. I've been using it for a few months without any issues. :p

I'm attaching the modified firmware which you can flash if you have the same controller with the same firmware. Original firmware is also attached.

Edit: This only applies to a subset of KZQW22A controllers, namely those that have a model number similar to KZQW22A-LKTS17066 found on some GZR bikes. There seem to be many users with “MIFA” variants, but these controllers have firmware readout protection enabled, and the flashed firmware is using a different protocol for the display, so the firmware is not interchangeable between the models (even though the hardware is the same). See this for more info: https://endless-sphere.com/forums/viewtopic.php?p=1569529#p1569529

Here are some helpful notes:

Programming connector:
Code:
black – GND
yellow – SWIM
blue – Reset
red – maybe VCC, you don't need it

To read data from the microcontroller (assuming you use stlink v2):
Code:
./stm8flash -c stlinkv2 -p stm8s105s4t6c -s flash  -r KZQW22A-flash.bin
./stm8flash -c stlinkv2 -p stm8s105s4t6c -s eeprom -r KZQW22A-eeprom.bin
./stm8flash -c stlinkv2 -p stm8s105s4t6c -s opt    -r KZQW22A-opt.bin

To write the firmware:
Code:
./stm8flash -c stlinkv2 -p stm8s105s4t6c -s flash -w KZQW22A-flash-hacked-double-speed-limit.bin

Good luck!
 

Attachments

  • KZQW22A-flash-hacked-double-speed-limit.zip
    11.9 KB · Views: 84
AlexDaniel said:
we managed to reverse-engineer the firmware and remove the speed limit

congratulations :)

So the speedlimit is really hardcoded and not an editable parameter in the EEPROM?!

regards
stancecoke
 
stancecoke said:
AlexDaniel said:
we managed to reverse-engineer the firmware and remove the speed limit

congratulations :)

So the speedlimit is really hardcoded and not an editable parameter in the EEPROM?!

regards
stancecoke

Yes, the speed limit itself has nothing to do with EEPROM. It simply checks some variable (which we think represents speed) against a hardcoded value, and if it's larger it reduces the PWM duty cycle to either zero or some very low value (I don't remember now). We did look at the processing of EEPROM data for a bit, but we didn't get much further than the discussion earlier in this thread (or somewhere on this forum). Our goal was just to remove the speed limit, so we didn't see the need to investigate more into EEPROM processing.
 
Slipy said:
motor spin all time at very low speed

Nice to see the motor spinning, this is a great sucess already! Congratulations!

It seems that the battery-current measuring is not stable fast enough at startup. We already have build in a pause in the autozero procedure in the adc_init(void) function, but it seems to be too short.
You can try to increase the number of loop runs in the delay-loop, or just use a higher offset (e.g. 5 instead of 1) in line 79 of the adc.c

Code:
ui16_current_cal_b -= 1;

regards
stancecoke
 
Yess THANK YOU, it's fully working, i have a last question, interpolation disable its bldc mode (trapezoidal) or sine?
And problem with controller was with one resistor on KingQween's scheme, on brake is two resistor 10k to 5v and 10k to gnd, and last is wrong, if i pull-up to gnd its automatically triggered brake
 
Has the BMSBattery bluetooth adapter been implemented yet?
https://bmsbattery.com/parts/920-17236-bluetooth-module-for-s06s-bl-or-s09p-bl-controller.html#/497-voltage-36v

They have versions for different voltages, so it looks like anything above 48V is out. Has anyone tried this for higher voltages?
 
transposon said:
Has the BMSBattery bluetooth adapter been implemented yet?
https://bmsbattery.com/parts/920-17236-bluetooth-module-for-s06s-bl-or-s09p-bl-controller.html#/497-voltage-36v

They have versions for different voltages, so it looks like anything above 48V is out. Has anyone tried this for higher voltages?
Differences only on dc-dc converter, if you want higer voltage, you can buy hc05 or hc06 Bluetooth module and
https://a.aliexpress.com/_Bf93RnzW
https://a.aliexpress.com/_dY7aYI8
Or what's similar and solder it together


But s06s controller can't operate with higer voltage because Lm317 inside
 
Slipy said:
transposon said:
Has the BMSBattery bluetooth adapter been implemented yet?
https://bmsbattery.com/parts/920-17236-bluetooth-module-for-s06s-bl-or-s09p-bl-controller.html#/497-voltage-36v

They have versions for different voltages, so it looks like anything above 48V is out. Has anyone tried this for higher voltages?
Differences only on dc-dc converter, if you want higer voltage, you can buy hc05 or hc06 Bluetooth module and
https://a.aliexpress.com/_Bf93RnzW
https://a.aliexpress.com/_dY7aYI8
Or what's similar and solder it together


But s06s controller can't operate with higer voltage because Lm317 inside

Thanks Slipy,

Do you think it's easier to go totally homebrew for this as you described, or to buy the adapter and modify it to handle high voltages?
 
Hello and good morning.

i have a little problem and i have no idea why it is so.
At the first to the facts:

- I have a rear hub motor with 1000W.
- Pas Throttle and BrakeSwitch
- KT 36/48 SVPRD-HRD01

With the standard Kunteng KT Stock Controller, i can ride my bike without any problems. Not with the full power because of the 10A rated controler but that is OK for me. The controller is only warm but not hot after a longer ride.

When i now switch to the custom controller with the open source firmware, everything is ok, too. It turns very smooth. All functions are great, but the controller gets very hot after a round about 5 km long ride, with 25 or 45 % (Assistant Level 1-3)
I have check the sequence hall sensors. They are OK.

Have one of you an idea, what i can change in my settings or what is wrong?

Best regards and thank you in advanced.
And stay healthy in this special time.
Sascha
 

Attachments

  • 2020-04-20 08_41_59-Foto - Google Fotos.jpg
    2020-04-20 08_41_59-Foto - Google Fotos.jpg
    145.9 KB · Views: 2,280
  • 2020-04-20 08_43_59-Foto - Google Fotos.jpg
    2020-04-20 08_43_59-Foto - Google Fotos.jpg
    149.4 KB · Views: 2,280
sascha121985 said:
When i now switch to the custom controller with the open source firmware, everything is ok, too. It turns very smooth. All functions are great, but the controller gets very hot after a round about 5 km long ride, with 25 or 45 % (Assistant Level 1-3)
I have check the sequence hall sensors. They are OK.

Have one of you an idea, what i can change in my settings or what is wrong?

It was noticed earlier in the development of the firmware that the OS fw produces more heat in the controller than the stock fw. Casainho did experiment with some changes in the fw (mosfet 'dead time' etc) but couldn't seem to make any improvement, so it was decided to just live with it.

I find it only causes any real problem when I run with the controller enclosed in a saddlebag. In the open air the controller hardly gets warm.
 
Thanks for your answer.
But it gets so hot, that is swith off automaticly. So it is not possible to use it.
I can try to reduce the current from 100 to 80?

Best regards
Sascha
 
sascha121985 said:
- I have a rear hub motor with 1000W.

Then why are you using a 500W controller? And are you using regenerative braking with that 1kW hub?
Just get a 1500W controller if your battery and BMS can handle it.
 
Do you think it's easier to go totally homebrew for this as you described, or to buy the adapter and modify it to handle high voltages?
I think easier to do a homemade version, because you and someone other don't know what inside in bmsbattery module, you don't know scheme and dont know what you must to modify, on homemade version you must only choose dc dc converter from your voltage to 5v and solder six wires +- input dcdc converter voltage, +- from converter to Bluetooth module and rx tx

P. S. I hope you understand what i wrote, because I'm ukrainian and write this without a translator :)
 
Back
Top