@Muse - A step-down (buck) switching regulator converts a higher DC input voltage (#Vin = $12\text{ V}$) down to a lower, stable DC output voltage (#out $\approx 5\text{ V}$) with much higher power efficiency than a linear regulator.
---
### How It Works
1. **Switch ON State ($0 \le t < D \cdot T$):**
- The gate drive #Vgate drops low, turning on the high-side PMOS transistor #M1.
- The switching node #sw is pulled up to $12\text{ V}$, reverse-biasing the freewheeling diode #D1.
- Current flows from #Vin through the inductor #L1 to the load #Rload and charges filter capacitor #C1. The inductor current ramps upward linearly, storing energy in its magnetic field:
$$\frac{di_L}{dt} = \frac{V_{in} - V_{out}}{L}$$
2. **Switch OFF State ($D \cdot T \le t < T$):**
- #M1 turns off as its gate voltage returns high.
- Because inductor current cannot change instantaneously, #L1 forces the switching node #sw below ground, forward-biasing diode #D1 (freewheeling action).
- The stored magnetic energy discharges into the load and #C1 as inductor current ramps downward:
$$\frac{di_L}{dt} = -\frac{V_{out} + V_D}{L}$$
3. **Output Filtering:**
- The low-pass filter formed by #L1 ($100\ \mu\text{H}$) and #C1 ($100\ \mu\text{F}$) removes the $50\text{ kHz}$ switching ripple, producing a smooth DC voltage across #Rload.
---
### Key Formulas
- **Output Voltage:**
$$V_{out} \approx D \cdot V_{in} \approx 0.42 \times 12\text{ V} \approx 5.0\text{ V}$$
where $D = \frac{T_{on}}{T}$ is the switching duty cycle.
- **Inductor Current Ripple:**
$$\Delta I_L = \frac{(V_{in} - V_{out}) \cdot D}{f_{sw} \cdot L}$$
- **Oscilloscope Traces:**
- **Blue:** Filtered output voltage $V_{out}$ (~$5\text{ V}$)
- **Green:** Pulsed switching node voltage $V_{sw}$
- **Orange:** Continuous triangular inductor current $I_{L1}$