XPD: open-source keywin e-bike lab replacement

Get all your technical information about electric bikes here.
Post Reply
aop   10 µW

10 µW
Posts: 5
Joined: Aug 18 2011 3:13pm
Location: Switzerland

Re: XPD: open-source keywin e-bike lab replacement

Post by aop » Aug 19 2011 2:36am

parabellum wrote:
Read before posting please.
@parabellum: I can't follow your ccomment.

I write a feedback of my xpd experience. I exactly followed the approach of anpaza by using the turnigy to check the current and influence of the parameter changement. But apparantly my EB224 controller does not accept some parameters of xpd

Any further feedback are welcome

User avatar
parabellum   10 MW

10 MW
Posts: 2067
Joined: Nov 19 2010 9:55am
Location: Dominican Republic, north.

Re: XPD: open-source keywin e-bike lab replacement

Post by parabellum » Aug 19 2011 11:55am

Then sorry. :D
Have you tried to set the parameters much lower then needed?
Put something like 10A or lower limit on battery current and see what your reading are. Shunt value for battery current can be wrong in the code.
I also noticed that sometimes controller does not take changes even if Ok confirmation comes, can not specify condition of such event. Try to repeat programming until it works.

Edit: In one specific case programming was altered after inrush current conditions, I forgot to shut off mine switch and powered the controller without precharge procedure.

Edit 2: Welcome to the ES aop!

aop   10 µW

10 µW
Posts: 5
Joined: Aug 18 2011 3:13pm
Location: Switzerland

Re: XPD: open-source keywin e-bike lab replacement

Post by aop » Aug 19 2011 2:49pm

parabellum wrote:Then sorry. :D
Have you tried to set the parameters much lower then needed?
Thanx for your help; yes indeed, I already lowered the battery current limit to 8.2 A and even overcurrent delay detection to "serious long 5.0s (with reduced phase current to immediately feel a obviously difference in acceleration, to prevent blown FETs or motor :wink: )" without any change.
parabellum wrote: Put something like 10A or lower limit on battery current and see what your reading are. Shunt value for battery current can be wrong in the code.
I also noticed that sometimes controller does not take changes even if Ok confirmation comes, can not specify condition of such event. Try to repeat programming until it works.
I will! and I want also try a hacked Keywin e-bike lab to compare the results and of course I'll write down my experience in this forum :D.
parabellum wrote: Edit 2: Welcome to the ES aop!
Thank you, pretty cool place here for e-scooter tuning freaks...

User avatar
parabellum   10 MW

10 MW
Posts: 2067
Joined: Nov 19 2010 9:55am
Location: Dominican Republic, north.

Re: XPD: open-source keywin e-bike lab replacement

Post by parabellum » Aug 19 2011 8:10pm

AOP!

I always was tempted to control everything with phase current, in my remote phantasies it is a kind of torque regulation, like ICV. Is it?

aop   10 µW

10 µW
Posts: 5
Joined: Aug 18 2011 3:13pm
Location: Switzerland

Re: XPD: open-source keywin e-bike lab replacement

Post by aop » Aug 20 2011 3:27am

Yes, the phase current is in direct relation to the torque, which means in plain text more current more torque. The voltage makes the speed, simply expressed.

The parameter "battery current limit" is used to limit the maximum power consumption of the motor e.g. limited to 3kW. (at least I think so :wink: )

You can imagine the difference between battery and phase current as that:

P = U x I (electrical approach)
P = 2 x Pi x f x M (mechanical approach)

P = Power
U = Voltage
I = Current

Pi = 3.14...
f = speed (rpm)
M = torque

You accelerate your e-scooter from dead stop to maximum speed, with full throttle:

