这是用户在 2024-11-2 12:07 为 https://app.immersivetranslate.com/pdf-pro/5c883c52-4abb-406a-b2f5-5fc6de479474 保存的双语快照页面,由 沉浸式翻译 提供双语支持。了解如何保存?

AERO 401: UAV Modeling and Control Course
AERO 401:无人机建模与控制课程

Tutorial Exercise 教程练习

Dr. Yahya H Zweiri 耶哈亚·H·兹韦里博士Department of Aerospace Engineering-Khalifa University, Center for Autonomous Robotic Systems (KUCARS), Khalifa
航空航天工程系-哈利法大学,自动化机器人系统中心(KUCARS),哈利法
University of Science and Technology
科学技术大学
2024

This exercise composes of three tutorial sessions, and should be run in MATLAB 2019 or later versions. The exercise makes use of the MATLAB Control Toolbox. The exercise must be written-up and uploaded to the Blackboard by designated dates written below. Late reports will not be marked and will receive zero marks. Remember to include your name and the date on your front page. Do not describe method or procedure. Do not reproduce or explain any MATLAB code in your answers, but use theory to support comments and explain results where appropriate. Keep your answers reasonably brief and succinct.
本练习由三个教程环节组成,需在 MATLAB 2019 或更高版本中运行。该练习使用 MATLAB 控制工具箱。练习必须在下面指定的日期之前撰写并上传到 Blackboard。迟交的报告将不予评分,得分为零。请记得在首页上写上你的名字和日期。请勿描述方法或程序。请勿在答案中复制或解释任何 MATLAB 代码,但应使用理论支持评论,并在适当的地方解释结果。请保持答案简洁明了。

Introduction 介绍

The procedure of designing controllers for unmanned aerial systems can be broken down into the following stages:
设计无人机系统控制器的过程可以分为以下几个阶段:

i) Study system to be controlled - choose sensors and actuators
i) 研究要控制的系统 - 选择传感器和执行器

ii) Model resulting system to be controlled
ii) 建模要控制的系统

iii) Linearize model. Simplify model if necessary
iii) 线性化模型。如有必要,简化模型。

iv) Analyze the resulting model, determine its properties
iv) 分析生成的模型,确定其属性

v) Decide on performance specifications, decide on type of controller to be used
v) 决定性能规格,决定使用的控制器类型

vi) Design controller to meet specifications
设计控制器以满足规格要求

vii) Test controllers by simulation with full non-linear model of the plant
通过全非线性模型对测试控制器进行仿真

viii) Design hardware and software and implement controller
设计硬件和软件并实现控制器

ix) Tune controller on-line
在线调节控制器
The objective of the exercise is to use various techniques to analyse and design feedback controllers for a simple system, that is to perform stages (iv) and (vi) of the above procedure.
本次练习的目标是使用各种技术分析和设计简单系统的反馈控制器,即执行上述程序的第(iv)和第(vi)阶段。

You will design controllers for a quadrotor attitude dynamics which is modelled as a 3rd order system, G ( s ) G ( s ) G(s)G(s), of the form
您将为四旋翼姿态动力学设计控制器,该动力学被建模为一个三阶系统, G ( s ) G ( s ) G(s)G(s) ,形式为
G ( s ) = k s ( T 1 s + 1 ) ( T 2 s + 1 ) G ( s ) = k s T 1 s + 1 T 2 s + 1 G(s)=(k)/(s(T_(1)s+1)(T_(2)s+1))G(s)=\frac{k}{s\left(T_{1} s+1\right)\left(T_{2} s+1\right)}
where T 1 T 1 T_(1)T_{1} is the time constant of the propulsion system and T 2 T 2 T_(2)T_{2} is the time constant of the attitude channel caused by body dynamics and aerodynamics effects. The objective of the design is to obtain a feedback controller which achieves the performance specifications on the step response of percent overshoot M p 10 % M p 10 % M_(p) <= 10%M_{p} \leq 10 \% and peak time t p 0.5 t p 0.5 t_(p) <= 0.5t_{p} \leq 0.5 sec, with zero steady state error.
其中 T 1 T 1 T_(1)T_{1} 是推进系统的时间常数, T 2 T 2 T_(2)T_{2} 是由于机体动力学和空气动力学效应引起的姿态通道的时间常数。设计的目标是获得一个反馈控制器,使其在超调百分比 M p 10 % M p 10 % M_(p) <= 10%M_{p} \leq 10 \% 和峰值时间 t p 0.5 t p 0.5 t_(p) <= 0.5t_{p} \leq 0.5 秒的阶跃响应上达到性能规格,并且稳态误差为零。

