## New Open Source E-Bike/E-vehicle calculator & simulator

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

Okay, so just letting any other possibly interested developers what's going on (There doesn't seem to be much of those, but just in case. )

I'm trying to incorporate inductance modeling. I reasoned my own solution to the inductance modeling, and the resulting graph in the non-current limited region (The right of the "knee") seems to result in motor torque remarkably similar to ebikes.ca. That's good, even though I'm sure our equations are not that identical.

But, moving to the left of the graph's, I can't seem to come up with a formula that'll transition smoothly into the current limited region. It's either too high or too low and there doesn't really seem to be a "neat" solution (At least it's not obvious to me so far). So I'm wondering if this is why ebikes.ca eventually came up with an iterative approach to experimentally solving the problem because there isn't a formulaic solution.

swbluto
10 GW

Posts: 4424
Joined: Fri May 30, 2008 5:23 pm

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

Okay, so I went back to re-implementing the ebikes.ca code and in the gap around 150 rpm and below where the results are invalid, I just used the simple resistive model because inductance makes little difference at those low RPMs. Resultingly, there's a "little jump" at that point of transition, but it seems negligible for most practical concerns.

After implementing the ebikes.ca code, I noticed that the battery current and motor current curves are slightly off from what you'd expect. While I messed around with a variable that I could've influenced (Our K factors seem to be off by a factor of around 10), that didn't seem to affect it. So, I'm thinking that's an artifact of the iterative experimental approach of solving the motor current and battery current problem, and it's not apparent on ebikes.ca's curves because they don't tell you the battery current nor motor current.

