Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

% Provide your student ID. Uncomment the followign line and assign your student number to the variable StudentID. %StudentID=1234567; % DC motor values La = 0.1; %Motor armature inductance Ra =...

1 answer below »
% Provide your student ID. Uncomment the followign line and assign your student number to the variable StudentID.
%StudentID=1234567;
% DC motor values
La = 0.1; %Motor armature inductance
Ra = 1.0; %Motor armature resistance
Km = 0.4; %Gyrator (motor) co-efficient
= 0.2; %Damping co-efficient
Jm = 0.1; %Moment of inertia
TL = 0.0; %Load torque
N = 7.0; %Gear ration N_2 / N_1
m = 5.0; %Mass of pendulum
l = 1.0; %Length of pendulum arm
g = 9.8; %Gravity
% Matrices of the state-space model
A = [-Ra/La -Km/Jm 0;
Km/La -
Jm -l*m*g/N^2
0 1/Jm 0];
B = [1;
0;
0];
C = [0 0 1/N];
D = [0];
% Define the transfer function G using the command "tf"
%% PID tuning - Oscillation method
% Use the Oscillation Method to obtain Ku and Pu. Define the variables here
% Use the values of Ku and Pu to compute the PID gains Kp, Ti, Td and N. Define these variables here.
% Fine tune the gains Kp, Ti and Td to satisfy the control requirements (rise time, overshoot, steady-state e
or), e.g. you can use Kp=0.9*Kp
% Obtain the transfer function of the PID controller. Use the command "pidstd".
% In the Matlab command window, you can type "help pidstd" to understand this command more. Matlab provides a comprehensive help documentation which explains every command in great details.
% Obtain the closed-loop transfer function Tcl. Use the command "feedback" and save the result in the variable "Tcl"
% Plot the step respose of the closed loop transfer function Tcl. Use the command "step".
% Use the command "step" to save the the step response in the variables "y" and "t" (see the example in the problem description)
% Use the command "stepinfo" to obtain the characteristics of the step response and save the result in the variable "assessStep" (see the example in the problem description)
% Check that the control requirements are met
% Compute the steady-state e
or and save it in the variable "ess" (see the example in the problem description)

18/10/2022, 14:19 MathWorks Learning Tool
https:
lms-grader.mathworks.com/launch 1/3
Script 
Problem 2: Reaction Curve Method My Solutions
Description
Consider a DC motor with a dynamic model , and is used to drive a cable reel with a dy
controller using the Zielger Nichols Reaction Curve method. The closed loop system is shonw in the figure

The PID controller should have the following parallel form,
.
Assessment
The closed-loop step response should achieve the following objectives:
Peak Time:
Overshoot:
Zero steady-state e
o
Requirements
The following requirements are for assessment purposes.
Include the following MATLAB functions in your codes.
XXXXXXXXXXtf; pidstd
Store your closed-loop step response in y and t (time vector). The values in y will be used to evalua
% Tcl is the closed-loop transfer function
[y,t] = step(Tcl)
% steady-state e
o
XXXXXXXXXXess = abs(1 - y(end))
% Peak time
XXXXXXXXXXassessStep = stepinfo(y,t);
% We will test if assessStep.PeakTime <= 0.5
G1(s) =
0.8s + 1.6
s2 + 4s + 7.2
CPID(s) = Kp(1 +
1
Tis
+
TD
τDs + 1
)
Tp ≤ 0.5 second
P.O. ≤ 30%
18/10/2022, 14:19 MathWorks Learning Tool
https:
lms-grader.mathworks.com/launch 2/3
 Reset  MATLAB Documentation (https:
www.mathworks.com/help/)  Save
% Provide your student ID. Uncomment the followign line and assign your student nu
%StudentID=1234567;
% DC motor transfer function
G1 =
% Cable reel transfer function
G2 =
% System transfer fuction
G=G1*G2
%% PID - Reaction curve method
% Compute the step response of G and save it in [Y2,T2]
% Compute the derivative of the step response
% Finds the inflection point [M,I]
% Time that the inflection point was observed
% Magnitude of the step reponse at the inflection point
% Gradient of the step reponse at the time of the inflection point
% Find the X and Y intercepts
% Compute the parameters for ZN PID tuning, i.e. "R" and "tau"
% Obtain the PID gains Kp, Ti, Td and N using the ZN tuning rules for the Reaction
% Fine tune the gains Kp, Ti and Td to satisfy the control requirements (Peak time,
% Obtain the transfer function of the PID controller. Use the command "pidstd".
% In the Matlab command window, you can type "help pidstd" to understand this comma
% Obtain the closed-loop transfer function Tcl. Use the command "feedback" and save
% In the following line we use the command "step" to save the the step response in
[y,t] = step(Tcl);
% Use the command "stepinfo" to obtain the characteristics of the step response and
% Check that the control requirements are met
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
https:
www.mathworks.com/help
18/10/2022, 14:19 MathWorks Learning Tool
https:
lms-grader.mathworks.com/launch 3/3
Assessment: Run Pretest  Submit 
 Run Script 
© 2020 The MathWorks, Inc.
% In the following line we compute the steady-state e
or and save it in the varia
ess = abs(1 - y(end))
Student ID
Make sure the following matlab functions are included in
your code. (Pretest)
Check if G1 and G2 are defined co
ectly. (Pretest)
Overshoot (Pretest)
Peak Time (Pretest)
Steady-state e
or (Pretest)
48
49
50
51
52
Answered 3 days After Oct 19, 2022 University of Newcastle

Solution

Rachakonda answered on Oct 20 2022
66 Votes
There is no issue in my program. Check at your side I am sending you M files.
Assignment 1
Assignment 2
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here