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

I just tried the latest version you posted(EbikeCalc2.jar) - it won't work on my XP system now [error:Java Virtual Machine Launcher "Could not find the main class"].

I just checked, and the earlier version still works on this computer.
 
Still sorta works at my end:

 
That's a quirk of the program. If you're past 80% of the no-load RPM using one of the preloaded hub motors, it draws a line from the efficiency at 80% to an assumed 0 percent efficiency at the no-load RPM and then guesses based on that. To correct that quirk, I'd have to know the no-load currents of the various hub motors(You see that the program currently assumes a no-load current of 0 amps for the hub motors which is, well, clearly wrong.).

Also, 26.3 cm is pretty small for a wheel diameter... :wink:

Anyways, I'll look into that "main class" problem. It might be a problem with how I set the program up(It probably is). Edit: I did some testing and it appears it comes up with that error if you don't preserve the folder structure inside the zip-folder(i.e., the "lib" folder is in the same folder as the EbikeCalc2.jar file, and the "lib" folder has the "swing layout" file. The zip file must be extracted/unzipped.). I think I may just create an installer for future releases just so this set-up problem doesn't occur.
 
I've found a fatal flaw with the program. If the throttle is less than 100%, it won't do predictions accurately. The further away it is from 100%, the more inaccurate it is. Just a heads up.

I'm in the process of correcting the problem and expect to have a release in 2 days(November 5th). Stay tuned folks! I think some will like it. :wink:
 
