Ask questions for Matlab PID()
Show older comments

1.What is the meaning of demon = [1 3 1]?
2.What is the meaning of Gp=tr(num,demon)?
3.How to interpret this line:
M=feedback(Gp,H)
This is a website address for this PIC control:
https://www.bilibili.com/video/BV1Aq4y1U7bg?from=search&seid=281292339855222775&spm_id_from=333.337.0.0
Thanks
1 Comment
Walter Roberson
on 26 Mar 2022
you miscopied. The code does not use tr(), it uses tf()
Control systems are often expressed as transfer functions, each deals with derivatives. The higher the power of s you see, the higher the derivative. The overall expression is the laplace transform of the time function.
Answers (1)
Hi @Chris Yang
It is actually not "demon", but "denom", a shortened form of the word "Denominator". A Demon generally means an evil spirit or devil, whereas the denominator is the part below the fraction line:
- The line denom = [1 3 1] creates a horizonatal vector of numbers with 3 elements in it. These numbers are actually coefficients for
that will be used for creating the transfer function model later. Similarly, num = [1] creates the coefficient for
in the numerator (the part above the fraction line). - The line Gp = tf(num, denom) creates the transfer function model
for the Plant (a control theory term that stands for a dynamical system to be controlled). - The line M = feedback(Gp, H) creates the closed-loop transfer function that loops around the the feedforward transfer function
and the feedback transfer function
. The transfer function commonly relates the reference input
to the output
. Since there is only one feedforward element,
(no controller
), then the formula is given by
.
Hope the explanations help. Also suggest you to take these TWO (2) short courses:
Categories
Find more on PID Controller Tuning in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!