After system modelling and linearization, the next stage in the control system design procedure is to perform some analysis of the system. In this exercise, the analysis consists of looking at the open loop poles and zeros, the open loop step response and the system Bode plot. By means of the root locus technique, and the Bode plot, some stability analysis on the system is also be performed to find out limiting values of controller gain.
在系统建模和线性化之后,控制系统设计过程的下一阶段是对系统进行一些分析。在这个过程中,分析包括查看开环极点和零点、开环阶跃响应以及系统的波德图。通过根轨迹技术和波德图,还将对系统进行一些稳定性分析,以找出控制器增益的限制值。
For the controller design stage of this exercise, proportional controllers are designed using the root-locus and Bode plots. In addition, both a P+D controller and a pole placement state feedback controller are designed.
在本练习的控制器设计阶段,使用根轨迹和波德图设计比例控制器。此外,还设计了一个 P+D 控制器和一个极点配置状态反馈控制器。

The next stage of the design procedure would be to test the controllers in simulation with the non-linear model of the plant (using, for example SIMULINK). This stage is not covered in this exercise. Additional elements could be incorporated at this stage, such as plant disturbances and sensor noise. Finally, the controller hardware/software would be designed and tested on the real plant.
设计过程的下一阶段是使用植物的非线性模型(例如使用 SIMULINK)在仿真中测试控制器。此阶段在本练习中未涵盖。此阶段还可以加入其他元素,例如植物干扰和传感器噪声。最后,将设计并测试控制器的硬件/软件在真实植物上。

Figure 1: Closed loop system with proportional controller
图 1:带比例控制器的闭环系统

1 Analysis of the plant (Tutorial 2, due date is 4th November)
植物分析(教程 2,截止日期为 11 月 4 日)

NOTE - ALL THE OTHER SECTIONS OF THIS LABORATORY DEPEND UPON THE COMPLETION AND RESULTS OF THIS SECTION.
注意 - 本实验室的所有其他部分都依赖于本部分的完成和结果。
Question 1.1 Using the second order system formulae, calculate the minimum damping ratio of the dominant poles for an overshoot of M p 10 % M p 10 % M_(p) <= 10%M_{p} \leq 10 \%.
问题 1.1 使用二阶系统公式,计算超调为 M p 10 % M p 10 % M_(p) <= 10%M_{p} \leq 10 \% 时主极点的最小阻尼比。
Question 1.2 Using the second order system formulae, calculate the minimum damped frequency, ω d = ω n 1 ζ 2 ω d = ω n 1 ζ 2 omega_(d)=omega_(n)sqrt(1-zeta^(2))\omega_{d}=\omega_{n} \sqrt{1-\zeta^{2}}, of the dominant poles for a peak time t p 0.5 sec t p 0.5 sec t_(p) <= 0.5sect_{p} \leq 0.5 \mathrm{sec}.
问题 1.2 使用二阶系统公式,计算主极点的最小阻尼频率 ω d = ω n 1 ζ 2 ω d = ω n 1 ζ 2 omega_(d)=omega_(n)sqrt(1-zeta^(2))\omega_{d}=\omega_{n} \sqrt{1-\zeta^{2}} ,以达到峰值时间 t p 0.5 sec t p 0.5 sec t_(p) <= 0.5sect_{p} \leq 0.5 \mathrm{sec}
Question 1.3 Sketch the area in the s-plane where the dominant poles must lie in order to meet both the specifications.
问题 1.3 在 s 平面中勾画出主极点必须位于的区域,以满足两个规格。

