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

33 次查看(过去 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 Control

Community Treasure Hunt

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

Start Hunting!

Translated by