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

조회 수: 44 (최근 30일)
(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.

댓글을 달려면 로그인하십시오.

커뮤니티

더 많은 답변 보기:  Power Electronics Community

카테고리

Help CenterFile Exchange에서 Converters (High Power)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by