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

dr_lulz said:
Motor runs but takes a lot of current. No load current is about 10A while it was 1A before. Startup is very rough and fast, low speed is not possible. I changed phase cables a few times but did not find a better combination. So this must be a software issue ...

any idea what i can do?
So startup is rought and fast , low speed no possible. And asking all that current. I would say something about that angle is to much advanced.

Please first do the procedure as described on install page, about verifying phases wirings and hall sensors wirings.

Then, please measure the output signal of the phase current sensor while motor is stopped. The sensor has 3 pins: GND, VCC 5V and phase current signal. Please measure it and say here what is the value.

Finally, I just can think of the adjustment of angle offset on config.h, that default value is 0. Try to increase/decrease in steps of 10.
 
casainho said:
dr_lulz said:
Motor runs but takes a lot of current. No load current is about 10A while it was 1A before. Startup is very rough and fast, low speed is not possible. I changed phase cables a few times but did not find a better combination. So this must be a software issue ...

any idea what i can do?
So startup is rought and fast , low speed no possible. And asking all that current. I would say something about that angle is to much advanced.

Please first do the procedure as described on install page, about verifying phases wirings and hall sensors wirings.

Then, please measure the output signal of the phase current sensor while motor is stopped. The sensor has 3 pins: GND, VCC 5V and phase current signal. Please measure it and say here what is the value.

Finally, I just can think of the adjustment of angle offset on config.h, that default value is 0. Try to increase/decrease in steps of 10.

Thanks for fast response :D

i have done the hall sensor verification procedure. As i expected they are correct.

output from ACS712 is 2.5V while motor not running

by "running the motor at low speed is not possible" i mean even at lowest throttle it runs already pretty fast. With my other controller i can reach maybe 1 rotation per minute, while min speed on your firmware seems to be ~1 rotation per 3 sec. Is this intended? In general the motor "runs" at any speed. The only point is it takes way too much current. Also there is very rough braking when i release the throttle, probably have to disable regen?
 
dr_lulz said:
casainho said:
dr_lulz said:
Motor runs but takes a lot of current. No load current is about 10A while it was 1A before. Startup is very rough and fast, low speed is not possible. I changed phase cables a few times but did not find a better combination. So this must be a software issue ...

any idea what i can do?
So startup is rought and fast , low speed no possible. And asking all that current. I would say something about that angle is to much advanced.

Please first do the procedure as described on install page, about verifying phases wirings and hall sensors wirings.

Then, please measure the output signal of the phase current sensor while motor is stopped. The sensor has 3 pins: GND, VCC 5V and phase current signal. Please measure it and say here what is the value.

Finally, I just can think of the adjustment of angle offset on config.h, that default value is 0. Try to increase/decrease in steps of 10.

Thanks for fast response :D

i have done the hall sensor verification procedure. As i expected they are correct.

output from ACS712 is 2.5V while motor not running

by "running the motor at low speed is not possible" i mean even at lowest throttle it runs already pretty fast. With my other controller i can reach maybe 1 rotation per minute, while min speed on your firmware seems to be ~1 rotation per 3 sec. Is this intended? In general the motor "runs" at any speed. The only point is it takes way too much current. Also there is very rough braking when i release the throttle, probably have to disable regen?
Ok. So all hall sensors sequence is ok. I hope you also tested phase sequences.

2.5V is ok.

That is not intended. Also should not ask so much current but instead the same. Please test with the angle offset different values and keep an eye to the current used, torque when motor startup with load and startup correctly.

Regen may work incorrectly while the rest don't work well. But even, it can not be working well and need developement. Let's see what you get.
 