To obtain the plant you will use in this exercise, type
要获取您在本练习中使用的植物,请输入
[ k , T 1 , T 2 ] = deal ( 0.7904 , 0.0648 , 0.106 ) [ k , T 1 , T 2 ] = deal ( 0.7904 , 0.0648 , 0.106 ) [k,T1,T2]=deal(0.7904,0.0648,0.106)[\mathrm{k}, \mathrm{~T} 1, \mathrm{~T} 2]=\operatorname{deal}(0.7904,0.0648,0.106)
Question 1.4 Record the values of k , T 1 k , T 1 k,T_(1)k, T_{1} and T 2 T 2 T_(2)T_{2}.
问题 1.4 记录 k , T 1 k , T 1 k,T_(1)k, T_{1} T 2 T 2 T_(2)T_{2} 的值。

Define the plant, G ( s ) G ( s ) G(s)G(s), in transfer function form by
定义植物 G ( s ) G ( s ) G(s)G(s) 的传递函数形式为
G = tf ( k , [ T 1 T 2 , T 1 + T 2 , 1 , 0 ] ) G = tf ( k , [ T 1 T 2 , T 1 + T 2 , 1 , 0 ] ) G=tf(k,quad[T1**T2,T1+T2,1,0])\mathrm{G}=\mathrm{tf}(\mathrm{k}, \quad[\mathrm{~T} 1 * \mathrm{~T} 2, \mathrm{~T} 1+\mathrm{T} 2,1,0])
Obtain the open-loop poles of the plant by pole (G)
通过极点 (G) 获取系统的开环极点

Plot the plant poles on the s s ss-plane by pzmap(G);
s s ss 平面上通过 pzmap(G)绘制植物极点;
Question 1.5 Record the transfer function and comment on it. Record and comment on the plant poles.
问题 1.5 记录传递函数并对此进行评论。记录并评论植物极点。

Question 1.6 What will happen if you try to obtain the plant open loop step response? Explain why.
问题 1.6 如果你尝试获取植物的开环阶跃响应,会发生什么?请解释原因。

Obtain the open loop impulse response by
获取开环脉冲响应通过

impulse(G); 冲动(G);
Question 1.7 Explain this response characteristics.
问题 1.7 解释这个响应特性。

2 Proportional controller design by root-locus
2 根轨迹法的比例控制器设计

The root locus displays the locii of the closed loop system poles for a controller
根轨迹显示了控制器闭环系统极点的位置
K ( s ) = k p K ( s ) = k p K(s)=k_(p)K(s)=k_{p}
as the value of k p k p k_(p)k_{p} increases from zero for the system shown in Figure 1.
随着图 1 所示系统中 k p k p k_(p)k_{p} 的值从零增加。

Plot the root locus of the plant by
绘制植物的根轨迹图

