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: 1226
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 14, 2018 6:34 am

honya96 wrote:
Jan 14, 2018 6:31 am
I am gonna confirm the wattage correction in few minutes, but I can say allready that it reads atleast 20% too high.
Great! And then, please tell us how did you measure.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

honya96
100 W
100 W
Posts: 193
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 14, 2018 7:28 am

So its much higher.
Standby 6.9-7w - 20-21 on lcd. No load 46-48w - 120-138 on lcd. 400w real - 840-860lcd .

Motor current 40A at tool gives 10-11 real. :shock: 15A at tool gives 3.5-3.8 real.

Measured by 8$ AE wattmeter (checked to work well)
Attachments
20180114_131103-1024x576.jpg
20180114_131103-1024x576.jpg (111.31 KiB) Viewed 306 times

casainho
100 kW
100 kW
Posts: 1226
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 14, 2018 7:38 am

honya96 wrote:
Jan 14, 2018 7:28 am
So its much higher.
Standby 6.9-7w - 20-21 on lcd. No load 46-48w - 120-138 on lcd. 400w real - 840-860lcd .

Motor current 40A at tool gives 10-11 real. :shock: 15A at tool gives 3.5-3.8 real.

Measured by 8$ AE wattmeter (checked to work well)
That is really crazy values!! I think we should not consider low values like under 3amps. On your measures, I would only consider the "400w real - 840-860lcd" and that would mean LCD is showing double of wattage.

1. What controller did you use? it is an unchanged controller?
2. how many shunts does it have?
3. Did you use latest firmware? (because I already halved the wattage on LCD on last days....)

Also, let's compare with geofft measures.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

honya96
100 W
100 W
Posts: 193
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 14, 2018 8:12 am

6fet as the 2 on photos I sent. Its back to original as much as I was able to get. 1 original shunt.

It should be latest firmware from yesterday flashed by your tool.

50A set at tool blew my 8A fuse so I replaced with 20A and It drives already better than original I would say. Great work. I am done testing gearmotor at 10s

Next is 6fet with 14s battery and direct motor on the bigger bike. If it runs, then flashing the 18fet.

Bug report: PAS at 0 runs motor when pedal rotating backwards.
slow reaction to throttle and PAS while running and standstill also.
Does not start the motor with a bit of throttle while icon is showing it should run.

User avatar
stancecoke
1 kW
1 kW
Posts: 458
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 14, 2018 8:31 am

honya96 wrote:
Jan 14, 2018 8:12 am
50A set at tool blew my 8A fuse so I replaced with 20A
Obviously the board revision KT-SVPxx uses a different gain at the OpAmp. So we have to use a diffent calibration factor in the code.

I guess, the R17 is different from 10k on your board.
OP_Gain.PNG
OP_Gain.PNG (6.38 KiB) Viewed 297 times
honya96 wrote:
Jan 14, 2018 8:12 am
Does not start the motor with a bit of throttle while icon is showing it should run.
I think this is caused by the offset to negative zero current value, we implemented yesterday to make the motor stop faster.

regards
stancecoke
Last edited by stancecoke on Jan 14, 2018 8:51 am, edited 1 time in total.

honya96
100 W
100 W
Posts: 193
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 14, 2018 8:47 am

stancecoke wrote:
Jan 14, 2018 8:31 am

I think this is caused by the offset to negative zero current value, we implemented yesterday to make the motor stop faster.
But we need to be able to block the motor by mechanical brakes right after releasing throttle with direct motor.. as it is now it still pushes half the amp limit in the air to stop the motor in 1 second from full speed.

casainho
100 kW
100 kW
Posts: 1226
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 14, 2018 9:14 am

honya96 wrote:
Jan 14, 2018 8:47 am
But we need to be able to block the motor by mechanical brakes right after releasing throttle with direct motor.. as it is now it still pushes half the amp limit in the air to stop the motor in 1 second from full speed.
I don't like much the way direct drive motor works with our firmware, but I must say I don't have experience with original firmware or others with direct drive motors.

Can you please explain what you feel that happens while braking with brakes; releasing throttle, etc??
On our firmware, the motor is always "engaged" with the phases always with signal, we never open the phases. When duty_cycle/throttle is 0, there is signal of 50% duty_cycle of PWM signal on each phases, there is why motor is blcoked and is hard to push by hand... If you push, you will be doing regen...
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

User avatar
stancecoke
1 kW
1 kW
Posts: 458
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 14, 2018 9:21 am

Hmm, I rode my direct drive with the firmware from the torque-simulation fork only, but that worked definitly better than the original firmware. @honya96: perhaps you can try it, too:
https://github.com/stancecoke/BMSBatter ... s_firmware

It has implemented regen controlled by linear hall input on pad X4 already.

