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

Get all your technical information about electric bikes here.

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

Postby swbluto » Fri Oct 10, 2008 3:29 pm

The latest (vastly improved version) is going to be either on the last page or the next to last page. The version listed below was the original version that only works for Windows and Linux.

Hello all. I created this program just for curiosity's sake and also the sake of me needing to choose the right motor and gear ratios for my soon-to-be electric scooter to perform upto the desired specs. It is here I release it to the community and to indulge in however you wish. Since it's a java applet, it requires a java-enabled browser which I've heard to be claimed to be nearly universally compatible with browsers. If you can't view it, you probably need to download the Java Runtime Environment(Google "JRE") or use whatever your browser might suggest.

Here's a test to see if you're java enabled

It can be viewed here.

Update: For those with compatibility issues, I've ported this to a stand-alone application(But the application still requires the "java libraries" to be installed). The program-version is here. Since this is my first application and I didn't take the time to completely learn stand-alone application programming, exiting requires pressing the "file" tab and clicking exit. The little red 'x' in the corner does nothing. Explanations for the variables can be found on the original online page, http://www.geocities.com/swbluto4gems/classes/SpeedPrediction.htm.

Right now it's in the "Beta testing version", so I'm looking for testing! Basically, this provides your top-speed under the given conditions you specify and if you can report this calculator's prediction and your in-real-life speed, that'd be wonderful! Also, I'm looking to make it more user-friendly, clear and accurate, so any suggestions are welcomed! In fact, I encourage them! Also, if you feel there should be other features, please say so. Some features, like those involving graphs, would take some time for me to investigate so those probably won't be coming for a week. However, if you like more specs like battery current demanded, motor current, power, etc., feel free to make the request! And, also, if anyone thinks the layout is awful, I can upload the User-Interface file which you can edit as you please in NetBeans (A java IDE Gui program.) or you can make suggestions. If any of the interface seems too vague or not clear(like the resistance doesn't specify units of ohms even though that's what it works with), be sure to mention it!

Planned and upcoming features(as of October 10th, 2008):

Completed
-Adding functionality to account for excessive motor heating. Basically, the user would put in the motor's winding's temperature.
-Air density that is automatically calculated from user-specified temperature and altitude.
-Pop-up to alert of missing necessary input.


More upcoming features(As of October 22nd):

