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

sylvain_wm said:
Hi,

I can flash it.
The LCD display works but :
- the speed remains at zero while I pedal.
- the battery indicator remains empty while the voltage display by the LCD is 81V.
I checked the speed signal, the torque and PAS signal...
The hall sensors work well...
Here is the screenshot of my OSEC configurator.
config.png

And motor doesn't spin ? try to untick External Speed sensor
 
atkforever said:
And motor doesn't spin ? try to untick External Speed sensor

No, the motor doesn't spin, and no noise... nothing happens...
Here are 2 pictures of my controller.
20210217_130544.jpg
resistors.jpg
On the second photo, the two resistors heat up a lot !!! I measure 22V at their terminals ... that's huge!!!
 
Did you try to adjust the "Motor spec angle" parameter? start from 0 and increase by 5.

An other thing, you say battery your battery is at 81V, 235 as overvoltage value seems a bit low to me, try 240 for instance.
 
atkforever said:
Did you try to adjust the "Motor spec angle" parameter? start from 0 and increase by 5.

An other thing, you say battery your battery is at 81V, 235 as overvoltage value seems a bit low to me, try 240 for instance.

I tried 241 for overvoltage value.
I unticked External Speed sensor...
I tried different angles...
Nothing.

I wonder why my LCD display doesn't display the battery capacity and the speed...?
 
sylvain_wm said:
Make sure, that the brake is not active, otherwise the controller sticks in startup:
https://github.com/stancecoke/BMSBattery_S_controllers_firmware/blob/18fdd5ce9479425b2fba97a2997f7b2d5f4d27f5/main.c#L100

Flash in Diagnostics mode and log the sent data with an USB-UART-Converter or a HC-05 bluetooth module.
Show us the log.

https://github.com/stancecoke/BMSBattery_S_controllers_firmware/wiki/07---The-Diagnostics-Mode

regards
stancecoke
 
stancecoke said:
Make sure, that the brake is not active, otherwise the controller sticks in startup:
How can I know if the brake is not active?

stancecoke said:
Flash in Diagnostics mode and log the sent data with an USB-UART-Converter or a HC-05 bluetooth module.
Show us the log.

What data do you want me to send?

In Diagnotics mode I notice the ui8_BatteryVoltage = 156 while I measure 80,5V... I expected more than 235...
 
sylvain_wm said:
How can I know if the brake is not active?

If the controller is sending data in diagnostics mode, everything is OK with the brake.

sylvain_wm said:
What data do you want me to send?
by default this parameters are sent:
https://github.com/stancecoke/BMSBattery_S_controllers_firmware/blob/18fdd5ce9479425b2fba97a2997f7b2d5f4d27f5/main.c#L193

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

The ui16_control_state gives the first indication, of what is happening.
You can check the meaning of the control state with the little tool, or "by hand"
https://github.com/stancecoke/BMSBattery_S_controllers_firmware/wiki/08-Control-State-and-Troubleshooting

The probably critical bits for over- and undervoltage are not implemented in the tool. So you have to analyze them by hand
2048 undervoltage
4096 overvoltage

sylvain_wm said:
In Diagnotics mode I notice the ui8_BatteryVoltage = 156 while I measure 80,5V... I expected more than 235...
obviously the calibration factor for the voltage is different for your high voltage controller.

regards
stancecoke


68747470733a2f2f7777772e706564656c6563666f72756d2e64652f77696b692f6c69622f6578652f66657463682e7068703f63616368653d26773d34393226683d36373126746f6b3d356535653732266d656469613d656c656b74726f746563686e696b3a6f7365635f73746174655f7472616e736c61746f722e706e67
 
I used the default parameters and received this :
Screenshot_BlueTerm.jpg

Weird, the transmission is bad? I didn't have this problem with my other KT 48.

ui16_control_state = 28
ui16_setpoint = 0 and sometimes 5
ui16_motor_speed_erps = 0
ui16_BatteryCurrent = 313 ?????
ui16_sum_torque = 0
ui16_momentary_throttle = 73 ?????

I don't really understand these values.
 
There's very much noise on the UART line obviously. :shock:

The values are OK so far.
What kind of torque sensor are you using? You have to apply torque and turn the pedal at the same time to make the motor start.
Does the last value increase, if you apply torque on the crank?
You should print out the value of ui16_time_ticks_between_pas_interrupt_smoothed for checking the PAS interrupt. The value has to decrease, the faster you are turning the pedals.
The PAS interrupt seems to be the problem...

For debugging, it would be easier to test with a thumb throttle and not in torquesensor mode.
The values for throttle min and throttle max are not correct, obviously.

Concerning the not working display: have you checked the last XOR of the checksum? See the FAQs in the wiki how to check.

regards
stancecoke
 
I tried changing ui16_current_cal_b -= 1; using values between -10 and 10. Negative values made the wheel rotate itself and positive values did nothing to remove the resistance. I did accidentally change ui16_current_cal_b >>= 4; to >>=8 and as soon as the controller was switched on, the wheel spun up to ridiculously high speed, even faster than my old controller, without any throttle input which brings me on to the issues I have been having with the speed limits. It doesn't seem to matter what I set them to, some lower values give me slightly higher speed and setting them all to maximum makes the motor even slower. Gear ratio is totally random, As I increase it from 1 in steps of 5, some values give me higher speeds and others lower. For example, gear ratio 88 runs quite fast and on 89 it's much slower. It still doesn't spin as fast as the old squarewave controller I had no matter what settings I use for wheel circumference, gear ratio, etc. These are my current settings. I don't have any torque sensor or pedal assist connected to the bike. The hub motor is geared and is on a 20 inch wheel. Is there a way to just bypass or remove all the speed limit code as it seems to have some sort of bug in it?