You will not regen at pushing the bike, because the current is always controlled to be zero with no throttle or regen signal.
So the wheel always will turn without resistance...

regards
stancecoke
Last edited by stancecoke on Jan 14, 2018 9:25 am, edited 1 time in total.

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 14, 2018 9:24 am

Guys, I'll hold back on any further testing until you've got honya's issues sorted.

I'm beginning to think that life would be easier for everybody if you had separate firmware branches for the geared and direct drive motors...?
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

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

stancecoke wrote:
Jan 14, 2018 9:21 am
Hmm, I rode my direct drive with the firmware from the torque-simulation fork only, but that worked definitly better than the original firmware.
That's good to know. Any disadvantages over a geared motor??
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

casainho
100 kW
100 kW
Posts: 1226
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 14, 2018 9:28 am

geofft wrote:
Jan 14, 2018 9:24 am
I'm beginning to think that life would be easier for everybody if you had separate firmware branches for the geared and direct drive motors...?
The thing is that I don't if there are diferencies... What would be different??
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

honya96
100 W
100 W
Posts: 193
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 14, 2018 9:40 am

@Casainho: I know they are always energized, that was the problem with motor not stopping but still trying to turn at 160mA current. I think its good for me that they are energized, cause it allows faster reaction time (which is not there yet at pwm rise - 20) can the current or duty cycle be lowered. so it will take less current while mechanicaly braking with wheel in air? I don't fully understand the problem. Will think about it more.

What you dont like about direct drive with this fw?

@Stancecoke: I guess the torque-simulation will be better from what you wrote.

@Geofft: my reported issues are not important to solve if you dont have them too :wink: so you dont have to wait. I feel like it should be separate for gear or direct also. Or just option in config tool which will change a lot of things.

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 14, 2018 9:49 am

casainho wrote:
Jan 14, 2018 9:28 am
geofft wrote:
Jan 14, 2018 9:24 am
I'm beginning to think that life would be easier for everybody if you had separate firmware branches for the geared and direct drive motors...?
The thing is that I don't if there are diferencies... What would be different??
Was just thinking that changes made for one type may have negative effects on the other. Of course I accept that you guys know best however, if you're happy to develop both types inside the same package then that's fine for me.. :wink:
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

User avatar
stancecoke
1 kW
1 kW
Posts: 458
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 14, 2018 10:14 am

honya96 wrote:
Jan 14, 2018 9:40 am
@Stancecoke: I guess the torque-simulation will be better from what you wrote.
be careful, with this firmware, the zero current value is not set automatically but is set in the Java Tool OSEC_Parameter_Configurator.jar. So with your obviously different current measuring on your board, you'll have to adjust it. In this firmware, you can set the calibration factor for the gain, too. So with some iterations, you should be able to find the right setting for your controller.

https://www.pedelecforum.de/wiki/doku.p ... _java_tool

regards
stancecoke

honya96
100 W
100 W
Posts: 193
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 14, 2018 12:14 pm

stancecoke wrote:
Jan 14, 2018 10:14 am
honya96 wrote:
Jan 14, 2018 9:40 am
@Stancecoke: I guess the torque-simulation will be better from what you wrote.
be careful, with this firmware, the zero current value is not set automatically but is set in the Java Tool OSEC_Parameter_Configurator.jar. So with your obviously different current measuring on your board, you'll have to adjust it. In this firmware, you can set the calibration factor for the gain, too. So with some iterations, you should be able to find the right setting for your controller.

https://www.pedelecforum.de/wiki/doku.p ... _java_tool