-incorporating automatic design optimization
-Adding scroll bars
-Investigating and eventually adding graphing capability(Might not work on all systems as the graphing engine isn't necessarily multi-platform)
-Trying to make compatible with Mac-based systems in some way, shape or form due to Java 5 antiquities.
-Convert to calculate based on Forces as opposed to Power.
-Adding a combo box to allow users to choose their particular gear combinations, with appropriate boxes provided for each.
-Eventually... eventuallllllly document everything and provide links and other useful information to help decide a few values that might be differ depending on your application(Like, say, the frontal area of a motorcycle is usually higher than a bicyclist which this was based on, but a recumbent is less. Having a quick picture guide might help.).
-include no-load current to increase accuracy in general, and efficiency and heat generation in particular.

And I hope to fix a few design flaws that don't impose on normal usage, but could be errant for some combinations. Hopefully, I can make it so that it's more accurate for brushed motors for those that use brushed motors; The current code base is built around the brushless motors assumption which might provide inaccurate estimates of efficiency and dissipated heat for brushed motors.

By the way, some of the "suggested values" may not be entirely accurate as I was pulling them off the top of my head from various places I remember seeing them on the internet. So more research about their accuracy might be desired.

By the way, my real life top-speed is usually 24.9 mph: this thing predicted 25. :shock:

(About the basic theory of operation. It calculates the power provided depending on the motor, voltage, resistance, etc.(a complicated formula) and the power needed at a given velocity. It then logically tests consecutive velocity values and it hones in on the point where the "Power provided" and "Power needed" curves meet. It then reports the velocity at that intersection. And, most of the formulas were derived from Alan Kelm's research and Kreuzotter.de, but I had to modify some of Kelm's since some were... well... inaccurate. I.E., power = F*v, and the force of wind resistance is proportional to (v_ground+v_wind)^2, so the power formula for wind resistance is proportional to [r v_ground*(v_ground+v_wind)^2 and not (v_ground+v_wind)^3. This is important because the latter formula would possibly cause two intersections with the power formula whereas the force curves would possibly have one intersection, which is not sensible. But, I still need to find his thread so I can praise him for his research!)

By the way, the model breaks down where the power needed exceeds power provided near 0 mph so values of ".1" mph should indicate "You're going backwards" or "You're not going anywhere".
Attachments
interface.GIF
What it looks like
interface.GIF (19.25 KiB) Viewed 3411 times
Last edited by swbluto on Sat Jan 02, 2010 3:56 am, edited 14 times in total.
DO NOT BUY FROM ELECTRICSCOOTERPARTS . COM! They are DAMN THIEVES! They will happily take your money, not send you the product, and then claim because you didn't mention something within 15 days (Hello, mail can sometimes take longer than 15 days), they've lost all records and thus they can't help you out.

Check out the latest version of the FREE e-bike/e-scooter( or anything that uses a single brushless or brushed motor) simulator.
User avatar
swbluto
10 GW
10 GW
 
Posts: 4131
Joined: Fri May 30, 2008 5:23 pm

Re: New Online E-Bike/E-vehicle calculator - Beta testing

Postby pwbset » Fri Oct 10, 2008 3:53 pm

"Loading Java Applet failed..."

:?:
Crystalyte Rear "Old School" 504
Clyte 72v20a Pedal First Shunt Soldered
DeWalt ~52v9ah

Mileage:
'08: 963mi
'09: 566mi
'10: 126mi
pwbset
1 MW
1 MW
 
Posts: 1691
Joined: Wed Apr 23, 2008 8:29 pm

Re: New Online E-Bike/E-vehicle calculator - Beta testing

Postby swbluto » Fri Oct 10, 2008 4:11 pm

pwbset wrote:"Loading Java Applet failed..."

:?:


Hmmmm... That seems odd. It appears to work on mine.

My guess is that this version uses technology too new for your current Java plug-in, but that doesn't make sense since it uses Swing technology which must be at least 2 years old.

Do you think you might have any of the problems listed at http://en.wikipedia.org/wiki/Java_applet#Compatibility_issues ? I was hoping they wouldn't be widespread enough to prevent a sizable amount of users from using this applet as someone thought Java is pretty much universal. But that "AMD64" problem has me worried as that's kind of widely used.
DO NOT BUY FROM ELECTRICSCOOTERPARTS . COM! They are DAMN THIEVES! They will happily take your money, not send you the product, and then claim because you didn't mention something within 15 days (Hello, mail can sometimes take longer than 15 days), they've lost all records and thus they can't help you out.

Check out the latest version of the FREE e-bike/e-scooter( or anything that uses a single brushless or brushed motor) simulator.
User avatar
swbluto
10 GW
10 GW
 
Posts: 4131
Joined: Fri May 30, 2008 5:23 pm

Re: New Online E-Bike/E-vehicle calculator - Beta testing

Postby pwbset » Fri Oct 10, 2008 4:52 pm

This is failing in all browsers I check with. I'm on a Mac with all the latest everything (web developer by trade), but it doesn't work in IE7 either.

jfail1.jpg
(92.53 KiB) Downloaded 43 times


jfail.jpg
jfail.jpg (8.27 KiB) Viewed 3401 times
Crystalyte Rear "Old School" 504
Clyte 72v20a Pedal First Shunt Soldered
DeWalt ~52v9ah

Mileage:
'08: 963mi
'09: 566mi
'10: 126mi
pwbset
1 MW
1 MW
 
Posts: 1691
Joined: Wed Apr 23, 2008 8:29 pm

Re: New Online E-Bike/E-vehicle calculator - Beta testing

Postby swbluto » Fri Oct 10, 2008 5:08 pm

Well, gee, garsh. If only I had a Mac to do compatibility testing with. You wouldn't think it'd be related to the fact you're using a Macintosh since Java is "supposed to be" platform independent, but java virtual machines must be built for whatever computer they're running off of so I can imagine there might be some entry for compatibility issues.

I kind of wonder who else might be having problems. Are there any PC users having any problems?
DO NOT BUY FROM ELECTRICSCOOTERPARTS . COM! They are DAMN THIEVES! They will happily take your money, not send you the product, and then claim because you didn't mention something within 15 days (Hello, mail can sometimes take longer than 15 days), they've lost all records and thus they can't help you out.

Check out the latest version of the FREE e-bike/e-scooter( or anything that uses a single brushless or brushed motor) simulator.
User avatar
swbluto
10 GW
10 GW
 
Posts: 4131
Joined: Fri May 30, 2008 5:23 pm

Re: New Online E-Bike/E-vehicle calculator - Beta testing

Postby pwbset » Fri Oct 10, 2008 5:47 pm

swbluto wrote:Are there any PC users having any problems?


But.. it failed in IE 7 on Windows XP for me also.. see above. :wink:
Crystalyte Rear "Old School" 504
Clyte 72v20a Pedal First Shunt Soldered
DeWalt ~52v9ah

Mileage:
'08: 963mi
'09: 566mi
'10: 126mi
pwbset
1 MW
1 MW
 
Posts: 1691
Joined: Wed Apr 23, 2008 8:29 pm

Re: New Online E-Bike/E-vehicle calculator - Beta testing

Postby michaelplogue » Fri Oct 10, 2008 6:40 pm

I can get into it in IE 7 and Mozilla Firefox 3 - and I can select the presets or custom values, but nothing happens when I press the 'Calculate' button. I've got java Standard edition Version 6, update 5.
http://nws.carbonmade.com

Goped ESR Super Extend Range (S.E.X): 24V 30AH SLA
Diggler FS: Xlite 5303, 36V 40AH LiMn
Schwinn Spoiler chopper bicycle: Ezee front motor, 48V 30AH LiFePo4 (under construction)
Kikker Hardknock motorcycle: Etek-RT, Kelly PM72401, BMI 60V 60AH
Build Thread: http://endless-sphere.com/forums/viewtopic.php?f=10&t=6972
User avatar
michaelplogue
10 kW
10 kW
 
Posts: 660
Joined: Thu Apr 17, 2008 2:34 pm
Location: Ankara, Turkey

Re: New Online E-Bike/E-vehicle calculator - Beta testing

Postby michaelplogue » Fri Oct 10, 2008 6:43 pm

Oops! Got it working - left out the voltage block....... :oops:

So It's working for me in Firefox 3.
http://nws.carbonmade.com

Goped ESR Super Extend Range (S.E.X): 24V 30AH SLA
Diggler FS: Xlite 5303, 36V 40AH LiMn
Schwinn Spoiler chopper bicycle: Ezee front motor, 48V 30AH LiFePo4 (under construction)
Kikker Hardknock motorcycle: Etek-RT, Kelly PM72401, BMI 60V 60AH
Build Thread: http://endless-sphere.com/forums/viewtopic.php?f=10&t=6972
User avatar
michaelplogue
10 kW
10 kW
 
Posts: 660
Joined: Thu Apr 17, 2008 2:34 pm
Location: Ankara, Turkey

Re: New Online E-Bike/E-vehicle calculator - Beta testing

Postby swbluto » Fri Oct 10, 2008 6:56 pm

pwbset wrote:
swbluto wrote:Are there any PC users having any problems?


But.. it failed in IE 7 on Windows XP for me also.. see above. :wink:



Haha. "See above", as in the explorer's title bar! I'm confused though as I'm seeing "Windows XP" and an Apple logo in the same window.

I just tried this on another PC laptop and it appears to work fine there. I'll also try my AMD computer if I can get it connected to the net(Or wait... I could just put it on a USB flashdrive.).

And yeah, I was thinking about adding that "This <specific entry> is empty" popup, but I need to learn how to cause pop-ups. :shock: (And, to the feature list it goes!) By the way, michaelprologue, how's the accuracy? I was starting to have doubts about the "pedaling power" box since apparently my peak-pedaling-output power is at what Louis Armstrong(sp?) continuously puts out on the tour-de-france. :shock:(400-500 watts) But I've been bicycling for some time, I guess. :lol:
DO NOT BUY FROM ELECTRICSCOOTERPARTS . COM! They are DAMN THIEVES! They will happily take your money, not send you the product, and then claim because you didn't mention something within 15 days (Hello, mail can sometimes take longer than 15 days), they've lost all records and thus they can't help you out.

Check out the latest version of the FREE e-bike/e-scooter( or anything that uses a single brushless or brushed motor) simulator.
User avatar
swbluto
10 GW
10 GW
 
Posts: 4131
Joined: Fri May 30, 2008 5:23 pm

Re: New Online E-Bike/E-vehicle calculator - Beta testing

Postby pwbset » Fri Oct 10, 2008 7:00 pm

swbluto wrote:Haha. "See above", as in the explorer's title bar! I'm confused though as I'm seeing "Windows XP" and an Apple logo in the same window.


Windows run natively on Macs with virtualization. I'm honestly not sure why I'm unable to view your applet as I use/view applets all day every day without issue. Going to drop out of the thread now anyway sorry to waste the bandwidth. The screenshot looks cool. Good luck with your project.
Crystalyte Rear "Old School" 504
Clyte 72v20a Pedal First Shunt Soldered
DeWalt ~52v9ah

Mileage:
'08: 963mi
'09: 566mi
'10: 126mi
pwbset
1 MW
1 MW
 
Posts: 1691
Joined: Wed Apr 23, 2008 8:29 pm

Re: New Online E-Bike/E-vehicle calculator - Beta testing

Postby michaelplogue » Fri Oct 10, 2008 7:23 pm

It seems to be pretty accurate. I just did a guesstimation on my wheel diameter with tire and it was a bit slow than my real-world test. But then I realized I was using the 'rated' voltage on my battery pack and upped it to what it really runs at and it came out pretty darn close. As for the pedal power box, I didn't use it - since I'm using a stand-up scooter with a 5303 on it..... no pedals.... :)

Soon I'll be able to test it on an Ezee that I'll be mounting on a Schwinn Spoiler chopper bike, but I've got the 20" model motor on a 24 inch rim, so I'm guessing it wont be perfect. Using the 26" model Ezee motor it says that I'll get around 24mph, so I'm thinking it will be a bit faster in reality. I should have it built sometime next week so I'll be able to compare it with what the Cycle Analyst says.
http://nws.carbonmade.com

Goped ESR Super Extend Range (S.E.X): 24V 30AH SLA
Diggler FS: Xlite 5303, 36V 40AH LiMn
Schwinn Spoiler chopper bicycle: Ezee front motor, 48V 30AH LiFePo4 (under construction)
Kikker Hardknock motorcycle: Etek-RT, Kelly PM72401, BMI 60V 60AH
Build Thread: http://endless-sphere.com/forums/viewtopic.php?f=10&t=6972
User avatar
michaelplogue
10 kW
10 kW
 
Posts: 660
Joined: Thu Apr 17, 2008 2:34 pm
Location: Ankara, Turkey

Re: New Online E-Bike/E-vehicle calculator - Beta testing

Postby TylerDurden » Sat Oct 11, 2008 12:03 am

Not working in Google Chrome... downloaded latest java, too. :(

Edit: no workee in WinXP IE6... :(
Have a Nice Day,

TD

___________________________________________________________

FYI: Adding pictures?

Please post your Watts-at-speed in the survey.
User avatar
TylerDurden
100 GW
100 GW
 
Posts: 6254
Joined: Thu Jan 04, 2007 5:50 pm
Location: Wear the fox hat.

Re: New Online E-Bike/E-vehicle calculator - Beta testing

Postby swbluto » Sat Oct 11, 2008 12:07 am

TylerDurden wrote:Not working in Google Chrome... downloaded latest java, too. :(


That really sucks. Usually programming has a lot of last-minute "gotchas" but ensuring compatibility between multiple machine configurations is hard when I don't have multiple different machines to test it on. Unfortunately, this problem seems more widespread than I hoped. I'll look into creating a stand-alone application and that might be completed in a day or two(depending on several unknowns. Biggest one is that I haven't done one yet. :wink:).

Edit: I just read that Google Chrome hasn't yet got a JVM for its browser with Sun's current release. It appears I had to download a one "newer" than the one Sun currently has to offer to make it work which I found via a missing plugin notice on the applet. After that, it worked.
Last edited by swbluto on Sat Oct 11, 2008 3:30 pm, edited 1 time in total.
DO NOT BUY FROM ELECTRICSCOOTERPARTS . COM! They are DAMN THIEVES! They will happily take your money, not send you the product, and then claim because you didn't mention something within 15 days (Hello, mail can sometimes take longer than 15 days), they've lost all records and thus they can't help you out.

Check out the latest version of the FREE e-bike/e-scooter( or anything that uses a single brushless or brushed motor) simulator.
User avatar
swbluto
10 GW
10 GW
 
Posts: 4131
Joined: Fri May 30, 2008 5:23 pm

Re: New Online E-Bike/E-vehicle calculator - Beta testing

Postby swbluto » Sat Oct 11, 2008 10:36 am

Ok, I now have it in a stand-alone application form. I didn't completely learn GUI stand-alone app programming in the creation process, so exiting requires pressing the file tab and then "exit" as the little red 'x' in the corner does nothing. Explanations for the variables can be found on the original online page, http://www.geocities.com/swbluto4gems/classes/SpeedPrediction.htm.

For now, I'm putting development on hold. I want to develop this in an environment where it can be universally accepted in practice(As opposed to theory like java applets), so I think I'm going to transfer program execution to the server side and just ouput text and graphics using CGI of some sort. Ideally, I would create graphs so that the numbers can be immediately understood(and any possible errors), but it doesn't seem like there's an easy way to do it in java and CGI development with java to interface with apps that could do it seems to require a specialized/expensive server environment, so I think I'm just going to implement this program in another language and add features onto that. It'll take time as I have to learn new languages so don't expect anything new for a couple of weeks. In the mean time, be sure to voice what features/data you want to see! I'm hoping this will eventually develop into something widely useful.
DO NOT BUY FROM ELECTRICSCOOTERPARTS . COM! They are DAMN THIEVES! They will happily take your money, not send you the product, and then claim because you didn't mention something within 15 days (Hello, mail can sometimes take longer than 15 days), they've lost all records and thus they can't help you out.

Check out the latest version of the FREE e-bike/e-scooter( or anything that uses a single brushless or brushed motor) simulator.
User avatar
swbluto
10 GW
10 GW
 
Posts: 4131
Joined: Fri May 30, 2008 5:23 pm

Re: New Online E-Bike/E-vehicle calculator - Beta testing

Postby Mathurin » Sat Oct 11, 2008 4:41 pm

Welp, works at my end.

works2.PNG
(133.63 KiB) Downloaded 1194 times



Off the top of my head:

Would be nice to have mouseovers explaining each variable.

Tire diameter in inches is weird and not very SI compatible. I would very strongly prefer roll out in mm.

The average Canadian man weighs just under 82kg, in the US of A he is ~90Kg and ebikes
stay somewhere between 20-40kg, so the default value of 250Kg total weight is a bit much.

Something that would be absolutely excellent is explanations how to measure each variable,
maybe links to them, or a fairly comprehensive table with approx values for various configs
and stuff. EG stuff like this:
http://bike.terrymorse.com/rolres.html
http://physics.technion.ac.il/~rutman/c ... 20test.pdf
http://www.recumbents.com/mars/pages/pr ... r/Crr.html
So you wouldn't have to go guessing or digging the internet tubes for nearly every variable. I
know I would love it.

Also an acceleration line would be very nice, not sure how that could work out but it's
something that I feel is missing from other calculators. So for example you could see the stall
speed @ slope for various motor configs.

Having an ebikes.ca style graph output would be very nice, but with 4 tons more info that you
can select to have computed or not. So if you only want to compare say efficiency vs
acceleration or some such then you can have only those two lines plotted, etc. Maybe
something to compare two lines of the user's choice and draw another line from it.
You have to know, not fear, that someday you are going to die. Until you know that and embrace that, you are useless. - Tyler Durden, Fight club. Ditch the fake identity you've created for yourself, walk your own way in a society of mindless drones to become real, you are not your social status.
Mathurin
1 MW
1 MW
 
Posts: 1508
Joined: Wed May 24, 2006 2:49 pm
Location: Quebec

Next

Return to E-Bike Technical

Who is online

Users browsing this forum: No registered users and 1 guest