XPD: open-source keywin e-bike lab replacement

Get all your technical information about electric bikes here.
User avatar
Hyena   100 GW

100 GW
Posts: 5628
Joined: Aug 13 2008 9:10am
Location: Sydney, Australia
Contact:

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

Post by Hyena » Jul 09 2012 8:33pm

Welcome back Anpaza, great work!

Rather than guessing the shunt and current values is there any facility in the program to enter a defined Rshunt value ?
Presumably this is what is done by selecting the controller type from the drop down menu (ie for a 12 fet it expects X shunt value, for a 9 fet it expects less etc) I guess for people who don't know their shunt resistance just selecting the controller type is easy but for those of us customising our controllers (whichis what this software is all about) a list of selectable shunt resistances would alloy you to more accurately program a variety of controllers
www.HyenaElectricBikes.com
Aussie high powered e-bike kits and custom performance ebikes
New FUTR and Hyena special edition Beta frames now available!
My build and HD video thread____. My youtube channel____ Hyena Facebook page
My bike is writing cheques my body can't cash...

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 » Jul 10 2012 3:29am

I've received this proposal many times in the past.
However, beside the shunt resistance, there are other unknowns in the equation:
- What is the amplification factor of the opamp amplifier?
- What is the reference voltage of the microcontroller?

I've looked at the schematics of some XC846-based controller which I found somewhere. Looks like reference voltage is 5V. In this case the battery voltage measuring resistor divider, which is 1.2k/15k on that schematics, will achieve 5V on output at 67.5V. But the maximal voltage the controller "sees" with this divider is over 75V. Thus, there's something I don't understand here.

Also, the amplification coefficient of the opamp could be calulated if I know the shunt resistance and reference voltage. But I'm not convinced reference voltage is 5V, and I don't know the shunt resistance for different controllers. Is there some place where I can find the shunt resistance for all EB2xx and EB3xx controllers of all existing modifications (Lyen, ecrazyman, cellman)?

electraflyit   10 W

10 W
Posts: 78
Joined: Jul 08 2008 12:19am
Location: Toowoomba, Queensland

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

Post by electraflyit » Jul 11 2012 1:28am

Those with a CA connected will know the shunt resistance of their controller, because it has to be set to get the correct amp reading.
I should add 'only with unmodded shunts'.
Eddie

User avatar
boostjuice   10 kW

10 kW
Posts: 959
Joined: Jul 27 2008 8:50am
Location: Canberra, Australia

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

Post by boostjuice » Jul 11 2012 2:13am

Anpaza, Would you be able to add selectable XPD profiles for EB324 and EB336 controllers? I have one of the latest revision (EB3 with Sunplus 65SF112A MCU) 36FET controllers from Keywin i would like to program.
Last edited by boostjuice on Jul 11 2012 10:05pm, edited 1 time in total.

zombiess   100 MW

100 MW
Posts: 2911
Joined: Feb 01 2011 2:16am
Location: Ventura

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

Post by zombiess » Jul 11 2012 9:55am

boostjuice wrote:Anpaza, Would you be able to add selectable XPD profiles for EB324 and EB336 controllers? I have one of the latest revision (EB3 with Sunplus 65SF112A MCU) version 36FET controllers from Keywin i would like to program.
When did those come out? Ive only seen eb224 and eb236 using the 116 ecu. If they ate eb3 they should use the gpm8f ( something close to that) ecu.

pwbset   1 MW

1 MW
Posts: 1580
Joined: Apr 23 2008 8:29pm
Location: Montana

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

Post by pwbset » Jul 11 2012 12:37pm

amberwolf wrote:I skimmed thru the thread and the XPD (and python) websites, and didn't see any info on troubleshooting XPD on a Mac.
I would also LOVE to see XPD running on a Mac as it's all I use. I do have access to a Windows 7 VirtualBox image at work so might try that, but Mac support would be killer.

User avatar
amberwolf   100 GW

100 GW
Posts: 29879
Joined: Aug 17 2009 6:43am
Location: Phoenix, AZ, USA, Earth, Sol, Local Bubble, Orion Arm, Milky Way, Local Group
Contact:

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

Post by amberwolf » Jul 11 2012 2:39pm