At start you have the max current but a small feedback voltage (I don't know the correct english expression) over the motors coil. You get a high torque, but speed is still low --> battery power is rather low because of the low feedback voltage.

At the end of acceleration you just need to compensate all resistance (air, roll etc.) the used torque lowers, because you don't have an acceleration anymore, but your feedback voltage is, because the high speed, high too --> battery power is rather low because of the low torque.

Now you can imagine, that something between is the maximum power point, when phase current is lowering and voltage is increasing. There you can use the battery current limit, to keep the motor specifications.

The same considerations work with the mechanical approach as you can see: high torque low speed at start, low torque high speed at the end...

Now to the risks:

Motor:
High current is a higer stress for motors --> more current in the motor coils generates more power dissipation and with that the motor temperature will increase. When the motor windings get too hot the motor damages, due the isolation of the winding wires begin to melt and a short circuit occures.

High voltage for the motor is usually less critical --> but when the voltage gets too high it ist possible that the isolation of the winding is too weak and you get sparks which also damages the isolation of the winiding and so on the motor.

Controller:
Due the power switching silicon elements with their restrictions of voltage and current, both parameters need to be under control. The thermal capacity of the controller case is rather low to a motor. Due that fact, usually the time where you can overcharge the controller is more limited than the motor itself.

Usually we don't have really good and detailed specs of our motors and controllers, so everybody uses more or less a trial and error, or trial and damage approach :D

regards

User avatar
parabellum   10 MW

10 MW
Posts: 2067
Joined: Nov 19 2010 9:55am
Location: Dominican Republic, north.

Re: XPD: open-source keywin e-bike lab replacement

Post by parabellum » Aug 21 2011 8:21am

Thank you for explanation aop. Simply said I just want to skip my battery limit and try run on phase limit only, do not need to protect my LiPos anyway. :D

Have you tried to program your controller with EB218/Lyen instead EB224 (there can be something wrong in the code). The only difference should be few multiplication factors for shunt, R12 etc. values. I can confirm that EB218 works fine(it is a little offset in shunt values only)

aop   10 µW

10 µW
Posts: 5
Joined: Aug 18 2011 3:13pm
Location: Switzerland

Re: XPD: open-source keywin e-bike lab replacement

Post by aop » Aug 22 2011 3:30pm

Yep, have fun with phase current :D

But I need to append, I just explained the common case of accelaration . During accelaration in the flats the current is going down while increasing the speed. But you can overcharge your motor by cruising uphill for a certain time, then you'll need the battery limit, not just to protect your batteries :roll:

I'll check the EB218, thanks for the hint.

User avatar
anpaza   10 W

10 W
Posts: 69
Joined: Dec 07 2010 5:24pm

Re: XPD: open-source keywin e-bike lab replacement

Post by anpaza » Aug 24 2011 11:34pm

aop wrote:I just want to share my first experiences with xpd and an EB224 controller. Don't know the source, but it does not seem one from Lyen. It was build in my chinese electric scooter...
Problem is that the parameters programmed into the controller are highly dependent on the components used in the controller, notably the shunt resistance, battery voltage divider and so on. Perhaps it may even depend on the firmware version number.

Do you have a variant of "Keywin E-Bike Lab" that works with your controller? I usually just peep the parameters that KEBL sends to the controller, then fit them to a linear function and put that function into XPD. If it happens your controller to use a different shunt value, the real currents will be different than programmed.
aop wrote:Anyway, I used the EB224/Lyen settings to programm it and it worked to sucessful download the parameters to the controller. There are just some funny effects I wonder about it:
- "Phase current" changes works --> Accelaration changes --> maximum current on turnigy (wattsup clone) change too
The effect of the "Battery Current" setting may be observed by setting it to something low (e.g. 15A), then accelerating instantly from a dead stop. After a few seconds the battery current will stabilize about the programmed value (or so I expect), until you reach some speed at which the current starts to decrease (due to back-EMF being close to battery voltage). However, Infineon may use much more peak currents due to various reasons, notably the mentioned "Block Time" setting, this is normal. So, no wonder changing phase current indirectly affects peak battery current.
aop wrote:- "Rated current" changes has no influence --> I can not limit the maximum power, which from my understandings should be possible with this parameter
Exactly, that's what this setting is for. Very strange it does not work, have you tried to set it to something very low, like 10A, you will immediately observe the effect, if the setting works :)
aop wrote:- "Block time" changements has no influence on dead stop - accelaration...
I have not experimented with this parameter myself, I can judge what it does mostly from other people's comments.
aop wrote:I wonder are there other (limited) firmwares known on the infineon chips? These controllers just measure the battery rated current, the phase current is calculated, right? The controller has build in 4 shunts in parallel.
I don't know anything about the firmware, this is Highly Closed Source software :) The phase current is calculated from battery current, that's what I think too (something like "Battery Current" / "PWM Duty"). This is what looks strange when I hear that setting the phase current limit works, but battery current limit doesn't. The only thing I may think of is that the controller has a hardcoded battery current limit, thus it ignores the settings coming from XPD.

User avatar
parabellum   10 MW

10 MW
Posts: 2067
Joined: Nov 19 2010 9:55am
Location: Dominican Republic, north.

Re: XPD: open-source keywin e-bike lab replacement

Post by parabellum » Aug 25 2011 10:41pm

anpaza you are cool.
everyone else gust try it and recalculate it if necessary.

User avatar
Floont   1 kW

1 kW
Posts: 439
Joined: Jul 20 2010 1:15pm
Location: Tampa, Florida

Re: XPD: open-source keywin e-bike lab replacement

Post by Floont » Aug 26 2011 3:08pm


:?: Has anyone tried to install the python base installation under Windows 7 (64 bit) and done it successfully? :?:

The final step of the Python install, where pyserial-2.5.win32.exe is installed, fails on my 64 bit machine. The other two msi's seem to install fine under the Program Files(x86)directory.

I just cannot get it to install. Perhaps I need a 64 bit version?

FA
Build 2: (present build): Rear x5304 on full suspension Mongoose, 127v 30s3p 10aH Turnigy Lipo, Lyen 24FET 100amp controller, CA2.2, 26" Hookworm front, 26" Crazy Bob rear, 203mm disc brakes, Airzound horn, twin Blaze 2 watt front lights - BURNED
All my posts on this site are licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License

User avatar
gensem   100 kW

100 kW
Posts: 1461
Joined: Apr 01 2011 5:28pm
Location: Sao Paulo - Brazil

Re: XPD: open-source keywin e-bike lab replacement

Post by gensem » Aug 26 2011 3:18pm

I have it installed on my desk and laptop, and they are using w7 x64.

I dont remember about having any issue to install.

As far I know there is no specific x64 version, but the x86 one available works perfectly.

I woulda try to remove the old installs and install the pre-reqs "As Administrator" in this order:
(just hit next, next, finish.... no need to customize the installs)

python-2.7.1
pygtk-all-in-one-2.22.6.win32-py2.7
pyserial-2.5.win32

After that you should be able to use XPD.
Justin we really appreciate what you did!

User avatar
Floont   1 kW

1 kW
Posts: 439
Joined: Jul 20 2010 1:15pm
Location: Tampa, Florida

Re: XPD: open-source keywin e-bike lab replacement

Post by Floont » Aug 26 2011 5:41pm

gensem wrote:...I would try to remove the old installs and install the pre-reqs "As Administrator" in this order:
(just hit next, next, finish.... no need to customize the installs)

python-2.7.1
pygtk-all-in-one-2.22.6.win32-py2.7
pyserial-2.5.win32

After that you should be able to use XPD.
I uninstalled all three and reinstalled them in the suggested order, but this time I installed pyserial-2.5.win32.exe as an administrator and everything works fine now.

Thanks!!!

FA

PS Now All I have to do is figure out which one of the 9 com port selections is the one to use for my single com port.
Last edited by Floont on Aug 26 2011 6:44pm, edited 1 time in total.
Build 2: (present build): Rear x5304 on full suspension Mongoose, 127v 30s3p 10aH Turnigy Lipo, Lyen 24FET 100amp controller, CA2.2, 26" Hookworm front, 26" Crazy Bob rear, 203mm disc brakes, Airzound horn, twin Blaze 2 watt front lights - BURNED
All my posts on this site are licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License

User avatar
Arlo1   100 GW

100 GW
Posts: 8335
Joined: Apr 26 2009 10:36pm
Location: Nanaimo
Contact:

Re: XPD: open-source keywin e-bike lab replacement

Post by Arlo1 » Aug 26 2011 6:20pm

Floont wrote:
gensem wrote:...I would try to remove the old installs and install the pre-reqs "As Administrator" in this order:
(just hit next, next, finish.... no need to customize the installs)

python-2.7.1
pygtk-all-in-one-2.22.6.win32-py2.7
pyserial-2.5.win32

After that you should be able to use XPD.
I uninstalled all three and reinstalled them in the suggested order, but this time I installed pyserial-2.5.win32.exe as an administrator and everything works fine now.

Thanks!!!

FA

PS Now All I have to do is figure out which one of the 7 com port selections is the one to use for my single com port.
It will show you in device manager
Does your project need a high performance motor drive, battery charger or other power electronics developed? Let's talk!
www.powerdesigns.ca
Leaf motor controller build. http://endless-sphere.com/forums/viewto ... 27#p963227
YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
Never above 4.2v never below 2.7v EVER!!!
Support me on Patreon. https://www.patreon.com/user/posts?u=6842045
http://www.undergroundelectrics.ca/

User avatar
Floont   1 kW

1 kW
Posts: 439
Joined: Jul 20 2010 1:15pm
Location: Tampa, Florida

Re: XPD: open-source keywin e-bike lab replacement

Post by Floont » Aug 26 2011 6:49pm

Arlo1 wrote:It will show you in device manager
Thanks... the device manager clearly shows all 9 there. Of course, 7 are virtual, 1 is an ECP LP1, and the remaining one is the real one, oddly enough assigned COM4.
Build 2: (present build): Rear x5304 on full suspension Mongoose, 127v 30s3p 10aH Turnigy Lipo, Lyen 24FET 100amp controller, CA2.2, 26" Hookworm front, 26" Crazy Bob rear, 203mm disc brakes, Airzound horn, twin Blaze 2 watt front lights - BURNED
All my posts on this site are licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License

User avatar
gensem   100 kW

100 kW
Posts: 1461
Joined: Apr 01 2011 5:28pm
Location: Sao Paulo - Brazil

Re: XPD: open-source keywin e-bike lab replacement

Post by gensem » Aug 26 2011 7:50pm

Floont wrote: Thanks... the device manager clearly shows all 9 there. Of course, 7 are virtual, 1 is an ECP LP1, and the remaining one is the real one, oddly enough assigned COM4.

I knew it woulda be easy! GL with XPD because I find it much better than keywin
Justin we really appreciate what you did!

User avatar
parabellum   10 MW

10 MW
Posts: 2067
Joined: Nov 19 2010 9:55am
Location: Dominican Republic, north.

Re: XPD: open-source keywin e-bike lab replacement

Post by parabellum » Aug 26 2011 10:53pm

Floont, If you connect your adapter first and then start the application, it will track the port automatically. (if you do not have insane serial ports quantity occupied already, I think) :)

