I had to solve the problem of generating a PWM signal with a duty cycle variable. The most useful block I found for this issue was
PWM Generator (DC-DC) where the PWM frequency is fixed but you can modify the duty cycle from an input.
It seems easy, but when I firts tried, I didn't get the result I expected.
Finally I realized that the problem was in the characteristics of the display. So here you can find an example of the block running as it's expected.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSaFLsFzdzMu7j-6tCoMBxxHsAA2ZDuOfmpHnYNusvbUQ1i9gynQTGE3BHP9wxm6HfZ-fe3st7n1dsvCT3bRHSkFhcf7Lo4XWWN7FJkgz8A3nxl8HhXkslbbRRGXiciTvpVYb5kxhshFE/s640/picture1.png) |
PWM signal generator circuit. Variable duty Cycle |
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4ijFPWtF-e5QjRMwee8lrPu8JqqG_2ZjKQwP3QlBgiIkKVjeaCO7OecD7ptBZr1dyf-5tFHq9_dF-iXNotrfdtREVq4f-UdZkMXpZcCi3fenGTTpbI4Sb-qtQRV_r193HtoQIA4E77lY/s400/picture2.png) |
Stair Generator Parameters |
In order to have a good representation of the different duty cycles the scope must be configured in continuous mode (sample time = 0) and the appropiate time range (In this case t = 0.001)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVtx2cx8pgEgBpTcpi1Gyd0tve3uJ1wqGCg6F2aK4MPdx-uDrdddZ4tpBOtjdFoIoLV05BhqBwoZV_C7maw4PVd3W9VTiVZcwvbXa0FJg8dcQ1v1uLSPdpmyjFB70eg3W9heBzQRz8CvQ/s400/picture3.png) |
Display parameters |
Here you can find the simulation result:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg44-r2kbWs-wVoWMBmltja3GIeMASditoIiwhG_Y4oEeSIYX90i79IP8K8w77TeMvLAH8gRcTDB0erLP8iOdeuTJzb5sqd9c_m9OCzL_rqFgVpyKOoiqA0QT05xxZohDFTUcqMO__3Dzg/s640/picture4.png) |
Simulation result |
Notice that the duty cycle follows the input signal.
No comments :
Post a Comment