How to update value when different value is 0 in simulink?

3 次查看(过去 30 天)
Hi everyone,
I am creating a Simulink model to control an asynchronous motor with a current source inverter. I want to simulate a ramp-up by changing the frequency from an initial value to the rated value using a rate limiter. The issue is that I want to update the reference frequency value only when the counter (for selecting switches) reaches 0.
I have tried using the Signal Sample and Hold block as well as a combination of switches and memory blocks, but it is not working. The counter should always change from 0 to 180, but it is not behaving as expected.
Can anyone help with this?

回答(2 个)

Divyanshu
Divyanshu 2024-8-6
编辑:Divyanshu 2024-8-6
You can try using triggered subsystems. Add your entire model inside the triggered subsystem block and use the counter as a control signal for triggered subsystem.
When the value of counter changes from 0 to 180 then it will trigger a 'rising' edge and the triggered subsystem would be enabled. Make sure to keep the 'Trigger Type' as 'rising' in the block parameters of 'Trigger' block.
You can refer the following documentation link for more detail on 'Triggered Subsystem':

Piotr Kolodziej
Piotr Kolodziej 2024-8-8
编辑:Piotr Kolodziej 2024-8-8
Hello Divyanshu.
Thanks for help.I noticed that I was wrong. It was not the problem with updating value.
I used clock to create sinus signal wich was reseting the integrator block. The problem was with the clock, after updating the frequency I should reset the clock.
It is impossible to reset the clock so the only way is to use another memory block to update the last clock time value of 180 degrees and substract it from the time of the clock.
However it is easier to do it using Matlab Function.
Screen in attachments.
Thanks for help.

类别

Help CenterFile Exchange 中查找有关 Simulink 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by