How can i replace Simscape "DC Voltage Source" with a Simulink signal?

39 ビュー (過去 30 日間)
Multiplexer
Multiplexer 2017 年 8 月 4 日
コメント済み: Mark Sherstan 2018 年 11 月 20 日
(UPDATED)
Hello, there is this elec_motor_dc_pwm example which is SimScape electric motor controlled by PWM (it uses PWM signal for motor speed and has an integrated H-Bridge model).
In the example it uses a "DC Voltage Source" block to set PWM reference voltage that controls simulated motor.
What i want is to be able to somehow set the motor voltage with a Simulink "double" data type signal instead of that constant "DC Voltage Source" ("double" data type signal from Simulink will be changing over time during simulation).
The first thing that came to my mind was to use a "S PS" converter block but "DC voltage source" block needs two inputs and it wouldn't connect anyway
So i found a "Controlled Voltage Source Block". I changed its type to "DC", set "Initialize", "Initial amplitude 0" and set "Measurements Voltage".
After that i connected Simulink "double" data type signal to "S" input of "Controlled Voltage Source" and after that i tried replacing Simscape "DC Voltage Source" with new block like below
but the signals still wont connect, when i get them close to each other a little red crossed circle icon appears.
I'm obviously missing something, some additional conversion but i have no idea what is it.

採用された回答

Multiplexer
Multiplexer 2017 年 8 月 7 日
編集済み: Multiplexer 2017 年 8 月 7 日
Wow, ok, this is what it turned out to be the problem. I used "wrong" controlled voltage source block.
So apparently there are two blocks with exactly same name, one is
Specialized Technology/Fundamental Blocks/Electric Sources/Controlled Voltage Source
and the other is
Foundation Library/Electrical/Electrical Sources/Controlled Voltage Source
The second one would not connect at all to the circuit (as on images above) but when i picked the first one it worked.

その他の回答 (1 件)

Daniel Burke
Daniel Burke 2017 年 8 月 4 日
I’m not entirely sure by your description but it seems like you have tried replacing the "PWM reference voltage" block with a controlled voltage source, then routing the output of a S-PS converter block into the input of that controlled voltage source. I was able to run it using a constant as my input to the S-PS converter and setting the “Input signal unit” parameter inside of the S-PS converter to V in the drop-down menu. If this is not working on your end the problem might instead be with the signal you are trying to use from Simulink.
  2 件のコメント
Multiplexer
Multiplexer 2017 年 8 月 7 日
Yeah, i might have not explain my problem very well, I'll try again, this time with images, this should clear things up (and ill update original post too).
So there is this elec_motor_dc_pwm example which is SimScape electric motor controlled by PWM.
It uses a "DC Voltage Source" block to set PWM reference voltage that controls simulated motor.
What i want is to be able to somehow set the motor voltage with a Simulink "double" data type signal instead of that constant "DC Voltage Source" ("double" data type signal from Simulink will be changing over time during simulation).
The first thing that came to my mind was to use a "S PS" converter block but "DC voltage source" block needs two inputs and it wouldn't connect anyway
So i found a "Controlled Voltage Source Block". I changed its type to "DC", set "Initialize", "Initial amplitude 0" and set "Measurements Voltage".
After that i connected Simulink "double" data type signal to "S" input of "Controlled Voltage Source" and after that i tried replacing Simscape "DC Voltage Source" with new block like below
but the signals still wont connect, when i get them close to each other a little red crossed circle icon appears.
I'm obviously missing something, some additional conversion but i have no idea what is it.
Mark Sherstan
Mark Sherstan 2018 年 11 月 20 日
I ran across this post looking for something else but you needed a Simulink-PS Converter to bridge between simulink and simscape.

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

コミュニティ

カテゴリ

Help Center および File ExchangeConverters (High Power) についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by