Signal monitoring issue on Matlab Simulink from C2000
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Dear Community
I am trying to do the practice the model give in "Host-Target Communication"
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1537845/image.png)
Fig: Host
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1537850/image.png)
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).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1537855/image.png)
While I run the host model I found the following response.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1537860/image.png)
However, when I plot the signal at 20kHz sample frequency, I found smooth sine wave.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1537865/image.png)
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?
0 Commenti
Risposte (1)
Sayan
il 8 Dic 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.
0 Commenti
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!