AFAIK there's no specific reason it shouldn't run on a mac with OSX; I just don't know how to do it myself yet, and haven't had time to troubleshoot much. I expect all that needs to be done is A) have a new enough version of Python (I think I have the latest OSX 10.4 compatible off the Python site), have serial.py in the right place, and use the right sequence of events to startup Python and XPD. Just have to figure out those things and I bet it will work.

pwbset   1 MW

1 MW
Posts: 1580
Joined: Apr 23 2008 8:29pm
Location: Montana

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

Post by pwbset » Jul 11 2012 4:23pm

amberwolf wrote:Just have to figure out those things and I bet it will work.
I wonder about USB drivers etc... maybe I'll play around with it and see what happens. I code PHP for a living (not well or anything though haha) so can probably digest the Python, but talking to ports... meh... we'll see...

User avatar
amberwolf   100 GW

100 GW
Posts: 29879
Joined: Aug 17 2009 6:43am
Location: Phoenix, AZ, USA, Earth, Sol, Local Bubble, Orion Arm, Milky Way, Local Group
Contact:

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

Post by amberwolf » Jul 11 2012 5:18pm

The driver might be an issue, but there should be OSX drivers for at least the common chip(s). My issue is getting XPD to run *at all*, because I don't actually know what I'm doing with the Mac anymore. :oops:

A google search for drivers does turn up some; haven't tested any.
http://www.google.com/search?q=OSX+10.4 ... ial+driver

User avatar
Alan B   100 GW

100 GW
Posts: 7741
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

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

Post by Alan B » Jul 11 2012 9:31pm

The Python code and GUI should be portable. Drivers for USB serial adapters are usually available. It looks like the PySerial module should work on both PC and Mac. So there's a good chance it will work, or can be fixed.

I have complicated Pythong GUI programs that have ported to MaxOS with no changes, though they didn't involve serial.

User avatar
boostjuice   10 kW

10 kW
Posts: 959
Joined: Jul 27 2008 8:50am
Location: Canberra, Australia

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

Post by boostjuice » Jul 11 2012 10:04pm

zombiess wrote:
boostjuice wrote:Anpaza, Would you be able to add selectable XPD profiles for EB324 and EB336 controllers? I have one of the latest revision (EB3 with Sunplus 65SF112A MCU) version 36FET controllers from Keywin i would like to program.
When did those come out? Ive only seen eb224 and eb236 using the 116 ecu. If they ate eb3 they should use the gpm8f ( something close to that) ecu.
According to Keywin, the 65F112A is a Sunplus clone of the 8B116. Does that mean the board should be programmed as an eb2xx?

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 » Jul 13 2012 4:04pm

boostjuice wrote:Anpaza, Would you be able to add selectable XPD profiles for EB324 and EB336 controllers? I have one of the latest revision (EB3 with Sunplus 65SF112A MCU) 36FET controllers from Keywin i would like to program.
Do you have the Keywin E-Bike Lab with support for those controllers? Right now I'm taking controller parameters from KEBL.

Perhaps, I'll add later the possibility to add new controller definitions if you know several hardware parameters (shunt resistance, voltage divider etc).

User avatar
boostjuice   10 kW

10 kW
Posts: 959
Joined: Jul 27 2008 8:50am
Location: Canberra, Australia

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

Post by boostjuice » Jul 16 2012 2:51am

anpaza wrote:
Perhaps, I'll add later the possibility to add new controller definitions if you know several hardware parameters (shunt resistance, voltage divider etc).
That'd be a great help to others in the future. I'll read/measure them for you (4 wire method for the shunt wires)

User avatar
hillzofvalp   1 MW

1 MW
Posts: 1876
Joined: Dec 26 2010 2:09am
Location: Los Angeles, CA

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

Post by hillzofvalp » Jul 16 2012 10:21pm

Yeah, with my EB318, the current entered into XPD has to be twice my intended value. i.e., opposite what was said for the EB312 My CA is calibrated, and it is reading 48.8A to a 89.8A setting in XPD. THat should be giving me a theoretical 44.9A +/-1%, but it's giving me a 8% overshoot (even with block time set at 0.0s). I don't know what's to fault...tolerance of the board measuring circuitry I suppose.