rlocus (G)
The command 命令
sgrid
draws in lines of constant damping ratio ζ ζ zeta\zeta and natural frequency ω n ω n omega_(n)\omega_{n}. The damping ratio lines are drawn from ζ = 0 ζ = 0 zeta=0\zeta=0 to 1 in steps of 0.1 .
绘制了恒定阻尼比 ζ ζ zeta\zeta 和自然频率 ω n ω n omega_(n)\omega_{n} 的线。阻尼比线从 ζ = 0 ζ = 0 zeta=0\zeta=0 绘制到 1,步长为 0.1。
Question 2.1 Explain the root locus characteristics.
问题 2.1 解释根轨迹特性。
Question 2.2 From the root locus plot, determine whether both design specifications a re simultaneously possible using proportional feedback alone. Record any calculations and show your workings on the root locus plot (by hand). Determine ω d ω d omega_(d)\omega_{d} and hence t p t p t_(p)t_{p} at the required value of ζ ζ zeta\zeta. Record your calculations.
问题 2.2 从根轨迹图中,确定是否可以仅使用比例反馈同时满足两个设计规范。记录任何计算,并在根轨迹图上展示你的工作(手动)。确定 ω d ω d omega_(d)\omega_{d} ,并因此在所需的 ζ ζ zeta\zeta 值下确定 t p t p t_(p)t_{p} 。记录你的计算。
The plot above shows all possible closed-loop pole locations for a pure proportional controller. Obviously not all of those closed-loop poles will satisfy our design criteria. We can use the function sgrid to plot lines of constant damping ratios and natural frequencies. For the peak time condition, you may need to manually add one more constraint to the plot.
上面的图显示了纯比例控制器所有可能的闭环极点位置。显然,并不是所有这些闭环极点都能满足我们的设计标准。我们可以使用函数 sgrid 来绘制恒定阻尼比和自然频率的线。对于峰值时间条件,您可能需要手动向图中添加一个额外的约束。
MATLAB provides an interactive root locus facility. Type
MATLAB 提供了一个交互式根轨迹功能。输入
[kp,poles_kp]=rlocfind(G)
and use the mouse to determine the required value of k p k p k_(p)k_{p} for an overshoot of 10 % 10 % 10%10 \%. The eigenvalues at this point are also returned by the function rlocfind. Note that this is not a very accurate method.
并使用鼠标确定超调量为 10 % 10 % 10%10 \% 时所需的 k p k p k_(p)k_{p} 值。此时的特征值也由函数 rlocfind 返回。请注意,这不是一种非常准确的方法。
Question 2.3 Record the value of k p k p k_(p)k_{p} and the poles at this point.
问题 2.3 记录 k p k p k_(p)k_{p} 的值以及该点的极点。

The required value of k p k p k_(p)k_{p} is now in the MATLAB workspace as the variable kp . Calculate the closed loop transfer function
所需的 k p k p k_(p)k_{p} 值现在在 MATLAB 工作区中作为变量 kp。计算闭环传递函数。
T ( s ) = k p G ( s ) 1 + k p G ( s ) T ( s ) = k p G ( s ) 1 + k p G ( s ) T(s)=(k_(p)G(s))/(1+k_(p)G(s))T(s)=\frac{k_{p} G(s)}{1+k_{p} G(s)}
by 通过
T = feedback ( k p G , 1 ) T =  feedback  ( k p G , 1 ) T=" feedback "(kp**G,1)T=\text { feedback }(k p * G, 1)
Obtain the closed loop damping ratio, natural frequency and poles by damp (T)
获取闭环阻尼比、自然频率和极点通过 damp (T)

Now display the closed loop system step response by
现在通过显示闭环系统的阶跃响应

step(T); 步(T);
From the plot, measure M p M p M_(p)M_{p} and t p t p t_(p)t_{p}.
从图中测量 M p M p M_(p)M_{p} t p t p t_(p)t_{p}

Question 2.4 Record and comment on the closed loop transfer function. Record the closed loop damping ratio, natural frequency and poles and compare these to the values predicted from the root locus. Record M p M p M_(p)M_{p} and t p t p t_(p)t_{p}. Comment on the response. Does your design meet the specifications? Compare the overshoot and peak time to the values predicted from the root locus.
问题 2.4 记录并评论闭环传递函数。记录闭环阻尼比、自然频率和极点,并将这些与根轨迹预测的值进行比较。记录 M p M p M_(p)M_{p} t p t p t_(p)t_{p} 。对响应进行评论。您的设计是否符合规格?将超调量和峰值时间与根轨迹预测的值进行比较。
Question 2.5 Using the interactive root-locus facility, use the mouse to determine the limiting value of k p k p k_(p)k_{p} for system stability. Calculate the value by hand.
问题 2.5 使用交互式根轨迹工具,使用鼠标确定系统稳定性的极限值 k p k p k_(p)k_{p} 。手动计算该值。

