pid modeling

An article is a guide to a pid, the aim is to establish an overall concept for the pid, this one simply describes three methods of modeling pid

For a simple system, we need to focus on the specific composition of the whole system

By the law of Ohm's law circuit and the like, as an element modeling, to give the final model of the system

This way a lot of trouble, not be discussed here

The method of system identification

This method does not require a specific implementation of the system of interest, the processing system as a dual port, the input can be given a desired output

If a heater shown in FIG bread rises after the heater 10 degrees, the equation can be related to the establishment of the heater, the heater is not necessary to know the resistance heating or infrared heat

Also note that if a given input in the system input range to prevent damage to the system

MATLAB simulation

Here to use a system identification tool library of MATLAB

This simulation is modeled on a motor

Motor model offered here

First need to initialize the model line following variables related to the matlab command

1
2
3
4
5
J = 0.01;
b = 0.1;
K = 0.01;
R = 1;
L = 0.5;

In simulink model running again, the back matlab, this time will find that the work area more step_input and / img / matlab / motor_speed these two variables

Find the system in matlab toolbox identification tool, open

Data import Choice Time Domain Data , fill in the information in the pop-up window in the figure below, click import

接下来在estimate的下拉框中选择transfer function model,点击estimate,运行完后,如图所示把结果tf1拖入to workspace

此时在MATLAB的工作区中应该能看见tf1这个变量,在命令行输入tf1,就能看见传递函数

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
>> tf1

tf1 =

大专栏  pid建立模型 class="line"> From input "u1" to output "y1":
-1.042e-08 s + 2
------------------
s^2 + 12 s + 20.02

Name: tf1
Continuous-time identified transfer function.

Parameterization:
Number of poles: 2 Number of zeros: 1
Number of free coefficients: 4
Use "tfdata", "getpvec", "getcov" for parameters and their uncertainties.

Status:
Estimated using TFEST on time domain data "mydata".
Fit to estimation data: 100
FPE: 4.857e-33, MSE: 4.851e-33

回到simulink,修改DC Motor Transfer Fcn为对应的传递函数,开始仿真。

仿真结束后打开scope查看,结果如下图

从结果可以看出这个传递函数是正确的

对现有非线性模型线性化

这个方法和前面系统辨识的方法很类似,不过上一个方法使用的是模型的输入输出结果建立模型,这个是通过对系统线性化得到模型

MATLAB仿真

最终效果的模型在这里提供

如下图所示,先添加linear analysis points

在菜单栏打开Analysis->Control Design->Linear Analysis..

如下图所示,设置t=2,点击Step Plot 1,双击点开linsys1,显示线性化的选项选择Transfer Function

如下图所示,验证这个传输函数的正确性

可以看出这个传递函数是正确的


Guess you like

Origin www.cnblogs.com/sanxiandoupi/p/11711224.html