|
|
|
![]() |
|
|||||||
|
||||||||
********** PLEASE USE THESE LINKS TO DOWNLOAD LATEST VERSIONS **********
compiled ready-to-run model NEW!!
updated C code which includes motor voltage drops due to circuit resistance
Derivation of Voltage Drop Model
PDF Drivetrain Acceleration
Drivetrain acceleration model with loss of traction (wheel slip), motor voltage drop due circuit resistance, accel based on reduced-voltage motor curves, and torque-dependent, speed-dependent, and constant friction losses.
Full C source code.
2nd-order numerical integration using Heun's Method.
CSV output file can be directly imported into Excel for graphing acceleration, speed, distance, motor amps, and motor voltage vs time.
drivetrain accel h6 RevB.pdf
drivetrain accel h7.zip
drivetrain accel h7.xls
20130924_2231.zip
drivetrain accel RevC.pdf
voltage drop model rev E.pdf
drivetrainModel_20131218.zip
19-09-2013 00:42
Andrew SchreiberVery cool. Now if only we could convince you to use variable names longer than 2 characters 
Am I correct in assuming that Tm = Ts*(1-V/Vfree); on line 55 could also be used to figure out approximate current draw? Or am I over simplifying this?
19-09-2013 01:19
Ether|
Am I correct in assuming that Tm = Ts*(1-V/Vfree); on line 55 could also be used to figure out approximate current draw?
|
Very cool. Now if only we could convince you to use variable names longer than 2 characters
|
19-09-2013 01:47
Andrew Schreiber|
Yes. Kt, the motor torque constant, is Newton_meters per amp. So you can calculate the motor amps A=Tm/Kt. For a CIM, Kt≈0.018 Nm/A. You could easily modify the C code to output amps so it could be plotted.
However, the model does not account for voltage drops due to heavy currents through the wires, the wire connection points, the battery' s internal resistance, changes in motor resistance due to temperature, etc so the accuracy of Tm (and the current) will be affected. Also, Kt is not strictly constant - it varies somewhat with motor temperature. |
|
I've been programming since 1969 and I've never liked long variable names. To me it makes the code much less readable. I like the code to look like the way I would write the equations. I know opinions differ on this matter.
|
19-09-2013 10:28
NemoThis is cool. I wouldn't have looked up Heun's method if I hadn't seen this thing. I also wouldn't have looked up rolling resistance. This white paper has given me some homework. Hopefully I can include those two things into the calculator I've been playing with. Thanks very much for posting goodies like this.
19-09-2013 11:36
Ether
I posted an update/correction to the C code:
- fixed an error in the English-to-SI conversion constants
- modified the accel function to better reflect the relationship between friction and rolling resistance
- added total drive motor amps to output
19-09-2013 12:49
Nathan StreeterCan't look at this in-depth right now... but thank you very much for another great resource! This looks quite useful... particularly if k1, k2, and k3 are given real, semi-accurate values (not just assumptions)!
19-09-2013 13:09
Andrew Schreiber|
I posted an update/correction to the C code: - fixed an error in the English-to-SI conversion constants - modified the accel function to better reflect the relationship between friction and rolling resistance - added total drive motor amps to output |
19-09-2013 13:14
Ether
19-09-2013 13:29
Andrew Schreiber|
There's a CSdiff report in the posted ZIP file that contains the revised C code :-)
|
19-09-2013 13:46
Ether|
Thanks, I'll get those integrated sometime in the near future.
|
19-09-2013 16:37
Ether|
http://bl.ocks.org/schreiaj/raw/6604...a78a8c98eda1b/... I'll post the updated version tonight...
|
19-09-2013 17:04
Andrew Schreiber|
Thanks for doing this. I'm hoping your user-friendly interface will generate more interest and technical discussion, and maybe even inspire teams to conduct tests and make their data available.
|
21-09-2013 08:51
IKEThanks for putting this together.
I put together this "Drag Estimator" for my HS supermileage team years ago. It is based off of the Empirical rolling resistance and wind resistance test given in the Bosch automotive handbook.
http://www.epulaski.k12.in.us/tech/s...ign/design.htm
For rolling resistance, this gives a constant coefficient and a v^2 coefficient.
21-09-2013 13:53
Ether|
For rolling resistance, this gives a constant coefficient and a v^2 coefficient.
|
L = Kro+Krv*V; (line #68 in the 9/19/2013_1112a code)to
L = Kro+Krv*V*V;In fact, you could make the rolling resistance any function of V, or even use a look-up table if you have experimental data.
21-09-2013 15:57
SoftwareBug2.0|
I structured the code to make it very simple to change the rolling resistance model if you want to. It takes only 2 keystrokes (^2) to change the rolling resistance model from
L = Kro+Krv*V; (line #68 in the 9/19/2013_1112a code)to L = Kro+Krv*V^2; |
21-09-2013 17:41
Tom Line
21-09-2013 21:04
Ether
21-09-2013 23:38
Andrew Schreiber
23-09-2013 16:51
Ether
23-09-2013 17:03
Andrew SchreiberMy current JS port has some minor typos that I haven't had the chance to hunt down yet. I'm working with Emscripten to compile the C code to Javascript which should mean I can integrate your changes faster too.
23-09-2013 17:22
Ether|
...should mean I can integrate your changes faster too.
|
24-09-2013 23:13
Ether|
the model does not account for voltage drops due to heavy currents through the wires, the wire connection points, the battery' s internal resistance...
|
13-10-2013 15:03
Richard100Ether - Very nice, thanks for developing this. Do you think it could be extended to include wheelbase parameters and predict motor current draw when turning (say differential steering)? We've had trouble in this area during drive system design.
13-10-2013 15:11
Ether|
Ether - Very nice, thanks for developing this. Do you think it could be extended to include wheelbase parameters and predict motor current draw when turning (say differential steering)? We've had trouble in this area during drive system design.
|
18-12-2013 22:51
cadandcookiesThe executable works very well functionally-- I was able to run it with no problems and create some nice graphs based on it.
The only problem I've noticed is that I really have no idea what any of the variables are until I look back into the original program for comments.
I don't think I've quite expressed my appreciation for this program enough-- it is really nice to have such a good model for generating a good estimate of how fast a given drive train setup will move.
02-01-2014 15:44
brennonbrimhallBased on the discussion on this thread (see posts #24 and #28), I've ported Ether's/Andrew Schreiber's C code to Java, and made a GUI front-end with charting. It's not the most pretty thing ever coded, but it may help to make the calculator more accessible by non-programmers. You can find the source code here, with .jar file releases here.
I'd appreciate any feedback you might have.
17-09-2014 09:20
Ether|
You can find several links here for static analysis of turning force (which relates to motor current) for skid-steer vehicles.
|
04-10-2014 15:21
lemiantThank you so much for making this. You're my go-to resource for FRC physics and the community wouldn't be the same without you.
On line 84 voltage drop is calculated, but you don't ever seem to account for it when calculating the torque of the motors, is that correct?
04-10-2014 16:19
Ether|
On line 84 voltage drop is calculated, but you don't ever seem to account for it when calculating the torque of the motors, is that correct?
|
| In the C code, there is an accel(V) function which computes the vehicle acceleration given its speed V. The vehicle speed V is directly related to the motor speed Wm through the wheels and the transmission, assuming no wheel slip. This motor speed Wm is then used in the formula Tm=Toffset-Tslope*Wm derived above to obtain the motor torque (see line 77 in the code). By using this formula for motor torque, the voltage drops due to current are automatically included in the calculation. |