Unlimited regen unloaded is much smoother than setting 2. On the road, it seems much smoother. I'm going to try to turn up the phase amps (one thing at a time) now because I had it set at 80A and must've been getting 40A.

update: I know that usually there will be peaks on the cycle analyst above the cycle analyst's current limit. I've had this controller programmed through keywin to 99A and have been running it at 77A limited by CA. During that time I saw peaks of 78-79A. Now, when I set current to 192.5 (96.25A) in XPD, I see peaks of 102A when the cycle analyst was limited to 95A.

While I don't have a clamp to measure phase current and confirm this, I can probably say the same is true for phase current (programmed value/2=actual). To get to my intended 140 phase amps, I will have to program for 280 phase amps :twisted:

zombiess   100 MW

100 MW
Posts: 2911
Joined: Feb 01 2011 2:16am
Location: Ventura

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

Post by zombiess » Jul 17 2012 1:30am

hillzofvalp wrote: While I don't have a clamp to measure phase current and confirm this, I can probably say the same is true for phase current (programmed value/2=actual). To get to my intended 140 phase amps, I will have to program for 280 phase amps :twisted:
I'm not so sure, my experience with EB3 boards has shown me that the phase setting appears to be independent of the shunt value. I modded the shunt on my 18 FET controller from 1.25mOhm to 0.5mOhm and regen did not increase at all and when I turned down the phase current it wasn't even ride able it was so slow, I had to leave my phase current at the original setting and adjust the battery amps in order to dial in the performance. I suspect the EB3 boards might be doing something different with the phase current and ignoring the shunt unlike the the EB2xx boards which had a correlation between battery A, phase A and lower shunts than expected.

For example, with my 1.25mOhm shut EBS setting of 2 no mods my bike would pull about 17A max during regen. After modding the shunt to 0.5mOhm and an EBS setting of to my bike would still only pull 17A max during regen. The shunt was calibrated for each test.

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 » Jul 17 2012 6:35am

hillzofvalp wrote:Yeah, with my EB318, the current entered into XPD has to be twice my intended value. i.e., opposite what was said for the EB312
Pretty interesting.

a) Could you explain what and where was said about EB312?
b) What EB318 do you have? From Lyen, from CellMan, from e-crazyman? With all these "mods" around it's pretty hard to follow.

If you definitely have a Lyen or e-crazyman EB318 (which is named simply "EB318" in XPD) and there's a noticeable difference when programming your controller with XPD on one side, and unmodified "EM3EV.exe" or "Lyen MK.exe" software on other side, I'd like to know that.

If this confirms, I'd like to have the program you used to program your controller. I've checked the final binary output that goes into controller when using "Lyen MK2.exe" and XPD, and it's pretty much the same; there are some (very) minor differences due to different numbers rounding etc, but not something as big as a twofold difference in current settings. I'll double-check it again specifically for EB318 when I'll have some time to work on XPD.
hillzofvalp wrote:Unlimited regen unloaded is much smoother than setting 2. On the road, it seems much smoother. I'm going to try to turn up the phase amps (one thing at a time) now because I had it set at 80A and must've been getting 40A.
"Unlimited regen" feature is still unconfirmed on EB3xx controllers. It seemed to work on EB2xx, but I don't have any numbers on the EB3xx series.

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 » Jul 17 2012 6:46am

zombiess wrote:
hillzofvalp wrote: I'm not so sure, my experience with EB3 boards has shown me that the phase setting appears to be independent of the shunt value. I modded the shunt on my 18 FET controller from 1.25mOhm to 0.5mOhm and regen did not increase at all
As far as I know, the shunt value does not influence regen in any way. The reason is that the current measuring circuitry (notably the shunt voltage amplifier) does not "see" negative currents. For the microcontroller it's the same as 0 amps.

Thus the regen setting works by limiting PWM duty cycle. Anyway, even at the "unlimited" setting Infineon doesn't do everything that can be done, because the regeneration with MaxController on the same hub motors is much stronger than with Infineon (and works almost until full-stop).

User avatar
hillzofvalp   1 MW

1 MW
Posts: 1876
Joined: Dec 26 2010 2:09am
Location: Los Angeles, CA

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

