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

Electric Motors and Controllers
Basia   10 W

10 W
Posts: 69
Joined: Nov 10 2017 4:17am
Location: Wilmington

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

Post by Basia » Jun 12 2018 6:48am

perhaps I need to remove the extra settings from config.h. pas, etc. ? I have only a brake and thtottle. what else can you think of to simplify the settings?

User avatar
stancecoke   100 kW

100 kW
Posts: 1007
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Jun 12 2018 7:04am

casainho wrote:
Jun 12 2018 6:46am
stancecoke wrote:
Jun 12 2018 6:36am
We could easily implement constant regen activated by the brake lever switch, but nobody asked for that so far.
That is already implemented on current firmware and that is how I am being testing regen. When brakes are activated, battery regen current is set to ADC_BATTERY_REGEN_CURRENT_MAX and target duty_cycle is set to 0:
Ah, nice to see, I didn't knew that :-)

But if you set target duty_cycle to zero, you have to disable FOC at regen, otherwise the advance angle runs to nirvana, see the posts before.

regards
stancecoke

casainho   1.21 GW

1.21 GW
Posts: 3528
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Jun 12 2018 7:06am

stancecoke wrote:
Jun 12 2018 7:04am
But if you set target duty_cycle to zero, you have to disable FOC at regen, otherwise the advance angle runs to nirvana, see the posts before.
That is what I am trying to solve. The Android app you did recommend works very well and will help me on this!! Thanks.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

casainho   1.21 GW

1.21 GW
Posts: 3528
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Jun 12 2018 7:09am

Basia wrote:
Jun 12 2018 6:48am
perhaps I need to remove the extra settings from config.h. pas, etc. ? I have only a brake and thtottle. what else can you think of to simplify the settings?
The issue about the motor, I think is nothing about regen. Or you find a good working hall sensor and phase wire combinations or the firmware simple won't work for you. Other option would be to develop the firmware and make an option on config.h for motor rotation direction -- I am busy with other things and I am not really motivated to work on that.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

User avatar
stancecoke   100 kW

100 kW
Posts: 1007
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Jun 12 2018 7:42am

I think the issue with the rotation direction is solved already?!
Basia wrote:
Jun 10 2018 11:17am
I chose the right combination!
I changed the phase wires yellow-yellow green-blue and blue-green.
Hall sensors changed the yellow-blue green-green blue-yellow.
the direction of rotation is correct
regards
stancecoke

Basia   10 W

10 W
Posts: 69
Joined: Nov 10 2017 4:17am
Location: Wilmington

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

Post by Basia » Jun 12 2018 7:53am

stancecoke wrote:
Jun 12 2018 7:42am
I think the issue with the rotation direction is solved already?!
Basia wrote:
Jun 10 2018 11:17am
I chose the right combination!
I changed the phase wires yellow-yellow green-blue and blue-green.
Hall sensors changed the yellow-blue green-green blue-yellow.
the direction of rotation is correct
regards
stancecoke
Yes, I wrote that it was solved. the motor does not stop

User avatar
stancecoke   100 kW

100 kW
Posts: 1007
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Jun 12 2018 7:58am

Basia wrote:
Jun 12 2018 7:53am
the motor does not stop
If you disable regen in the java tool, the motor stops correctly?!

regards
stancecoke

Basia   10 W

10 W
Posts: 69
Joined: Nov 10 2017 4:17am
Location: Wilmington

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

Post by Basia » Jun 12 2018 9:35am

stancecoke wrote:
Jun 12 2018 7:58am
Basia wrote:
Jun 12 2018 7:53am
the motor does not stop
If you disable regen in the java tool, the motor stops correctly?!

regards
stancecoke
does not depend on regen. now picked up the configuration. 131 degrees motor offset and interpolation 0. The wheel rotates well but does not stop until the end. slowly rotates after releasing throttle

casainho   1.21 GW

1.21 GW
Posts: 3528
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Jun 12 2018 9:36am

Basia wrote:
Jun 12 2018 9:35am
stancecoke wrote:
Jun 12 2018 7:58am
Basia wrote:
Jun 12 2018 7:53am
the motor does not stop
If you disable regen in the java tool, the motor stops correctly?!

regards
stancecoke
does not depend on regen. now picked up the configuration. 131 degrees motor offset and interpolation 0. The wheel rotates well but does not stop until the end. slowly rotates after releasing throttle
Try on with yourself on top, should work well.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

Basia   10 W

10 W
Posts: 69
Joined: Nov 10 2017 4:17am
Location: Wilmington

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

Post by Basia » Jun 12 2018 10:01am