regards
stancecoke
Thanks. As I see its just for kingmeter, so I will try main branch first and then this without display, and wait what you come up with, if the 2 branches will get combined to work from one config tool (btw I like stancecoke's layout more) or stay separate and you will add kt-lcd?

User avatar
stancecoke
1 kW
1 kW
Posts: 458
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 14, 2018 1:35 pm

You can try the torque simulation branch without a display, just to see, if it works better on your direct drive. (without display, level 3 is activated by default)
If it's satisfying for you, we can improve the master branch with this control algorithm. I don't plan to do further development on my fork.

regards
stancecoke

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

stancecoke wrote:
Jan 14, 2018 1:35 pm
If it's satisfying for you, we can improve the master branch with this control algorithm. I don't plan to do further development on my fork.
I agree however I am in a phase that I don't have much time to help on this task.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

casainho
100 kW
100 kW
Posts: 1226
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 14, 2018 1:43 pm

honya96 wrote:
Jan 14, 2018 8:12 am
1. Bug report: PAS at 0 runs motor when pedal rotating backwards.
2. slow reaction to throttle and PAS while running and standstill also.
3. Does not start the motor with a bit of throttle while icon is showing it should run.
1. That is no good :-( -- I guess we really need to try increasing the minimum value PAS cadence in main.h file
2. that is because control algorithm of throttle is slow... and we now know it needs better implementation
3. seems good to me to be like that -- I see throttle, brake, etc symbols like kind of safety, you can verify and don't have bad surprises.
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 14, 2018 2:36 pm

honya96 wrote:
Jan 14, 2018 8:12 am
Bug report: PAS at 0 runs motor when pedal rotating backwards.
Honya, when I had this problem, rather strangely I found it was much worse with 'PAS direction left' selected than it was with right. If you are runnuing PAS left try switching to right (flip the disc over to restore direction) maybe it will help you too...
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR 20amp, LCD3, 48v 12s lipo.

User avatar
stancecoke
1 kW
1 kW
Posts: 458
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 14, 2018 4:03 pm

mtdr from the German forum has managed to flash the firmware to a KTE-SVP7, but the switch to 60°interpolation doesn't work, and with 6-Step the motor (yamaha middrive) stops after a while :-(
I have no idea how to help at the moment
https://www.pedelecforum.de/forum/index ... ost-938489

regards
stancecoke
Last edited by stancecoke on Jan 15, 2018 3:21 am, edited 1 time in total.

honya96
100 W
100 W
Posts: 193
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 14, 2018 4:43 pm

casainho wrote:
Jan 14, 2018 1:43 pm
honya96 wrote:
Jan 14, 2018 8:12 am
1. Bug report: PAS at 0 runs motor when pedal rotating backwards.
2. slow reaction to throttle and PAS while running and standstill also.
3. Does not start the motor with a bit of throttle while icon is showing it should run.
1. That is no good :-( -- I guess we really need to try increasing the minimum value PAS cadence in main.h file
2. that is because control algorithm of throttle is slow... and we now know it needs better implementation
3. seems good to me to be like that -- I see throttle, brake, etc symbols like kind of safety, you can verify and don't have bad surprises.
1. happens only with assistance 0
3. Its very annoying that it starts only if you turn it 1/3 atleast so it starts and then back off to get the power you desired.

honya96
100 W
100 W
Posts: 193
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 14, 2018 4:47 pm

geofft wrote:
Jan 14, 2018 2:36 pm
honya96 wrote:
Jan 14, 2018 8:12 am
Bug report: PAS at 0 runs motor when pedal rotating backwards.
Honya, when I had this problem, rather strangely I found it was much worse with 'PAS direction left' selected than it was with right. If you are runnuing PAS left try switching to right (flip the disc over to restore direction) maybe it will help you too...
Thank you. It means flipping 12 magnets one by one after tearing my PAS apart :D Its not that big issue now.. I am allready running another bike with direct motor, and trying the torque simulation branch.

casainho
100 kW
100 kW
Posts: 1226
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 14, 2018 6:04 pm

casainho wrote:
Jan 14, 2018 1:43 pm
3. That may happen because of output voltage of your throttle may have a gap considering the values of ADC:
Go to main.h and adapt that values. But first, with throttle connected, measure the min and max voltages with a multimeter.
0 --> 0 volts
255 --> 5 volts

Code: Select all

#define ADC_THROTTLE_MIN_VALUE 51
#define ADC_THROTTLE_MAX_VALUE 183
I just went to read again what you wrote before: Does not start the motor with a bit of throttle while icon is showing it should run.
Maybe the issue is with our current control algorithm, I don't know.
Last edited by casainho on Jan 15, 2018 4:56 am, edited 1 time in total.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

casainho
100 kW
100 kW
Posts: 1226
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 14, 2018 6:14 pm

stancecoke wrote:
Jan 14, 2018 4:03 pm
mtdr from the German forum has managed to flash the firmware to a KT-SVP7, but the switch to 60°interpolation doesn't work, and with 6-Step the motor (yamaha middrive) stops after a while :-(
I have no idea how to help at the moment
https://www.pedelecforum.de/forum/index ... ost-938489
"The engine needs a full turn of the crank until it starts" <--- I would say the phases / hall sensors signals do not match as on S06S. Maybe the motor rotates but badly and will never work correctly, if the phases / hall sensors signals do not match.
My advice, go only with S06S and S12S.
Developer of the Flexible OpenSource firmware for EBike motor controllers: https://opensourceebikefirmware.bitbucket.io/

User avatar
stancecoke
1 kW
1 kW
Posts: 458
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 15, 2018 2:37 am

casainho wrote:
Jan 14, 2018 6:14 pm
My advice, go only with S06S and S12S.
This advice we would have to give to honya96, too, as he uses a KTE-SVP Board revision also!

regards
stancecoke

Post Reply