PWM Theoretical basis EN/ES

As we discover the functions that we can execute with a microcontroller things become more interesting because we are expanding our catalog with these functions which are useful when choosing our "control strategy".

In the previous topic we learned how to generate frequencies using the TMR2 of the microcontroller which opens the doors to new control tools such as communications and power control (both can be possible if we can control the signal generation).

Although we are still at a very early stage to venture into advanced communication modes, I think it is time to get to know concepts and principles of operation of a system for which I think it is the perfect time to learn about PWM (pulse width modulation).


A medida que vamos descubriendo las funciones que podemos ejecutar con un microcontrolador las cosas se hacen más interesantes porque vamos ampliando nuestro catálogo con dichas funciones las cuales son útiles a la hora de elegir nuestra "estrategia de control".

En el tema anterior aprendimos a generar frecuencias usando el TMR2 del microcontrolador lo cual abre las puertas a nuevas herramientas de control como lo son las comunicaciones y el control de potencia (ambas pueden ser posible si logramos controlar la generación de señales).

Aunque aun estamos en una etapa muy pronta para aventurarnos en modos de comunicación avanzados considero que es tiempo de ir conociendo conceptos y principios de funcionamiento de un sistema para lo cual creo que es el momento perfecto de aprender sobre PWM (modulación por anchura de pulso).




Src

Fundamental concepts

In order to facilitate the understanding of this article to any reader I consider necessary to define some basic concepts in telecommunications and power control, topics on which the PWM signal is based.

In our article Electric current in the time domain we learned some characteristics that are part of a wave, among these we can remember that a periodic wave will have an amplitude, a period, a phase (or phase angle), a frequency and others to which for now we will limit ourselves to evaluate those mentioned.

➤ Modulation: One of the advantages that a periodic wave presents is that it can be transmitted by radio frequency, this fact is used to transmit information at a distance but the information is contained in waves for which one of the mentioned characteristics is modified and thus includes the information. The modification of parameters in a wave in order to generate information is known as modulation.


Con la finalidad de facilitar la comprensión de este artículo a cualquier lector considero necesario definir algunos conceptos básicos en materia de telecomunicaciones y control de potencia, temas en los cuales está basada la señal PWM.

En nuestro artículo Corriente eléctrica en el dominio del tiempo aprendimos algunas características que forman parte de una onda, entre estos podemos recordar que una onda periódica tendrá una amplitud, un periodo, una fase (o ángulo de fase), una frecuencia y otras a las que por ahora nos limitaremos para evaluar las mencionadas.

➤ Modulación: Una de las ventajas que presenta una onda periódica es que puede ser transmitida por radiofrecuencia, este hecho se aprovecha para transmitir información a distancia pero la información está contenida en ondas para las cuales una de las característics mencionadas se modifica y de esta forma incluye la información. La modificación de parámetros en una onda con la finalidad de generar información se conoce como modulación.




Src

Pulse

If we have a DC source, a button and a bulb in series, we could say that to turn on the bulb you must "press" the button, while we hold the button the bulb will absorb energy, we could say that the time we hold the button is the time How long does the pulse last?

According to the illustration in the previous paragraph, we can define a pulse as the event by which a voltage goes from low to high until the moment it returns to the low state, with the time it lasts in the high state being an important characteristic. since it determines the time in which an energy transfer occurs.


Si tenemos una fuente DC, un pulsador y una bombilla en serie podríamos decir que para encender la bombilla se debe "pulsar" el boton, mientras sostenemos el boton la bombilla absorverá energía, podríamos decir que el tiempo que duramos pulsando el boton es el tiempo en que dura el pulso.

Según la ilustración del párrafo anterior podemos definir un pulso como el evento mediante el cual un voltaje pasa de bajo a alto hasta el momento en que vuelve al estado bajo siendo el tiempo que dura en estado alto una característica importante ya que determina el tiempo en el que ocurre una transferencia de energía.




By varying the pulse duration time, two important effects can be achieved: A form of communication and a power control.

  • Communication: To convert pulses into a signal a value is determined for each time duration, so if we assume that a time of 5ms represents the number 5 the receiver can measure the duration of the pulse and interpret the message can change the time for different characters that come to form a message.

  • Power control: If we use a switch to connect a load to the power source the source will deliver the highest possible power to the load and the total consumption (Watts per hour) is a function of time, this means that the longer the connection time the higher the consumption. If we can disconnect the load in short intervals without affecting its good performance we would be reducing the consumption and causing an effect on the power. This can be useful for controlling the speed of a motor, brightness intensity in a lamp and other applications.


