Pulse Width Modulation(PWM) working Principal using Matlab
Share Now...

PWM

Introduction

Pulse Width Modulation(PWM) working Principal using Matlab.

PWM stands for Pulse Width Modulation. It is a type of digital modulation that is widely used for controlling the power delivered to electrical devices, such as motors, lights, and heaters.

In PWM, the duty cycle of a square wave is varied to control the average value of the waveform, which is proportional to the power delivered to the device. The duty cycle is defined as the proportion of time that the square wave is in the “on” state to the total time it takes to complete one cycle. By varying the duty cycle, the average value of the waveform can be adjusted, and therefore the power delivered to the device can be controlled.

PWM is used in many applications because it is a simple and efficient way to control the power delivered to a device, while also reducing the amount of electromagnetic interference generated by the device. For example, in motor control, PWM is used to control the speed of a motor by adjusting the duty cycle of the square wave that is applied to the motor. By adjusting the duty cycle, the average voltage applied to the motor can be adjusted, which in turn changes the motor speed.

In PWM, the frequency of the square wave is typically much higher than the bandwidth of the device being controlled. This results in a low-frequency signal that is filtered out by the device, while the high-frequency component of the signal drives the device. This results in low electromagnetic interference and improved power efficiency

PWM Components

  1. A Pulse Generator: This generates the square wave that serves as the base signal for the PWM waveform. The pulse generator can be a digital or analog circuit, and it produces a square wave with a fixed frequency and variable duty cycle.
  2. A Control Circuit: This circuit adjusts the duty cycle of the square wave in response to control signals from an external source, such as a microcontroller or a potentiometer. The control circuit can be an analog or digital circuit that implements a control algorithm to adjust the duty cycle based on the input signal.
  3. A Power Stage: This stage delivers the PWM signal to the load, such as a motor or a light. The power stage typically includes a power switch, such as a transistor or a MOSFET, and an output filter, such as a low-pass filter, to smooth out the PWM signal and produce a continuous average voltage that drives the load.
  4. A Load: This is the device that is being controlled by the PWM signal. The load can be a motor, a light, a heater, or any other device that requires power control.
  5. An optional Feedback Circuit: This circuit measures the response of the load to the PWM signal and provides feedback to the control circuit. The feedback circuit can be used to implement closed-loop control, where the duty cycle of the PWM signal is adjusted based on the load response, in order to maintain a desired setpoint.

Duty Cycle of PWM

The duty cycle of a PWM waveform is the proportion of time that the waveform is in the “on” state, relative to the total time it takes to complete one cycle. It is expressed as a percentage or as a fraction of the total cycle time.

For example, if the PWM waveform is “on” for half of a cycle, and “off” for the other half of the cycle, the duty cycle would be 50%. If the PWM waveform is “on” for a quarter of a cycle, and “off” for the other three quarters of the cycle, the duty cycle would be 25%.

The duty cycle of a PWM waveform can be adjusted to control the average value of the waveform and, therefore, the power delivered to the load. For example, if the duty cycle is increased, the average value of the waveform increases, and more power is delivered to the load. Conversely, if the duty cycle is decreased, the average value of the waveform decreases, and less power is delivered to the load.

In PWM applications, the frequency of the waveform is typically much higher than the bandwidth of the load, so the load only responds to the average value of the waveform. By adjusting the duty cycle, the average value of the waveform can be controlled, and the power delivered to the load can be adjusted.

Software Requirement

Matlab Software or Online Matlab

Matlab Code

clc;
clear all;
close all;
F2=input('Messsage frequency=');
F1=input('Carrie Sawtooth Frequency=');
A=5;
t=0:0.001:1;
c=A.*sawtooth(2*pi*F1*t);
subplot(3,1,1)
plot(t,c);
xlabel('time')
ylabel('Amplitude');
title('Carrier Sawtooth Wave');
grid on;
m=0.75*A.*sin(2*pi*F2*t);
subplot(3,1,2);
plot(t,m);
xlabel('Time');
ylabel('Amplitude');
title('Message Signal');
grid on;
n=length(c);
for i=1:n
if (m(i)>=c(i))
pwm(i)=1;
else
pwm(i)=0;
end
end

subplot(3,1,3);
plot(t,pwm);
xlabel('Time');
ylabel('Amplitude');
title('plot of PWM');
axis([0 1 0 2]);
grid on;

PWM Output

PWM5

Explore More Projects on Matlab

Join us for Regular Updates

TelegramJoin Now
WhatsAppJoin Now
FacebookJoin Now
InstagramJoin Now
LinkedInJoin Now
Join our Telegramconnectkreations

About Connect Kreations

We the team Connect Kreations have started a Blog page which is eminently beneficial to all the students those who are seeking jobs and are eager to develop themselves in a related area. As the world is quick on uptake, our website also focuses on latest trends in recent technologies and project learning and solutions. We are continuously putting our efforts to provide you with accurate, best quality, and genuine information. Here we also have complete set of details on how to prepare aptitude, interview and more of such placement/ off campus placement preparation.

Connect Kreations is excited to announce the expansion of our services into the realm of content creation! We are now offering a wide range of creative writing services, including poetry, articles, and stories.

Whether you need a heartfelt poem for a special occasion, a thought-provoking article for your blog or website, or an engaging story to captivate your audience, our team of talented writers is here to help. We have a passion for language and a commitment to creating high-quality content that is both original and engaging.

Our services are perfect for individuals, businesses, and organizations looking to add a touch of creativity and personality to their content. We are confident that our unique perspectives and diverse backgrounds will bring a fresh and exciting voice to your project.

Thank you for choosing Connect Kreations for your content creation needs. We look forward to working with you and helping you to bring your vision to life!

The website is open to all and we want all of you to make the best use of this opportunity and get benefit from it..🤓

Share Now...
Connect Kreations
Connect Kreations
Articles: 57