Discrete to continuous in Simulink.

2 ビュー (過去 30 日間)
Nguyen Hieu
Nguyen Hieu 2022 年 8 月 25 日
コメント済み: Paul 2022 年 8 月 29 日
Hi, I use PID controller to control the input voltage (Ui) of the servo valve to adjust the spool displacement [-10< Ui <10 (V)].
I coded Ui =[-10:0.01:10]; and Simulink show the error: "Encountered unknown exception". So i think that discrete value from Ui can't calculate for the continuous system ( have PID controller and Intergator). It has any block or code to make Ui become continuous? Thank you for help.
  5 件のコメント
Nguyen Hieu
Nguyen Hieu 2022 年 8 月 29 日
Math equation is: @Paul
Paul
Paul 2022 年 8 月 29 日
Apparently Ui is supposed to be scalar, but its coded as a 2001-element vector. Why is it coded as a vector?

サインインしてコメントする。

回答 (1 件)

Abderrahim. B
Abderrahim. B 2022 年 8 月 25 日
Hi!
Use d2c and/or c2d functions in a MATLAB function !
Check out the link below, some others methods to do this conversion are listed there.
Note that most of these methods require Control System Toolbox.
Hope this helps
  2 件のコメント
Nguyen Hieu
Nguyen Hieu 2022 年 8 月 29 日
My code is:
U =[-10:0.1:10];
Ui=d2c(U);
And Matlab show:
Error using d2c (line 33)
Not enough input arguments.
Error in half_car_supension (line 16)
Ui=d2c(U);
Can you help for this. Thank you.
Abderrahim. B
Abderrahim. B 2022 年 8 月 29 日
d2c and c2d accept model object as input, will not work in your case. To convert a vector(discrete) to continuous use quantizer and zero-order hold blocks.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by