1
\$\begingroup\$

By using PWM I have converted some signal to pulses and inserted it into transfer function of 2/(0.01*s+1)

I then compared between the result of the original output and the output after using PWM (blue line is the original output and the yellow is due to PWM):

enter image description here

It can be seen that the output from the PWM is chattering.

The Simulink model looks as following:

enter image description here

The triangle is made by using the following points: (0,0.5) , (0.0025,0) , (0.0075,1) , (0.01,0.5)

Also, by increasing the frequency of the sine wave the result seems to be better:

enter image description here

Is there some way to make it with smaller standard deviation for the results?

Thank you.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ What does the convert block do? Are you using a sample&hold for the sine? Why? Is the triangle also sampled? What sample rate compared to the triangle and sine? The limiter at the output seems useless. The result seems strange, compared to this quick test. \$\endgroup\$ – a concerned citizen Oct 7 '18 at 17:13
  • \$\begingroup\$ The converter just allows to insert this type of signal to the transfer function. Sample&hold is used just to check how it would react in my real signal which will be sampled every 0.02 seconds (here I just left it for the sine), The limiter is indeed useless. Maybe the difference is due to the transfer function? \$\endgroup\$ – Ben Oct 7 '18 at 17:31
  • \$\begingroup\$ There is no where near enough information to even begin to highlight where the problem is.What is the characteristics of the sinus waveform. Where are the axis markers on the plots. The PWM freq appears to be 100Hz but equally the sin freq is very close to this. The TF has a timeconstant of 10ms so it won't attenuate the pwm that much. Why use a compare to zero when a comparison block will do \$\endgroup\$ – JonRB Oct 7 '18 at 21:00
1
\$\begingroup\$

You haven't given particulars, but it looks like you are seeing the result of individual PWM pulses. If so, and that's not what you want, then you need to low pass filter the PWM output more.

The low pass filter should be attenuating the PWM frequency to below your maximum noise limit. It is apparently not doing this, so needs to be re-designed.

As high as possible PWM frequency helps. That leaves more frequency ratio between the PWM frequency and the highest frequency of interest. That in turn makes it easier to attenuate the PWM frequency while not attenuating the desired frequency.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you Olin, I have edited the question to add more information. \$\endgroup\$ – Ben Oct 7 '18 at 16:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.