OpenLoop Motor Simulation
Assignment Overview:
In this assignment you will
simulate the motor and potentiometer assembly as it starts up under full
voltage (12VDC). In this part of the project use the parameters shown
below and friction is neglected. In a future assignment, you will identify more
accurately the motor parameters, system inertia, and friction.
Steps:  Write out the Ordinary Differential Equation
(ODE) that needs to be solved.
 Write Matlab code so that it models the motor dynamics neglecting friction. Simulate motion for the first 100 milliseconds.
 Use the Euler method with time steps of 0.01, 0.001, and 0.0001 seconds.
 Use the RungeKutta method with ODE45 using the default options.
 For each simulation use the tic and toc functions to record the computation time to perform the simulation. Also record the final angular position and velocity of the motor.
Turn in:
 A brief description of the problem including assumptions and parameters used.
 Write out key equations used in code.
 Matlab Code. Use good programming practices as described in Good Programming Practices.
 Plots of:
 Motor Position Output vs. Time for 100 milliseconds for all simulations on one axes.
 Motor Velocity Output vs. Time for 100 milliseconds for all simulations on one axes.
 Table of final motor position, motor velocity, computation time, for each simulation method and time step.
 Brief discussion of appropriate time step for an Euler simulation, the tradeoff in terms of computation time, and comparison with the RungeKutta method.
Guidelines  Use meaningful and consistent variable names. See: Good Programming Practices.
 Include concise documentation within your code.
 Within your Matlab code the units for angles should be in radians, but plotted outputs should be in degrees.
 Always label axes on plots and include units.
 Use legend or directly indicate curves on plots. If black and white printouts are used, then labeling should not solely depend on color.
 Use mark up tool to indicate areas of interest on plot.
 When comparing 2 curves (e.g. theory and experiment), plot curves on the same axes.
Parameters you will need: The motor used is Maxon part number 339281. See spec sheet. You will need to use the:  Torque constant and Speed constant
 Rotor inertia
The power supply is a 12VDC with a maximum 3amp output (switching power supply). Note, the motor is rated for 24V, but we are using a 12V power supply. The values for the torque constant and speed constant do not change, but the stall torque and no load speed ratings will be 50% of their listed values when operated at 12V. References:
o Motor Dynamics o
Euler
Method
o Good Programming Practices