Post by hillzofvalp » Jul 17 2012 9:28am

anpaza wrote:
For now I know about CellMan's controllers, he recommends programming his EB306 & EB309 by choosing EB312 in KEBL/XPD, and his EB312 by choosing EB312 and setting the current value twice smaller than desired.
My eb318 is a lyen. Programming with xpd at 200 phase amps and 192A battery makes it feel smoother and maybe even faster than when I program at 145 phase amps and 99 battery amps on keywin... But the motor isn't as warm. I will have to investigate this today at higher phase amps setting.. I tested it last night when, as you know, everything feels faster.

First thing I will try is the current settings but with EBS set to strong (2) like it was before. Then I will increase phase amps until regen feels like it did with the highest setting in lyen mk2? From what I have been able to record so far, I'm pretty sure phase amp setting directly effects unlimited regen strength.

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 » Jul 17 2012 9:55am

192A battery? are you sure?
Justin we really appreciate what you did!

User avatar
hillzofvalp   1 MW

1 MW
Posts: 1876
Joined: Dec 26 2010 2:09am
Location: Los Angeles, CA

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

Post by hillzofvalp » Jul 17 2012 12:55pm

Yeah! I have to program double my intended output.

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 » Jul 17 2012 1:00pm

hillzofvalp wrote:Yeah! I have to program double my intended output.
bleh... i tought that it was 190a for real. hehe
Justin we really appreciate what you did!

itchynackers   100 kW

100 kW
Posts: 1081
Joined: Dec 27 2009 11:11am
Location: Janesville, WI

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

Post by itchynackers » Jul 19 2012 5:13pm

I'm having a problem with this software. Maybe a computer guru could help me.

History:
At one time, I had this software working perfectly on my Windows 7 64 bit machine. Now, due to my computer being wiped, I've had to re-install the xpd software. Seemed to install ok. Then, the first time I tried to re-program my controller, the computer looked like it was searching for a driver for the usb cable I just plugged in. I don't think it installed. Now, when I try to program, I plug in the usb, and the computer makes a little noise (like it is seeing the cable), but the xpd software won't let me select any port. Anyone know what I could try? I'm about as dumb as a doughnut when it comes to computers.

Thanks,
Adam
9c 9x7f w/ 12awg phases
9c 8x8r w/ 10awg phases, temp sensor, vented
9c 6x10r w/ 10awg phases, temp sensor, liquid cooled, 3rd Place Pikes Peak 2012!

"Don't argue with the galactically stupid...they drag you down to their level and beat you with experience"

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 » Jul 19 2012 7:45pm

You need the driver for the USB to serial adapter (it doesnt come with XPD)
Gimme a sec I ll find the driver for you.

Edit: files attached... Install the driver with the USB cable disconnected.
Im almost sure you got a counterfeit one, coz all my TTLs are made with fake chips. So please install the driver that works with the counterfeit first.
Attachments
Profilic_Counterfeit_Chipset.zip
(1.77 MiB) Downloaded 174 times
Prolific_Original_Chipset_v1.6.1.zip
(3.25 MiB) Downloaded 154 times
Last edited by gensem on Aug 28 2012 7:23pm, edited 1 time in total.
Justin we really appreciate what you did!

DAND214   1 GW

1 GW
Posts: 3231
Joined: Aug 10 2008 8:28pm
Location: About 1200 miles south of Chicago, in sunny/rainny Port Richey, Florida!

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

Post by DAND214 » Jul 19 2012 11:48pm

Thanks I needed that driver too.

Dan

itchynackers   100 kW

100 kW
Posts: 1081
Joined: Dec 27 2009 11:11am
Location: Janesville, WI

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

Post by itchynackers » Jul 20 2012 7:03am

Thanks GENSEM! You are a gentleman and a scholar. The counterfeit one worked for me.

Adam
9c 9x7f w/ 12awg phases
9c 8x8r w/ 10awg phases, temp sensor, vented
9c 6x10r w/ 10awg phases, temp sensor, liquid cooled, 3rd Place Pikes Peak 2012!

"Don't argue with the galactically stupid...they drag you down to their level and beat you with experience"

Post Reply