0% found this document useful (0 votes)
12 views7 pages

ACS Lab Exp 3

Uploaded by

620978vk
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)
12 views7 pages

ACS Lab Exp 3

Uploaded by

620978vk
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/ 7

Experiment: 3

AIM: Simulate Speed and position control of DC Motor


Theory:
Simulating the speed and position control of a DC motor in MATLAB can be done by modeling the DC

motor’s dynamics and designing controllers such as Proportional-Integral-Derivative (PID) controllers

for both speed and position control. Below is a step-by-step guide for simulating the DC motor control.
MATLAB CODE:

clc
clear all
close all
% Parameters of the DC motor
R = 1; % Resistance (Ohms)
L = 0.5; % Inductance (H)
K = 0.01; % Motor constant (Nm/A or Vs/rad)
B = 0.1; % Friction constant (Nms)
J = 0.01; % Inertia (kg.m^2)

% Transfer function for speed control


num_speed = K;
den_speed = [L*J, (L*B + R*J), (R*B + K^2)];
sys_speed = tf(num_speed, den_speed);

% Transfer function for position control (introduces 's' for integration)


num_position = K;
den_position = [L*J, (L*B + R*J), (R*B + K^2), 0];
sys_position = tf(num_position, den_position);

% PID controller parameters for speed control


Kp_speed = 100;
Ki_speed = 50;
Kd_speed = 10;
% PID controller parameters for position control
Kp_pos = 10;
Ki_pos = 10;
Kd_pos = 1;

% Define PID controllers


pid_speed = pid(Kp_speed, Ki_speed, Kd_speed);
pid_position = pid(Kp_pos, Ki_pos, Kd_pos);

% Closed-loop system for speed control


sys_cl_speed = feedback(pid_speed * sys_speed, 1);

% Closed-loop system for position control


sys_cl_position = feedback(pid_position * sys_position, 1);

% Simulate step response for speed control


figure;
subplot(2,1,1);
step(sys_cl_speed);
title('Speed Control Step Response');
xlabel('Time (seconds)');
ylabel('Speed (rad/s)');

% Simulate step response for position control


subplot(2,1,2);
step(sys_cl_position);
title('Position Control Step Response');
xlabel('Time (seconds)');
ylabel('Position (rad)');

% The PID gains in the controller may need to be tuned for your specific motor.
% You can use tools like pidtool or pidTuner in MATLAB to fine-tune these
% values based on the system's response.
pidtool(sys_cl_speed);
pidtool(sys_cl_position);
OUTPUT:

By using the PID TUNER, desired graph can be adjust by sliding the 'Response Time' and 'Transient Behaviour'
sliders. On Clicking the 'Show Parameters' values of PID controller and performance parmeters can be seen.
RESULT: We succesfully Simulated the Speed and position control of DC Motor using PID controller.
PID Tuner is also used to get the desired graph, for specific motors.
7EE4-22 ADVANCED CONTROL SYSTEM LAB
Practical No:-3
Objective:-Simulate Speed and position control of DC Motor.

S.No. Viva Questions (to be answered in the Lab file)

1. What is DC Motor?

2. Why DC Motor Speed Control is Important?

3. Define Simulink in Matlab?

4. Which types of loops are provided by Matlab?

5. Which types of operators are allowed in Matlab?

6. What is the function of integrator in MATLAB?

7. What is the function of scope in MATLAB?

8. What is MATLAB API in control system

9. Define the integral control action?

10. Define minimum phase transfer function?

You might also like