I changed the foc angle offset from 0 to 50, but did not find a good spot between :(

i have disabled FOC and motor ran very good. Do all the features also work with FOC disabled?
I am especially wondering about current limit. So i could just run block mode for now
 
dr_lulz said:
I changed the foc angle offset from 0 to 50, but did not find a good spot between :(

i have disabled FOC and motor ran very good. Do all the features also work with FOC disabled?
I am especially wondering about current limit. So i could just run block mode for now
Ok.

And 50 equals to 70 degrees which is a bit already. Please try on the inverse direction, like -10, -20, etc. And did you notice any change while testing that values??

Yes, current control works with FOC disabled. I think everything works with FOC disabled. But it should be very inefficient, asking to much current for the same torque...

So, for your tests, the thing is FOC not working well.... some other ideas:

Find this piece of code on motor.c:
if (UI8_ADC_MOTOR_CURRENT > ui8_adc_motor_current_offset)
{
// motor mode
if (ui8_adc_id_current > ADC_PHASE_B_CURRENT_ZERO_AMPS_FOC_MAX) { ui8_angle_correction++; }
else if (ui8_adc_id_current < ADC_PHASE_B_CURRENT_ZERO_AMPS_FOC_MIN) { ui8_angle_correction--; }
}
else
{
// regen mode
if (ui8_adc_id_current > ADC_PHASE_B_CURRENT_ZERO_AMPS_FOC_MAX) { ui8_angle_correction--; }
else if (ui8_adc_id_current < ADC_PHASE_B_CURRENT_ZERO_AMPS_FOC_MIN) { ui8_angle_correction++; }
}
Using the firmware you did download and your needed changes on config.h, exchange the ++ for -- and vice-versa on that piece of code.

Even more deep is the next test, delete all that code and put there only this 2 lines:
if (ui8_adc_id_current > ADC_PHASE_B_CURRENT_ZERO_AMPS_FOC_MAX) { ui8_angle_correction++; }
else if (ui8_adc_id_current < ADC_PHASE_B_CURRENT_ZERO_AMPS_FOC_MIN) { ui8_angle_correction--; }
Also even if not working, try to exchange the ++ for -- and vice-versa.

I must say this is all strange because recently we tested with different motors and all did work. Myself, I tested with S06S controller and Q85 motor.
 
Hello there!

Im sorry if this is not the place to post this but i just have to ask you guys if you might help me with this "issue" im having.
I have one of these controllers that is listed on this website as seen below.
https://opensourceebikefirmware.bitbuck ... oller.html

I also have a topic open on this forum trying to get help to remove the "smooth start" that my controller has but that didn't really help me unfortunately.
viewtopic.php?f=2&t=93784&p=1372983#p1372983

I can see that the info mentions that the controller in the pictures of doesn't have a phase current sensor so what im wondering is if this is a phase current sensor and what it's objective is?
https://imgur.com/a/0KBqs5f

Im very happy with the way the whole bike is working with all functions etc but the smooth ramp up in power is just not working for me at all, it doesn't matter if the bike get's harder to use as long as i can get rid of this function because im almost only going to use it in the woods/trails.

I have a KT LCD3 display and i haven't been able to find a setting that removes the smooth starting but i might be missing something.
Here is a picture of the whole bike aswell if you want to see it =)
https://imgur.com/mwBsqoR

Again im sorry of this is not the place to post this.
 
Sinterpuck said:
Im very happy with the way the whole bike is working with all functions etc but the smooth ramp up in power is just not working for me at all, it doesn't matter if the bike get's harder to use as long as i can get rid of this function because im almost only going to use it in the woods/trails.
I don't know what is a "smooth startup". I think other users here are using some big motors and modded KT controllers with that motors to get high currents. Maybe they can tell you theirs experience at startup.
 
casainho said:
I don't know what is a "smooth startup". I think other users here are using some big motors and modded KT controllers with that motors to get high currents. Maybe they can tell you theirs experience at startup.

The controller gives very little power from the start and ramps it up slowly (smootly) so it's a comfortable ride, if i release the throttle and gives it full throttle while still riding i get a 0.5-1sec delay before it's back to full power.
I want to be able to get full power instantly instead of having to wait for the power to come on, it just doesn't work for hard trail riding.
 
Sinterpuck said:
Hello there!

Im sorry if this is not the place to post this but i just have to ask you guys if you might help me with this "issue" im having.
I have one of these controllers that is listed on this website as seen below.
https://opensourceebikefirmware.bitbuck ... oller.html

I also have a topic open on this forum trying to get help to remove the "smooth start" that my controller has but that didn't really help me unfortunately.
viewtopic.php?f=2&t=93784&p=1372983#p1372983

I can see that the info mentions that the controller in the pictures of doesn't have a phase current sensor so what im wondering is if this is a phase current sensor and what it's objective is?
https://imgur.com/a/0KBqs5f

Im very happy with the way the whole bike is working with all functions etc but the smooth ramp up in power is just not working for me at all, it doesn't matter if the bike get's harder to use as long as i can get rid of this function because im almost only going to use it in the woods/trails.

I have a KT LCD3 display and i haven't been able to find a setting that removes the smooth starting but i might be missing something.
Here is a picture of the whole bike aswell if you want to see it =)
https://imgur.com/mwBsqoR

Again im sorry of this is not the place to post this.

Thats normal with stock FW.. nothing you can do with it.

