Download presentation
Presentation is loading. Please wait.
Published byBaldric Bailey Modified over 9 years ago
2
1 MATLAB AND CONTROLS PRESENTED BY:- AGILESWARI K. RAMASAMY DR. FARRUKH HAFIZ NAGI
3
2 Controls & MATLAB INRTRODUCTION Control system consists of subsystems and processes assembled for the purpose of controlling the outputs of the processes. DC MOTOR Physical Modeling of a DC Motor Physical Modeling of a DC Motor in STATE SPACE Designing the full-state feedback controller Bode Plot PID CONTROLLER LTIVIEW
4
3 A common actuator in control systems is the DC motor. It directly provides rotary motion and, coupled with wheels or drums and cables, can provide transitional motion. Physical Modeling of a DC Motor
5
4 The motor torque, T, is related to the armature current, i, by a constant factor Kt. The back emf, e, is related to the rotational velocity by the following equations: Kt (armature constant) = Ke (motor constant). Physical Modeling of a DC Motor rotational speed is the output voltage is the input
6
5 Newton's law combined with Kirchoff's law : The modeling equations in Laplace Transforms Physical Modeling of a DC Motor
7
6 Open-loop transfer function The value of the constants :- moment of inertia of the rotor (J) = 0.01 kg.m^2/s^2 damping ratio of the mechanical system (b) = 0.1 Nms electromotive force constant (K=Ke=Kt) = 0.01 Nm/Amp electric resistance (R) = 1 ohm electric inductance (L) = 0.5 H rotational speed is the output voltage is the input Physical Modeling of a DC Motor
8
7 Motor speed design criteria based on step input Settling time less than 2 seconds Overshoot less than 5% Steady-state error less than 1% Physical Modeling of a DC Motor
9
8 MATLAB representation of Open loop transfer function is as follows: Create a new m-filem-file Enter the following commands in m-file: J=0.01 %Defining constants b=0.1 K=0.01 R=1 L=0.5 num=K %Defining the numerator den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2)] %Defining denominator step(num,den,0:0.1:3) %Obtaining the step response step title('Step Response for the Open Loop System') Physical Modeling of a DC Motor
10
9 Alternative MATLAB representation J=0.01; b=0.1; K=0.01; R=1; L=0.5; num=K den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2)] T=tf(num,den)%Defining transfer function step(T,0:0.1:3) %Obtaining step response step title('Step Response for the Open Loop System') %Title of the figure Physical Modeling of a DC Motor
11
10 Physical Modeling of a DC Motor When 1 volt is applied to the system, the motor can only achieve a maximum speed of 0.1 rad/sec, ten times smaller than our desired speed. It takes the motor 3 seconds to reach its steady-state speed; this does not satisfy our 2 seconds settling time criterion. Overshoot less than 5% Settling time less than 2 seconds Steady-state error less than 1%
12
11 Physical Modeling of a DC Motor in STATE SPACE DC Motor Differential Equation is represented in state-space by choosing rotational speed and electric current as the state variables voltage as an input rotational speed as output State space representation DC Motor Differential Equation
13
12 Physical Modeling of a DC Motor in STATE SPACE MATLAB representation of Open loop transfer function using the state-space equations. Create a new m-filem-file Enter the following commands in m-file: J=0.01 ; b=0.1; K=0.01; R=1;L=0.5; A=[-b/J K/J ; -K/L -R/L] %Defining the matrix A,B,C,D B=[0 ; 1/L] C=[1 0] D=0 step(A, B, C, D) % Obtaining the step response
14
13 Designing the full-state feedback controller The schematic of full state feedback system is
15
14 Designing the full-state feedback controller The characteristic polynomial for this closed- loop system is the determinant of (sI-(A-BK)). The matrices A and B*K are both 2x2 matrices, there should be 2 poles for the system. The two poles will be placed at -5 + i and -5-i (note that this corresponds to a zeta = 0.98 which gives 0.1% overshoot and a sigma = 5 which leads to a 1 sec settling time). MATLAB will find the controller matrix,K using these two poles. Settling time less than 2 seconds Overshoot less than 5% Steady-state error less than 1%
16
15 J=0.01; b=0.1; K=0.01; R=1;L=0.5; A=[-b/J K/J ; -K/L R/L]; B=[0 ; 1/L]; C=[1 0]; D=0; p1 = -5 + i% Pole 1 p2 = -5 - i% Pole 2 K = place(A,B,[p1 p2]) % Obtaining the value for the controller t=0:0.01:3;%Defining the time step step(A-B*K,B,C,D,1,t)%Obtaining the step response step MATLAB representation of full state feedback system. Designing the full-state feedback controller
17
16 Step response with K controller Designing the full-state feedback controller
18
17 BODE PLOT The main idea of frequency-based design is to use the Bode plot of the open-loop transfer function to estimate the closed-loop response. JJ=0.01; bb=0.1; KK=0.01; RR=1;L=0.5; nnum=K; dden=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2)]; b bode(num,den)%Obtaining the bode plot MATLAB representation to draw bode plot.
19
18 A controller will be designed to satisfy the design requirements. The closed loop DC motor with the controller Overshoot less than 5% Settling time less than 2 seconds Steady-state error less than 1% PID CONTROLLER
20
19 PID CONTROLLER Transfer function of PID controller: K p =porportional gain K D =derivative gain K i =intergral gain
21
20 PID CONTROLLER J=0.01; b=0.1; K=0.01; R=1;L=0.5; num=K; den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2)]; Kp=100 %Defining the Proportional constant numa=Kp*num %Obtaining the new numerator dena=den %Obtaining the denominator [numac,denac]=cloop(numa,dena) %Obtaining the num and den of the %closed loop system t=0:0.01:5; step(numac,denac,t) step title('Step response with Proportion Control') MATLAB representation for proportional controller.
22
21 PID CONTROLLER J=0.01; b=0.1; K=0.01; R=1;L=0.5; num=K; den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2)]; Kp=100 %Defining the Proportional constant numa=Kp*num%Obtaining the new numerator dena=den %Obtaining the denominator T=tf(numa,dena)%Obtaining the new OL transfer function G=feedback(T,1)%Obtaining the new CL transfer function t=0:0.01:5; step(G,t) step title('Step response with Proportion Control') Alternative MATLAB representation for proportional controller
23
22 PID CONTROLLER Step response with Proportional Control
24
23 PID CONTROLLER Derivative control – reduce overshoot Integral control – reduce steady state J=0.01; b=0.1; K=0.01; R=1; L=0.5; num=K; den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2)]; Kp=100; %Defining proportional contstant Ki=1; Kd=1; %Defining integral and derivative constant numc=[Kd, Kp, Ki]; %Obtaining num and den of the controller denc=[1 0]; numa=conv(num,numc) %Obtaining the num and den of the whole % system dena=conv(den,denc) [numac,denac]=cloop(numa,dena) %Obtaining the num and den of the closed %loop system step(numac,denac) title('PID Control with small Ki and Kd')
25
24 PID CONTROLLER Derivative control – reduce overshoot Integral control – reduce steady state J=0.01; b=0.1; K=0.01; R=1; L=0.5; num=K; den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2)]; Kp=100; %Defining proportional constant Ki=1; Kd=1; %Defining integral and derivative constant numc=[Kd, Kp, Ki]; %Obtaining num and den of the controller denc=[1 0]; C=Tf(numc,denc)%Transfer function of the controller P=tf(num,den) %Transfer function of the Plant G=series(C,P) % Transfer function of the plant and controller T=feedback(G,1)%Closed Loop transfer function step(T) title('PID Control with small Ki and Kd')
26
25 PID CONTROLLER Step response of the system with small Ki and Kd for the PID controller
27
26 PID CONTROLLER Increase K i to reduce settling time Ki=200
28
27 PID CONTROLLER Increase K d to reduce overshoot K d =10 K i =200 K p =100
29
28 LTIVIEW LTIVIEW (GUI Tools)- convenient way to obtain time and frequency response plots of LTI transfer function. Define the transfer function in the command window Type LTIVIEW Import the function Right click on the plot and then select the type of responses.
30
29 THE END
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.