基于极点配置方法的控制系统设计

1.设计流程
在这里插入图片描述在这里插入图片描述2. 模型
在这里插入图片描述3. select_poles

function p = select_poles(order, t_settle, damp_ratio, settling_pct)

%SELECT_POLES  Determine pole locations for pole placement design.
%
%   P = SELECT_POLES(ORDER, T_SETTLE, DAMP_RATIO) computes a set
%   of pole locations for the system order ORDER, with settling
%   time T_SETTLE (in seconds) and a damping ratio of DAMP_RATIO
%   where (0 < DAMP_RATIO < 1). The settling percentage error
%   defaults to 1%.
%
%   P = SELECT_POLES(ORDER, T_SETTLE, DAMP_RATIO, SETTLING_PCT)
%   allows the settling percentage error SETTLING_PCT to be
%   specified.
%
%   The poles are located equidistantly along an arc in the
%   complex plane that satisfies the given settling time and
%   damping ratio constraints.
%
%   Example: p = select_poles(4, 0.5, 0.8, 0.02)
%   This computes the poles for a 4th order system with a settling
%   time of 0.5 seconds, a damping ratio of 0.8 and a settling
%   error of 2%. The result is p = (-7.8240 +/- 5.8680i,
%   -9.5559 +/- 2.0818i).
%
%   By Jim Ledin 2002.

if nargin < 4
    settling_pct = 0.01; % If no settling percentage given, use 1%
end

settling_limit = -log(settling_pct) / t_settle;
amplitude = settling_limit / damp_ratio;
order_is_odd = (mod(order, 2) == 1);

if order_is_odd
    n_complex_pairs = (order-1) / 2;
    p(n_complex_pairs+1) = -amplitude; % One pole is on the real axis
else
    n_complex_pairs = order / 2;
end

if order > 1
    angle = acos(damp_ratio);
    d_theta = 2*angle / (order-1);
    theta = pi - angle  + (0:(n_complex_pairs-1))*d_theta;
    p(1:n_complex_pairs) = amplitude * exp(i*theta);
    
    if order_is_odd
        p(n_complex_pairs+2:2*n_complex_pairs+1) = conj(p(n_complex_pairs:-1:1));
    else
        p(n_complex_pairs+1:2*n_complex_pairs) = conj(p(n_complex_pairs:-1:1));
    end
end

4.plot_poles

function plot_poles(sscl, t_settle, damp_ratio)

%PLOT_POLES  Plot system pole locations  with settling time and damping ratio constraints.
%
%   PLOT_POLES(SSCL, T_SETTLE, DAMP_RATIO)
%
%   This function plots the pole locations for the closed loop
%   system SSCL along with the settling time constraint
%   T_SETTLE (in seconds) and damping ratio DAMP_RATIO.

%   By Jim Ledin, 2002.

plot(pole(sscl), 'o')

axis equal
a = axis;
x_min = a(1); x_max = a(2);
y_min = a(3); y_max = a(4);

settling_pct = 0.01; % If no settling percentage given, use 1%
settling_limit = -log(settling_pct) / t_settle;
if x_max < -settling_limit + 0.1*(x_max - x_min)
    x_max = -settling_limit + 0.1*(x_max - x_min);
    a(2) = x_max;
end

hold on
plot([x_min x_max], [0 0], '--k')
plot([0 0], [y_min y_max], '--k')

plot([-settling_limit -settling_limit], [y_min y_max]);

angle = acos(damp_ratio);
plot([x_min 0 x_min], [x_min*tan(angle) 0 -x_min*tan(angle)])

axis(a)
hold off
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Quincy.Liu

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

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

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

打赏作者

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

抵扣说明:

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

余额充值