# Peak-Current-Mode Modulator (`pcmModulator`)

> Turns a switch on at each clock and off when the sensed current plus a ramp reaches the control voltage.

![pcmModulator](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/img/pcmModulator.svg)

[Component reference](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/) · [繁體中文](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/ic/pcmModulator/)

**Group:** ICs · **Kind:** `{"definition":"pcmModulator","kind":"subsystem"}`

## When to use it

Use it at the architecture stage of a current-mode controller, to choose the frequency, the slope compensation, the blanking and the current limit with the real power stage before transistor level. Use PWM Controller (UC384x class) or the controller ICs for a real part.

## Pins

| Pin | Domain | Meaning |
|---|---|---|
| `VC` | electrical | Control voltage, from the error amplifier |
| `ISNS` | electrical | Sensed current as a voltage Ri·i |
| `EN` | signal | Enable signal, high to switch |
| `GATE` | signal | Switch command, 0 or 1 |
| `GND` | electrical | Reference of VC and ISNS |

## Common parameters

- `fsw`: Clock frequency: the switch turns on at each clock edge (Default: 500000)
- `se`: Slope of the compensation ramp added to ISNS (0 = none). Stable at any duty when se is at least half the sensed down-slope (U-97); the boundary is mc·D' = 0.5, mc = 1 + se/Sn (Ridley 1991). Valley mode: stable when se > (sE − sD)/2, half the sensed up-slope minus the down-slope (Tiwary & Rincon-Mora 2026, Eq. 22) (Default: 0)
- `dmax`: Maximum duty: the switch is forced off after this fraction of the period (Default: 0.9)
- `tBlank`: Leading-edge blanking after the clock: the minimum on-time in peak mode, the minimum off-time in valley mode (Default: 0.00000005)
- `vcMax`: Clamp of the control voltage: the cycle-by-cycle current limit, in volts at ISNS (Default: 2.5)

## Parameters

| Key | Unit | Default | Typical range | Description | Datasheet source |
|---|---|---|---|---|---|
| `fsw` | Hz | 500000 | 1k – 100meg Hz | Clock frequency: the switch turns on at each clock edge | typical, user must set |
| `se` | V/s | 0 | 0 – 1t V/s | Slope of the compensation ramp added to ISNS (0 = none). Stable at any duty when se is at least half the sensed down-slope (U-97); the boundary is mc·D' = 0.5, mc = 1 + se/Sn (Ridley 1991). Valley mode: stable when se > (sE − sD)/2, half the sensed up-slope minus the down-slope (Tiwary & Rincon-Mora 2026, Eq. 22) | typical, user must set |
| `dmax` | — | 0.9 | 50m – 999m | Maximum duty: the switch is forced off after this fraction of the period | typical, user must set |
| `tBlank` | s | 0.00000005 | 100p – 1m s | Leading-edge blanking after the clock: the minimum on-time in peak mode, the minimum off-time in valley mode | typical, user must set |
| `vcMax` | V | 2.5 | 10m – 100 V | Clamp of the control voltage: the cycle-by-cycle current limit, in volts at ISNS | typical, user must set |
| `valley` | — | 0 | 0 – 1 | 0 = peak current mode; 1 = valley current mode: the clock turns the switch off, it turns on when ISNS minus the ramp falls to VC, tBlank is the minimum off-time and dmax does not apply | typical, user must set |

_Parameter descriptions are in English in both languages._

## Model

A clock at fsw sets the switch on and forces it off after dmax of the period. After the blanking time tBlank the switch turns off once V(ISNS) plus a ramp rising at se from the clock exceeds V(VC), limited to 0 to vcMax (the cycle-by-cycle current limit). Ridley (IEEE TPEL 1991) gives the sampling double pole at fsw/2 with Qp = 1/(π·(mc·D' − 0.5)), mc = 1 + Se/Sn: without a ramp the current loop oscillates at half the clock above D = 0.5, and a ramp of half the sensed down-slope keeps it stable at any duty (Unitrode U-97). In steady state the average sensed current is V(VC) − Se·D·Ts − Sn·D·Ts/2 (Erickson & Maksimovic, ch. 12).

## Common mistakes

- The defaults are typical, user must set. They are design values of an architecture block, not a part's data sheet: set fsw, se and vcMax for your design.
- Above a duty of 0.5 the current loop needs slope compensation. With se at zero the inductor current alternates from period to period; set se to at least half the sensed down-slope, Ri·Vout/L for a buck.
- The comparator acts one solver step late, so the peak overshoots by the slope times the step. Keep the maximum step near 1/(200·fsw) or smaller.

Problems rules: `step.too_large`, `ground.missing`

## Datasheet and sources

This is an architecture block, so its numbers come from your design, not a data sheet. fsw is the switching frequency, se the ramp slope in volts per second at ISNS, dmax the maximum duty, tBlank the leading-edge blanking (and minimum on-time) and vcMax the current limit in volts at ISNS. When you later model a real controller, take the oscillator, ramp and current-limit rows of its electrical table.

## Example

Open the example with the command `file.openExample` and the name `demo:pcmModulator`.

---
Generated by `cargo xtask reference` from the usage texts and parameter specs. Do not edit by hand.
