1 内容介绍
Problem: Separately excited DC motor with a voltage of 200 V, armature current of 10.5 A, speed
of 2000 rpm, armature resistance of 0.5 ohm, armature inductance of 0.2 H, field resistance of 400
ohm, field inductance of 200 H, and moment of inertia of 3 kgm2. Load torque is assumed
proportional to speed as 𝑇𝐿 = 𝑏𝜔 where 𝑏 = 0.0408 Nmsec/rad. Design a lead compensator for
DC motor have a phase margin of 450.
Solution: Solving this numerical we get the values of back emf (194.7 V), power (2044.87 W),
speed in rad/sec (209.43 rad/sec), field current (0.5 A), mutual inductance (1.859 H), and
electromagnetic torque (9.364 Nm).
2 部分代码
%% Program to design the Lead compensator for a given system
% Consider a numerical from Advanced Control Theory, A Nagoor Kani
% Numerical 1.6: Design a lead compensator for a unity feedback system with
% open loop transfer function G(s)= K/(s(s+1)(s+5)) to satisfy the
% following specifications (i) velocity error constant K_v=50, (ii) Phase
% margin =20 degrees.
% Name of the Student:
% Roll number:
close all
clear all
clc
%% Uncompensated control system transfer function (assuming H(s)=1)
% Calculate the value of gain K from e_ss and use it.
num=[250];
den=[1 6 5 0];
G=tf(num,den);
%% Bode plot of the uncompensated system
figure(1)
bode(G), grid on % To check PM and GM of the uncompensated system
title('Bode plot of uncompensated system')
[Gm,Pm,Wcg,Wcp] = margin(G);
%% Lead compensator Design
Pmd=20; % Desired Phase Margin (PM)
Phi_m=Pmd-Pm+30; % Maximum phase lead angle (degree)
% Check different values for the safety factor to get the desired PM
Phi_mr=Phi_m*(pi/180); % Maximum phase lead angle (radian)
% Determine the transfer function of the lead compensator
alpha=(1+sin(Phi_mr))/(1-sin(Phi_mr));
Mc=-10*log10(alpha); % Magnitude to be compensated in db
% Locate the frequency in Figure(1) for Mc
wm=28.5;
p=wm*sqrt(alpha); % Pole of lead compensator
z=p/alpha; % Zero of lead compensator
gain=alpha;
numc=[1 z];
denc=[1 p];
Gc=tf(numc,denc);
% Total forward transfer function of the compensated system
Gt=gain*Gc*G;
%% Comparison of compensated and uncompensated bode plots
figure(2)
bode(G,'--r', Gt,'-'), grid on
legend('Uncompensated system', 'Compensated system')
title('Comparison of compensated and uncompensated bode plots')
%% Since H(s)=1, the feedback transfer function
Gc1u=feedback(G,1); % Closed loop TF of uncompensated system
Gclc=feedback(Gt,1); % Closed loop TF of compensated system
% Comparison of compensated and uncompensated step responses
figure(3)
subplot(2,1,1)
step(Gc1u, '--r'); grid on
title('Uncompensated system step response')
subplot(2,1,2)
step(Gclc, '-'); grid on
title('Compensated system step response')
%% Comparison of compensated and uncompensated ramp responses
t=0:0.02:4;
figure(4)
[y1,z1]=step(250, [1 6 5 250 0],t); % Take num and den coefficients of Gclu with a pole at origin
[y2,z2]=step([2.185e06 6.661e05], [1 2670 1.599e04 2.198e06 6.661e05 0],t);
% Take num and den coefficients of Gclc with a pole at the origin
subplot(2,1,1)
plot(t,y1,'.'), grid on
title('Uncompensated system ramp response')
subplot(2,1,2)
plot(t,y2,'-'), grid on
title('Compensated system ramp response')
3 运行结果
4 参考文献
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机、雷达通信、无线传感器等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。