Signal monitoring issue on Matlab Simulink from C2000

5 views (last 30 days)
Dear Community
I am trying to do the practice the model give in "Host-Target Communication"
Fig: Host
Fig: Target
I kept things as it is. Only, I added the following model inside the target to generate the 50Hz sine wave from the target controller (F28379D launhpad).
While I run the host model I found the following response.
However, when I plot the signal at 20kHz sample frequency, I found smooth sine wave.
Why is the sinewave like staircase shape?
It is supposed to be smooth wave as the sampling frequency in the target model is 20kHz, which is more than enough for the 50Hz signals.
Could anybody have any explanation for it?

Answers (1)

Sayan on 8 Dec 2023
Hi ismail hossain,
I understand from your query that the sinosoidal signals that you need to generate using your customized model are not as smooth as you have plotted those signal in the separate figure in MATLAB.
The possible reason for the staircasing of the signal can be due to the "Sample time" that you have provided in the Discrete-Time Integrator block. This sample time determines when the block output changes. If you have provided the sample time as the "Solver" step size in the configuration set, it will not be used to compute the block output. If you need to use 20kHz sampling frequency, you need to define 5e-5 in the "Sample time" parameter of the Discrete-Time Integrator block.
You can find more information on the Discrete-Time Integrator block in the following documentaion.
Hope this helps in answering the query.

Community Treasure Hunt

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

Start Hunting!