Apply Ziegler Nichols PID tuning method and a second alternative PID tuning method for this motor shaft position control problem using Matlab simulations. Explain
Perform an analysis of controller performance using performance metrics of your own choice for both of your PID tuning methods. Evaluate the robustness of this controller to external disturbances.
Provide your conclusions from this simulation analysis.
The DC motor system of Section 2 is now discretised. Use Matlab to determine the open loop and closed loop Zdomain transfer functions of the discretised system.
Perform a root locus analysis of the discretised system in the Z domain. Select three different values of the sampling period to evaluate the effect of discretisation on stability.
Apply PID control in discrete time using Matlab simulations with the same sampling time periods as in 3b.
Compare the performance of PID control of 3c with an equivalent continuous time PID implementation using performance metrics of your own choice.
Performance Metrics for PID Tuning Methods
 The following table gives the absolute, relative and cumulative relative frequencies of number of passengers travelling at each train station in Melbourne during the peak time, 7am to 9:29 am. The data has been divided into 10 intervals.
Class Interval 
Midpoint of Interval 
Count 
Relative Frequency 
Cumulative Relative Frequency 
248547 
365.72 
18 
37.50% 
37.50% 
548847 
662.67 
6 
12.50% 
50.00% 
8481147 
985.22 
9 
18.75% 
68.75% 
11481447 
1271.43 
7 
14.58% 
83.33% 
14481747 
1601.00 
2 
4.17% 
87.50% 
17482047 
1848.00 
2 
4.17% 
91.67% 
20482347 
2268.00 
1 
2.08% 
93.75% 
26482947 
2830.00 
1 
2.08% 
95.83% 
29483247 
2958.00 
1 
2.08% 
97.92% 
74487747 
7729.00 
1 
2.08% 
100.00% 
Table 1: Frequency Table of Number of Passengers at Peak time
 The figure shows the histogram obtained using the above table for the number of passengers.
The average of the number of passengers who are present in a train station in Melbourne during the peak times between 7am and 9:29 am is 1062.6875. The value of the median for the raw data was obtained after having sorted the data in ascending order. Then, as the total number of observations is 48, the median corresponds to 24^{th}observation in the sorted data and is equal to 733. The mode is the observation with highest frequency. Considering the data in raw ungrouped form, the observation 401 had highest frequency of 2. Thus the mode is 401.
 The data provided in this problem is a sample from the larger population of data. A population refers to the sum of all the cases or set of instances of the event under study. It accounts for each and every individuals, subjects, objects or data points. A sample is only a representative of the population. It is a subset of the larger set that is the population. The data here clearly does not account for all the students attending Holmes each day.
 The standard deviation for the sample of the weekly attendance at Holmes was computed using the following:
Here, n = number of sampled observations, = i^{th} observation in the sample, 1 ≤ i ≤n,
= mean weekly attendance.
The calculations for the sample standard deviation are shown in the following table:
X 
X 
(X)^{2} 
472 
12.5714 
158.0408 
413 
71.5714 
5122.469 
503 
18.42857 
339.6122 
612 
127.4286 
16238.04 
399 
85.5714 
7322.469 
538 
53.42857 
2854.612 
455 
29.5714 
874.4694 
Table 2: Calculation for Standard Deviation of Weekly attendance
The standard deviation, using the formula specified above, was then computed to be equal to 68.559.
The inter quartile range is the difference of the third quartile from the first quartile. The value of the first quartile was computed 6014. The value of the third quartile was computed as 7223. Thus the inter quartile range was computed as 1209.
The inter quartile range is unaffected by outliers that may be present in the data. Hence unlike standard deviation which depends on the mean and hence is influenced by outliers, the inter quartile range can be particularly useful in measuring variation of a dataset which has extreme values.
The correlation coefficient computed using observations on attendance and the sales of chocolate bar was computed as 0.967. Therefore a strong positive relation exists between the two variables.
Let X denote the weekly attendance at Holmes and let Y be the number of chocolate bars that are sold. Taking Y as dependent and X as independent variable, the regression model of the following form is to be determined:
Y= a+ b. X +
The estimate of the parameters after solving the normality equations for solving the linear regression model are:
a =
b=, where, = mean of Y, = mean of X
Computing the value of a and b, table 3 shows the computations:
X 
Y 
X 
Y 
^{2} 
^{2} 

