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.

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.

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.

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.

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.

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](https://github.com/brennonbrimhall/DrivetrainCalculator/releases).

I’d appreciate any feedback you might have.

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.

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?

No. It is accounted for in the motor torque calculation. See the last paragraph in the voltage drop model rev E.pdf document:

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.

I’m digging up an old thread here, but I wonder if I can ask for tech support with Ether’s drivetrain simulator.

I’ve edited the drivetratinModel.bat file as instructed in the readme, but when I try to run the executable in windows it doesn’t write a new file as expected. Running it in the shell (cmd.exe) gives me “error environment variable filename not defined”.

I’ve used this simulator in the past, but I can’t remember doing anything differently. It’s very handy, if a bit clunky to use. I have a personal rule not to trust any 3rd party calculator unless I can verify it with an independant one. I’d like to run Ether’s code to verify the WCP calculator (http://www.wcproducts.net/how-to-drivetrain/) and to plot some acceleration curves.

This reminds me that I’ve been meaning to build a GUI for Ether’s code…

*Hi Brendan,

Just saw your post. I will try to help you solve the problem.

In Windows, file extensions of the type “exe” have priority over extensions of the type “bat” when searching for a file to execute when the filename (without extension) is typed in a command window.

So when you type the filename “drivetrainModel” without extension, it executes drivetrainModel.exe instead of drivetrainModel.bat… and the bat file never gets executed and so it never has a chance to set the environment variables that the exe file is expecting.

There are 3 different ways to solve the problem you are seeing:

  1. Force windows to execute the bat file by typing the full filename with the extension: drivetrainModel.bat

  2. Rename the bat file to a different name, like for example “test.bat”. Then just type “test” in your command window. Assuming there is no “test.exe” in the default directory, Windows will find “test.bat” and execute it.

  3. Don’t use a command shell. Instead, navigate to the folder in Windows and double-click on the drivetrainModel.bat file

Two more things to be aware of:

a) In your post, drivetrainModel is mis-spelled as “drivetratinModel.bat”.

b) If you edited the bat file to use a filename with spaces in it, you should put the filename in quotes, like this: “my filename.CSV”

Please let me know if this fixes the problem.

That solves it! I was running the executable, not the .bat file. My mistake, thanks!