Here's what I have so far. The link to the .zip is below and the self-extracting .exe(which avoids possible set-up problems) can be found here. I've found out macs can't use .exe files(or can they?), so the zip file below is provided for those that have systems that won't work with .exe(or whatever platform winrar didn't target).

The graphing feature is in its early stages. Each variable has its own axis so if you want to know its value, look at the corresponding axis. The different force curves nor current curves are aligned, so don't assume that where they intersect on the graph is the true intersection so make sure to look at the axis. I'll try to get those aligned, but from my power curve attempt, it doesn't seem like I've mastered it yet. Also, the efficiency curve and power curve must be shown since... well... I'm still learning how to make everything optional. Also, the efficiency and heat generation curves aren't accurate near the no-load speed for the hub-motors but they are(or should be) accurate for everything else that has a no-load current. If you happen to know the K, Rm and Io for any of the hub motors, feel free to customize and make sure to tell me what it is so others can benefit!

Also, the optimization feature requires every parameter to be filled in, even for the parameter being varied('cuz I'm too lazy to make it work without it. Just enter any number in the boxes at the top and it should work.). The optimization works by dividing the range of values you request it to test into many different sample points, samples them, and then finds the maximum(or minimum) result of whatever you're wanting to optimize(say speed or efficiency.) and reports back in the message box. The "steps" box basically asks how many different samples you want to test: The more steps, the more resolution/greater-accuracy it'll have but it'll also take longer. My computer starts bogging down past 1000 steps, but it seems some of the newer computers can easily/quickly handle 10,000 steps. It doesn't do any error-checking, so don't be surprised if you may get back negative numbers when requesting the minimum. All I have to say is adjust the min and max so they're "realistic.". You're not likely going to use the throttle at 2% since that's not enough current to overcome the cogging torque, so put the minimum higher than the force it takes to overcome whatever forces you're working against(wind, hills, cogging torque, etc.).

Anyways, report back any features you want! Suggestions for improvements! Bugs! Etc.! I'm making this for the community, so feel free to help improve it.

And, also, a manual/help guide will be eventually developed that describes each variable in detail(including how to determine it). On a side note, "RPM" stands for the motor's RPM in the graph. I should add that...
 

Attachments

  • EbikeCalc0.12.zip
    1.7 MB · Views: 328
It shouldn't be difficult. :mrgreen:

I've figured how to align the different variables and each variable now has its very own special color and axis, so comparing is made easy! I'm also thinking about undertaking some rigorous algebraic analysis to figure out accurate estimates for the hub motor's specs from ebikes.ca's charts so the efficiency and heat generation can be calculated accurately. So that may get corrected in the next release!(Possibly by tomorrow.)
 
swbluto said:
Also, 26.3 cm is pretty small for a wheel diameter... :wink:
That's the default value. I still cringe at diameter used for this purpose, would prefer rollout in mm like on bike computers.

Also if you're going to include acceleration, a speed/time at 30m would be a nice touch for urban cyclists.


Edit:
Found a pretty nice calculator online, it's for scooters but is otherwise pretty nice. Very complete instructions, needs a tubful of polish tho.
http://trottelec.ifrance.com/performa.html
 
Here's the newest release. The zip file is below and the self-extracting archive that avoids common installation problems can be found here. The zip file is for any system whereas the self-extracting archive is for Windows. The zip file should be unzipped in its entirety so the folder structure is preserved as the program depends on the correct folder structure.

I've added the rudimentary acceleration; Some axes are aligned; Help files have been created with the corresponding menu items; about menu item added; The ability to save input and open input files; and other fixes such as the hub motors. The hub motors aren't perfect but they seem more accurate than before and they still seem to accurately predict my speed.

I'm planning another type of graphing so that you can see your acceleration, speed and distance over time. So if you wanted to see your speed at 30 m, you'd just find where the distance curve is at 30 meters, and you can see your time, velocity and acceleration at 30 meters. This would seem to be a "computationally involved" problem so there's a lot of thinking needed to reduce the total amount of computation(i.e., make it graph quickly), so this might take some time to figure out.

That calculator looks nice but I don't understand French so it seems I can't use it.

A problem with adding the roll-out is that I don't know how to include more than two options along with making the interface "look nice". It'd be possible to use a drop-down menu to select the preferred way of measuring it, but that would seem to uglify and make it look unbalanced.
 

Attachments

  • ebike_0dot13.zip
    1.7 MB · Views: 285
OMG! I fixed the hub motors. Now the graphs are >98-99% true to ebike.ca's graphs for at least the 40x series(And the predictions should be equally accurate). It appears the formula for calculating winding resistance from the winding temperature was entered in wrongly, but now it's fixed.

Anyways, I'm going to add the graphing code and then release all these fixes and updates in the next release. Might be some time next week.
 
So it's been some time! Shortly after my last post, I received my electric scooter and was all involved in upgrading that. I also received my acceptance letter to UW, which then initiated blazing a path of finding an apartment in a city on the other side of the state practically entirely online and other academic planning, so I've been fairly busy. I recently completed much of what that entailed (including scoring a sweet 1/2 bedroom apartment for $700/month with everything included! That might not sound like such a good deal but it is in Seattle's rental market!) just recently and I'm waiting until January to buy and install a proper outrunner controller and getting it working but I'm thinking of completing the throttle-system and water-proofing parts before hand just to get it out of the way.

As far as the software, I've corrected the temperature formulas which seems to increased the accuracy of the charts to practically replicating ebikes.ca's simulator for the 40x series motor, and "pretty darn close" for others(I haven't checked the other motors and corrected whatever but it shouldn't be off by a significantly noticeable amount). Also, now a transient simulation graph for acceleration, velocity and distance has been created so it can predict how fast you'll go, how far you are, and how quickly you'll accelerate from a stand-still and it shows it over time. And... that's all I can remember at the moment.

WARNING:
This program does not take into account drive train efficiency, so if you're using a drive train system to rotate the wheel (i.e., with an R/C motor, Etek or other things that aren't hub motors), make sure to take off 5-10%(or add 5-10%) of the relevant values to get a "realistic idea". Example, if you have a two stage drive system, imagine taking off about 5-10% of the top speed, so a top speed of 33 mph would be about 30-31. The acceleration time of 50% of top speed would be somewhere around 10% more so 10 seconds would become something like 11 seconds.

For Windows, a self-extracting .exe has been created to ease the set-up process: http://www.mediafire.com/download.php?lgj4zy2mz44

And for any system with the ability to unzip .zip files, the main zip folder(Make sure to unzip the entire zip file to preserve the folder structure which the program needs to operate correctly) is below.
 
Just got the program to run on my machine.

I initially had a problem because of a Nokia PC Suite for phone, which stole the file association for .jar files (doubleclicking on the calculator file started the Nokia program).

I couldn't get the file association back to what it should have been, but then I found a program called "jarfix" from softpedia.com which worked a treat.
 
swbluto:

Excellent work - congratulations.

I've been contemplating a similar tool (and didn't realize that you had already built one). I had done some similar modeling in Excel for vehicle dynamics, and had modeled similar parameters to your program.

HOWEVER, what I believe is needed is a way to take a ride (defined as a set of length segments, each segment with a particular grade and a target velocity) and use a tool such as yours to estimate overall battery consumption. You can now pretty trivially use http://www.mapmyride.com/ to get excellent grade profiles of any route. If we could take a table of such data and use your calculator to estimate overall ride energy consumption, it would be great - and I wouldn't have to write it myself in Javascript :)

Willie
 

Dude, that software is bad izzl!
No troubles. I just unpacked and the jar file ran fine

I dialed in my specifics and attempted to maximize my wh/mile.
Your calculation is very close to what I have been seeing on the CA.

Nice work :!:
I plan to spend many insomniac hours playing with this program.

-methods
 
Awwwwww, thanks for the appreciation and your welcome. To tell you the truth, I had a grandeur vision of this tool being widely recognized and used but I'm no longer delusioned. It seems it has evolved into something that's meant more for "designers"(Including amateurs, like myself!) than the casual electric-bike-shopper and so that's probably limited its broad appeal. That and it doesn't seem easy to port to an online format without heavy bandwidth costs.