casainho wrote:
Jun 12 2018 9:36am
Basia wrote:
Jun 12 2018 9:35am
stancecoke wrote:
Jun 12 2018 7:58am
Basia wrote:
Jun 12 2018 7:53am
the motor does not stop
If you disable regen in the java tool, the motor stops correctly?!

regards
stancecoke
does not depend on regen. now picked up the configuration. 131 degrees motor offset and interpolation 0. The wheel rotates well but does not stop until the end. slowly rotates after releasing throttle
Try on with yourself on top, should work well.
change code in breake.c ? Nothing has changed

User avatar
stancecoke   100 kW

100 kW
Posts: 1007
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Jun 12 2018 11:28am

Basia wrote:
Jun 12 2018 10:01am
Nothing has changed
If the throttle is released, the battery current is controlled to be zero. With the wheel in the air, the battery current will be almost zero, even, if the wheel is still spinning. Just put the wheel on floor and the wheel will stop...

regards
stancecoke

Basia   10 W

10 W
Posts: 69
Joined: Nov 10 2017 4:17am
Location: Wilmington

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

Post by Basia » Jun 12 2018 12:45pm

stancecoke wrote:
Jun 12 2018 11:28am
Basia wrote:
Jun 12 2018 10:01am
Nothing has changed
If the throttle is released, the battery current is controlled to be zero. With the wheel in the air, the battery current will be almost zero, even, if the wheel is still spinning. Just put the wheel on floor and the wheel will stop...

regards
stancecoke
I stop it with my hand when I release it again it rotates

User avatar
stancecoke   100 kW

100 kW
Posts: 1007
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Jun 12 2018 1:15pm

Yes that's normal, as casainho has removed the PI-controller for the battery current from the code. But it doesn't matter in real life, except you want to carry the scooter by hand while the system is switched on...
We had a workaround by reducing the value of adc_battery_current_offset_10b by some digits in the adc.c formerly...

Code: Select all

  // read and average a few values of ADC battery current
  ui16_adc_battery_current_offset_10b = 0;
  for (ui8_i = 0; ui8_i < 16; ui8_i++)
  {
    ui16_counter = TIM2_GetCounter () + 10; // delay ~10ms
    adc_trigger ();
    while (!ADC1_GetFlagStatus (ADC1_FLAG_EOC)) ; // wait for end of conversion
    ui16_adc_battery_current_offset_10b += ui16_adc_read_battery_current_10b ();
  }
  ui16_adc_battery_current_offset_10b >>= 4;
  ui16_adc_battery_current_offset_10b -= 8;
  ui8_adc_battery_current_offset = ui16_adc_battery_current_offset_10b >> 2;
I don't remember, if that caused any trouble at another part of the code...

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

Basia   10 W

10 W
Posts: 69
Joined: Nov 10 2017 4:17am
Location: Wilmington

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

Post by Basia » Jun 12 2018 1:20pm

stancecoke wrote:
Jun 12 2018 1:15pm
Yes that's normal, as casainho has removed the PI-controller for the battery current from the code. But it doesn't matter in real life, except you want to carry the scooter by hand while the system is switched on...

regards
stancecoke
1.5 A normal current for idling?

User avatar
stancecoke   100 kW

100 kW
Posts: 1007
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Jun 12 2018 1:22pm

Basia wrote:
Jun 12 2018 1:20pm
1.5 A normal current for idling?
definitely not. It should be around 20mA

regards
stancecoke

Basia   10 W

10 W
Posts: 69
Joined: Nov 10 2017 4:17am
Location: Wilmington

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

Post by Basia » Jun 12 2018 1:29pm

stancecoke wrote:
Jun 12 2018 1:22pm
Basia wrote:
Jun 12 2018 1:20pm
1.5 A normal current for idling?
definitely not. It should be around 20mA

regards
stancecoke
20mA battery current at maximum speed (50km/h)? The throttle reacts very strongly. possible to make less sensitive?

User avatar
stancecoke   100 kW

100 kW
Posts: 1007
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Jun 12 2018 1:37pm

sorry that was a missunderstandig due to my english knowledge :D
For max speed with wheel in the air, it's OK!

You shouldn't judge the throttle behavior with the wheel in the air, as the firmware controls the current and not the speed.

regards
stancecoke

Basia   10 W

10 W
Posts: 69
Joined: Nov 10 2017 4:17am
Location: Wilmington

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

Post by Basia » Jun 12 2018 2:13pm

