Go to Post Looks like a perfect device for scaring the cats :D - Dan Petrovic [more]
Home
Go Back   Chief Delphi > CD-Media > White Papers
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

photos

papers

everything



Drivetrain Acceleration Model

Ether

By: Ether
New: 16-09-2013 18:01
Updated: 18-12-2013 22:34
Total downloads: 3183 times



********** 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.

Attached Files

  • pdf PDF Drivetrain Acceleration 2013-09-16_525p RevB

    drivetrain accel h6 RevB.pdf

    downloaddownload file

    uploaded: 16-09-2013 22:53
    filetype: pdf
    filesize: 19.98kb
    downloads: 555


  • zip C source Drivetrain Acceleration 2013-09-19_1112a

    drivetrain accel h7.zip

    downloaddownload file

    uploaded: 19-09-2013 11:43
    filetype: zip
    filesize: 5.43kb
    downloads: 189


  • xls Example output plotted in Excel

    drivetrain accel h7.xls

    downloaddownload file

    uploaded: 19-09-2013 11:51
    filetype: xls
    filesize: 140.5kb
    downloads: 296


  • zip C source Drivetrain Acceleration 2013-09-24_2231

    20130924_2231.zip

    downloaddownload file

    uploaded: 24-09-2013 23:06
    filetype: zip
    filesize: 6.65kb
    downloads: 364


  • pdf PDF Drivetrain Acceleration 2013-09-25 RevC

    drivetrain accel RevC.pdf

    downloaddownload file

    uploaded: 25-09-2013 00:48
    filetype: pdf
    filesize: 22.41kb
    downloads: 759


  • pdf Derivation of Voltage Drop Model rev E

    voltage drop model rev E.pdf

    downloaddownload file

    uploaded: 27-09-2013 22:33
    filetype: pdf
    filesize: 45.99kb
    downloads: 518


  • zip ready-to-run model 2013-12-18

    drivetrainModel_20131218.zip

    downloaddownload file

    uploaded: 18-12-2013 22:32
    filetype: zip
    filesize: 63.52kb
    downloads: 500



Recent Downloaders

  • Guest

Discussion

view entire thread

Reply

19-09-2013 00:42

Andrew Schreiber


Unread Re: paper: Drivetrain Acceleration Model

Very 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


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by Andrew Schreiber View Post
Am I correct in assuming that Tm = Ts*(1-V/Vfree); on line 55 could also be used to figure out approximate current draw?
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 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.

Quote:
Very cool. Now if only we could convince you to use variable names longer than 2 characters
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.


* when not slipping. when slipping, you'd have to use the kinetic friction force and back-calculate the motor torque.




19-09-2013 01:47

Andrew Schreiber


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by Ether View Post
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.
So, close enough for determining if it's bad or not but not close enough to be an "accurate model".


Quote:
Originally Posted by Ether View Post
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.
Twas just a joke, I know the equations look like this but I've always found annotating them with english names helped me understand what was going on. Course, that was the second thing I did with this (first was read what heun integration was). Thanks for sharing this.



19-09-2013 10:28

Nemo


Unread Re: paper: Drivetrain Acceleration Model

This 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


Unread Re: paper: Drivetrain Acceleration Model


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 Streeter


Unread Re: paper: Drivetrain Acceleration Model

Can'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


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by Ether View Post

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


Dangit man, I just finished converting to coffeescript and started putting a front end on it! Mind posting your diffs?

http://bl.ocks.org/schreiaj/raw/6604...a78a8c98eda1b/ It's still missing the axis so it's kinda useless to get numbers out of but I'll post the updated version tonight once I get the axis un-inverted.

Current coffeescript port available at https://gist.github.com/schreiaj/660...a78a8c98eda1b/



19-09-2013 13:14

Ether


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by Andrew Schreiber View Post
Mind posting your diffs?
There's a CSdiff report in the posted ZIP file that contains the revised C code :-)




19-09-2013 13:29

Andrew Schreiber


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by Ether View Post
There's a CSdiff report in the posted ZIP file that contains the revised C code :-)


Thanks, I'll get those integrated sometime in the near future.



19-09-2013 13:46

Ether


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by Andrew Schreiber View Post
Thanks, I'll get those integrated sometime in the near future.
I've got visitors coming over in 15 minutes.

