PWM modulation is the process that takes analog input signal and produces a Pulse-Width-Modulated digital signal where pulse width or duty cycle is proportional to the input voltage. Any microcontroller can easily generate PWM signal using timers but resolution is limited to only 7-8 bits for higher sample rates like ones needed for sound or ultrasound signal modulation. Principle here is to compare analog input voltage with triangle waveform using analog comparator that gives unlimited resolution.
OperationThere are two modulators where one takes non-inverted input signal and other takes inverted input signal. Two outputs OUT1 (PWM1) and OUT2 (PWM2) makes differential PWM output, that is suitable for driving H-Bridge power stage.
Regulation is possible by closing negative feedback circuit by populating R15 resistor and leaving R9 unpopulated. Differential feedback input (FB1 - FB2) connects to final regulation output (H-Bridge power stage output) through resistor divider network in order to adjust full scale of output (0-VCC) to full scale of input (1Vrms). If feedback is not needed, R9 resistor should be populated and R15 unpopulated.
SetupKiCad open source project files are available. It is possible to do setup using proto-board and do connections according to attached schematic. Other way is to fabricate PCB and solder all parts, so it can be reused as module in different projects. To get PCB just send gerber files to PCB manufacturer. For soldering download ibom.html and use it as placement guide.
PinoutUse Trimpot RV1 to set desired PWM frequency. If oscilloscope is available use it to measure CLOCK signal at P2 pin 10, otherwise use multimeter to measure RV1 resistance (between pins 1-2) and calculate frequency according:
Fpwm=R7/(R6*(RV1+R5)*C)/4.
Comments