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

szkuba said:
Just been finushing a projekt on 12 FET controller and lost the link between controller and LCD possibly during reconnecting the LCD plug... . The LCD only turns up and show voltage reading, no speed reading, no battery bar, no asist level change. I tried no LCD version and all is working fine except i cannot change the assit level...
So the issue was quite interesting. I had "torque from x4" version the LCD model was LCD4 but i also tested with LCD3, the situation was following : i did not liked the voltage reading on LCD. It was fluctuating even when the motor was still. So changed P05 perimeter to "0" which means "real time voltage monitoring. After turning on the system again the communication with LCD was lost.
The one week later i got some time to troubleshoot it again. I changed the P05 to some value and boom the communication was restored again.
This was replicated on LCD 3 as well, excatly the same behaviour.

So this may prevent someone else from frustation : DO NOT SETUP P05 to "0"!
 
Hi there!
I'm struggling for a week now to have the android App working

-I can see data in debug mode with a USB serial adapter connected on the controller.
-I can see data with the HC-05 on my USB serial adapter sending data at 9600 bauds
-BUT I can NOT see the data thru HC-05 while connected on the controller

Do I need to have some kind of level adapter for the RX TX while connected on the controller?

Please help and I will write a detailed tutorial to share it
 
There is no level adapter just straigth connection. Personally i have programmed 3 controllers and all worked well on Bluetooth connection made according wiki on Github page. Hope you swith on the controller and HC-05 at the same time?
 
Thanks szkuba
No I did not start the HC-5 and the controller at the same time, is it mandatory? Why? :?:
Because my HC-5 works on a separate power supply for now.
 
The controller may sync at startup with UART. It may be the case that not done simultaneosly controller looses the communication. But you can try and find if IT helps. Of course share the results please.
 
I wanted to ask someone who might understand this software better than me. I finally got this installed and working, along with a t9 torque sensor using the torque on x4 branch. I calibrated everything I could but I'm running into the issue that with about 1/8th of a turn of the crank the bike takes off at full power. What setting can I adjust to make the power ramp a bit smoother and less aggressive. I was also wondering if there is a way to make sure the torque sensor is working.
 
szkuba said:
The controller may sync at startup with UART. It may be the case that not done simultaneosly controller looses the communication. But you can try and find if IT helps. Of course share the results please.

I have now the HC-5 receiving the diagnostic data in a terminal app !
BUT the BluOsec app crashes after establishing connection !

any idea?

with main branch and x4 branch

(the HC-5 starting with the controller did not changed anything)
 
Admiralrofl said:
I wanted to ask someone who might understand this software better than me. I finally got this installed and working, along with a t9 torque sensor using the torque on x4 branch. I calibrated everything I could but I'm running into the issue that with about 1/8th of a turn of the crank the bike takes off at full power. What setting can I adjust to make the power ramp a bit smoother and less aggressive. I was also wondering if there is a way to make sure the torque sensor is working.

I remember when I first started using the 'torque X4' branch I had similar issues and had to reduce the 'TQ calib' setting (in the configurator) dramatically to get the assist level within normal range. I think I ended with the setting somewhere around 50-70.