Variando el tiempo de duración del pulso se pueden conseguir dos efectos importantes: Una forma de comunicación y un control de potencia.

  • Comunicación: Para convertir pulsos en una señal se determina un valor para cada tiempo de duración, de esta forma si suponemos que un tiempo de 5ms representa el número 5 el receptor podrá medir la duración del pulso e interpretar el mensaje pudiendo modificar el tiempo para distintos caracteres que lleguen a formar un mensaje.
  • Control de potencia: Si usamos un interruptor para contectar una carga a la fuente de energía la fuente entregará la mayor potencia posible a la carga y el total del consumo (Vatios por hora) es una función del tiempo, esto quiere decir que mientras mayor sea el tiempo de conexión mayor será el consumo. Si podemos desconectar la carga en intervalos cortos sin que esto afecte su buen funcionamiento estaríamos reduciéndo el consumo y causando un efecto en la potencia. Esto puede ser de utilidad para el control en la velocidad de un motor, intensidad de brillo en una lámpara entre otras aplicaciones.

Pulse width modulation

Now let's consider a periodic signal whose shape is a square wave, we could say that it is a signal composed of controlled pulses that have the same duration of time, these types of signals are the basis of digital systems as these pulses are used to represent the set of binary numbers and represent bits with each of them and bytes grouping a series of pulses, on all this is built our current digital technology.

If we take a square wave and modify the "pulse width" in a controlled way we can say that we are performing a pulse width modulation which is also known as PWM, now instead of pressing a button we have a system that can generate the same signal automatically. It is important to note that this type of modulation only affects the pulse width, however the frequency of the wave remains the same.


Ahora vamos a considerar una señal períodica cuya forma es una onda cuadrada, podríamos decir que es una señal compuesta por pulsos controlados que tienen la misma duración de tiempo, este tipo de señales son la base de los sistemas digitales ya que estos pulsos sirven para representar el conjunto de los números binarios y representar bits con cada uno de ellos y bytes agrupando una serie de pulsos, sobre todo esto está construida nuestra tecnología digital actual.

Si tomamos una onda cuadrada y modificamos el "ancho del pulso" de forma controlada podemos decir que estamos realizando una modulación por ancho de pulso lo que también se conoce como PWM, ahora en lugar de estar presioando un pulsador tenemos un sistema que puede generar la misma señal de forma automática. Es importante señalar que este tipo de modulación solo afecta el ancho de pulso, sin embargo la frecuencia de la onda sigue siendo la misma.




PWM characteristics

If the frequency is not affected by PWM neither is the period, therefore the cycle time remains the same, the time that lasts the pulse is called useful cycle and is measured with a percentage value, ie, 100% of the period the value of the useful cycle can be between 0 and 100%, when it is 100% is equivalent to a DC voltage of equal value to the amplitude (pulse value in volts). The mathematical formula to calculate the duty cycle is where D represents the duty cycle, T the period and the pulse time.

The duty cycle percentage also determines the percentage of source voltage delivered to the load, if our source is 20V and we use a 50% duty cycle the load will see a voltage of 10V (which is 50% of 20), this is valid for every percentage value and is the way in which power can be reduced in a load by varying the duty cycle value.


Si la frecuencia no es afectada por PWM tampoco lo es el período, por lo tanto el tiempo de duración del ciclo sigue siendo el mismo, el tiempo que dura el pulso de denomina ciclo útil y se mide con un valor porcentual, es decir, del 100% el período el valor del cíclo útil puede ser entre 0 y 100%, cuando es del 100% es equivalente a un voltaje DC de igual valor a la amplitud (valor del pulso en voltios). La formula matemática para calcular el ciclo útil es donde D representa al ciclo útil, T el periodo y el tiempo que dura el pulso.

El porcentaje del ciclo útil también determina el porcentaje de voltaje de fuente que se entrega a la carga, si nuestra fuente es de 20V y usamos un ciclo útil del 50% la carga verá un voltaje de 10V (que es el 50% de 20), esto es válido para cada valor porcentual y es la forma en la que se puede reducir la potencia en una carga variando el valor del ciclo útil.


PWM applications

Although PWM can be used with a carrier to transmit information, this application is impractical because there are many techniques with higher efficiency for this purpose. That is why the main uses of PWM are in power control.

It is very useful for controlling motors and varying the intensity of brightness in a light source, it is also used in switching power supplies to stabilize current delivery and servo motors. As always the limitation is the imagination as it can be used to reduce voltage among many other applications.


Aunque PWM se puede usar con una portadora para transmitir información esta aplicación es poco práctica debido a que existen muchas técnicas con mayor eficiencia para este propósito. Es por esto que las principales utilidades de PWM estan en el control de potencia.

Es muy útil para el control de motores y variar la intensidad de brillo en una fuente de luz, también se usa en las fuentes conmutadas para estabilizar la entrega de corriente y en servo motores. Como siempre la limitación es la imaginación ya que se puede usar para reducir tensión entre muchas otras aplicaciones.







H2
H3
H4
3 columns
2 columns
1 column
6 Comments
Ecency