Last time I tried this custom FW it wasnt faster yet, maybe its better now.
 
So, on TSDZ2 we can read original firmware from flash memory of STM8. Then we disassembled and started to look around and I wanted to send the motor current value to LCD (done!), just like happens on KT. The firmware should be similar and it is interesting to see how the guys did the main loop, the ADC readings, the big array for SVM(??) of 3888 bytes while we are using just 256 bytes array, etc.

So, if anyone is interested to look at our currents knowledge of the original firmware: https://endless-sphere.com/forums/viewtopic.php?p=1381811#p1381811

Here is the TSDZ2 original firmware with an improvement to send motor current to LCD (still original LCD does not read motor current). This is mostly for developers/advanced users that may want to use LCD3 instead of the original LCD or some Arduino, etc.

TSDZ2_original_firmware-Flexible.zip

After disassembling we got good insights of some parts of the firmware do work. We could understand how data is sent to LCD and we could add our own function with the needed changes to send the current to the LCD.

Here is current disassembled file with our knowledge: https://docs.google.com/spreadsheets/d/1Zuv3ELZCQJf2eksGHNJ1gKZ7Hxlrk2OHaV0mXiXQ5Hs/edit?usp=sharing



And our added code at strong red color:

[/quote]
 
About the BMSBattery torque sensor breaking

Until now I got no answer from BMSBattery (despise my insistence) about the breaking of 2 of my bottom bracket torque sensors. The other 3 installed on my 3 ebikes with KT controllers and running our firmware, are doing well.

So, I am being developing firmware for LCD3 as also some little improvements for TSDZ2 original firmware. I am also using my ebike with TSDZ2.
As I wanted to test the battery max current TSDZ2 use at different assist level, yesterday I went with my ebike to a climb and did the max force I could and did repeat like 15 times (in fact, the climb is at the entrance of my garage). Later, while doing a normal ride, the right pedal fall off and the thread between the pedal and the crank (this crank comes with TSDZ2 kit) was damaged so that it no longer works -- and a lot of users are using this TSDZ2 cranks but no one is talking about this issue. This issue did happen also on my right side and I think that is because I always start pedaling with my right leg and so I do more force on that side.

To resume: I think it is no coincidence, I think that or I am doing to much force on the pedals with my weight (100kg) and legs or I am pushing the threads too tightly.
For the BMSBattery torque sensor, I started to tighten the threads lightly and use glue that secures the screws.
 
There are many reports about broken bottom bracket shafts, broken bearings, gearwheels and defective freewheels in the german forum. It is not for nothing that spare parts for the TSDZ2 are available at every corner :shock:

regards
stancecoke
 
stancecoke said:
There are many reports about broken bottom bracket shafts, broken bearings, gearwheels and defective freewheels in the german forum. It is not for nothing that spare parts for the TSDZ2 are available at every corner :shock:
Thanks. I wasn't aware of that.
Still, I will try to use less force when tighten screws and go ahead using this systems and learn with the experience. I think time will tell.
 
Looking at the assembly code of TSDZ2 motor, I found:

The next code will read the hall sensor state:
Read 4 times the same value in sequence to assume it, otherwise keep reading up to get the same read value 4 times.

I think maybe is a good idea to read 2 or more times the same value on hall sensors because of the noise on the signals... something that we could implement on our firmware.
In fact, on TSDZ2 firmware seems that always read 4 times each digital signal.
 
I developed the firmware the LCD3 up to a point that is most usable (at least for TSDZ2 motor since it does not have many options). Anyone interested to help develop for KT controllers and our firmware??

Things I would like to see:
- filtering motor power and just show in 10W step (I just did that for TSDZ2!!)
- show regen current, by show the number of regen current + brake symbol

casainho said:
After 2 days, I got it working and I finally can swap the TSDZ2 original LCD to KT LCD3. Many thanks to hurzhurz for improving the original firmware.

KT LCD3 showing the following data from TSDZ2 motor:
- battery voltage
- motor power in watts
- bicycle wheel speed
- motor assist level
- brakes state
- battery state of charge

[youtube]75Na5RDLZAk[/youtube]

The motor power is clearly going to zero when it should not, this is clearly an issue that I need to improve. For the calcs, I am using the same filtered and stable voltage we can can on LCD. I guess the only source of issues is the current value sent by the controller... maybe I am doing something wrong somewhere...

After, I want to start calc the motor used Wh for the current trip.
 
