Variable Resolution PWM Generation Using Divide-by-W Counter

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current microprocessor-based PWM systems face limitations in achieving high resolution due to timer interrupt latency, resulting in quasi-random timing errors that affect system performance, especially in high-response systems, and require costly hardware modifications for improved resolution.

Innovation Solution

A system comprising a microcontroller, a divide by W counter, a delay circuit, and a flip-flop with a logic gate to generate a PWM signal with variable duty cycle resolution, minimizing hardware usage and CPU overhead, allowing resolution up to a fraction of the CPU time period.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If timer interrupt latency is used in software-based PWM generation, then CPU overhead is reduced, but timing precision and PWM resolution deteriorate due to quasi-random timing errors

Engineering Contradiction:
ImproveCPU overheadVSAvoidPWM resolution
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The PWM generation function is segmented into two parts: a software component that sets the duty cycle ratio, and a hardware component (counter and logic gate) that generates the precise PWM waveform. This segmentation allows the CPU to avoid timing-critical operations while maintaining high resolution through hardware-based pulse generation.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

A counter circuit serves as an intermediary between the CPU and the PWM output. The counter receives the duty cycle ratio from the CPU, then autonomously generates the PWM waveform using its internal clock and logic gates, eliminating the need for CPU intervention during the actual pulse generation process.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If hardware modifications are made to improve PWM resolution, then PWM resolution improves, but system cost and complexity increase

Engineering Contradiction:
ImprovePWM resolutionVSAvoidhardware complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The counter circuit performs multiple functions: it acts as a frequency divider, a timing generator, and a waveform shaper. By using a single counter component with clock input and logic gate outputs, the system achieves high-resolution PWM without requiring multiple specialized hardware components.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

Instead of modifying the CPU's internal timer hardware to achieve higher resolution, the invention creates a separate, dedicated counter circuit that copies the essential timing function but operates at higher resolution using its own clock source and logic gate structure.

Inventive Principle:
Principle #26Copying

3Measurement precision

If direct CPU control is used for each PWM output pulse, then PWM timing precision improves, but CPU time and productivity are reduced

Engineering Contradiction:
ImprovePWM timing precisionVSAvoidCPU time
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The counter is pre-configured with the duty cycle ratio before PWM generation begins. This preliminary setup allows the counter to autonomously generate precise PWM waves without requiring CPU intervention during the actual pulse generation, thus maintaining timing precision while freeing CPU resources.

Inventive Principle:
Principle #10Preliminary action

4Measurement precision

If PWM resolution is increased beyond input frequency multiples, then output resolution improves, but timer interrupt latency causes timing errors

Engineering Contradiction:
ImprovePWM resolutionVSAvoidtiming accuracy
Core Design Contradiction:
Measurement precisionVSReliability

Solution Approach 1:

The system dynamically adjusts the counter's operating parameters based on the desired PWM resolution. The counter can operate at different division ratios and clock frequencies to achieve various resolution levels without being constrained to fixed multiples of the input frequency, while maintaining timing accuracy through hardware-based generation.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS20080048899A1System and method for generating a pulse width modulated signal having variable duty cycle resolution
Publication Date: 2008.02.28 STMICROELECTRONICS PVT LTD
  • US20080048899A1 patent drawing
  • US20080048899A1 patent drawing
  • US20080048899A1 patent drawing

AI summary

A system and method generate a pulse width modulated signal having variable duty cycle resolution. A hardware uses minimal hardware to improve the PWM duty cycle resolution up to 0, such that highest possible resolution of a waveform can be obtained, including a sine wave. An embodiment of the invention uses a microcontroller, a divide by W counter, a delay circuit, a flip-flop, and a logic gate.