0% found this document useful (0 votes)
21 views6 pages

Department of Electrical and Electronics Engineering Matlab Theory and Practice (ELEC 403) Module V, Assignment 5

The document contains questions and answers about modeling and analyzing control systems using Matlab. It discusses how to [1] tune a PID controller using the PID Tuner app, [2] analyze linear models using the Linear System Analyzer, and [3] represent systems in different forms like transfer function and state-space. It also provides steps to design controllers based on time and frequency response specifications.

Uploaded by

BABAJI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views6 pages

Department of Electrical and Electronics Engineering Matlab Theory and Practice (ELEC 403) Module V, Assignment 5

The document contains questions and answers about modeling and analyzing control systems using Matlab. It discusses how to [1] tune a PID controller using the PID Tuner app, [2] analyze linear models using the Linear System Analyzer, and [3] represent systems in different forms like transfer function and state-space. It also provides steps to design controllers based on time and frequency response specifications.

Uploaded by

BABAJI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Rishab Sharma A4717020001

Department of Electrical and Electronics Engineering


Matlab Theory and Practice [ELEC 403]
Module V, Assignment 5

Q1. To automatically tune a PID Controller block using PID Tuner in Matlab, you can follow
these steps:

1. Open the Simulink model containing your PID Controller block.

2. Double-click on the PID Controller block to open its parameters.

3. In the block dialog, click on the "Tune" button. This will open the PID Tuner.

4. Configure your control system requirements and objectives (e.g., set desired performance
specifications).

5. Click the "Tune" button in the PID Tuner, and it will automatically adjust the PID
parameters to meet your specified requirements.

6. You can analyze the tuned controller's performance and make further adjustments if
necessary.

Q2. To analyze the time-domain and frequency-domain responses of multiple linear models
using Linear System Analyzer in Matlab, follow these steps:

1. Create or import the linear models of your system.

2. Open the Linear System Analyzer app in Matlab.

3. Load the linear models into the app.

4. In the Linear System Analyzer, you can select and plot the step response, impulse response,
or any other time-domain or frequency-domain response for the imported models.

5. You can compare and analyze the responses of multiple models to assess their performance
and behavior.

Q3. Here's a Matlab program to represent the given state space representation in transfer
function form and perform various analyses:

```matlab

% Define the state-space matrices


Rishab Sharma A4717020001

A = [2 3; 4 5];

B = [0; 1];

C = [4 3];

D = 0;

% Create the state-space model sys_ss

= ss(A, B, C, D);

% Convert the state-space model to transfer function sys_tf

= tf(sys_ss);

% Plot the pole-zero plot pzmap(sys_ss);

% Plot the root locus rlocus(sys_ss);

% Plot the Nyquist plot nyquist(sys_ss);

% Plot the Bode plot bode(sys_ss);

% Calculate the gain and phase margins [Gm,

Pm] = margin(sys_ss); fprintf('Gain Margin: %f

dB\n', 20*log10(Gm)); fprintf('Phase Margin:

%f degrees\n', Pm);

```

Q4. To design a PID Controller for fast reference tracking using PID Tuner, you would
typically set the performance requirements and follow these steps:
Rishab Sharma A4717020001

1. Open your Simulink model.

2. Insert a PID Controller block.

3. Double-click the PID Controller block and click on "Tune" to open PID Tuner.

4. Specify your reference tracking requirements (e.g., settling time, overshoot).

5. Use PID Tuner to automatically tune the PID parameters for fast reference tracking.

6. Iterate the tuning process as needed.

7. Analyze the system's response to ensure it meets the reference tracking specifications.

Q5. To analyze the time-domain and frequency-domain responses of one or more linear models
using the Linear System Analyzer in Matlab, follow the same steps as mentioned in the answer
to Q2.

Q6. Bode diagram design involves designing a control system to meet certain frequency
response specifications. The major design steps include:

1. Define Specifications: Specify the desired gain margin, phase margin, and crossover
frequency for your system.

2. Determine Open-Loop Transfer Function: Based on the desired specifications,


calculate the open-loop transfer function G(s).

3. Convert to Bode Form: Express G(s) in Bode form (magnitude and phase) using Bode
plots or Matlab.

4. Adjust Controller Parameters: Design or adjust your controller (e.g., PID) to achieve
the desired Bode plot shape.

5. Verify Design: Simulate the system with the designed controller to verify that the
actual frequency response meets the specified requirements.
Rishab Sharma A4717020001

Example:

Let's say you want a system with a gain margin of 6 dB, a phase margin of 45 degrees, and a
crossover frequency of 2 rad/s. You would design and adjust your controller to achieve these
values in the Bode plot.

Q7. The LTI (Linear Time-Invariant) Viewer in Matlab is a tool for analyzing the time and
frequency domain responses of linear systems. To analyze a given LTI system, follow these
steps:

1. Create or import your LTI system into Matlab.

2. Open the LTI Viewer by typing "ltiview" in the command window.

3. In the LTI Viewer, select your LTI system.

4. You can analyze the time-domain response by selecting "Step Response" or "Impulse
Response" and view the plot.

5. To analyze the frequency-domain response, select "Bode Plot" or "Nyquist Plot" and view
the corresponding plots.

6. You can also customize the analysis by specifying frequency ranges, input signals, and
other parameters.

Q8. Mathematical equations for a DC motor:

- Electrical equation: V = R * I + L * (di/dt)

- Mechanical equation: T = K * I

- Kinematic equation: θ = (1/J) ∫T dt

Assuming values: R (motor resistance), L (motor inductance), K (motor constant), J (inertia),


θ (angular displacement).

Matlab commands to construct a state-space model:

```matlab

% Define motor parameters


Rishab Sharma A4717020001

R = 1; % Resistance

L = 0.1; % Inductance

K = 0.01; % Motor constant

J = 0.02; % Inertia

% State-space matrices

A = [-R/L -K/L;

K/J 0];

B = [1/L; 0];

C = [1 0];

D = 0;

% Create the state-space model sys_ss

= ss(A, B, C, D);

% Convert to transfer function sys_tf

= tf(sys_ss);

```

Q9. Matlab program to represent the given transfer function in state space form and perform
various analyses:

```matlab

% Define the transfer function

num = [3, 4, 5]; den = [4, 1, 2,

10];
Rishab Sharma A4717020001

% Create the transfer function model sys_tf

= tf(num, den);

% Convert to state-space [A,

B, C, D] = tf2ss(num, den);

sys_ss = ss(A, B, C, D);

% Plot zeros and poles pzmap(sys_ss);

% Nyquist plot nyquist(sys_ss);

% Bode plot bode(sys_ss);

% Calculate gain and phase margin [Gm, Pm] =

margin(sys_ss); fprintf('Gain Margin: %f dB\n',

20*log10(Gm)); fprintf('Phase Margin: %f

degrees\n', Pm);

```

You might also like