(The problem is that the motor current and battery current values diverge by 1 to 5 amps when they're supposed to be equal (Motor current > battery current) and the battery current isn't limited at exactly its battery current limit. It's more that battery current limit - .5 amps, but it converges to the actual limit at lower RPMs.)

Anyways, I'm thinking of releasing it in current's state but the curves are just funny. It doesn't really reflect my attention to precision since it's ebikes.ca's "good enough" code, but on the other hand, it makes such a small difference from what you'd actually experience in real life, that it doesn't really functionally matter.

If I release it, I'm thinking of making it a "special version" with a particular emphasis on... it's ebikes.ca's formulas, don't blame me. What do y'all think?

(Btw, I'm not saying the curves are "wrong" although they might be, it's just a little funny looking.)

swbluto
10 GW

Posts: 4424
Joined: Fri May 30, 2008 5:23 pm

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

SW, a few months ago I did a bit of work on making the program read a text file for motor info, and fill in the list, rather than having all that data hard coded. I just checked out your newest code, and merged my changes. Is that something you would want me to commit?

I would also like to let ya know... I don't know exactly how well the new formulas are calculating everything. It seems like the efficiency is incredibly low compared to what it should be, and so is the total power out. Also, the "power required" in graphing is broken for me. Haven't had a chance to look into it yet.
tostino
100 kW

Posts: 1036
Joined: Mon Mar 24, 2008 4:12 pm
Location: New Port Richey, FL

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

Sure, commit it!

I'll have to look at the latest release when I get to the work station. I've been trying to add inductance modeling to the code and have been doing some refining, and I haven't uploaded that version to the repository yet. If you can send an .esim file that demonstrates the problems you're noticing, that'd be great. If you let me know what output you were expecting, I can probably pinpoint any possible problems faster.

swbluto
10 GW

Posts: 4424
Joined: Fri May 30, 2008 5:23 pm

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

I'll commit it asap then, i'll just need ya to add me to the team on Assembla. Same username as on here.

And lets see... here are a couple .esim's (one for the new version, one for the old).

Edit: that is not a real world proven setup (yet...) I will make a save of the current bike I have that matches it's performance and attach that too.

Edit#2: okay, the .esim files of my current bike must be on my home computer, i'll see if I can find them when I get home.
Attachments
Saves.rar
tostino
100 kW

Posts: 1036
Joined: Mon Mar 24, 2008 4:12 pm
Location: New Port Richey, FL

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

Okay, an invitation has been extended. If the code you're referring to is the "revision 4", yeah, that hasn't been released yet and it's definitely no-good. I have some code that I haven't uploaded yet that's a bit more accurate (And the user can choose between inductive and simple resistive modeling, depending on which they think is more applicable.)

swbluto
10 GW

Posts: 4424
Joined: Fri May 30, 2008 5:23 pm

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

Ahh yeah I meant revision 4. When you said not released, I thought you meant that it wasn't even on the svn. Alright, now i'm on the same page!

And thanks for the invite!
tostino
100 kW

Posts: 1036
Joined: Mon Mar 24, 2008 4:12 pm
Location: New Port Richey, FL

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

Just wanted to bump this and say that i've spent the past couple days coding (without all that much to show for it honestly). I committed my changes to the svn, and I still have more work to do. I reverted the inductance code from v4, because it is not working correctly. We need to get a stable version on the svn, then work on the inductance code (I won't be much help I don't think =/).

I also disabled the motor current limiting until I can make sure that it models it correctly (which I wasn't sure of last night).

I added the ability for the program to read the motor info from a text file, rather than having it hard coded. That way we can add new motors easily and quickly.

Some UI errors have been fixed as well.

More work to do! Hopefully I will have a little time this weekend =).
tostino
100 kW

Posts: 1036
Joined: Mon Mar 24, 2008 4:12 pm
Location: New Port Richey, FL

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

Grrr! Well I fixed a few more things such as the graph generating correctly with the Power Needed lining up and all, and I am trying to work on having it tell you predicted quarter mile times... I am just having a hard time with the math for it =/. Anyone have any ideas?

I honestly have no idea how I can put in a distance, and have it tell me the time it takes to get to it... I fail lol.

Edit:
Gah! I thought I had it... but for some reason when I try and feed getDistance() a time, it doesn't return anything... and I don't know where it is looking for info it doesn't have... The only place I see it used is in TimeGraph.java (and it works just fine when used there exactly the same way as I am trying to use it).
tostino
100 kW

Posts: 1036
Joined: Mon Mar 24, 2008 4:12 pm
Location: New Port Richey, FL

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

Hey guys,

Totally not related, but I tried to make a spreadsheet to calculate heating a battery pack due to Ri. https://spreadsheets.google.com/ccc?key ... y=COLxqNYI

I know it's inaccurate because it doesn't take into account Ri change as a result of heat or SOC (among other things), but I thought you might be interested in it. Maybe you can make something useful with the idea?

auraslip
1.21 GW

Posts: 3646
Joined: Fri Mar 05, 2010 5:19 pm

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

Hey boys i try to download SWbluto simulator, but the file is corrupted...
Can you help me?
Thanks
esoria
100 W

Posts: 128
Joined: Tue Sep 07, 2010 4:57 am

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

esoria wrote:Can you help me?

I just tried to download the versions posted here and found them to be corrupted too. Best thing I can come up with short of getting Netbeans and building it is going to http://www.assembla.com/code/ebikecalcu ... des/EvCalc and get the zip there. Or you could look at the previous revisions to get an older one. Hopefully only a correctly built file was committed. Thats what I am trying anyhow. -Damcard

damcard
100 W

Posts: 286
Joined: Mon Feb 02, 2009 6:15 pm
Location: San Antonio, TX

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

Worked for me. I unzipped it to a directory (in my case '/home/david/Desktop/ebikecalc/EbikeCalc17'). Opened a console in that directory and ran 'java -jar /home/david/Desktop/ebikecalc/EbikeCalc17/EvCalc.jar ebikecalc2.mainFrame'. I have version 1.6.0_24 on 64 bit Ubuntu. -Damcard

damcard
100 W

Posts: 286
Joined: Mon Feb 02, 2009 6:15 pm
Location: San Antonio, TX

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

Thanks boys
esoria
100 W

Posts: 128
Joined: Tue Sep 07, 2010 4:57 am

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

Give me a bit if you want my latest revision... i'll zip it up and post it here.
tostino
100 kW

Posts: 1036
Joined: Mon Mar 24, 2008 4:12 pm
Location: New Port Richey, FL

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

I will be one of the thankfull waiters thanks for your work!
Felt beer-cruiser MAC 8T lifepo4 36V12AH 12FETS4110 http://www.bavarian-ebikes.com

dodjob
100 W

Posts: 292
Joined: Wed Jun 30, 2010 3:46 pm

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

I've downloaded the zip file to my puter a few times, but when I try to open it up, Windows 7 sez "Windows cannot open the folder. The compressed (zipped) Folder xxxxx is invalid."

Is it something on my end? I appear to be able to open other zip files - was this maybe corrupted by the upgrade that toasted the pictures?

-JD

Knowledge is acquired through experience, everything else is just information - Albert Einstein
"Cheater?" I'm not competing, I'm Commuting!

oatnet
100 MW

Posts: 2507
Joined: Thu Apr 26, 2007 3:03 pm
Location: SoCal, USA

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

I get an error as well in Window 7. I am using Winzip to extract. I get a "start of central directory could not be found; Zip file corrupt. Possible cause; file transfer error."

I tried it 3 different times on 2 different PCs. I also tried it to a Windows server and it couldn't open it either.
Taz
100 mW

Posts: 35
Joined: Tue May 17, 2011 10:13 pm

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

Taz - I've uploaded it on my site - it's a fresh compression so it should work https://sites.google.com/site/shelbyele ... /tech-docs

Does anyone have any ideas on how I could use this to model using two hub motors at once?

auraslip
1.21 GW

Posts: 3646
Joined: Fri Mar 05, 2010 5:19 pm

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

damcard wrote:
esoria wrote:Can you help me?

I just tried to download the versions posted here and found them to be corrupted too. Best thing I can come up with short of getting Netbeans and building it is going to http://www.assembla.com/code/ebikecalcu ... des/EvCalc and get the zip there. Or you could look at the previous revisions to get an older one. Hopefully only a correctly built file was committed. Thats what I am trying anyhow. -Damcard

Any instructions on how to install/run this simulator? I can't unzip the original and don't know what to do w/ the files listed at the site above. Thanks.
Youtube channel, 2011 Highlights vid. Ebike Nerdcast.
Giant DH Comp: 20s lipo (10Ah), hs3540, 72V 45A 12FET, 900W BMSBattery charger.
GT I-Drive, 20s lipo, 9C, 72V 45A 12FET.

GCinDC
1 GW

Posts: 3457
Joined: Fri Jan 23, 2009 11:19 am
Location: Washington, DC

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

http://www.endless-sphere.com/forums/viewtopic.php?f=18&t=19548 - Ebike Nerd Podcast
Thanks to Justin @ ebikes.ca! Go there, buy stuff. Support the Revolution

grindz145
100 MW

Posts: 2667
Joined: Tue Apr 07, 2009 12:10 pm
Location: Rochester NY

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

Bumping this to find out if there is an update available anywhere or a working version?
Greyborg Hub Motor, Lyen 18FET, Customized full suspension kids MTB. Top Speed 61 MPH
9C 8x8, 24S2P LiPo, Lyen 12 FET, Diamondback Recoil Comp. Top Speed 42 MPH
GreyborgUSA Dealer
zombiess
100 kW

Posts: 1491
Joined: Tue Feb 01, 2011 2:16 am
Location: Ventura

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

That one seems dead a long time.

Justin's simulator is now much better than before:
http://www.ebikes.ca/simulator/
Skippic
100 W

Posts: 217
Joined: Tue Jun 22, 2010 11:23 pm
Location: Bratislava, Slovakia

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

Skippic wrote:That one seems dead a long time.

Justin's simulator is now much better than before:
http://www.ebikes.ca/simulator/

Sure is, but you can't input custom motors to simulate so it doesn't work for me.
Greyborg Hub Motor, Lyen 18FET, Customized full suspension kids MTB. Top Speed 61 MPH
9C 8x8, 24S2P LiPo, Lyen 12 FET, Diamondback Recoil Comp. Top Speed 42 MPH
GreyborgUSA Dealer
zombiess
100 kW

Posts: 1491
Joined: Tue Feb 01, 2011 2:16 am
Location: Ventura

### Re: New Open Source E-Bike/E-vehicle calculator & simulator

Hello all! I thought there was a working zip somewhere earlier in this thread, but if it's not working anymore, I'll upload one later on today. Thanks for bringing it to my attention! I want you guys to get your awesome e-bikes rolling as soon as possible and spread word of THE REVOLUTION!

swbluto
10 GW

Posts: 4424
Joined: Fri May 30, 2008 5:23 pm

PreviousNext