Back to Hub | RP2040 MicroPython Lab
State: COAST (OFF)

šŸŽļø DC Motor DRV8833 Dual PWM & Supply Voltage Physics

Analyze how dual PWM signals on both `IN1` & `IN2` pins control direction and active decay braking, and how driver supply voltage ($VM$) scales terminal voltage ($V_{\text{eff}}$) and rotational speed ($\omega$).

šŸ”Œ RP2040 Dual PWM (GP14/GP15) āž” DRV8833 H-Bridge āž” DC Motor Speed: 0 RPM (0.0 V_eff)
VM DRIVER SUPPLY 5.0 V DC Driver Power Rail + - RP2040 MCU GP14 ── PWM1 GP15 ── PWM2 GND ─── GND DRV8833 Dual H-Bridge IC IN1 IN2 OUT1 ──► OUT2 ──► DC MOTOR IN1 PWM: 32768 (50.0%) IN2 PWM: 0 (0.0%) Effective V_coil: 2.50 V Rotational Speed: +1250 RPM
šŸŽ›ļø Dual PWM Duty & Driver Supply Voltage Controls Mode: FORWARD (CW)
5.0 V DC
2.7V (Min Driver Limit) 5.0V (Standard Logic Supply) 10.8V (Max VM Limit)
50.0 % (32768)
0.0 % (0)
šŸ“Š Dual PWM & Supply Voltage Physics V_eff = VM Ɨ Net Duty

The DRV8833 H-Bridge switches the motor coil across the high-voltage supply rail ($VM$). Net speed is proportional to net terminal voltage ($V_{\text{eff}}$), while supplying PWM on BOTH pins simultaneously triggers active fast-decay dynamic braking[cite: 1, 2]!

1. Net Differential PWM Duty Cycle:
$\Delta D = \text{Duty}_{\text{IN1}} - \text{Duty}_{\text{IN2}} =$ +50.0%
2. Effective Coil Terminal Voltage ($V_{\text{eff}}$):
$V_{\text{eff}} = VM \times \Delta D = 5.0\text{V} \times 0.50 =$ 2.50 V
3. Angular Velocity & Decay State:
Speed: +1250 RPM | Active Drive
šŸ MicroPython Dual PWM Controller RP2040 Executing
import machine, time

# Configure Dual PWM on GP14 (IN1) & GP15 (IN2)
in1 = machine.PWM(machine.Pin(14))
in2 = machine.PWM(machine.Pin(15))
in1.freq(20000); in2.freq(20000) # 20kHz Ultrasonic

# Set PWM Duty Registers
in1.duty_u16(32768) # IN1 Signal
in2.duty_u16(0) # IN2 Signal
šŸ“ Theoretical Question: Dual PWM & Voltage Scaling
If the driver supply voltage ($VM$) is increased from $5\text{V}$ to $10\text{V}$ while holding the PWM duty cycle constant at $50\%$, how are the motor's effective coil voltage and rotational speed affected?