Untitled.png
 
sdobbie said:
Negative values made the wheel rotate itself and positive values did nothing to remove the resistance.
This is exactly the expected behaviour. Set the offset to a value that lets the wheel rotate slightly when the wheel is in the air and the throttle is closed. Then there can't be a resistance any more, as the motor will always produce a little positive torque.

sdobbie said:
The hub motor is geared and is on a 20 inch wheel
?! a geared motor with regen?! There are only very few motors with this strange setup.
I recomment to read the wiki carefully, everything is explained there.

regards
stancecoke
 
Yes, the clutch in the motor has been welded.

No, everything isn't explained in the wiki. You mention schematics, where can I find them? Temperature sensors are mentioned. Where do I connect the sensor? x4 throttle doesn't even have a setting for it's upper and lower limit like the normal throttle does. Your suggestion to set all the speed limits to 100 does not work and you have done nothing to explain the strange behavior of the gear ratio setting. I don't want the wheel to rotate slightly by itself as that is wasting power. If I pedal faster with no throttle or regen input, the controller consumes more power. It is far worse efficiency wise than my old controller.
 
sdobbie said:
No, everything isn't explained in the wiki. You mention schematics, where can I find them? Temperature sensors are mentioned.

To be honest, you're getting on my nerves :roll: ...
Please use the search function, try to understand what's happening in the code.
For the use of the BluOSEC app, ask @Xnyle, he has developed it, I'm not using it.
Nobody asked you to use our open source firmware.

regards
stancecoke

Edit:
sdobbie said:
I don't want the wheel to rotate slightly by itself as that is wasting power. If I pedal faster with no throttle or regen input, the controller consumes more power. It is far worse efficiency wise than my old controller.
Please show us logs of the power consumption of both controllers in various ride situations. The slightly spinning wheel will only draw very few current, maybe 400 mA. To have a measurable impact on the system efficiency, you would have to ride without electric assistance most of the time.
 
Hi,
stancecoke said:
You should print out the value of ui16_time_ticks_between_pas_interrupt_smoothed for checking the PAS interrupt. The value has to decrease, the faster you are turning the pedals.
The PAS interrupt seems to be the problem...
It's OK, the value decreases while I pedal faster.
stancecoke said:
For debugging, it would be easier to test with a thumb throttle and not in torquesensor mode.
The values for throttle min and throttle max are not correct, obviously.
There is a problem : I connected a thumb Throttle as you suggested. I checked the signal on the 18 pin of the processeur, everything is OK : 0.8V min and 2.9V max for the THROTTLE signal. The problem is that I don't see any change with the BlueTerm app: i16_momentary_throttle remains zero.
 
stancecoke said:
Concerning the not working display: have you checked the last XOR of the checksum? See the FAQs in the wiki how to check.

The display works but doesn't display the right information : battery indicator changes if I change the undervoltage value, power changes in an erratic way, the speed remains zero ...
I don't know if it's the XOR.
I can try your suggestion but I don't really know what to do.

Do I have to change the display.c program?

Thank you.
 
To be honest, you're getting on my nerves

You know what gets on my nerves? People who release buggy software then make smartarse remarks when people try to get help with said bugs. Going to buy a vesc instead as it seems to be fit for purpose and made by someone a bit more mature.
 
sylvain_wm said:
The problem is that I don't see any change with the BlueTerm app: i16_momentary_throttle remains zero.
Please send "ui8_adc_read_throttle()" in the printf line directly, does that show reaction to the throttle input?
can you post your recent config.h as a textfile, please!

sylvain_wm said:
0.8V min and 2.9V
so you can calculate throttle min and max approximatly:
0.8*255/5 = 41
2.9*255/5 = 147

sylvain_wm said:
The display works but doesn't display the right information
OK, then there is no problem with the XOR, perhaps with the noise on the UART line. Which display do you use? KT LCD3?

regards
stancecoke
 
stancecoke said:
can you post your recent config.h as a textfile, please!
Here you are :
View attachment config.txt

I'm starting to wonder if the problem isn't the controller itself ... maybe?
The resistors that heat up a lot (200°C!!) that's weird... the ADC that doesn't work...
I'll try to check the PCB.
Thanks
 
Your voltage calibration is still set to 90? I guess u should use a value around 150 or even more for this kind of controller.
 
atkforever said:
Your voltage calibration is still set to 90? I guess u should use a value around 150 or even more for this kind of controller.
I tried but t doesn't change anything.
Thanks
 
casainho said:
honya96 said:
s-lcd3 v3,0 72v ( works down to 50v with all my 36,48v controllers)
now I am back with another kt-lcd3 v3.0 0.6F 24-48v and another controller but it has the same board... maybe I will try the 12fet now. its the bmsbattery 40A same as yours.

edit: no brake icon, as i mentioned before. empty battery.
Rotate de motor by hand and see if it is hard to push, when comparing to the controller poweered off.

See that no one ever tested the 72v controller version.

I would say it has different power resistors to measure the battery voltage and so the firmware triggers undervoltage -- try to increase number of cells and there should be a value where it does not trigger.

Even better, measure with a multimeter your battery voltage and also the voltage at STM8 pin, then I can update the firmware for 72v version. Try also to read the resistors value.

I've found this message from Casainho, if it can help...
 
stancecoke said:
so you can calculate throttle min and max approximatly:
0.8*255/5 = 41
2.9*255/5 = 147

I don't know why, but the throttle is reading now and I have 37 min and 180 max....
 
Back
Top