浮名此生分享 http://blog.sciencenet.cn/u/hailangww 工学博士

博文

[转载]What is the N coefficient filter in simulink?

已有 487 次阅读 2024-9-3 11:45 |系统分类:科研笔记|文章来源:转载

What is the N coefficient filter in simulink? What effect does it have on the PID controller?

Hi Rikke,

Please refer to this post:

http://www.mathworks.com/matlabcentral/answers/63762-filter-coefficient-n-in-pid-block

The filter coefficient is used to implement derivative action. Since implementing something like "Kd*s" is not possible since implementing improper transfer function is not possible. Hence instead of "Kd*s", we do something like:

Kd*(N*s/(s+N)).

So if N is sufficiently large, it tends to "Kd*s"

Hope this helps.

Hi Vaibhav, I have the following question: how can implement in Simulink a PID expressed like this? I'm not able to put it in Simulink's form. Thanks for your help,

image.png

MYO ZIN AUNG 2020-6-26

You can use Simulink Transfer Function Block.

SASANK DAS 2022-2-4

Can I give filter cofficient as N=2000, which will giving good indcutor current response for my buck converter, rather than using N=100(which will producing more noice)

Filter coefficient (N) in PID block?

Robert 2013-2-17

评论: Andre Elliot 2023-5-15

采纳的回答: Arkadiy Turevskiy 

Good evening folks!

While tuning my quadrotor model in Matlab I found that the Matlab PID function had a Filter coefficient (N) term in the PID equation. However I have not encountered such a term in my typical PID programs. How would one implement this term into the PID equation and what would be some simple C code to add this term into the derivative? I tried generating C code from my model but got a lot of header and C program files with nothing close to simple.

My current PID code line in C is:

U2 = KP * phi_error + KI * phi_errorsum + KD * (PHI_RATE_desired-PHI_RATE);

Many Thanks, Robert

Arkadiy Turevskiy  2013-3-12

在 MATLAB Online 中打开

The code would look like that.

主题复制

   FilterCoefficient = (Kd * u - Filter_DSTATE) * N;

   y = (Kp * u + Integrator_DSTATE) + FilterCoefficient;

   Integrator_DSTATE += Ki * u * 0.01;

   Filter_DSTATE += 0.01 * FilterCoefficient;

HTH.

Arkadiy

  4 个评论

显示 2更早的评论

Marzieh Hosseini

Marzieh Hosseini 2021-5-6

Hi,

Is it the same code if I want to implement PID in Matlab code, while I am controlling a device directly with Matlab and I got real time information in my Matlab?

Andre Elliot

Andre Elliot 2023-5-15

Hi what are u, N, y and the meaning of DSTATE? nice day.

困

 更多回答(3 个)

Shashank Prasanna

Shashank Prasanna  2013-2-17

Hi Robert, this link should give you a better idea of what N means:

http://www.mathworks.com/help/simulink/slref/pidcontroller.html#br9ejg0-18

If you have Simulink Control Design toolbox, then you can use the built in pidtune functionality to tune the PID.

  1 个评论

Brian Candiloro

Brian Candiloro 2023-1-13

Can this filter term be realized in a physical opamp differentiator circuit or only in code?

困

Robert

Robert 2013-2-17

Thank you for the response, but I saw that link and do not quite understand it entirely, especially the filter block.

So in essence should the code look something like this:

Derivative PID:

Derivative_gain*(set_rate - N*acutal_rate)?

I am not quite sure where the filter (1/s) comes into play.

Thank you

  0 个评论

困

Robert

Robert 2013-2-21

Any ideas?

  1 个评论

Seng Tak Goh

Seng Tak Goh 2019-3-11

在 MATLAB Online 中打开

Hi Robert,

In essence, the filtered derivative is doing a first order filtering on the change of the inputs, scaled by D gain.

The 1/s integrates the previous output scaled by N term, then adding the input change scaled by D * N to produce the output.

If you multiply the D term of the continuous form by s, you will see it better how the filtering comes into play.

In discrete form:

主题复制

y[n] = D*N*(u[n]-u[n-1]) + (1-N*Ts)*y[n-1];

困



https://blog.sciencenet.cn/blog-54347-1449417.html

上一篇:[转载]表磁、剩磁和磁通量
下一篇:[转载]STM32延时函数的四种方法:普通延时(2种)、SysTick 定时器延时(2种)
收藏 IP: 180.154.88.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-11-24 11:19

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部