Beruflich Dokumente
Kultur Dokumente
(3rd Bachelor)
Laboratory session 2
PWM Control
(Academic year 2012-2013)
The target of this lab is to understand PWM modulation and to design the digital circuitry to generate useful PWM signals.
How to get a sine wave reference? The output of an 8 -bit counter can be used as address for an 8 -bit lookup table containing the sine wave. This lookup table can be implemented in a ROM. Project --- > New Source --- > IP Core ---> Memories -- > Ram & Rom ---> Block Memory generator ---> Single Port Rom (8 bit wide, 256 words deep). Also you can add a text file to be connected to the ROM (--- > load init file). This file should contain the sine wave (values between 0 up to 255). The format for this file should have the extension name .coe (you can find it on toledo). The value 0 corresponds to the most "negative" value of the sine, the value 128 is the zero crossing, the value 255 is the most positive value of the sine wave.
Assignment 1:
Generate a simple PWM signal with changeable duty cycle.The period of the PWM is fixed, an UP switch should be used to increase the pulsewidth, a DOWN switch should be used to decrease the width.
Assignment 2:
Generate a sine modulated PWM signal. Pushing the UP switch should increase the sine frequency, pushing the DOWN switch should decrease it. Apply an external RC filter to observe the sine wave inside the PWM.
The H-Bridge.
In order to easily control a motor running in both directions the H Bridge is used.
Figure 1 H Bridge In the figure 1, you can see when A1 and A2 are closed the motor is running clockwise and when B1 and B2 are closed, the motor is running counter clockwise. When both A1-A2 and B1-B2 have identical ON-times, the motor is standing still. When A1-A2 is more of the time active than B1-B2, then the motor will run clockwise. Else when B1-B2 is more active the motor will run anti-clockwise. The main advantage of PWM / H-Bridge system is that power loss in the switching devices is very low. When a switch is off there is practically no current, and when it is on, there is almost no voltage drop across the switch. That is why it is widely used to control motors. In theory, there are two PWM signals needed for the H Bridge and they should be exactly inverted from each other (see in Fig2). The switch A1/A2 is controlled by PWM_A, while the switch B1/B2 is controlled by PWM_B.
However, in reality there is always a problem to get this system working well. Although both signals can be made to not overlap, in reality the delay of the switches can make them to be active at the same time : both switch A1 and switch B1 are on at the same time ! This generates a short circuit between Vcc and Ground, and the excessive current will kill the switches. To be avoided !!!
Figure 3 Short circuit when controlling the H Bridge Hence a minimum dead time is required to prevent this short circuit behavior. With appropriate dead time, you will never meet this short circuit situation. A switch going ON has to wait for a while till the other switch is really OFF.
Assignment 3:
Generate a PWM signal with programmable dead time for the motor. Starting from the main PWM signal the control signals A and B should be derived. Use I/O pins on the board (Expansion Connectors in the datasheet ex: B4 and A4) and output to an oscilloscope. The PWM period and pulse width might be constant, but the dead time should be adjustable by the UP and down switches.