Later this evening I'll strip out all the non-functional changes and give you a report of the minimum changes needed.

It's not a lot, once I get rid of the non-functional changes.




19-09-2013 16:37

Ether


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by Andrew Schreiber View Post
http://bl.ocks.org/schreiaj/raw/6604...a78a8c98eda1b/... I'll post the updated version tonight...
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.




19-09-2013 17:04

Andrew Schreiber


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by Ether View Post
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.


Here's the updated version (haven't put your code changes in yet) but I did make it a little easier to read.

http://bl.ocks.org/schreiaj/raw/6604...06fc207f7a970/



21-09-2013 08:51

IKE


Unread Re: paper: Drivetrain Acceleration Model

Thanks 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


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by IKE View Post
For rolling resistance, this gives a constant coefficient and a v^2 coefficient.
I'm glad you brought this up.

I structured the code to make it very simple to change the rolling resistance model if you want to. It takes only 2 keystrokes 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*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.

However, I think the V*V term only comes into play due to air resistance at speeds much higher than FRC robot speeds. It would be enlightening to see some actual data of rolling resistance vs speed for a typical FRC robot (with drivetrain mechanically disengaged from wheels) on FRC carpet surface.






21-09-2013 15:57

SoftwareBug2.0


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by Ether View Post
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;
Um... "^" is xor in C.



21-09-2013 17:41

Tom Line


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by SoftwareBug2.0 View Post
Um... "^" is xor in C.
Someone slipped into excel mode in the middle of a line of C.



21-09-2013 21:04

Ether


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by Tom Line View Post
Someone slipped into excel mode in the middle of a line of C.
Actually...
Octave, Maxima, SciLab, AWK, and RLaB :-)




21-09-2013 23:38

Andrew Schreiber


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by Ether View Post
Actually...
Octave, Maxima, SciLab, AWK, and RLaB :-)


Which is still less weird than the weird case of coffeescript that I found while porting this by accident...

Turns out "variable *" compiles to "variable * variable" as opposed to throwing a compile error.



23-09-2013 16:51

Ether


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by Ether View Post
- added total drive motor amps to output
There's a small error in the build 9/19/2013_1112a code.

At line 75, "A*4/10" should be "A*n/10".




23-09-2013 17:03

Andrew Schreiber


Unread Re: paper: Drivetrain Acceleration Model

My 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


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by Andrew Schreiber View Post
...should mean I can integrate your changes faster too.
That would be great.

I want to add battery voltage drop so mentors can use the model as a visual teaching tool to show students why low resistance in the motor wires and connections really does matter.




24-09-2013 23:13

Ether


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by Ether View Post
the model does not account for voltage drops due to heavy currents through the wires, the wire connection points, the battery' s internal resistance...

9/24/2013 added updated C code (build 2013-09-24_2231) which includes motor voltage drops due to circuit resistance.


9/24/2013 added an explanation how the voltage drop model was derived.





13-10-2013 15:03

Richard100


Unread Re: paper: Drivetrain Acceleration Model

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.



13-10-2013 15:11

Ether


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by Richard100 View Post
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.
Possibly. You can find several links here for static analysis of turning force (which relates to motor current) for skid-steer vehicles.




18-12-2013 22:51

cadandcookies


Unread Re: paper: Drivetrain Acceleration Model

The 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

brennonbrimhall


Unread Re: paper: Drivetrain Acceleration Model

Based 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


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by Ether View Post
You can find several links here for static analysis of turning force (which relates to motor current) for skid-steer vehicles.
Due to changes made by the web host, many of those links are now broken.

So I collected everything together in one place and posted it here.




04-10-2014 15:21

lemiant


Unread Re: paper: Drivetrain Acceleration Model

Thank 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


Unread Re: paper: Drivetrain Acceleration Model

Quote:
Originally Posted by lemiant View Post
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?
No. It is accounted for in the motor torque calculation. See the last paragraph in the voltage drop model rev E.pdf document:

Quote:
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.
If you change the values of Rone and/or Rcom, you will definitely see the effect of changed voltage drop in the model's output.

Thanks for the words of encouragement.




view entire thread

Reply

Tags

loading ...



All times are GMT -5. The time now is 06:26.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi