Matlab Simulink-Using PID controls?

Click For Summary
SUMMARY

This discussion focuses on using Matlab Simulink to implement PID control for a robotic arm's motion equation, specifically J(θ)'' = τ - mgl cos(θ). The user seeks guidance on modeling this second-order nonlinear differential equation in Simulink and verifying PID control rules of thumb. Key insights include the effects of proportional (Kp) and derivative (Kd) control on oscillation frequency, settling time, and steady-state error. The Ziegler-Nichols tuning method is recommended for iterative PID tuning.

PREREQUISITES
  • Understanding of PID control theory and its parameters (Kp, Kd, Ki)
  • Familiarity with Matlab Simulink environment and modeling
  • Knowledge of nonlinear differential equations and their numerical solutions
  • Basic principles of control systems and stability analysis
NEXT STEPS
  • Learn how to model differential equations in Matlab Simulink
  • Research the Ziegler-Nichols tuning method for PID controllers
  • Explore the effects of varying Kp and Kd on system response in Simulink
  • Study examples of PID control implementations for robotic systems
USEFUL FOR

Control engineers, robotics students, and anyone interested in implementing PID control in Matlab Simulink for dynamic systems.

annas425
Messages
16
Reaction score
0
Matlab Simulink--Using PID controls?

I need to use Simulink to determine an approximate numerical solution to the equation of motion for a robotic arm (image below). The equation of motion for the system is J (\theta)'' = \tau - mgl cos (\theta). (An ordinary, 2nd order nonlinear differential equation.)

2883upy.jpg


Assuming zero initial conditions and a small desired angle of the robot arm, I need to verify the following rules of thumb for PID control for a step input.

- 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! I would really, sincerely appreciate any and all help with this! Thank you!

It's hard for me to give an "attempt at a solution" when I am completely lost :( I am not asking for the answer, I just want to know where to begin. Please please, understand. I understand the relationships between items (a) through (d), but I do not know how to even begin to use Simulink, or model this equation in Simulink. Thank you again in advance.

Here is a screenshot of a .slx Simulink file that my professor sent out in order to help us with the nonlinear model…I'm not sure what to do with it (when I run it, it says that "J is an undefined variable"):
29njdz6.png
 
Last edited:
Physics news on Phys.org
For PID tuning the "rules of thumb" vary with the stiffness of the system being controlled!

For hydraulics you can start with all Proportional, but applied at a slow rate.
Then if you don't want to go past your objective (e.g., bang into stuff), you add Integral until the limits are honored.
Finally, you add Derivative (very small amounts) to get rid of the "ringing".

So it is an iterative process - it goes much faster if each iteration is a computer simulation!
 

Similar threads

Replies
2
Views
2K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K