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

Electric Motors and Controllers
honya96
100 W
100 W
Posts: 188
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 20, 2018 7:59 am

24" x 3.0" tire so almost like 26". 46 magnets, no reduction. Firmware has some bugs for sure, I left my bike running on stand to drain battery and after about 2 minutes running with fixed throttle possition it started to accelerate to 78km/h on display and back to 35 and again. After releasing throttle it did once again and stopped, then after adding throttle just some sound but no turning. Had to flash again.

casainho
100 kW
100 kW
Posts: 1225
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 20, 2018 9:26 am

honya96 wrote:
Jan 20, 2018 7:59 am
24" x 3.0" tire so almost like 26". 46 magnets, no reduction. Firmware has some bugs for sure, I left my bike running on stand to drain battery and after about 2 minutes running with fixed throttle possition it started to accelerate to 78km/h on display and back to 35 and again. After releasing throttle it did once again and stopped, then after adding throttle just some sound but no turning. Had to flash again.
On that test, was the motor accelerating and keep always increasing the speed the the speed shown on LCD was wrong or do you think the speed shown on the LCD reflects the real value??

I must say I don't have a motor that fast, maybe there are some variable doing overflow with such high speed values. I need to think more about this. Every information about your tests is important, but please give detailed information!! Say in which conditions, which options the firmware and options on LCD like the values for P1, etc.

So, with 46 magnets, has 23 poles.

For the limit of 520 ERPS, would be:
- 520/23 = 22.6 RPS; 22.6*60 = RPMs = 1356

On this table, https://endless-sphere.com/forums/viewtopic.php?t=16114, 1356 RPMs would be 154km/h!!! So you are not hitting the MOTOR_OVER_SPEED_ERPS of 520.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

geofft
100 W
100 W
Posts: 118
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 20, 2018 10:27 am

honya96 wrote:
Jan 20, 2018 7:37 am
@Casainho - edited config.h does not change it. I am far from hiting max erps, as I explained, I get 37km on display while set 72. Motor rpm is changing by P1 but still limits to about 37 on display

@Geofft - can you try the 100% throttle?
Always 100% throttle works ok for me, after I requested it casainho added this line to config.h :-

#define EBIKE_THROTTLE_TYPE_THROTTLE_PAS_ASSIST_LEVEL_PAS_ONLY

...and it has worked ok since then. Maybe double check you have this exact line? There are a couple of other lines that are very similar.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

casainho
100 kW
100 kW
Posts: 1225
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 20, 2018 10:31 am

geofft wrote:
Jan 20, 2018 10:27 am
honya96 wrote:
Jan 20, 2018 7:37 am
@Casainho - edited config.h does not change it. I am far from hiting max erps, as I explained, I get 37km on display while set 72. Motor rpm is changing by P1 but still limits to about 37 on display

@Geofft - can you try the 100% throttle?
Always 100% throttle works ok for me, after I requested it casainho added this line to config.h :-

#define EBIKE_THROTTLE_TYPE_THROTTLE_PAS_ASSIST_LEVEL_PAS_ONLY

...and it has worked ok since then. Maybe double check you have this exact line? There are a couple of other lines that are very similar.
That option, can be seen on config-example.h file on the firmware folder (should be added manually to config.h or main.h):

https://github.com/OpenSource-EBike-fir ... -example.h
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

honya96
100 W
100 W
Posts: 188
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 20, 2018 12:06 pm

casainho wrote:
Jan 20, 2018 9:26 am


On this table, https://endless-sphere.com/forums/viewtopic.php?t=16114, 1356 RPMs would be 154km/h!!! So you are not hitting the MOTOR_OVER_SPEED_ERPS of 520.
The speed shown was real (like full throttle on original fw), but much higher than full throttle on this fw (I cant get rid of 35-37km/h limit.)

P1 - 46 P3 - 1
12 magnets max cadence 20
Stock assist levels etc.
14s batt.
214 angle
137 angle
Stock pwm rise
No file edited (config.h, main) all stock