3 Proportional controller design by Bode plot (Tutorial 3, due date is 18th November)
通过波德图设计的比例控制器 (教程 3,截止日期为 11 月 18 日)

In this section, a proportional controller
在本节中,比例控制器
K ( s ) = k p K ( s ) = k p K(s)=k_(p)K(s)=k_{p}
for the system shown in Figure 1 will be designed and the stability analysed using frequency domain techniques.
将设计图 1 所示的系统,并使用频域技术分析其稳定性。

Obtain the plant Bode plot by bode (G);
通过 bode (G) 获取植物 Bode 图;
Question 3.1 Explain the Bode plot characteristics.
问题 3.1 解释波德图的特性。

Question 3.2 Find the limiting value of k p k p k_(p)k_{p} for system stability. Show the workings on the Bode plot.
问题 3.2 找到系统稳定性的极限值 k p k p k_(p)k_{p} 。在波德图上展示计算过程。

Question 3.3 From the Bode plot, determine the value of k p k p k_(p)k_{p} required for M p = 10 % M p = 10 % M_(p)=10%M_{p}=10 \% assuming
问题 3.3 从波德图中确定所需的 k p k p k_(p)k_{p} 值,以便 M p = 10 % M p = 10 % M_(p)=10%M_{p}=10 \% 假设
P M 100 ζ for P M < 70 deg P M 100 ζ  for  P M < 70 deg PM~~100 zetaquad" for "quad PM < 70degP M \approx 100 \zeta \quad \text { for } \quad P M<70 \mathrm{deg}
where PM is the phase margin. Show the workings on the Bode plot.
其中 PM 是相位裕度。请在波特图上展示计算过程。
Input the calculated value of k p k p k_(p)k_{p} into the MATLAB workspace as the variable kp. Now calculate the closed loop transfer function
将计算得出的 k p k p k_(p)k_{p} 的值输入到 MATLAB 工作区,作为变量 kp。现在计算闭环传递函数。
T ( s ) = k p G ( s ) 1 + k p G ( s ) T ( s ) = k p G ( s ) 1 + k p G ( s ) T(s)=(k_(p)G(s))/(1+k_(p)G(s))T(s)=\frac{k_{p} G(s)}{1+k_{p} G(s)}
by 通过
T = feedback ( k p G , 1 ) T =  feedback  ( k p G , 1 ) T=" feedback "(kp**G,1)\mathrm{T}=\text { feedback }(k p * G, 1)
Now display the closed loop system step response by
现在通过显示闭环系统的阶跃响应

step(T); 步(T);
From the plot, measure M p M p M_(p)M_{p} and t p t p t_(p)t_{p}.
从图中测量 M p M p M_(p)M_{p} t p t p t_(p)t_{p}

Question 3.4 Record and comment on the closed loop transfer function. Comment on the response. Record M p M p M_(p)M_{p} and t p t p t_(p)t_{p}. Compare M p M p M_(p)M_{p} to the value predicted from the Bode plot. Does your design meet the specifications?
问题 3.4 记录并评论闭环传递函数。评论响应。记录 M p M p M_(p)M_{p} t p t p t_(p)t_{p} 。将 M p M p M_(p)M_{p} 与从波德图预测的值进行比较。您的设计是否符合规格?
Now obtain the Bode plot of the open loop compensated system L ( s ) = G ( s ) K ( s ) = k p G ( s ) L ( s ) = G ( s ) K ( s ) = k p G ( s ) L(s)=G(s)K(s)=k_(p)G(s)L(s)=G(s) K(s)=k_{p} G(s) by bode (kpG);
现在通过 bode (kpG) 获取开环补偿系统 L ( s ) = G ( s ) K ( s ) = k p G ( s ) L ( s ) = G ( s ) K ( s ) = k p G ( s ) L(s)=G(s)K(s)=k_(p)G(s)L(s)=G(s) K(s)=k_{p} G(s) 的波德图;

