Skip to content

Commit 41faa80

Browse files
committed
Add script for calculating AP61302 parameters
1 parent b3f8c00 commit 41faa80

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

pcb/scripts/ap61302.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env python3
2+
3+
# Values from AP61302
4+
## VOUT reference voltage (0.6V)
5+
VOUT_REF = 0.6
6+
## Switching frequency (2.2 MHz)
7+
FSW = 2.2e6
8+
9+
# Values from PCB
10+
## USB voltage (5V)
11+
VIN = 5.0
12+
## Inductor value (2.2 uH)
13+
L = 2.2e-6
14+
## Output capacitor value (22 uF)
15+
COUT = 22.0e-6
16+
## Capacitor ESR (ESTIMATED 500 mOhm)
17+
ESR = 500.0e-3
18+
## Resistor 1 values (9.1 kOhm, 52.3 kOhm)
19+
R1S = [9.1e3, 52.3e3]
20+
## Resistor 2 value (10 kOhm)
21+
R2 = 10.0e3
22+
23+
for R1 in R1S:
24+
VOUT = VOUT_REF + (VOUT_REF * R1) / R2
25+
DELTA_IL = (VOUT * (VIN - VOUT)) / (VIN * FSW * L)
26+
VOUT_RIPPLE = DELTA_IL * (ESR + 1.0 / (8.0 * FSW * COUT))
27+
print(
28+
"VOUT", VOUT,
29+
"DELTA_IL", DELTA_IL,
30+
"VOUT_RIPPLE", VOUT_RIPPLE
31+
)

0 commit comments

Comments
 (0)