Simulink pulse generator issue

6 ビュー (過去 30 日間)
Brad
Brad 2013 年 4 月 12 日
In working on a project for one of my classes this semester I encountered an issue with matlab simulink that has me puzzled. In order to realize control of a circuit I was modeling I needed to have control of a pulse generator duty cycle. The build in model for pulse generator will allow you to send it a workspace variable for setting the duty cycle but there is no way that I found to have that variable change during the simulation based on feedback from the circuit. So I set out to build my own square wave signal using existing models within simulink.
To realize this model I first looked on the matlab file exchange and found that someone had already created a model to do what I wanted. I tried it out and found that it worked very well for signal periods greater 1ms but failed to work at all for periods less than 1ms. It would just output a triangle wave at the frequency specified by the period variable instead of a variable duty cycle square wave. I saw that other people commented on the file exchange that they had similar issues. So I created my own simple model to generate a square pulse with a variable duty cycle. The method I used was to create a repeating triangle wave signal and then compare it to a constant corresponding to the duty cycle I wanted to realize. Upon testing this model out I ran into the same problem again. The model works perfectly for periods that are greater than 1ms and fails to vary the duty cycle at periods at less than 1ms.
At this point I decided to reach out for help elsewhere. I was told to check the step size settings to see if the resolution would allow for that precision. I changed the step size from variable to fixed at a period of .5 us which is well above what would required for my simulation. It did not change the results of either model. I tried this on all versions of matlab at my disposal: 2011a, 2012a, and 2013a.
I am now being forced to look at alternative creative solutions in order to sidestep this issue with matlab and I would like to locate some help in correcting it.
Thanks in advance for insight into my issue.

回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by