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

2 visualizaciones (últimos 30 días)
Piotr Kolodziej
Piotr Kolodziej el 4 de Ag. de 2024
Editada: Piotr Kolodziej el 8 de Ag. de 2024
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?

Respuestas (2)

Divyanshu
Divyanshu el 6 de Ag. de 2024
Editada: Divyanshu el 6 de Ag. de 2024
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 el 8 de Ag. de 2024
Editada: Piotr Kolodziej el 8 de Ag. de 2024
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.

Categorías

Más información sobre Simulink en Help Center y File Exchange.

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by