Obtain the gain margin G M G M GMG M, phase margin P M P M PMP M, and associated frequencies ω c g ω c g omega_(cg)\omega_{c g} and ω c p ω c p omega_(cp)\omega_{c p} by [GM,PM,Wcg,Wcp] = margin(kp
G)
获得增益裕度 G)

You can convert GM to decibels by
您可以通过以下方式将 GM 转换为分贝:
20 log 10 ( GM ) 20 log 10 ( GM ) 20**log 10(GM)20 * \log 10(\mathrm{GM})
Question 3.5 Record the gain margin, phase margin, and associated frequencies.
问题 3.5 记录增益裕度、相位裕度及相关频率。

Comment on the Bode plot of the open loop compensated system. Show the gain and phase margins on the plot.
对开环补偿系统的波德图进行评论。图中显示增益和相位裕度。

4 PID/P+D controller design
4 PID/P+D 控制器设计

PID controllers are the most commonly used type of industrial control. They are usually designed by trial and error using a few simple rules.
PID 控制器是最常用的工业控制类型。它们通常通过试错法和一些简单规则进行设计。
Question 4.1 What will be the system type if a PID controller is used on this plant? For zero steady state error (to unity step references) for this plant, is an integrator required in the controller?
问题 4.1 如果在这个植物上使用 PID 控制器,系统类型将是什么?为了使该植物在单位阶跃参考下达到零稳态误差,控制器中是否需要一个积分器?
Question 4.2 What are the advantages and disadvantages of not using integral action (i.e., using P + D P + D P+DP+D control)?
问题 4.2 不使用积分作用(即使用 P + D P + D P+DP+D 控制)的优缺点是什么?