User avatar
Floont   1 kW

1 kW
Posts: 439
Joined: Jul 20 2010 1:15pm
Location: Tampa, Florida

Re: XPD: open-source keywin e-bike lab replacement

Post by Floont » Aug 27 2011 7:47am

parabellum wrote:Floont, If you connect your adapter first and then start the application, it will track the port automatically. (if you do not have insane serial ports quantity occupied already, I think) :)
I'm awaiting my Lyen controller to be fixed after spinning the axle in the dropout and shorting all the halls and 1 of the phases. So, I have nothing to test in my single laptop serial port... yet.
Build 2: (present build): Rear x5304 on full suspension Mongoose, 127v 30s3p 10aH Turnigy Lipo, Lyen 24FET 100amp controller, CA2.2, 26" Hookworm front, 26" Crazy Bob rear, 203mm disc brakes, Airzound horn, twin Blaze 2 watt front lights - BURNED
All my posts on this site are licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License

User avatar
Philistine   1 MW

1 MW
Posts: 1732
Joined: Aug 15 2010 7:33am

Re: XPD: open-source keywin e-bike lab replacement

Post by Philistine » Sep 02 2011 4:18am

Sorry if this is a stupid question or is covered in another thread, but I have read elsewhere that the general rule is that phase current should be set to 2.5 times what the rated current is. But on the Lyen 24 Fet defaul settings in this program, when the rated current is 40 amps, the phase current is 120amps (ie, 3 times). My Lyen 24Fet controller came default programmed to 40amps, but I want to reprogram it to 50amps. If I set the rated amps to 50amps, should I make the phase current set to 2.5 times (ie 125) or should I keep the same ratio as above, ie, 3 times (150)?

