Добавил:
ИВТ (советую зайти в "Несортированное") Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
interfeysy_1 / ИДЗ_машинка / даташиты / esp32_technical_reference_manual_en.pdf
Скачиваний:
6
Добавлен:
26.01.2024
Размер:
9.62 Mб
Скачать

16 Motor Control PWM (PWM)

16 Motor Control PWM (PWM)

16.1Introduction

The Motor Control Pulse Width Modulator (MCPWM) peripheral is intended for motor and power control. It provides six PWM outputs that can be set up to operate in several topologies. One common topology uses a pair of PWM outputs driving an H-bridge to control motor rotation speed and rotation direction.

The timing and control resources inside are allocated into two major types of submodules: PWM timers and PWM operators. Each PWM timer provides timing references that can either run freely or be synced to other timers or external sources. Each PWM operator has all necessary control resources to generate waveform pairs for one PWM channel. The MCPWM peripheral also contains a dedicated capture submodule that is used in systems where accurate timing of external events is important.

ESP32 contains two MCPWM peripherals: MCPWM0 and MCPWM1. Their control registers are located in 4-KB memory blocks starting at memory locations 0x3FF5E000 and 0x3FF6C000 respectively.

16.2Features

Each MCPWM peripheral has one clock divider (prescaler), three PWM timers, three PWM operators, and a capture module. Figure 16-1 shows the submodules inside and the signals on the interface. PWM timers are used for generating timing references. The PWM operators generate desired waveform based on the timing references. Any PWM operator can be configured to use the timing references of any PWM timers. Different PWM operators can use the same PWM timer’s timing references to produce related PWM signals. PWM operators can also use different PWM timers’ values to produce the PWM signals that work alone. Different PWM timers can also be synced together.

Figure 16­1. MCPWM Module Overview

An overview of the submodules’ function in Figure 16-1 is shown below:

Espressif Systems

410

ESP32 TRM (Version 5.0)

Submit Documentation Feedback

16Motor Control PWM (PWM)

PWM Timers 0, 1 and 2

Every PWM timer has a dedicated 8-bit clock prescaler.

The 16-bit counter in the PWM timer can work in count-up mode, count-down mode or count-up-down mode.

A hardware sync can trigger a reload on the PWM timer with a phase register. It will also trigger the prescaler’ restart, so that the timer’s clock can also be synced. The source of the sync can come from any GPIO or any other PWM timer’s sync_out.

PWM Operators 0, 1 and 2

Every PWM operator has two PWM outputs: PWMxA and PWMxB. They can work independently, in symmetric and asymmetric configuration.

Software, asynchronous override control of PWM signals.

Configurable dead-time on rising and falling edges; each set up independently.

All events can trigger CPU interrupts.

Modulating of PWM output by high-frequency carrier signals, useful when gate drives are insulated with a transformer.

Period, time stamps and important control registers have shadow registers with flexible updating methods.

Fault Detection Module

Programmable fault handling allocated on fault condition in both cycle-by-cycle mode and one-shot mode.

A fault condition can force the PWM output to either high or low logic levels.

Capture Module

Speed measurement of rotating machinery

Measurement of elapsed time between position sensor pulses

Period and duty-cycle measurement of pulse train signals

Decoding current or voltage amplitude derived from duty-cycle-encoded signals from current/voltage sensors

Three individual capture channels, each of which has a time-stamp register (32 bits)

Selection of edge polarity and prescaling of input capture signal

The capture timer can sync with a PWM timer or external signals.

Interrupt on each of the three capture channels

Espressif Systems

411

ESP32 TRM (Version 5.0)

Submit Documentation Feedback

Соседние файлы в папке даташиты