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

geofft said:
So, your wheel should be rotating at about 230RPM. The motor inside will rotate at 230 * 13.2 = 3036RPM; 3036/60 = 50.6 RPSeconds.
16 magnets / 2 = 8 poles; so in ERPS ---> 50.6 * 8 = 405 ERPs.

You will hit the MOTOR_OVER_SPEED_ERPS of 520 ERPs, at ~36km/h.

Ok, many thanks, that figure seems to make perfect sense.
By the way, just for we keep this alive in our minds, the Stancecoke branch increased the PWM frequency from the 16kHz to the 21kHz, which increases the MOTOR_OVER_SPEED_ERPS to 520 * (21/16) = 680 ---> your motor wheel will then run at max speed of 47km/h.
 
Had a little play with settings (bike on training roller) in the garage tonight, didn't have much time but can say that FOC_READ_ID_CURRENT_ANGLE_ADJUST has a lot to do with the way the motor performs. Should have more time later tomorrow, will give more details then.
 
Has anyone tried this firmware on this controller?
https://images-na.ssl-images-amazon.com/images/I/61CFDNVKqaL._SL1024_.jpg
https://www.amazon.com/Brushless-Controller-Regenerative-Braking%EF%BC%8C-Electric/dp/B06X9R46HT
 
al17 said:
Has anyone tried this firmware on this controller?
https://images-na.ssl-images-amazon.com/images/I/61CFDNVKqaL._SL1024_.jpg
https://www.amazon.com/Brushless-Controller-Regenerative-Braking%EF%BC%8C-Electric/dp/B06X9R46HT
I think no one ever tried but I think honya96 is interested in such powerful version of this controllers.
If anyone is willing to send one unit to me, I can try to put firmware working for it but only with a 500W motor.
 
al17 said:
Has anyone tried this firmware on this controller?
https://images-na.ssl-images-amazon.com/images/I/61CFDNVKqaL._SL1024_.jpg
https://www.amazon.com/Brushless-Controller-Regenerative-Braking%EF%BC%8C-Electric/dp/B06X9R46HT

I will try it soon. You can get it cheaper on ebay. 59$ shipped I think.

@Casainho
I dont know if its worth sending to Portugal or Deutschland, better if people interested will buy you the controller. I would if necesary to make it work.
 