I've actually committed a cardinal sin of technological nature: I've stopped adding to its evolution, so it'll probably wither away while advanced species / new software comes to take its place. I plan to open the source, but I need to take the time to copy and paste the open-source licensing agreement and getting the necessary documents. :lol: Another time.
 
I have spent many thousands of hours working on things that no one ever even looked at.

I understand what you mean.

-methods
 
this would be a great tool to show people that are just getting into Ev's some basics. You should include a section where you determine the % of time spent in aerodynamic tuck position. :wink:
 
Nice work Swbluto,

I've used it and i'm so surprized about how it is accurate comparing to the real world test!!!

Thanks.. it'a a very usefull tool for me and my crazy lab!!

Doc
 
yea... I have been thinking about why it is not really catching on.
I must admit I have only used the tool once. It was very accurate. I just punched in some numbers that I was familiar with and Bam - got my Ah/Mile right on the money.

I find myself using the simulator on ebikes.ca quite often even though it usually wont give me exactly what I want.
I end up playing silly games to extract whatever data I need.

A lot of it is the online convenience aspect.
A good deal of it is "old habits die hard".
The software is also a bit intimidating. It has quite a few options. That is not really an excuse though because it only took me a minute to figure out how to use it without reading any sort of directions.

I think the biggest reason that I have not used the software is because my 5305 blew up like a week after I found this thread and I was in a funk for months :lol:

I am going to make an effort to move a copy to my work computer (where I am always desperate for distraction :mrgreen: ) and spend more time getting familiar.
I have received news that my monster motor is almost done. Astro 3220 with hall sensors and all 6 phase wires popping out :mrgreen:
I will be wanting to do some simulations and I can guarantee that I wont find what I need for this setup with the ebikes.ca simulator.

I am excited to start working on a new project with a proper set of tools.

-methods
 
Hey everyone

Someone should stickify this thread .. this is a excellent calculator!

Maybe a mini manual would be helpfull to understand all the options!!

-steveo
 
OK. So I came to the party late. However, this calculator provides a very useful function that I have not found elsewhere with all its pieces integrated together as they are here.

I have several questions, if anyone is following this thread. It looks like the no-load current, motor resistance, and "K" value uniquely specify the different motors. Does anyone know what order approximation this is? Where did the program author come up with these values for the included motors? Is it as simple as measuring these values for a motor? I only know enough about electrical power/motors to be dangerous.

I am working with a group of university undergraduates who are, in essence, designing a small two person commuter vehicle, most likely based on hub motors. They are interested in extending the program to some different motors that have come out since the program was written.I have suggested they use this tool to help select appropriate motors and batteries.

So the program lives on. I, for one, encourage the author to keep up the good work.
 
pdf said:
I have several questions, if anyone is following this thread. It looks like the no-load current, motor resistance, and "K" value uniquely specify the different motors. Does anyone know what order approximation this is? Where did the program author come up with these values for the included motors? Is it as simple as measuring these values for a motor? I only know enough about electrical power/motors to be dangerous.


It is. The internal resistance is a constant depending on temperature (You can adjust the armature temperature in the calculator), the kV is a constant that determines the torque constant, and the no-load current summarizes the "no-load" losses of the motor like the cogging torque, eddy losses, bearing losses, etc.. In real life, the losses will be less than the no-load losses as the losses are a function of motor RPM and you're unlikely to go the no-load RPM in real life, but the effect of that will be minimal on most predicted values. However, since the no-load current is a function of RPM, it will change depending on how fast the motor will spin which usually changes with higher voltages. With the hub motors I have quoted, I believe that was derived for voltages of 36 volts and higher voltages will entail a higher no-load current than what's suggested. The custom option lets you change whatever you think may be different with your particular situation.

If you want to get much more precise with each individual loss and performance characteristic, first, you'll have to make the variation in product quality much lower than it already is. If you have the motor, you can measure it.
 
If you want to be precise, you have to measure a motor with a specific controller & set-up. Also, the way that controllers simulate the effect of voltage change, makes a difference to the real world performance at partial throttle settings.....
 
Miles said:
If you want to be precise, you have to measure a motor with a specific controller & set-up. Also, the way that controllers simulate the effect of voltage change, makes a difference to the real world performance at partial throttle settings.....

Indeed. The simulation doesn't take into account "timing advances" or any controller pecularities, it's just modeled as a voltage drop (of a diode) and simple resistor and simple linear PWM behavior. Despite that, though, it's been within 10% accuracy for many members here. If you don't have a motor, I suspect you'll get larger variation from the motor itself than the controller behavior as I believe most brushless motors are made by hand and they're not "precise", it seems. Many HXT motors seem to have true kV values that deviate within 10-20% of the stated value (it's usually higher).
 
Back
Top