Need your help! bought a controller kt36/48svpr inside pcb KTE-SVP5. I can not adjust the brake. at the maximum level of regeneration very strongly vibrates and makes noises when I press the brake. in the settings of LCD6 in the "C2" set 2. firmware standard.
https://youtu.be/Y1o3MngT2L4
 
casainho said:
2.5V is ok.

i have double checked the phase current sensor today and found that the current path is completely bridged, all 4 pins are connected.
Maybe thats the reason my controller does not really work. I am just wondering why it worked with original firmware :?:
 
Basia said:
Need your help! bought a controller kt36/48svpr inside pcb KTE-SVP5. I can not adjust the brake. at the maximum level of regeneration very strongly vibrates and makes noises when I press the brake. in the settings of LCD6 in the "C2" set 2. firmware standard.
https://youtu.be/Y1o3MngT2L4

Bad phase or hall wire combo? is it gutless and the wires to the motor get hot when the wheel is loaded?
 
chilltrout said:
Basia said:
Need your help! bought a controller kt36/48svpr inside pcb KTE-SVP5. I can not adjust the brake. at the maximum level of regeneration very strongly vibrates and makes noises when I press the brake. in the settings of LCD6 in the "C2" set 2. firmware standard.
https://youtu.be/Y1o3MngT2L4

Bad phase or hall wire combo? is it gutless and the wires to the motor get hot when the wheel is loaded?

Accelerates and goes very well. problems with the brake only. the wheel does not heat up when driving.
 
Basia said:
Need your help! bought a controller kt36/48svpr inside pcb KTE-SVP5. I can not adjust the brake. at the maximum level of regeneration very strongly vibrates and makes noises when I press the brake. in the settings of LCD6 in the "C2" set 2. firmware standard.
https://youtu.be/Y1o3MngT2L4

Thats normal with stock fw.
 
On the modified firmware the brake works better?
On the custom firmware brake proportional? on my controller (kt36/48svpr) 3 wires for brakes.
 
On KT LCD3 firmware, I am able to get from TZDZ2 motor controller the pedal torque sensor value and pedal cadence. Using a digital hook scale, I was able to calculate the force in Nm for each pedal torque sensor unit measured. Than, using cadence, I was able to calculate the torque in Watts. The torque value watts is comparable to the motor electric power is watts: I ride comfortable from 150 up to 200W while my motor can pull from the battery around 500 up to 900W.

So seems I am in a better shape than average cyclicist but far from Armstrong :)
So, I am in a more than average cyclist but far from Armstrong :)

Maybe someday we can implement this for KT controllers, for the ones that uses the torque sensor.

casainho said:
On the LCD, at middle right is shown the motor watts and at middle bottom is shown the watts I put on the pedals:

[youtube]ZrrRYpc-wkY[/youtube]
 
Basia said:
On the custom firmware brake proportional? on my controller (kt36/48svpr) 3 wires for brakes.
In my fork, there is linear regen implemented, but you have so solder in an extra wire for that function.


casainho said:
Than, using cadence, I was able to calculate the torque in Watts.
To be correct: this is not the torque, but the power.
Physical unit for torque: Nm
Physical unit for force: N
Physical unit for power: W

sorry for counting beans...

regards
stancecoke
 
stancecoke said:
casainho said:
Than, using cadence, I was able to calculate the torque in Watts.
To be correct: this is not the torque, but the power.
Physical unit for torque: Nm
Physical unit for force: N
Physical unit for power: W

sorry for counting beans...
Ok, let me resume and also make it clear to myself.

I used this site and others to calculate the Torque (were force I applied, I measured using the hook scale): https://www.engineeringtoolbox.com/torque-wrench-luggage-scale-d_1909.html
scale_wrench_torque.png


Then I calculated power:
Once you are familiar with the torque at different revolutions per minute (rpm’s) the power is easy to calculate. The formula for power calculation is:

P = τ x n x 2 x pi

τ = Torque
n = roations/ second
pi = 3,14
So yes, I was wrong to say I calculated Torque in Watts. I calculated the Torque in Nm and after with cadence I calculated Power in Watts.

I have a question for you, since you already though on all this before when analyzing the torque sensors:
1. I assume the value I have from the TSDZ2 motor controller is the average value on a full 1 rotation of the pedals. Do you think the measured value is equal to the value rider outputs or the rider outputs an even higher value do to forces that are not at 90 degrees with the cranks??

Because for my measured value of 150W comfortable riding, it seams the measurements and calculations are inline for the reference values we see online for an average cyclists... or it is just a coincidence...
 
Back
Top