geofft said:
'New' fw is very smooth, quiet and gentle with the motor. Maybe too much so for some tastes, as the stock fw has higher top speed (about 7.5%) and higher torque (I'd guess about 10%).


Although the 'best' FOC_READ_ID_CURRENT_ANGLE_ADJUST angle for my motor (by current measurement or 'scope test) seemed to be around 150 deg, I found that 'on the road' this was down on top speed and torque (compared to stock fw). I've since played around with this angle and discovered that 135 deg seems to work best, this gives speed and torque similar to stock. Maybe a little less torque, but not by much, and does this at a much lower wattage (if both wattmeters can be believed) 650watt for new fw against 850 for stock.

It will be interesting to see if this translates into greater range, on stock fw I usually achieve around 35km on a full charge, maybe now it will be a little more. Unfortunately uk current weather isn't great for long distance trials, but when it improves I'll let you know how it went... :wink:
 
Well, first test of the 18fet done. Everything works as with the 6fet. With 3 shunts I have set just 2A for testing and it pull well over 4A ( as expected) I am curious about the phase current sensor, 12fet has 50A, 18fet has 100A. So am I getting double the phase amperage set in firmware? I ordered 150 and 200A also for modding :twisted:

@Casainho
Please where, what values and in which range I can try safely to get usable throttle response? Or do you plan to redo the current control? I like the way it works with Stancecoke's fw but I cant find a rotor offset which starts well.
 
honya96 said:
Well, first test of the 18fet done. Everything works as with the 6fet. With 3 shunts I have set just 2A for testing and it pull well over 4A ( as expected) I am curious about the phase current sensor, 12fet has 50A, 18fet has 100A. So am I getting double the phase amperage set in firmware? I ordered 150 and 200A also for modding :twisted:
Good!! Can you please share some pictures of that controller with the programming header/cable, board?? So we can see it and I can backup it, since it is the first time!!

The LCD shows "motor"/battery current and not the phase current.
So, maybe that 18fet controller reads half of the current for the same value on the 6fet - maybe the shunt has half of the resistance.
Just double the max and regen current on config.h.

And for display,

Code:
  // B8: 4x controller current
  // Vbat = 30V:
  // - B8 = 255, LCD shows 1912 watts
  // - B8 = 250, LCD shows 1875 watts
  // - B8 = 100, LCD shows 750 watts
  // each unit of B8 = 0.25A
  i8_motor_current_filtered_10b = motor_get_current_filtered_10b ();
  i8_motor_current_filtered_10b -= 1; // try to avoid LCD display about 25W when motor is not running
  if (i8_motor_current_filtered_10b < 0) { i8_motor_current_filtered_10b = 0; } // limit to be only positive value, LCD don't accept regen current value
  ui8_tx_buffer [8] = (uint8_t) (i8_motor_current_filtered_10b);

Exchange this line ui8_tx_buffer [8] = (uint8_t) (i8_motor_current_filtered_10b); to:
Code:
ui8_tx_buffer [8] = ((uint8_t) (i8_motor_current_filtered_10b) << 1);

That right shift one position << 1 will multiply the value by 2, before is sent to LCD.

Maybe is the right time to start differentiate between controllers...

honya96 said:
Please where, what values and in which range I can try safely to get usable throttle response? Or do you plan to redo the current control? I like the way it works with Stancecoke's fw but I cant find a rotor offset which starts well.
EBIKE_THROTTLE_TYPE_THROTTLE_PAS_PWM_DUTY_CYCLE isn't enough for you? Throttle controlling directly the duty_cycle?

Yes, I will do that controller, the PI controller. I am being reading and learning more, before start. Let's see If I get it in 1 week.
 
Big capacitor and third shunt is not stock. Programing cable colours are soldered in reverse :?

I use the same programming connector on all my controllers.

I will test how the pwm controll behaves on road. Reaction time of this method is ok.

@Stancecoke - no luck to run the test motor with the high speed branch. Pin 23 is 1.585v, tested -310 to -324 cal b + 9-10 cal a at current set 350.

Maybe problem with 3 shunts?

Lcd wattmeter changes idle w when changing cal b. Its 0w at -324. 66w at -310.
 

Attachments

  • 20180131_204104-1024x576.jpg
    20180131_204104-1024x576.jpg
    107.8 KB · Views: 2,493
  • 20180131_204142-576x1024.jpg
    20180131_204142-576x1024.jpg
    67.7 KB · Views: 2,493
honya96 said:
I like the way it works with Stancecoke's fw but I cant find a rotor offset which starts well.

That's strange, as my fork uses the same algorithm. The only difference is the speed for switching to 60° interpolation. In my fork it is set to 5 erps, that may be to less for your motor, as it is set to 40 erps at casainhos code as default. You can edit line 121 in the motor.c and change the "5" to "40" and try again.

Code:
#if MOTOR_TYPE == MOTOR_TYPE_Q85
      if (ui16_motor_speed_erps > 1000)
      {
	ui8_motor_state = MOTOR_STATE_RUNNING_INTERPOLATION_360_DEGREES;
      }
      else if (ui16_motor_speed_erps > 5)
      {
	ui8_motor_state = MOTOR_STATE_RUNNING_INTERPOLATION_60_DEGREES;
      }
      else
      {
	ui8_motor_state = MOTOR_STATE_RUNNING_NO_INTERPOLATION_60_DEGREES;
}

honya96 said:
@Stancecoke - no luck to run the test motor with the high speed branch. Pin 23 is 1.585v, tested -310 to -324 cal b + 9-10 cal a at current set 350.
You can try a value about -328 for cal b. cal a will be something about 4. Try a value about 360 for maximum current (that should be something about 8 amps).

Good Luck! :)

regards
stancecoke
 
Thanks, I believe it will help. (I used 10 erps with main branch)

With those values still no response to throttle, as with the torque simulation branch on 6 fet. :|

With cal b -328 and cal a 4 I get 199w showing at idle. Tried up to -350 still nothing. Idle current is same as with main branch whatever I set, and it is easy to spin motor, unlike before with torque simulation branch.
 
honya96 said:
and it is easy to spin motor, unlike before with torque simulation branch.

OK, that's a hint to the undervoltage protection. The 18 FET will need a different calibration factor, for the 6 FET the factor is 3.7

Please try "5" as the value for undervoltage limit. If that the motor runs with this, we have to find the right calibration factor for the 18 FET later.

You can measure the voltage on pin 24 (AIN9) With this voltage we can calculate a rough value for the calibration factor:
Code:
calibration factor = (voltage on pin 24 *255 /5)/battery voltage

regards
stancecoke
 
honya96 said:
Its 4.082v
Is this the voltage on pin 24 or the calculated calibration factor?
4.082V on pin 24 seems to be quite high, it would be about 56V battery voltage with the calibration of the 6 FET. With this voltage we shouldn't get a problem with undervoltage protection...

What is your Battery voltage?

honya96 said:
where is that value?
The calibration factor is needed to calculate the value of undervoltage limit in the Java Tool, see the description

Which ride mode have you selected? Can you upload the content of your config.h?

regards
stancecoke
 
Voltage is about 56v or more so thats correct. I was thinking that its not caused by lvc.. I have it set at stock tool value. Ride mode throttle, most parameters stock, all as it worked with 6 fet.

Interesting that main branch works the same but this doesn't.
 
Hmm, strange. I have no idea, what's going wrong. Have you tested the "old" torque-simulation branch with the 18 FET?
https://github.com/stancecoke/BMSBattery_S_controllers_firmware/tree/Torque_Simulation_Testing

regards
stancecoke

p.s. still your config.h of the HighSpeedMotors Branch would be interesting....
 
Hm, I just crosschecked your settings with my 6FET + Middrive Motor and with the BionX direct drive, it works without problems ....

regards
stancecoke
 
I want to buy a 72v and around max 40 amp controller from aliexpress. Can you provide me a link which controller should buy ?
 
infernomer said:
I want to buy a 72v and around max 40 amp controller from aliexpress. Can you provide me a link which controller should buy ?
Maybe honya96 knows about it. Because I think the developers never run the firmware on such controllers although they should be very near, as long they do sinewave (need to run the motor using hall sensors and also have 1 phase current sensor, just like BMSBAttery S06S and S12S controllers).
 
infernomer said:
I want to buy a 72v and around max 40 amp controller from aliexpress. Can you provide me a link which controller should buy ?

Please provide as detailed info as possible about your build, so I can suggest the best.

If I remember correctly you can get 72v 40A from bmsbattery.com for 60$

+72v lcd3 from aliexpress, that way you get both tax free.

But you can't be sure it will work for you without sharing your battery/motor etc specs.
 
now i have magic pie 4 its 48 v 30amp max. But i want 72v because the future builds. I think i will get rid magic pie 4 and will buy leaf motor 1500w hub motor.
I dont have any battery yet but i am building it from recycled laptop batteries.
I live in turkey and 60 $ is not tax free in my country its about 25$ :( .
Thank you for helping me
 
I have 20s14p pack of used laptop 18650. Calculate with using max 6A per cell for really short bursts or 4A for a bit longer. Best to install 1$ lcd with temp sensor to keep battery under 60°C if you want to push it.

72v 40A 12fet controller can't handle hallomotor 48v 1000w motor (no load rpm at 20s is around 1150, so its asking too much phase current.) So look it up and get lower rpm motor than this one or/+ 72v 45A 18fet on Aliexpress for around 82$ it can handle 45A for much longer than 12fet its 40A rating.

25$ taxfree EU limit is not including shipping so you can ask seller to declare 22$ product + 38$ shipping and send you invoice with these prices so it can pass tax free even if they stop it.
 
BMSBattery can ship to EU without client paying taxes, I always do that. They sent first the package to UK and then finally to the EU country.
 
Back
Top