Figure 2: Closed loop system with P+D controller
图 2:带有 P+D 控制器的闭环系统
For many mechanical control applications, the derivative of the output is available for measurement using tachometers and other devices. However, for many applications, such a signal is simply not available (e.g. process engineering applications), or prohibitively expensive to obtain. In such cases, the derivative signal y ˙ ( t ) y ˙ ( t ) y^(˙)(t)\dot{y}(t) should be approximated by (high pass filter)
对于许多机械控制应用,输出的导数可以通过转速计和其他设备进行测量。然而,对于许多应用,这样的信号根本不可用(例如过程工程应用),或者获取成本过高。在这种情况下,导数信号 y ˙ ( t ) y ˙ ( t ) y^(˙)(t)\dot{y}(t) 应通过(高通滤波器)进行近似。
Y ˙ ( s ) = s Y ( s ) α s + 1 Y ˙ ( s ) = s Y ( s ) α s + 1 Y^(˙)(s)=(sY(s))/(alpha s+1)\dot{Y}(s)=\frac{s Y(s)}{\alpha s+1}
where 1 / α 1 / α 1//alpha1 / \alpha is greater than the system bandwidth. Making 1 / α 1 / α 1//alpha1 / \alpha too large means that high frequency noise in the measurement signal of y ( t ) y ( t ) y(t)y(t) is amplified.
1 / α 1 / α 1//alpha1 / \alpha 大于系统带宽时。将 1 / α 1 / α 1//alpha1 / \alpha 设置得过大意味着 y ( t ) y ( t ) y(t)y(t) 的测量信号中的高频噪声被放大。
The closed loop system is shown in Figure 2. The controller K ( s ) K ( s ) K(s)K(s) for this exercise is a P + D P + D P+D\mathrm{P}+\mathrm{D} controller
闭环系统如图 2 所示。本次练习的控制器 K ( s ) K ( s ) K(s)K(s) 是一个 P + D P + D P+D\mathrm{P}+\mathrm{D} 控制器。
K ( s ) = k p + s k d α s + 1 = k p + s ( k d + α k p ) α s + 1 K ( s ) = k p + s k d α s + 1 = k p + s k d + α k p α s + 1 K(s)=k_(p)+(sk_(d))/(alpha s+1)=(k_(p)+s(k_(d)+alphak_(p)))/(alpha s+1)K(s)=k_{p}+\frac{s k_{d}}{\alpha s+1}=\frac{k_{p}+s\left(k_{d}+\alpha k_{p}\right)}{\alpha s+1}
Now design the controller. Firstly, define α α alpha\alpha. A suggested value is α = 0.02 α = 0.02 alpha=0.02\alpha=0.02
现在设计控制器。首先,定义 α α alpha\alpha 。建议的值是 α = 0.02 α = 0.02 alpha=0.02\alpha=0.02
alpha=0. 02  alpha=0.  02 " alpha=0. "02\text { alpha=0. } 02
Define a proportional gain term, k p k p k_(p)k_{p}, in the MATLAB workspace in a variable kp. Similarly, define a derivative gain term, k d k d k_(d)k_{d}, in a variable kd . Now define the transfer function, K ( s ) K ( s ) K(s)K(s), of the controller by
在 MATLAB 工作区中定义一个比例增益项 k p k p k_(p)k_{p} ,存储在变量 kp 中。同样,在变量 kd 中定义一个微分增益项 k d k d k_(d)k_{d} 。现在通过以下方式定义控制器的传递函数 K ( s ) K ( s ) K(s)K(s)
K = t f ( [ k d + a l p h a k p , k p ] , [ a l p h a , 1 ] ) K = t f ( [ k d + a l p h a k p , k p ] , [ a l p h a , 1 ] ) K=tf([kd+alpha**kp,kp],[alpha,1])K=t f([k d+a l p h a * k p, k p],[a l p h a, 1])
Obtain the system open loop transfer function L ( s ) = G ( s ) K ( s ) L ( s ) = G ( s ) K ( s ) L(s)=G(s)K(s)L(s)=G(s) K(s) by
获得系统的开环传递函数 L ( s ) = G ( s ) K ( s ) L ( s ) = G ( s ) K ( s ) L(s)=G(s)K(s)L(s)=G(s) K(s) 通过
L = K G L = K G L=K**G\mathrm{L}=\mathrm{K} * \mathrm{G}
Now obtain the system closed loop transfer function
现在获得系统闭环传递函数
T ( s ) = G ( s ) K ( s ) 1 + G ( s ) K ( s ) = L ( s ) 1 + L ( s ) T ( s ) = G ( s ) K ( s ) 1 + G ( s ) K ( s ) = L ( s ) 1 + L ( s ) T(s)=(G(s)K(s))/(1+G(s)K(s))=(L(s))/(1+L(s))T(s)=\frac{G(s) K(s)}{1+G(s) K(s)}=\frac{L(s)}{1+L(s)}
by 通过
T = feedback ( K G , 1 ) T =  feedback  ( K G , 1 ) T=" feedback "(K***G,1)\mathrm{T}=\text { feedback }(\mathrm{K} \star \mathrm{G}, 1)
Now display the closed loop system step response by
现在通过显示闭环系统的阶跃响应

step(T); 步(T);
If the response does not meet the specifications, change kp and kd and repeat the procedure until a satisfactory design is obtained.
如果响应不符合规格,请更改 kp 和 kd,并重复该过程,直到获得满意的设计。
Question 4.3 From the plot, measure M p M p M_(p)M_{p} and t p t p t_(p)t_{p}. Does your design meet the specifications? Record the final values of k p k p k_(p)k_{p} and k d k d k_(d)k_{d}. Record the transfer function K ( s ) K ( s ) K(s)K(s)