If any of the guru's here could offer there thoughts I would be hugely appreciative, in idiot checking my proposed program choices (background, this is a 24Fet lyen, running 12S on my Yuba Mundo, with a 5304), which I want to knock up to 50amps:

Battery current: 50amps
Phase Current: 125amps (or should this be 150amps)?
Block time/overcurrent detection: am trying to decide between 0, 1, or 2, I presume a 24 fet/5304 combo could easily handle 1 second, is 2 seconds safe?
Speed: 121% (If I am not using a speed switch, and I set "speed 1" to 121% will this potentially increase my top speed, or have no effect?)

Any thoughts on the above would be hugely appreciated before I exploderise my controller.

User avatar
gensem   100 kW

100 kW
Posts: 1461
Joined: Apr 01 2011 5:28pm
Location: Sao Paulo - Brazil

Re: XPD: open-source keywin e-bike lab replacement

Post by gensem » Sep 02 2011 8:11am

Phil.. for a controller of that size, I guess it doesnt matter. The phase current will lower your voltage and raise your current if needed when rpm is low. Im gessing the rule of thumbs is 2.5-2.6 because most hubs work ok with that setting and going much further ll blow fets easier. Give it a try at 3x, I dont think you can hurt a controller thats 10kw factory rated before melting your hub motor.

