How to generate Pulse Frequency Modulated (PFM) waveform?

There are a lot of ways to generate PWM in simulink, also there is a built in PWM Generator block. But there are no direct resources availabe for generating variable frequency PWM. How can the variable frequency PWM be generated with the condition that "an update to frequency must be done at the completion of previous cycle".
This Programmable Pulse Generator is capable of varying the frequency of PWM, but it do not meet the above stated condition as updated are done instantly and do not wait for the cycle to complete which produces glitches in the application where it is used.
If someone knows how can the frequency of sawtooth/triangular..etc waveforms be changed in rum time, please share it too as it can provide a foundation for generation of variable frequency PWM.
Thank you!

6 commentaires

hello
a PWM isually generated by comparing the signal vs a triangular wave , why not simply build your own version of that ? it will require very few blocks (traingular wave form generator + comparator)
Yes that is possible and I have tried that. But the problem is that the frequency of traingular or sawtooth wave can not be updated when the simulation is running. How can we vary the frequency of triangular waveform sinusiodally with the condition that the update in frequency is applied at the end of previous cycle.
hello
so if I understand correctly, you want to modulate the carrier frequency (like in a spread spectrum design for class D amplifier ?)
Yes, Actually I want to generate Pulse Frequency Modulation (Frequency of PWM as a function of some signal like sine, square etc). In PWM time period of pulses is fixed and the information is coded in pulse width by changing duty cycle as a function of some signal. While in PFM pulse width is fixed (lets say to 50%) and frequency varies with signal.
So I want to generate flexible PFM to regulate the output of resonant converters. Since the output voltage of resonant converters is regulated by changing the frequency of switching waveforms. I hope you got my point.\
Regards,
Sohail
hello again
so as usually the carrier is a sawtooth signal, I was thinking of using a counter where the slope (= increment) can vary so the frequency of the carrier will be proportionnal to this increment
have you tried something like taht already ?

Connectez-vous pour commenter.

 Réponse acceptée

Mathieu NOE
Mathieu NOE le 29 Sep 2021

0 votes

hello again
so I created this simulation (see attachement) where the counter output is modulated by the frequency input
the frequency is a number around 1 (1 = nominal frequency)
if frequency is equal to 1 , the counter will increase up to Nmax specified (here 256) at the rate of the simulation (here 1000 iterations per second )
you can modulate that frequency to make it faster or slower . the upper trace is the counter output showing the sawtooth waveform, the lower trace is a copy of the "real" frequency value used at each counter cycle start (no modification of frequency inside one cycle is allowed)
maybe you can further build your solution on this little demo
all the best
Done with R2020b

5 commentaires

hello
have you tried my example ? does it fullfill your need ?
all the best
Sohail Ahmed
Sohail Ahmed le 30 Sep 2021
Modifié(e) : Sohail Ahmed le 30 Sep 2021
Thank you very much for your time and effort. This is exactly what I need. So the frequency of sawtooth waveform can be increased or descreased by decreasing or increasing the value of Nmax respectively OR it can be increased or decreased by decreasing or increasing sample time respectively. For the current setup with Nmax = 256 and sample time =1e-03 the frequency of sawtooth waveform is 3.906Hz.
Could you please share if you already know the relationship between sample time, Nmax and frequency of sawtooth.
Again thank you very much!
I have found the relationship which is:
hello
FYI, changing Nmax will affet the cycle duration of the triangle waveform but also it's amplitude , so if you want to keep the amplitude constant (as a regular sawtooth wave form generator) I would only use the freq input (my 2 cents)
The amplitude does not matter since I will compare sawtooth waveform with a constant value of half the value of Nmax to generate PWM.

Connectez-vous pour commenter.

Plus de réponses (0)

Communautés

Plus de réponses dans  Power Electronics Control

Community Treasure Hunt

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

Start Hunting!

Translated by