【机械】基于simulink模拟给定系统的超前补偿器,比较补偿和未补偿系统对阶跃和斜坡输入的响应

本文通过Matlab进行一个带有铅补偿器的直流电机控制系统设计,以达到指定的速度误差常数和相位裕度。首先介绍了电机参数,并展示了无补偿系统的博德图。接着设计了铅补偿器,通过调整参数确保了相位裕度为45度。最后,比较了补偿前后系统的博德图、阶跃响应和斜坡响应,验证了补偿器的有效性。

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代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值