BR
Justin we really appreciate what you did!

User avatar
Philistine   1 MW

1 MW
Posts: 1732
Joined: Aug 15 2010 7:33am

Re: XPD: open-source keywin e-bike lab replacement

Post by Philistine » Sep 02 2011 8:16am

Thanks Gensem - I will give it a go. I figured I should be fine but wanted to check. This will be my first time programming, so just wanted to make sure I was on the right track.

User avatar
Arlo1   100 GW

100 GW
Posts: 8335
Joined: Apr 26 2009 10:36pm
Location: Nanaimo
Contact:

Re: XPD: open-source keywin e-bike lab replacement

Post by Arlo1 » Sep 02 2011 9:12am

Philistine wrote: (If I am not using a speed switch, and I set "speed 1" to 121% will this potentially increase my top speed, or have no effect?)

Any thoughts on the above would be hugely appreciated before I exploderise my controller.
Set all three speed settings to what you want if you are not useing the switch. I think the switch off is setting 2 but its nice to be sure by having them all set there.

I did a string of tests on my little dyno with my x5 and my highly modded 24 fet controller. This is one of the best settings. I found to hi of phase amps made the motor hot to fast and I lost HP. I had to tie my bike down tight so it is poissible it makes a bit more hp but I think this is the highest HP I made. Also the shut is a strech of copper tubing so the Phase amps and battery amps are off ~3-4x what it says!
Does your project need a high performance motor drive, battery charger or other power electronics developed? Let's talk!
www.powerdesigns.ca
Leaf motor controller build. http://endless-sphere.com/forums/viewto ... 27#p963227
YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
Never above 4.2v never below 2.7v EVER!!!
Support me on Patreon. https://www.patreon.com/user/posts?u=6842045
http://www.undergroundelectrics.ca/

User avatar
gensem   100 kW

100 kW
Posts: 1461
Joined: Apr 01 2011 5:28pm
Location: Sao Paulo - Brazil

Re: XPD: open-source keywin e-bike lab replacement

Post by gensem » Sep 02 2011 12:28pm

Arlo, how ll us be able to know how much current you actually using with that much solder in the shunt? I was not able to see it in the video.
Btw have you seen the x5404 selling thread?
Last edited by gensem on Dec 06 2011 8:55pm, edited 1 time in total.
Justin we really appreciate what you did!

User avatar
Arlo1   100 GW

100 GW
Posts: 8335
Joined: Apr 26 2009 10:36pm
Location: Nanaimo
Contact:

Re: XPD: open-source keywin e-bike lab replacement

Post by Arlo1 » Sep 02 2011 1:10pm

I watch my CA readings it is calibrated proerly. I can pull crazy power wheelies with 200+ amps but the motor gets hot instantly!
Does your project need a high performance motor drive, battery charger or other power electronics developed? Let's talk!
www.powerdesigns.ca
Leaf motor controller build. http://endless-sphere.com/forums/viewto ... 27#p963227
YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
Never above 4.2v never below 2.7v EVER!!!
Support me on Patreon. https://www.patreon.com/user/posts?u=6842045
http://www.undergroundelectrics.ca/

User avatar
Floont   1 kW

1 kW
Posts: 439
Joined: Jul 20 2010 1:15pm
Location: Tampa, Florida

Re: XPD: open-source keywin e-bike lab replacement

Post by Floont » Sep 02 2011 7:29pm

gensem wrote:...
BTW have you seen the x5404 selling thread?
I think we've all discussed it in the facebook - Endless Sphere group.

But thanks for the mention. We're getting close to the magic number to place the bulk order.
Build 2: (present build): Rear x5304 on full suspension Mongoose, 127v 30s3p 10aH Turnigy Lipo, Lyen 24FET 100amp controller, CA2.2, 26" Hookworm front, 26" Crazy Bob rear, 203mm disc brakes, Airzound horn, twin Blaze 2 watt front lights - BURNED
All my posts on this site are licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License

User avatar
parabellum   10 MW

10 MW
Posts: 2067
Joined: Nov 19 2010 9:55am
Location: Dominican Republic, north.

Re: XPD: open-source keywin e-bike lab replacement

Post by parabellum » Sep 02 2011 10:58pm

Floont wrote:
gensem wrote:...
BTW have you seen the x5404 selling thread?
I think we've all discussed it in the facebook - Endless Sphere group.

But thanks for the mention. We're getting close to the magic number to place the bulk order.
Cant find this group somehow. Can you give me a link please?

Post Reply