Lab 0: MATLAB and ODE Solvers |
ME 4173 Robot Kinematics
The following report will display the results and conclusions of an experiment to simulate the output of an inverse pendulum system in MATLAB. The objectives of this experiment were to review MATLAB programming and using MATLAB to simulate ODEs and systems.
* Examine the basics of MATLAB
* Use MATLAB to simulate a system
* Use ODE solvers to numerically integrate the system over a set time period
The apparatus used in this experiment was MATLAB. It was used to provide a simulation environment to analyze the inverse pendulum’s motion.
Experiments ...view middle of the document...
An addTwo(a,b) function was created as an example.
Part five contained the method for utilizing MATLAB`s ordinary differential equation solver (ODE). It uses this solver to perform numerical integration which allows systems to be solved within the MATLAB environment. MATLAB contains a number of ODE solvers: ode23, ode113, ode15s, ode23s, ode23t, ode23tb, ode45. An example of an ODE solver was used to illustrate the process of utilizing the solver.
Part six of the experiment was the simulation of an inverted pendulum. The pendulum was simulated using the ODE solver. Before the ODE solver could be used, the ordinary differential equations for the inverted pendulum needed to be developed and placed into state space variables. This was done by creating a function called xdot( ). The function has two element: xdot(1) and xdot(2). The two were plotted using a plot( ) function in MATLAB. The result was two sinusoidal waves which were cyclic in nature.
The first problem which arose concerned the trigonometric functions within MATLAB. The code was written in degrees but the answer was expected to be in radians. It was giving a response which looked like an analog signal which was growing exponentially. Once the code was changed to display in radians, there was another issue. The code was checked by the TA and verified to be correct but the response was not what was expected. The issue was actually within...