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

Electric Motors and Controllers
casainho
100 kW
100 kW
Posts: 1209
Joined: Feb 14, 2011 2:43 pm

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

Post by casainho » Jan 24, 2018 4:27 pm

geofft wrote:
Jan 24, 2018 4:23 pm
casainho wrote:
Jan 24, 2018 7:23 am
Can you please tell if you are not hitting the MOTOR_OVER_SPEED_ERPS of 520 ERPs?
I don't think this is happening, but I'm not sure how to check it - is there some kind of display (or other) indication?
What is your P1 value ((motor magnets/2) * motor gear ratio) ? What is your wheel size and max wheel speed in km/h are you getting?
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

geofft
100 W
100 W
Posts: 117
Joined: Nov 09, 2012 9:41 am
Location: Berkshire UK

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

Post by geofft » Jan 24, 2018 4:37 pm

My P1 is set to 211 (16 magnets x 13.2 gear ratio).
26" wheels
max speed ~ 28kph
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

casainho
100 kW
100 kW
Posts: 1209
Joined: Feb 14, 2011 2:43 pm

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

Post by casainho » Jan 24, 2018 4:48 pm

geofft wrote:
Jan 24, 2018 4:37 pm
My P1 is set to 211 (16 magnets x 13.2 gear ratio).
26" wheels
max speed ~ 28kph
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.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

geofft
100 W
100 W
Posts: 117
Joined: Nov 09, 2012 9:41 am
Location: Berkshire UK

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

Post by geofft » Jan 24, 2018 4:53 pm

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.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

casainho
100 kW
100 kW
Posts: 1209
Joined: Feb 14, 2011 2:43 pm

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

Post by casainho » Jan 25, 2018 2:46 am

geofft wrote:
Jan 24, 2018 4:53 pm
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.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

geofft
100 W
100 W
Posts: 117
Joined: Nov 09, 2012 9:41 am
Location: Berkshire UK

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

Post by geofft » Jan 25, 2018 3:19 pm

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.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.


casainho
100 kW
100 kW
Posts: 1209
Joined: Feb 14, 2011 2:43 pm

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

Post by casainho » Jan 25, 2018 5:04 pm

al17 wrote:
Jan 25, 2018 4:58 pm
Has anyone tried this firmware on this controller?
https://images-na.ssl-images-amazon.com ... L1024_.jpg
https://www.amazon.com/Brushless-Contro ... 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.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

honya96
100 W
100 W
Posts: 170
Joined: Mar 05, 2015 9:38 am
Location: Czech Republic

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

Post by honya96 » Jan 25, 2018 6:20 pm

al17 wrote:
Jan 25, 2018 4:58 pm
Has anyone tried this firmware on this controller?
https://images-na.ssl-images-amazon.com ... L1024_.jpg
https://www.amazon.com/Brushless-Contro ... 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
100 W
100 W
Posts: 117
Joined: Nov 09, 2012 9:41 am
Location: Berkshire UK

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

Post by geofft » Jan 27, 2018 9:33 am

geofft wrote:
Jan 24, 2018 5:40 am
'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:
Last edited by geofft on Jan 28, 2018 3:11 am, edited 1 time in total.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

User avatar
stancecoke
1 kW
1 kW
Posts: 450
Joined: Aug 02, 2017 2:56 pm

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

Post by stancecoke » Jan 27, 2018 1:48 pm

The direction detection is added to the HighSpeedMotor branch now. The algorithm is not the optimum, but I found no better solution yet.

regards
stancecoke

honya96
100 W
100 W
Posts: 170
Joined: Mar 05, 2015 9:38 am
Location: Czech Republic

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

Post by honya96 » Jan 31, 2018 1:10 pm

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.

casainho
100 kW
100 kW
Posts: 1209
Joined: Feb 14, 2011 2:43 pm

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

Post by casainho » Jan 31, 2018 1:28 pm

honya96 wrote:
Jan 31, 2018 1:10 pm
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: Select all

  // 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: Select all

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 wrote:
Jan 31, 2018 1:10 pm
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.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

honya96
100 W
100 W
Posts: 170
Joined: Mar 05, 2015 9:38 am
Location: Czech Republic

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

Post by honya96 » Jan 31, 2018 2:52 pm

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 (168.95 KiB) Viewed 228 times
20180131_204142-576x1024.jpg
20180131_204142-576x1024.jpg (100.32 KiB) Viewed 228 times

User avatar
stancecoke
1 kW
1 kW
Posts: 450
Joined: Aug 02, 2017 2:56 pm

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

Post by stancecoke » Jan 31, 2018 3:43 pm

honya96 wrote:
Jan 31, 2018 1:10 pm
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: Select all

#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 wrote:
Jan 31, 2018 2:52 pm
@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

honya96
100 W
100 W
Posts: 170
Joined: Mar 05, 2015 9:38 am
Location: Czech Republic

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

Post by honya96 » Jan 31, 2018 4:46 pm

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.

User avatar
stancecoke
1 kW
1 kW
Posts: 450
Joined: Aug 02, 2017 2:56 pm

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

Post by stancecoke » Feb 01, 2018 1:02 am

honya96 wrote:
Jan 31, 2018 4:46 pm
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: Select all

calibration factor = (voltage on pin 24 *255 /5)/battery voltage
regards
stancecoke

honya96
100 W
100 W
Posts: 170
Joined: Mar 05, 2015 9:38 am
Location: Czech Republic

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

Post by honya96 » Feb 01, 2018 7:40 am

Its 4.082v, where is that value?

User avatar
stancecoke
1 kW
1 kW
Posts: 450
Joined: Aug 02, 2017 2:56 pm

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

Post by stancecoke » Feb 01, 2018 8:17 am

honya96 wrote:
Feb 01, 2018 7:40 am
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 wrote:
Feb 01, 2018 7:40 am
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

honya96
100 W
100 W
Posts: 170
Joined: Mar 05, 2015 9:38 am
Location: Czech Republic

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

Post by honya96 » Feb 01, 2018 9:25 am

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.

User avatar
stancecoke
1 kW
1 kW
Posts: 450
Joined: Aug 02, 2017 2:56 pm

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

Post by stancecoke » Feb 01, 2018 9:48 am

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/BMSBatter ... on_Testing

regards
stancecoke

p.s. still your config.h of the HighSpeedMotors Branch would be interesting....

honya96
100 W
100 W
Posts: 170
Joined: Mar 05, 2015 9:38 am
Location: Czech Republic

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

Post by honya96 » Feb 01, 2018 10:00 am

Old not tested yet
Attachments
Bez názvu.png
Bez názvu.png (35.52 KiB) Viewed 175 times

User avatar
stancecoke
1 kW
1 kW
Posts: 450
Joined: Aug 02, 2017 2:56 pm

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

Post by stancecoke » Feb 01, 2018 11:26 am

Hm, I just crosschecked your settings with my 6FET + Middrive Motor and with the BionX direct drive, it works without problems ....

regards
stancecoke
Last edited by stancecoke on Feb 01, 2018 12:01 pm, edited 1 time in total.

infernomer
10 µW
10 µW
Posts: 5
Joined: May 28, 2017 3:29 pm

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

Post by infernomer » Feb 01, 2018 11:44 am

I want to buy a 72v and around max 40 amp controller from aliexpress. Can you provide me a link which controller should buy ?

casainho
100 kW
100 kW
Posts: 1209
Joined: Feb 14, 2011 2:43 pm

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

Post by casainho » Feb 01, 2018 11:49 am

infernomer wrote:
Feb 01, 2018 11:44 am
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).
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

Post Reply