Simulink help -- PID Control for a robot arm?

17 views (last 30 days)
Kelsey
Kelsey on 26 Mar 2014
Answered: Arkadiy Turevskiy on 26 Mar 2014
<<
>>
I need to use Simulink to determine an approximate numerical solution to the equation of motion for a robotic arm (link to image below). The equation of motion for the system is J (\theta)'' = \tau - mgl cos (\theta). (An ordinary, 2nd order nonlinear differential equation.)
Assuming zero initial conditions and a small desired angle of the robot arm, verify the following rules of thumb for PID control for a step input. This should be for an original nonlinear model.
- for proportional control (Kp > 0, Kd = 0, Ki = 0), the solutions are oscillatory, and Kp increases the frequency of oscillation (which decrease the rise time and peak time), but decreases the mean steady state error. The settling time is finite (Hint: pick a starting value of Kp = 5)
- Add derivative control to the proportional controller (i.e., Kp > 0, Kd > 0, Ki = 0) and verify the following:
a) for small Kd, solutions are decaying oscillations
b) increasing Kd deceases settling time
c) increasing Kd to sufficiently large value eliminates oscillatory behavior; solution experimentally decays to final steady state value.
d) increasing Kp decreases the final steady state error
e) increasing Kp decreases rise time
(Hint: pick a starting value of Kd = 0.5)
I am really struggling with how to use Simulink, and especially how to do this in Simulink. Any tips/advice for a starting place to solve this problem would be GREATLY appreciated! Thank you so much, in advance. I would really, sincerely appreciate any and all help with this. Simulink was not gone over in class, and then suddenly we had an assignment entirely based on using Simulink. This is for a Differential Equations/Controls course.
Note that I also attached a screenshot of the .slx Simulink file that my professor sent out to help us with this nonlinear model (and also attached the .mdl version of the actual file). I'm not sure what to do with it however (when I run it, it says that "J is an undefined variable"). Thanks again!

Answers (1)

Arkadiy Turevskiy
Arkadiy Turevskiy on 26 Mar 2014
I suggest you start with learning a little bit about Simulink.Best way to do this is watch a couple of videos: this one and this one .
Once you watch these videos, I think the homework will be pretty straightforward.
A couple of specific pointers to get you going:
  • The model your professor provided is the model that implements that second order nonlinear ODE. The input signal is tau, output signal is theta.
  • In order for model to run, all variables used in the model need to be defined. So in MATLAB workspace you need to assign a value to J and to mgl. The values were probably provided in problem setup. Just define them in MATLAB, say (for example only):
J=1;
mgl=2;
After you do that, construct a closed loop system with PID Controller block as shown in the second video, and run simulations using PID gain values as prescribed in your homework.
It is pretty straightforward once you learn how Simulink works a little bit.
HTH.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!