Battery at 57V (doing this I wanted to discharge my battery a bit, cause I have blown 2 mosfets and then seen they are 60v (others have 68v or 80v) only so not enough margin for 14s.)
Bike on stand, throttle fixed manually to stay same, was running 37km /h then 35 for a while and then started doing what I explained. Anything else you need to know? I am going to test it more now

@Geofft - so its working with no need you to edit config.h? now I realize maybe maybe it worked for me to with germotor bike (and other kt-lcd3)

Maybe its "all" caused by lcd? The wrong speed, etc

honya96
100 W
100 W
Posts: 188
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 20, 2018 1:27 pm

tried the other display, and throttle is 100% at pas 0! (?), blown mosfets again when turning off the lcd. weird.
First blown was mosfet 1 and 4 now its 1 and 2 counting from shunt side.

casainho
100 kW
100 kW
Posts: 1225
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 20, 2018 1:38 pm

honya96 wrote:
Jan 20, 2018 1:27 pm
tried the other display, and throttle is 100% at pas 0! (?), blown mosfets again when turning off the lcd. weird.
First blown was mosfet 1 and 4 now its 1 and 2 counting from shunt side.
You can try without LCD and define your own default variabke valies that LCD define, they are on main.h. They are the EEPROM variables. Please erase first the firmware writing the option bytes, to nake sure EEPROM is also erased.

Also maybe I can make a firmware with speed controller disable, so you can try with juat direct throttle value to be dutycyle.

I am not at home so I can't help more until today.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

casainho
100 kW
100 kW
Posts: 1225
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 20, 2018 2:35 pm

When first run of firmware and without an LCD connected, the default values are this, defined 9n main.h. This values are after saved on persistent memory of STM8, everytime the LCD change their correspondonding values.

So, If you think your LCD can be source of problems, don't use it amd instead change this default values for your needs:

Code: Select all

// *************************************************************************** //
// EEPROM memory variables default values
#define DEFAULT_VALUE_ASSIST_LEVEL 		2
#define DEFAULT_VALUE_MOTOR_CHARACTARISTIC 	202 // for Q85 motor (12.6 * 16)
#define DEFAULT_VALUE_WHEEL_SIZE	 	20 // 26''
#define DEFAULT_VALUE_MAX_SPEED	 		25
#define DEFAULT_VALUE_POWER_ASSIST_CONTROL_MODE 1
#define DEFAULT_VALUE_CONTROLLER_MAX_CURRENT	10
// *************************************************************************** //
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

honya96
100 W
100 W
Posts: 188
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 20, 2018 2:44 pm

thanks, but I dont want to use without lcd. I am just pointing out things which dont work as they should.. the other lcd is running at 42km/h while its like walking speed with gear motor, now running on table, waiting if it fails again.

So its the communication between lcd and controller, limiting the speed.

@geofft you can test by setting P1 at like 20 so display shows 42 and you get walking speed and no way to go faster if I am right.
btw whats your board model number (like KTE-SVP5-A..)

Even my gearmotor bike at 1kw is going 60 downhill so it will be a problem for more people

@Casainho, just seen your last post. I allready tried changing "#define DEFAULT_VALUE_MAX_SPEED" to 72 but looks like lcd overrides it with "its own" 72 which means 42 or 37 on the two lcds :roll:

casainho
100 kW
100 kW
Posts: 1225
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 20, 2018 3:00 pm

honya96 wrote:
Jan 20, 2018 2:44 pm
@Casainho, just seen your last post. I allready tried changing "#define DEFAULT_VALUE_MAX_SPEED" to 72 but looks like lcd overrides it with "its own" 72 which means 42 or 37 on the two lcds :roll:
To make sure it is the LCD: do the same test but never connect the LCD and please tell us of the results.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

honya96
100 W
100 W
Posts: 188
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 20, 2018 3:03 pm

still same speed without display. set 72 and even 0, same. I did it all as you said :?

honya96
100 W
100 W
Posts: 188
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 20, 2018 3:15 pm

Original fw does not limit speed without display, since it doesnt know P1 value, which pole number is set by default here?

