MATLAB Scripts

by Jian Li

I. Gropt.m 

The procedure to run the program and optimize your car by choosing different gear ratios is as follows.  Additional instructions are available in GRopt.pdf.

  1. Copy the six files from GRopt.zip (“GRopt.m”, “GRopt.fig”, “TS1_16.txt”, “TS1_20.txt”, “TS1_25.txt”, “TS1_100.txt” and “TS1_400.txt” ) into one directory.

  2. Start MATLAB and set the working directory to the one where you have copied the above files to. 

  3. In your MATLAB command window, type in the command “GRopt” to bring up the visual interface shown below.  Note that the screenshot may be different from your screen.

  4. In the “Inputs” area, choose the gear ratio you want to use and fill in all of the parameters for  your car.

  5. To determine the “Drive Chain Efficiency”: Run one experiment on your car. By picking the proper drive chain efficiency, you can fit your simulation data to the experiment data you ran. This efficiency can be used in other simulations and calculations.

  6. Click on the "Plot" Button to have the program output the amount of time spent for acceleration, constant speed and deceleration. Two charts - “Speed vs. Time” and “Distance vs. Time” -  will also be plotted.

  7. Through trying different gear ratios and car parameters, you can pick the optimal gear train ratio using the simulations.

 

II. SpinWheel.m 

The procedure to run the program and optimize your wheel  by choosing different gear ratios and Platter diameter is as follows.  

  1. Copy the six files from SpinWheel.zip (“SpinWheel.m”, “SpinWheel.fig”, “TS1_16.txt”, “TS1_20.txt”, “TS1_25.txt”, “TS1_100.txt” and “TS1_400.txt” ) into one directory. The txt files are all Torque- Speed data for the motor you are going to use with different gear ratios. For example, "TS1_16.txt" is the Torque-speed outputs data for the motor with a 1:16 gear box. The data files are similar to those ones used included in GRopt.zip.

  2. Start MATLAB and set the working directory to the one where you have copied the above files to. 

  3. In your MATLAB command window, type in the command “SpinWheel” to bring up the visual interface shown below.  Note that the screenshot may be different from your screen.

  4. In the “Inputs” area, choose the gear ratio you want to use and fill in all of the parameters for  your car.

  5. To determine the “Drive Chain Efficiency”: Run one experiment on your car. By picking the proper drive chain efficiency, you can fit your simulation data to the experiment data you ran. This efficiency can be used in other simulations and calculations.

  6. Click on the "Plot" Button to have the program output the amount of time spent for acceleration and constant speed  Two charts - “Angular Speed vs. Time” and “Platter revolutions vs. Time” -  will also be plotted.

  7. Through trying different gear ratios and wheel-platter parameters, you can pick the optimal gear train ratio using the simulations.

 

Updates:

3/06/03:

1) New Torque Speed data added

2) One input added: number of driving motors

3/10/03

3) One input added: static friction coefficient

3/19/03

4) Torque-Speed Data Updated. "TS1_100.txt" (1:100) and "TS1_400.txt" (1:400) Torque-speed data are now based on 9V of motor driving voltage, the others are still based on 6V of motor driving voltage.

5) Add "Rolling Static Friction Coefficient", "Rolling Kinetic Friction Coefficient", "Sliding Static Friction Coefficient" and "Sliding Kinetic Coefficient". You need to do simple test on your car to find every coefficient. The default value in the program may not be correct for your design.

3/25/03

6) Add "Outside Gear Ratio". If you want to put your own gears outside the motor gearbox to drive your car, you can fill it in as you apply to estimate the performance of your car.

7) Add a plot of Torque versus time. This allows you to observe the torque on your car wheels before the car moves on constant speed.

3/28/03

8)  Torque-Speed Data Updated. "TS1_16.txt" (1:16) and "TS1_20.txt" (1:20) Torque-speed data are now based on 9V of motor driving voltage. "TS1_25.txt"(1:25) is still the data based on 6V.

4/1/03

9) Torque-Speed Data all updated

10) Outside Gear Ratio added to "SpinWheel.m" too.