New Open Source EBike/Evehicle calculator & simulator
Re: New Open Source EBike/Evehicle calculator & simulator
I'd be happy just to get a quick reference for top speed, range, current draw, and such.
Leave the science stuff to scientist.....Concentrate on making a great program and fill in the blanks as they become available.
Also I have no idea what my rolling resistance is or drag coefficient. Could you put in some examples the next version?
Leave the science stuff to scientist.....Concentrate on making a great program and fill in the blanks as they become available.
Also I have no idea what my rolling resistance is or drag coefficient. Could you put in some examples the next version?
THANKS TO EVERYONE HERE WHO TAUGHT ME ABOUT EBIKES. I'M IN YOUR DEBT.
I sell Ebike Brake levers and throttles with custom connectors crimped on! $10 shipped!
ES facebook group
r/ebikes ebikes on reddit
I sell Ebike Brake levers and throttles with custom connectors crimped on! $10 shipped!
ES facebook group
r/ebikes ebikes on reddit
Re: New Open Source EBike/Evehicle calculator & simulator
Do you mean in the help file? I was just wondering because I kind of wonder how many people actually know it's there.auraslip wrote: Also I have no idea what my rolling resistance is or drag coefficient. Could you put in some examples the next version?
(I'm kind of wanting to know because I wonder if I need to make the help file more obvious somehow.)
Re: New Open Source EBike/Evehicle calculator & simulator
I tried to simulate the Turnigy 80100B without much luck. I think there is either a bug, or the specs they report on Hobby King are wrong. I put in 130Kv, 32ohms motor resistance, 2A no load current, 200Amp limit, Gear Ratio 15, and left everything else the same, and it couldn't come up with reasonable predictions. Not sure what to do
Re: New Open Source EBike/Evehicle calculator & simulator
They meant 32 mOhms, so that's actually .032 ohms.dozentrio wrote:I tried to simulate the Turnigy 80100B without much luck. I think there is either a bug, or the specs they report on Hobby King are wrong. I put in 130Kv, 32ohms motor resistance, 2A no load current, 200Amp limit, Gear Ratio 15, and left everything else the same, and it couldn't come up with reasonable predictions. Not sure what to do
Re: New Open Source EBike/Evehicle calculator & simulator
ahh, that makes sense. I don't have a sense of what a reasonable motor resistance is yet. I did kinda suspect that, but when I checked other motors they were also in ohms Thanks!
Re: New Open Source EBike/Evehicle calculator & simulator
Ok, so this is NO WHERE near ready but, more to the point, I don't plan on making it ready because it works for my needs. If you want a "polished one" that uses the simple motor model, use .15. Otherwise, use .16.
So, what does this one do different? It uses inductance modeling, adds in motor pole and inductance boxes, I've added a motor current limit, and switching from a hub motor to custom doesn't delete the values. Also, the erroneous inefficiency code has been deleted. The inductance modeling code was shamelessly STOLEN from ebikes.ca. Actually, I'm just giving them the credit for it because I did basically copy and paste their javascript code and adapted it (If they email me and ask me to remove it or something, I'll have no problem with that, but I will publicize that request.)  I did make a feeble attempt at understanding the math and coming up with my own code, but it became clear to me that would take at least a week and no success was guaranteed. For some reason, the formulas give a NaN at some low speed for some reason (And messes up the graph below 710 mph) but since I don't particularly care about low motor speed performance, I don't really care. The simple model is a pretty good model of low speed performance anyhow.
I make no guarantees over accuracy. The only thing I can say is that the graphs are pretty close to the CA graphs, but not really exact. Like, there's will say 17 NM at 30 mph while mine will say 15 NM at that speed. So it's not exact, but close. It'll give me a more realistic idea of 9C performance which is all I'm really looking for.
There's a lot of errors with this one. Just about the only thing that works is the graphs, and that's only above 510 mph. So, if you need to predict your speed, you better start learning how to interpret graphs.
Edit: Actually, after playing around with this, it still seems better to just eyeball ebikes.ca's graphs. I guess I'll go back to the tired methods. I guess the point of this release is that it includes the source code (It's always available on the SVN repository, but it's actually distributed with the main program) so maybe someone could help make it better.
So, what does this one do different? It uses inductance modeling, adds in motor pole and inductance boxes, I've added a motor current limit, and switching from a hub motor to custom doesn't delete the values. Also, the erroneous inefficiency code has been deleted. The inductance modeling code was shamelessly STOLEN from ebikes.ca. Actually, I'm just giving them the credit for it because I did basically copy and paste their javascript code and adapted it (If they email me and ask me to remove it or something, I'll have no problem with that, but I will publicize that request.)  I did make a feeble attempt at understanding the math and coming up with my own code, but it became clear to me that would take at least a week and no success was guaranteed. For some reason, the formulas give a NaN at some low speed for some reason (And messes up the graph below 710 mph) but since I don't particularly care about low motor speed performance, I don't really care. The simple model is a pretty good model of low speed performance anyhow.
I make no guarantees over accuracy. The only thing I can say is that the graphs are pretty close to the CA graphs, but not really exact. Like, there's will say 17 NM at 30 mph while mine will say 15 NM at that speed. So it's not exact, but close. It'll give me a more realistic idea of 9C performance which is all I'm really looking for.
There's a lot of errors with this one. Just about the only thing that works is the graphs, and that's only above 510 mph. So, if you need to predict your speed, you better start learning how to interpret graphs.
Edit: Actually, after playing around with this, it still seems better to just eyeball ebikes.ca's graphs. I guess I'll go back to the tired methods. I guess the point of this release is that it includes the source code (It's always available on the SVN repository, but it's actually distributed with the main program) so maybe someone could help make it better.
Re: New Open Source EBike/Evehicle calculator & simulator
I feel stupid......... maybe a link in the program that goes to online help, or opens the text document?Do you mean in the help file?
THANKS TO EVERYONE HERE WHO TAUGHT ME ABOUT EBIKES. I'M IN YOUR DEBT.
I sell Ebike Brake levers and throttles with custom connectors crimped on! $10 shipped!
ES facebook group
r/ebikes ebikes on reddit
I sell Ebike Brake levers and throttles with custom connectors crimped on! $10 shipped!
ES facebook group
r/ebikes ebikes on reddit
Re: New Open Source EBike/Evehicle calculator & simulator
So I've updated the program. I reverted to the "simple resistance" model because I don't have time to figure out the inductance model (I know how to do it but it's going to take some time to implement  well, you know, I might catch a bug soon enough; it's usually how these things happen.), I also added in controller heat calculations that takes into consideration switching losses, resistive losses and freewheeling losses (The major ones) and all the details are provided in the textBox upon the calculation. You can also graph the controller heat, so you can see what controller heat may look like at its worst (0 mph where phase currents are at their highest).
The major differences here between this and the previous is that it includes a motor current limit, so you can see how performance will look like with such.
The major differences here between this and the previous is that it includes a motor current limit, so you can see how performance will look like with such.
Last edited by swbluto on Jul 11 2010 2:19pm, edited 3 times in total.
 ambroseliao 100 kW
 Posts: 1221
 Joined: Apr 27 2009 3:34pm
 Location: Washington, DC, USA area
 Contact:
Re: New Open Source EBike/Evehicle calculator & simulator
Very nice work. Thanks for creating this great software!
Ambrose
Ambrose
http://www.ebikes.ca/ is the best!
TidalForce M750X, Tidalforce S750 with Crystalyte HS3540, 1x TF iOX Cruiser. E+ 1000W hybrid bike. ebikes.ca DrainBrain & Cycle Analyst meters. GoPro HD Hero2 camera. Bosch Fat Packs, 37V 10Ah LiPO pack. Turnigy Multistar batteries
My blog: http://ebikerider.blogspot.com
Remember LiFEPo4 HVC is 3.65V and LVC is 2.7V
TidalForce M750X, Tidalforce S750 with Crystalyte HS3540, 1x TF iOX Cruiser. E+ 1000W hybrid bike. ebikes.ca DrainBrain & Cycle Analyst meters. GoPro HD Hero2 camera. Bosch Fat Packs, 37V 10Ah LiPO pack. Turnigy Multistar batteries
My blog: http://ebikerider.blogspot.com
Remember LiFEPo4 HVC is 3.65V and LVC is 2.7V
Re: New Open Source EBike/Evehicle calculator & simulator
Hey, no problem.
Just in case anyone wonders, they may notice a jump when it goes from the noncurrent limiting regime to the currentlimiting regime in the controller heat. This is mostly due to switching losses. Some people think something that the switching losses start to decrease above something like 8090% throttle and thus it should be more gradual, but the calculations don't support that assertion. Assuming a PWM frequency of 10 khz, the wave period will be 100 uS. That implies that 1 uS Turnoff/Turnon time will only be "cut short" above a duty cycle of .98 or so (Or 98% throttle)  so, it stands to reason that the switching losses will occur rather suddenly (unless you happen to be within the 9899.9% duty cycle range which would be rather peculiar).
Just in case anyone wonders, they may notice a jump when it goes from the noncurrent limiting regime to the currentlimiting regime in the controller heat. This is mostly due to switching losses. Some people think something that the switching losses start to decrease above something like 8090% throttle and thus it should be more gradual, but the calculations don't support that assertion. Assuming a PWM frequency of 10 khz, the wave period will be 100 uS. That implies that 1 uS Turnoff/Turnon time will only be "cut short" above a duty cycle of .98 or so (Or 98% throttle)  so, it stands to reason that the switching losses will occur rather suddenly (unless you happen to be within the 9899.9% duty cycle range which would be rather peculiar).
Re: New Open Source EBike/Evehicle 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 noncurrent 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.
I'm trying to incorporate inductance modeling. I reasoned my own solution to the inductance modeling, and the resulting graph in the noncurrent 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.
Re: New Open Source EBike/Evehicle calculator & simulator
Okay, so I went back to reimplementing 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.)
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.)
Re: New Open Source EBike/Evehicle 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.
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.
Re: New Open Source EBike/Evehicle 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.
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.
Re: New Open Source EBike/Evehicle 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.
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
 (288 Bytes) Downloaded 214 times
Re: New Open Source EBike/Evehicle 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 nogood. 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.)
Re: New Open Source EBike/Evehicle 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!
And thanks for the invite!
Re: New Open Source EBike/Evehicle 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 =).
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 =).
Re: New Open Source EBike/Evehicle 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).
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).
Re: New Open Source EBike/Evehicle 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?
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?
THANKS TO EVERYONE HERE WHO TAUGHT ME ABOUT EBIKES. I'M IN YOUR DEBT.
I sell Ebike Brake levers and throttles with custom connectors crimped on! $10 shipped!
ES facebook group
r/ebikes ebikes on reddit
I sell Ebike Brake levers and throttles with custom connectors crimped on! $10 shipped!
ES facebook group
r/ebikes ebikes on reddit
Re: New Open Source EBike/Evehicle calculator & simulator
Hey boys i try to download SWbluto simulator, but the file is corrupted...
Can you help me?
Thanks
Can you help me?
Thanks
Re: New Open Source EBike/Evehicle calculator & simulator
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. Damcardesoria wrote:Can you help me?
Re: New Open Source EBike/Evehicle 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
Re: New Open Source EBike/Evehicle calculator & simulator
Give me a bit if you want my latest revision... i'll zip it up and post it here.