honya96
100 W
100 W
Posts: 188
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 20, 2018 3:44 pm

I can say for sure that some other options than P1 P3 and C5 do some changes. I restored original values, put those 3 back as they was, and now I get no throttle at PAS 0 and much higher motor speed while still showing max 35.

Edit: Tried hard but found no specific value causing this, maybe C3 or C4, but after changing them back to stock throttle stays active at PAS:0

so, If anyone wants Throttle still 100%, change a lot randomly :D .
If throttle scaling with PAS, restore original settings by C10

casainho
100 kW
100 kW
Posts: 1225
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 20, 2018 6:57 pm

So, good to know that LCD is not limiting the speed.
Tomorrow I can change the firmware to disable speed and current controllers, then you can put directly PWM dutycyle on the motor, using the throttle -- can't be more direct.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

honya96
100 W
100 W
Posts: 188
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 21, 2018 3:39 am

casainho wrote:
Jan 20, 2018 6:57 pm
So, good to know that LCD is not limiting the speed.
Tomorrow I can change the firmware to disable speed and current controllers, then you can put directly PWM dutycyle on the motor, using the throttle -- can't be more direct.
I think it is limiting the speed somehow, when I set P1 to higher value I get higher rpm on motor but same speed reading. Without display I cant set the P1

Disabling current control is a big step back, thats the main feature I like.

geofft
100 W
100 W
Posts: 118
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 21, 2018 3:59 am

@geofft you can test by setting P1 at like 20 so display shows 42 and you get walking speed and no way to go faster if I am right.
btw whats your board model number (like KTE-SVP5-A..)
Didn't realise that the P1 setting was still active - my setting for this was 211 (16 magnets x 13.2 gear ratio). I'll try your numbers and let you know if I find anything that may help you.

My controller is a KT36/48SVPR, board number KTE-SVP5-A.

Edit to add: My P3 is set to 1, if set to 0 found it applied some restrictions to speed or throttle, can't remember exactly what they were.
My speed is set to max in display (72kph?) but my setup can only achieve about 33kph. I think this is probably the limit for a 201 rpm motor at 48v.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

honya96
100 W
100 W
Posts: 188
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 21, 2018 4:26 am

geofft wrote:
Jan 21, 2018 3:59 am
@geofft you can test by setting P1 at like 20 so display shows 42 and you get walking speed and no way to go faster if I am right.
btw whats your board model number (like KTE-SVP5-A..)
Didn't realise that the P1 setting was still active - my setting for this was 211 (16 magnets x 13.2 gear ratio). I'll try your numbers and let you know if I find anything that may help you.

My controller is a KT36/48SVPR, board number KTE-SVP5-A.

Edit to add: My P3 is set to 1, if set to 0 found it applied some restrictions to speed or throttle, can't remember exactly what they were.
My speed is set to max in display (72kph?) but my setup can only achieve about 33kph. I think this is probably the limit for a 201 rpm motor at 48v.
Great, so you have the same controller. Please test the low P1 value so you get much higher speed reading than reality, and see if it will go up to 72 or more like 35-42 while not full rpm at motor. Thanks :wink:

casainho
100 kW
100 kW
Posts: 1225
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 21, 2018 4:54 am

honya96 wrote:
Jan 21, 2018 3:39 am
casainho wrote:
Jan 20, 2018 6:57 pm
So, good to know that LCD is not limiting the speed.
Tomorrow I can change the firmware to disable speed and current controllers, then you can put directly PWM dutycyle on the motor, using the throttle -- can't be more direct.
I think it is limiting the speed somehow, when I set P1 to higher value I get higher rpm on motor but same speed reading. Without display I cant set the P1

Disabling current control is a big step back, thats the main feature I like.
P1 is the DEFAULT_VALUE_MOTOR_CHARACTARISTIC!! So ypu can change it without the LCD!!

The idea to disable current and speed controllers was jist for you to make a test and see if you can run your motor at max speed, without any limitation.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

User avatar
stancecoke
1 kW
1 kW
Posts: 455
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 21, 2018 8:28 am