Also it looks like the T9 tqsr outputs 1.5 - 3.0 volts, so you need to set the min/max values (you'll find these in ACAcontrollerState.c) to 300/600.

If these pointers don't help probably best to post up a screenshot of your configurator settings.
 
geofft said:
I remember when I first started using the 'torque X4' branch I had similar issues and had to reduce the 'TQ calib' setting (in the configurator) dramatically to get the assist level within normal range. I think I ended with the setting somewhere around 50-70.
this is because in the code dividing by 100 is missing. It says in comments right shift ">>15" but in fact only ">>8" is performed . Kind of simplification but makes main branch and X4 branch difficult to fine tune with the same perimeters.
 
roscop13 said:
....

I have now the HC-5 receiving the diagnostic data in a terminal app !
BUT the BluOsec app crashes after establishing connection !

any idea?

with main branch and x4 branch

(the HC-5 starting with the controller did not changed anything)
i can only share that mine BlueOSEC crashes when my smartphone in NOT in battery saving mode.. Quite strange but it works like that for me.
 
szkuba said:
roscop13 said:
....

I have now the HC-5 receiving the diagnostic data in a terminal app !
BUT the BluOsec app crashes after establishing connection !

any idea?

with main branch and x4 branch

(the HC-5 starting with the controller did not changed anything)
i can only share that mine BlueOSEC crashes when my smartphone in NOT in battery saving mode.. Quite strange but it works like that for me.


Thx this is a valuable clue! it might be related to the battery saver layer that most of phone manufacturer put on top of vanilla Android. Will try to diasble any kind of defauft batery saver and share the result here.
 
geofft said:
Admiralrofl said:
I wanted to ask someone who might understand this software better than me. I finally got this installed and working, along with a t9 torque sensor using the torque on x4 branch. I calibrated everything I could but I'm running into the issue that with about 1/8th of a turn of the crank the bike takes off at full power. What setting can I adjust to make the power ramp a bit smoother and less aggressive. I was also wondering if there is a way to make sure the torque sensor is working.

I remember when I first started using the 'torque X4' branch I had similar issues and had to reduce the 'TQ calib' setting (in the configurator) dramatically to get the assist level within normal range. I think I ended with the setting somewhere around 50-70.

Also it looks like the T9 tqsr outputs 1.5 - 3.0 volts, so you need to set the min/max values (you'll find these in ACAcontrollerState.c) to 300/600.

If these pointers don't help probably best to post up a screenshot of your configurator settings.


I did do the min max values in aca, and I see the TQ to 70 and still have this behavior. How many PAS magnets do j set it to? I've seen conflicting numbers of 18 or 36. I'll put up some screenshots tonight when I get home. I'm not sure I put the min/max values in the right spot though now that I think about it

Edit: Heres my configuration details, i confirmed i set the x4 min to 307 and max to 615
 

Attachments

  • test4.PNG
    test4.PNG
    78 KB · Views: 1,218
Admiralrofl said:
I did do the min max values in aca, and I see the TQ to 70 and still have this behavior. How many PAS magnets do j set it to? I've seen conflicting numbers of 18 or 36. I'll put up some screenshots tonight when I get home. I'm not sure I put the min/max values in the right spot though now that I think about it

Edit: Heres my configuration details, i confirmed i set the x4 min to 307 and max to 615

Hmm...nothing seems to be wildly amiss with your config. Does reducing 'TQ Calib' even further have any effect?
Is your tqsr output (when connected to the controller, pedals idle) sitting at 1.5v? Does it rise as expected when pedal pressure is applied?
Other than these suggestions I'm out of ideas I'm afraid..... :?
 
geofft said:
Admiralrofl said:
I did do the min max values in aca, and I see the TQ to 70 and still have this behavior. How many PAS magnets do j set it to? I've seen conflicting numbers of 18 or 36. I'll put up some screenshots tonight when I get home. I'm not sure I put the min/max values in the right spot though now that I think about it

Edit: Heres my configuration details, i confirmed i set the x4 min to 307 and max to 615

Hmm...nothing seems to be wildly amiss with your config. Does reducing 'TQ config' even further have any effect?
Is your tqsr output (when connected to the controller, pedals idle) sitting at 1.5v? Does it rise as expected when pedal pressure is applied?
Other than these suggestions I'm out of ideas I'm afraid..... :?

That's a good point about measuring the torque sensor output. I'll probe it tomorrow night and make sure it's actually putting out a correct.voltage value.
 
roscop13 said:
szkuba said:
roscop13 said:
....

I have now the HC-5 receiving the diagnostic data in a terminal app !
BUT the BluOsec app crashes after establishing connection !

any idea?

with main branch and x4 branch

(the HC-5 starting with the controller did not changed anything)
i can only share that mine BlueOSEC crashes when my smartphone in NOT in battery saving mode.. Quite strange but it works like that for me.


Thx this is a valuable clue! it might be related to the battery saver layer that most of phone manufacturer put on top of vanilla Android. Will try to diasble any kind of defauft batery saver and share the result here.

I have changed the android's BluoSec battery settings to remove all battery saving optimization, but the app is still crashing as soon as the connection is established. Same on 2 different phones.
Please please if you have experienced the same and have a solution share it.
 
That's a good point about measuring the torque sensor output. I'll probe it tomorrow night and make sure it's actually putting out a correct.voltage value.

..hopefully this doesn't become a case of another controller with an 'alternative' X4 circuit arrangement. Much discussed in the past and still unresolved I believe.... :shock:
 
geofft said:
That's a good point about measuring the torque sensor output. I'll probe it tomorrow night and make sure it's actually putting out a correct.voltage value.

..hopefully this doesn't become a case of another controller with an 'alternative' X4 circuit arrangement. Much discussed in the past and still unresolved I believe.... :shock:

So I took a multimeter to it and annoying it looks like my t9 torque sensor just kinda sucks. Its voltage range from no pressure to hardest pedaling force is 2.6v to 3.7v. it's definitely supposed to be 1.5v to 3v but what can you do. This totally explains the instant jump as it's basically it was hiring the max setting of 3v the second I started pedaling. I ended up adjusting my xmin and x4max accordingly to account for this range and now i can feel the torque sensor working. It definitely needs more tuning but it's progress so thanks for the help.


I'm trying to fine tune the TQ calibration but I noticed you said that you had to reduce yours but I read on the German wiki that it recommended 32*pas cycles per revolution (so 36 for me) as a starting point. I'm confused as that puts it back up to like 1152. Is this old info or something? https://www.pedelecforum.de/wiki/doku.php?id=elektrotechnik:eek:pen_source_firmware_java_tool
 
Admiralrofl said:
I'm trying to fine tune the TQ calibration but I noticed you said that you had to reduce yours but I read on the German wiki that it recommended 32*pas cycles per revolution (so 36 for me) as a starting point. I'm confused as that puts it back up to like 1152. Is this old info or something? https://www.pedelecforum.de/wiki/doku.php?id=elektrotechnik:eek:pen_source_firmware_java_tool

I wouldn't take too much notice of this info, I guess it would make sense if you were using the Master branch but, as already mentioned by Szkuba, the 'Torque from X4' branch handles the 'TQ calib' numbers very differently. I would just play around with 'TQ calib' until you get the level of assist you want, taking the 'Assist level' 1 to 5 settings into account.

That's a real pisser with your torquesensor, giving wrong o/p voltage makes you wonder how reliable it's likely to be. The first one I was sent had the o/p voltage stuck on 3v but the seller did eventually replace it - is there no hope of some help from the seller with yours..?
 
geofft said:
Admiralrofl said:
I'm trying to fine tune the TQ calibration but I noticed you said that you had to reduce yours but I read on the German wiki that it recommended 32*pas cycles per revolution (so 36 for me) as a starting point. I'm confused as that puts it back up to like 1152. Is this old info or something? https://www.pedelecforum.de/wiki/doku.php?id=elektrotechnik:eek:pen_source_firmware_java_tool

I wouldn't take too much notice of this info, I guess it would make sense if you were using the Master branch but, as already mentioned by Szkuba, the 'Torque from X4' branch handles the 'TQ calib' numbers very differently. I would just play around with 'TQ calib' until you get the level of assist you want, taking the 'Assist level' 1 to 5 settings into account.

That's a real pisser with your torquesensor, giving wrong o/p voltage makes you wonder how reliable it's likely to be. The first one I was sent had the o/p voltage stuck on 3v but the seller did eventually replace it - is there no hope of some help from the seller with yours..?


I bought it a while ago off AliExpress so no not really. That's the risk you take, I should have tested it when I got it but life got busy
 
can you try to measure X4 pin with TQ sensor disconnected? It should read 0V with the controller powered on.
 
here are two simple videos i made when i was trouble shooting the TQ readings:
[youtube]https://youtube.com/shorts/wb5_cHmJVKA?feature=share[/youtube]

[youtube]https://youtube.com/shorts/0y0M_e-lRMI[/youtube]

i was having instable readings because of 12v power line noise coused by controller phase wires EMC noise (most probably). Later this weekend i will post another video showing the details
 
szkuba said:
can you try to measure X4 pin with TQ sensor disconnected? It should read 0V with the controller powered on.

...yep, well worth checking this, I was also beginning to wonder if X4 was pulling the tqsr output high..
 
Hi all

I am not coding expert but noticed strange piece of code in Master brach comparing to X4 branch in ACAcommons.c . So when building up the array for "ui16_torque" the master branch seems to build the array of zero's? as the "map" function should read torque value at throttle port but it reads"ui8_throttle_min_range" instead which is defined ones forever so it will not change during the ride. I do attach screnshot of comparison of those two codes side by side.
Master code
Code:
ui16_torque[ui8_torque_index] = (uint8_t) map(ui8_throttle_min_range, ui8_throttle_min_range, ui8_throttle_max_range, 0, SETPOINT_MAX_VALUE); //map throttle to limits

X4 code
Code:
ui16_torque[ui8_torque_index] = (uint16_t) map(ui16_temp, ui16_X4_min_range, ui16_X4_max_range, 0, SETPOINT_MAX_VALUE); //map throttle to limits

Any thougths? or i am completely wrong?
 

Attachments

  • 2022-06-19 19_48_14-D__Install_BMS Open firmware_BMSBattery_S_controllers_firmware-TQ_plus Pow...png
    2022-06-19 19_48_14-D__Install_BMS Open firmware_BMSBattery_S_controllers_firmware-TQ_plus Pow...png
    26 KB · Views: 1,032
Has anyone else run into this problem I'm having with the torque on x4 fork>
I have all the 3 options for speed limit set to 100 but with my torque sensor, it stops assisting at 25 MPH. It just cuts the power to keep me there. Is there a hidden speed limit setting thats not present the in java tool that affects the torque sensor assist?
 
Admiralrofl said:
Has anyone else run into this problem I'm having with the torque on x4 fork>
I have all the 3 options for speed limit set to 100 but with my torque sensor, it stops assisting at 25 MPH. It just cuts the power to keep me there. Is there a hidden speed limit setting thats not present the in java tool that affects the torque sensor assist?

Are you inputting the brake lever 'morse' code to activate offroad mode? You need to do this to remove the speed limit.
Try searching for 'morse' on this thread if you need more info on how to do this.
I always struggle to hit the sequence correctly with the default timings, for me increasing 'morse tolerance' from 40 to 80 makes this much easier. You'll find this setting around line 21 in main.h.

Doing this certainly removes the 15mph limit for me, my setup doesn't reach 25mph so I can't comment on that :(
 
Back
Top