stancecoke wrote:
Jun 12 2018 1:15pm
Yes that's normal, as casainho has removed the PI-controller for the battery current from the code. But it doesn't matter in real life, except you want to carry the scooter by hand while the system is switched on...
We had a workaround by reducing the value of adc_battery_current_offset_10b by some digits in the adc.c formerly...

Code: Select all

  // read and average a few values of ADC battery current
  ui16_adc_battery_current_offset_10b = 0;
  for (ui8_i = 0; ui8_i < 16; ui8_i++)
  {
    ui16_counter = TIM2_GetCounter () + 10; // delay ~10ms
    adc_trigger ();
    while (!ADC1_GetFlagStatus (ADC1_FLAG_EOC)) ; // wait for end of conversion
    ui16_adc_battery_current_offset_10b += ui16_adc_read_battery_current_10b ();
  }
  ui16_adc_battery_current_offset_10b >>= 4;
  ui16_adc_battery_current_offset_10b -= 8;
  ui8_adc_battery_current_offset = ui16_adc_battery_current_offset_10b >> 2;
I don't remember, if that caused any trouble at another part of the code...

regards
stancecoke
with this code, the wheel stops as needed only very quickly)

casainho   1.21 GW

1.21 GW
Posts: 3528
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Jun 12 2018 2:19pm

Basia wrote:
Jun 12 2018 2:13pm
with this code, the wheel stops as needed only very quickly)
Great!! Can you please record a video, put on youtube and use on the tittle the name of this firmware project? So others can see it running a kick electric scooter?

So, it is finally running without issues, right?
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

Basia   10 W

10 W
Posts: 69
Joined: Nov 10 2017 4:17am
Location: Wilmington

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

Post by Basia » Jun 12 2018 2:42pm

casainho wrote:
Jun 12 2018 2:19pm
Basia wrote:
Jun 12 2018 2:13pm
with this code, the wheel stops as needed only very quickly)
Great!! Can you please record a video, put on youtube and use on the tittle the name of this firmware project? So others can see it running a kick electric scooter?

So, it is finally running without issues, right?
it seems that everything is fine! tomorrow I will check on the street. now record a video! Thank you so much!
can i connect lcd5?

Basia   10 W

10 W
Posts: 69
Joined: Nov 10 2017 4:17am
Location: Wilmington

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

Post by Basia » Jun 12 2018 3:04pm

Basia wrote:
Jun 12 2018 2:42pm
casainho wrote:
Jun 12 2018 2:19pm
Basia wrote:
Jun 12 2018 2:13pm
with this code, the wheel stops as needed only very quickly)
Great!! Can you please record a video, put on youtube and use on the tittle the name of this firmware project? So others can see it running a kick electric scooter?

So, it is finally running without issues, right?
it seems that everything is fine! tomorrow I will check on the street. now record a video! Thank you so much!
can i connect lcd5?

Basia   10 W

10 W
Posts: 69
Joined: Nov 10 2017 4:17am
Location: Wilmington

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

Post by Basia » Jun 12 2018 3:55pm

now checked in the apartment. very slow acceleration (
Oh... ADC battery current max 15 :oops:
Last edited by Basia on Jun 13 2018 1:24am, edited 1 time in total.

User avatar
stancecoke   100 kW

100 kW
Posts: 1007
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Jun 12 2018 11:01pm

Code: Select all

#define ADC_MOTOR_CURRENT_MAX	43 // each unit = 0.35A; 43 = 15A
regards
stancecoke

geofft   1 kW

1 kW
Posts: 346
Joined: Nov 09 2012 9:41am
Location: Berkshire UK

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

Post by geofft » Jun 13 2018 7:26am

Copied from TSDZ2 thread:-

A very kind feature would be, to enable/disable the 25 km/h limit with long pressing the up/down keys. Might this be implementable?


(casainho) Sure it is. We call it, on our OpenSource firmware for KT motor controllers, the street and offroad modes.


....so is this feature now working on the KT fw? I thought this was still in the 'future improvements' category.. :)
Last edited by geofft on Jun 13 2018 12:07pm, edited 1 time in total.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

casainho   1.21 GW

1.21 GW
Posts: 3528
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Jun 13 2018 7:32am

geofft wrote:
Jun 13 2018 7:26am
Copied from TSZD2 thread:-

A very kind feature would be, to enable/disable the 25 km/h limit with long pressing the up/down keys. Might this be implementable?


(casainho) Sure it is. We call it, on our OpenSource firmware for KT motor controllers, the street and offroad modes.


....so is this feature now working on the KT fw? I thought this was still in the 'future improvements' category.. :)
It is on the issue list with that name, discussed and defined ready to be implemented. I wish more developers could join.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

Post Reply