Creating a Clock Generator in Simulink

14 vues (au cours des 30 derniers jours)
Ta Wil
Ta Wil le 23 Fév 2022
Réponse apportée : Vidip le 23 Nov 2023
Hello,
I need to input data to a chart. I would like the data to represent the hours of the day from 0 to 23 and for this to be a repeated sequence so that I can have a simulation time of two days. How do I start to create such a clock generator?
Thank you.

Réponses (1)

Vidip
Vidip le 23 Nov 2023
I understand you want to create a clock generator that generates a periodic signal representing the hours of the day from 0 to 23, you can use the following steps:
  1. Use a 'Ramp block' in Simulink to generate a ramp signal with a period of 23 hours. This will represent the continuous progression of time within a day.
  2. You can use a 'Modulo block' to take the modulus of the ramp signal, effectively wrapping the signal back to 0 after it reaches 23. This will ensure that the signal remains within the desired range of 0 to 23.
  3. To quantize the Signal, use a 'Quantizer block' to quantize the modulated ramp signal to integers. This will convert the continuous time representation into discrete hours of the day, ranging from 0 to 23.
  4. Use a 'Delay block' with a delay time of 23 hours to delay the quantized signal by one day. This will effectively create a repeated sequence of the hourly values, allowing the simulation to run for two days.
For further information, refer to the documentation links below:

Community Treasure Hunt

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

Start Hunting!

Translated by