honya96 wrote:
Jan 20, 2018 7:37 am
@Stancecoke - Thanks but I will stick with main branch, can test the value if you want, but I am not intersted because it does not work with lcd3.
mtdr has sent a LCD3 to me, so I have now implemented basic functions for the LCD3 in my fork. I added the option of using a higher PWM frequency, also. See the new branch HighSpeedMotors.
The java tool is not updated yet. So you have to edit the config.h manually and doubleclick on Start_Compiling.bat at the moment.

regards
stancecoke

Image

geofft
100 W
100 W
Posts: 118
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 21, 2018 8:40 am

honya96 wrote:
Jan 21, 2018 4:26 am
Great, so you have the same controller. Please test the low P1 value so you get much higher speed reading than reality, and see if it will go up to 72 or more like 35-42 while not full rpm at motor. Thanks :wink:
Found that reducing the P1 number caused a reduction in both displayed and actual wheel speed. At P1=40 was getting a max speed (wheel and display) of just 8-9kph. BTW, my speed detection is via the motor signal (white wire on hall plug), I don't have an external speed sensor. Seemed to get the best result (speed and torque) around the 'correct' setting for my motor, 211.

Not sure if this of any help, or how much these results relate to the rather different characteristics of your motor - but if you need any more tests done then just let me know.. :)
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

geofft
100 W
100 W
Posts: 118
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 21, 2018 9:11 am

Bought one of these just recently:-

bike tester.jpg
Lots of these for sale quite cheap on ebay and great for controlled load testing, especially with weather like the UK today... :wink:
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

honya96
100 W
100 W
Posts: 188
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 21, 2018 9:16 am

geofft wrote:
Jan 21, 2018 8:40 am

Not sure if this of any help, or how much these results relate to the rather different characteristics of your motor - but if you need any more tests done then just let me know.. :)
Thanks, I think it confirms my problem.. for Casainho so he knows there is a bug. :wink:

@Casainho - no need to hurry with this issue, I can get the speed I want by setting wrong P1, then just the displayed speed is wrong.

honya96
100 W
100 W
Posts: 188
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 21, 2018 9:19 am

stancecoke wrote:
Jan 21, 2018 8:28 am

so I have now implemented basic functions for the LCD3 in my fork.
Looks like correct power measurement also, good work :wink:

I am going to try it right now.

casainho
100 kW
100 kW
Posts: 1225
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 21, 2018 9:34 am

@honya96: I disabled the speed and current controller and also the protection for motor stall, on the new testing branch "direct_throttle". Please download and test, you should be able to get your motor max speed: https://github.com/OpenSource-EBike-fir ... t_throttle

The motor controller is now simple as this (no speed and current controllers):

Code: Select all

void do_motor_controller_mode (void)
{
  // set PWM duty_cycle target value only if we are not braking
  if (!motor_controller_state_is_set (MOTOR_CONTROLLER_STATE_BRAKE))
  {
    motor_set_pwm_duty_cycle_target (ui8_throttle_value_filtered);
  }
}
@geofft: nice that you got the training bike roller, would be great if you could put a constant speed and adjust the value for FOC_READ_ID_CURRENT_ANGLE_ADJUST. Can you please share with us how was the process and the final value for your motor?

@stancecoke: great that HighSpeedMotors, would be great to have feedback from users!!
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

casainho
100 kW
100 kW
Posts: 1225
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 21, 2018 9:39 am

honya96 wrote:
Jan 21, 2018 9:16 am
geofft wrote:
Jan 21, 2018 8:40 am

Not sure if this of any help, or how much these results relate to the rather different characteristics of your motor - but if you need any more tests done then just let me know.. :)
Thanks, I think it confirms my problem.. for Casainho so he knows there is a bug. :wink:

@Casainho - no need to hurry with this issue, I can get the speed I want by setting wrong P1, then just the displayed speed is wrong.
I am lost here: can you please resume?
I understand that your motor is direct drive, with 46 magnets and you set P1 = 46, which is ok.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

Post Reply