472 
6916 
12.5714 
113.4286 
158.0408 
12866.04082 
1425.96 
413 
5884 
71.5714 
918.571 
5122.469 
843773.4694 
65743.47 
503 
7223 
18.42857 
420.4286 
339.6122 
176760.1837 
7747.898 
612 
8158 
127.4286 
1355.429 
16238.04 
1837186.612 
172720.3 
399 
6014 
85.5714 
788.571 
7322.469 
621844.898 
67479.18 
538 
7209 
53.42857 
406.4286 
2854.612 
165184.1837 
21714.9 
455 
6214 
29.5714 
588.571 
874.4694 
346416.3265 
17404.9 
Table 3: Computations for Regression
The mean of weekly attendance was found to be 484.571, the mean number of chocolate bars sold in a week was found to be 6802.57. Then
Discretisation and Root Locus Analysis of the Discretised System in the Z Domain
b= = 10.977 and a = 6802.57 – 10.977× 484.571 = 1628.6889
The regression model was therefore determined to be:
Y= 1628.6889 + 10.9772X
The sales are expected to increase by 10.9972 units with unit increase in weekly attendance and with zero attendance the expected sales is 1628.6 or 1629 units approximately.
The coefficient of determination or 1R^{2 }is the proportion of variation explained by the model. It is given by the formula: 1 . The value of the denominator was obtained as 4004031.714. The following table gives the computations done for the um of squared error:
X 
Y 
Predicted Y 
Error( =YPredicted Y) 
square of Error 
472 
6916 
6668.343 
247.657 
61333.82 
413 
5884 
6038.387 
154.3866 
23835.21 
503 
7223 
6999.338 
223.662 
50024.87 
612 
8158 
8163.156 
5.156081 
26.58517 
399 
6014 
5888.905 
125.095 
15648.69 
538 
7209 
7373.041 
164.0408 
26909.38 
455 
6214 
6486.83 
272.8304 
74436.41 
Table 4: Computations for Coefficient of Determination
The sum of squared error was found to be 252214.9601 Then the coefficient of determination was found to be 1 = 0.937.
Therefore it is seen that the model here explains 93.7% of the total variation in the dependent variable Y, that is the number if chocolate bars sold in a week. This is quite a good fit.
Let A be the event that a student is enrolled in Holmes, let B denote the event that a student is given grass root training, let C be the event that student is an external student and let D be the event that student is given scientific training. The following table gives the observed frequencies of the four events, A, B, C, D.
Scientific training 
Grassroots training 
TOTAL 

Recruited from Holmes students 
35 
92 
127 
External recruitment 
54 
12 
66 
TOTAL 
89 
104 
193 
Table 5: Table of Observed frequencies
 Then the probability that A occurs or B occurs is given by the formula:
P (A B) = P (A)+P(B)–P(
Here P(A) and P(B) are the marginal frequencies of “Recruited from Holmes students” and “Grassroots training” divided by total frequency.
P (A) = = 0.658
P (B) = = 0.538
P ( = = 0.476
Then P (A B) =0.658+0.5380.476 =0.720
 The probability that a randomly selected player is both an external studentAND is in scientific training is given by P( C D) = = 0.279
 Given that a player is from Holmes, the probability that he is in scientific training is given by the probability of P( D A) , where
P (DA) =
Here P (D, A) = P( A D) = = 0.181 and P( A) = 0.658 (from part a)
Then P (DA) = = 0.2775
 The test for independence between training and recruitment is done using Chisquared statistic for independence. The chi squared statistic is computed using the formula:
Here = Expected frequency of i^{th} case, = Observed frequency i^{th} case, 1 ≤ i ≤ 4 (2 cases for each of 2 variable)
The expected cell frequencies computed using the ratio of the product of the row and column totals with that of the total frequency is:
Scientific training 
Grassroots training 

Recruited from Holmes students 
58.56476684 
68.4352332 
External recruitment 
30.43523316 
35.5647668 
Table 6: Expected Cell Frequencies for Chisquared Test
Then the following table breaks down the computation for the Chisquared statistic:
Observed(O_{i}) 
Expected(E_{i}) 
O_{i} E_{i} 
(O_{i} E_{i})^{2} / E_{i} 
35 
58.56476684 
23.564767 
9.48178 
54 
30.43523316 
23.5647668 
18.24524 
92 
68.43523316 
23.5647668 
8.114216 
12 
35.56476684 
23.564767 
15.61372 
Table 7: Computations for Chisquare Statistics
The chi square statistic was then obtained as per the specified formula as 51.454. The degrees of freedom of the distribution is then (21) × (21) =1. The critical value of the chisquare statistic is 3.841. Thus the test concludes that the variables are not independent.
Let A denote a person belonging to segment A, similarly let B, C denote a person belonging to segments B,C and D respectively. Again let X denote the phenomenon that a person prefers the product X over Y and Z.
It is given that 20% of the customer belonging to segment A prefers product X over Y and Z, 35% of those in segment B prefers X, 60% of those in segment C prefers X and 90% of those in D prefers X over Y and Z. The conditional probabilities that a person from the segment A, B and C prefer X are:
P(XA) = 0.2, P(XB)=0.35, P(XC)= 0.6, P(XD) = 0.9
The probabilities of a person belonging to the segments are:
P(A) = 0.55, P(B)=0.33, P(C)=0.1,P(D)=0.05
Then P(A,X) = P(A)P(XA) = 0.2×0.55 = 0.11
P(B,X) = P(B)P(XB) = 0.33× 0.35 = 0.105
P(C,X) = P(C )P(XC) = 0.1× 0.6 = 0.06
P(D,X) = P(D)P(XD) =0.05× 0.9 =0.045
(b) Then the probability that a person favors X is,
P(X) = P(A,X)+P(B,X)+P(C,X)+P(D,X) = 0.32
 The probability that a person who favors X is from segment A is given by,
P(AX) = == 0.3437.
The probability that the customer will buy is given to be 1/10. It is also given that 8 customers entered the store in a 1 minute time interval. The number of customers who make a purchase among them then follows a binomial distribution with p being 1/10 and n being 8. Then the probability that 2 out of the 8 make a purchase is given by the probability mass function of Binomial(8, 1/10) distribution, given as:
Then the probability that two of the customers make a purchase is given as,
P(X=2) = = = 0.148.
 It is given that 4 people enter a store per minute within the time slot of 10 am to 11 am. Then the number of people entering the store in 2 minutes within the same time slot is 8. Hence it can be said that the number of people entering a store in 2 minutes between 10 am and 11 am follows a Poisson distribution with or mean 8, that is, an average of 8 people enter the store in 2 minutes. Then the probability that 9 people enter the store in the next 2 minutes is given by the probability mass function of Poisson(8) for x= 9. The probability is then calculated using the formula:
P(X=x) =, x ≥ 0
Then putting x=9, the probability was found to be = = 0.12
The average price of a Surfers Paradise apartment was determined to be $1.1 million and the standard deviation was found to be $385 000. It is then assumed that the price of a Surfers Paradise apartment follows a normal distribution and that the distribution parameters are specified by mean 1.1 and standard deviation 385000/1000000, that is, 0.358.
 Then the probability that an apartment would sell for over $2 million is given by the cumulative density function of normal distribution. If X denotes the price of an apartment then X follows normal with mean 1.1 and standard deviation 0.358. Then, Z= follows standard normal distribution.
Then using the CDF of standard normal, the probability that price is at least $2 million is given by, , being the CDF of standard normal distribution. Using the standard normal table, = = 0.99403. Then the probability that price is greater than $2 million is given by, 1 = 10.99403 =0.00597.
 The probability that the apartment will sell for over $1 million but less than $1.1 million is given by, P (Z<) – P ( Z<)
 Even though the population of apartments are a mix of old and new apartments and hence not a normal distribution, the sample size drawn is 50 and that makes it a large sample, which then as per central limit theorem implies that the standardized data follows a Z or standard normal distribution.
 11 out of 45 investors in the sample said that they would invest $1 million or more. Then the estimated probability that an investor would invest $1 million or more is 11/45 that is 0.244. Then the estimated population mean is 0.244. Then the chance that 30% of the investors are willing to commit can be computed by committing is obtained the large sample approximation to normal with mean 0.244 and standard deviation , which is 0.064 and then by computing the probability = = 0.807. So the probability that 30% would agree to invest $1 million is 0.807.
To export a reference to this article please select a referencing stye below:
My Assignment Help. (2020). Simulation Analysis Of Motor Shaft Position Control Using Ziegler Nichols And Alternative PID Tuning Methods In Matlab (Essay).. Retrieved from https://myassignmenthelp.com/freesamples/306secontrolandinstrumentation2/environmentandcomputing.html.
"Simulation Analysis Of Motor Shaft Position Control Using Ziegler Nichols And Alternative PID Tuning Methods In Matlab (Essay).." My Assignment Help, 2020, https://myassignmenthelp.com/freesamples/306secontrolandinstrumentation2/environmentandcomputing.html.
My Assignment Help (2020) Simulation Analysis Of Motor Shaft Position Control Using Ziegler Nichols And Alternative PID Tuning Methods In Matlab (Essay). [Online]. Available from: https://myassignmenthelp.com/freesamples/306secontrolandinstrumentation2/environmentandcomputing.html
[Accessed 12 August 2024].
My Assignment Help. 'Simulation Analysis Of Motor Shaft Position Control Using Ziegler Nichols And Alternative PID Tuning Methods In Matlab (Essay).' (My Assignment Help, 2020) <https://myassignmenthelp.com/freesamples/306secontrolandinstrumentation2/environmentandcomputing.html> accessed 12 August 2024.
My Assignment Help. Simulation Analysis Of Motor Shaft Position Control Using Ziegler Nichols And Alternative PID Tuning Methods In Matlab (Essay). [Internet]. My Assignment Help. 2020 [cited 12 August 2024]. Available from: https://myassignmenthelp.com/freesamples/306secontrolandinstrumentation2/environmentandcomputing.html.