Is the counter here working properly?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dongxu Guo
el 30 de Nov. de 2023
Respondida: Dongxu Guo
el 1 de Dic. de 2023
I am trying to simulate a system in Simulink as shown below. It's kindof like a sigma-delta modulator. The two switches act like comparators - when the error exceeds the upper limit, +d becomes 1, otherwise it remains 0; when the error exceeds the lower limit, -d becomes 1, otherwise it remains 0. Both counters are set to count up, when there's rising edge from +d/-d.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1556989/image.png)
Now the system is not working as I expected, and I noticed some weired behaviour of the counter at the top: +d only has one rising edge but the counter starts to count even before the rising edge. Is the counter working properly, or I'm doing something wrong? I've also attached the simulink model if it helps.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1556994/image.png)
3 comentarios
madhan ravi
el 30 de Nov. de 2023
Have a look at Triggered and Enabled subsystem, when you respond just post the output signal scope that you would like to achieve for the specified inputs.
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre General Applications en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!