by Drew Owens
Open-source 15-DoF XL330 biped goose robot with Spine molecule PCB, 3D-printed chassis, and Isaac Lab to MuJoCo sim-to-real RL stack
main
Drew Owens
Publish Microgoose Rev A full-stack hardware, CAD, datasheet, and 7-stage RL stack
e843249
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
#!/usr/bin/env python3
"""TI LMR33640DDDAR 400 kHz synchronous buck + AP2114H-3.3TRG1 LDO + INA226 telemetry:
every value derived from manufacturer datasheet equations for microgoose-spine Rev A.
Datasheets cited:
- TI LMR33640 (SNVSB26E, Section 7.5 & Section 9.2.2)
- Wurth Elektronik WE-XHMI 6060 74439346047 (Rev 2024)
- Diodes Inc AP2114H-3.3TRG1 (Rev 5, Electrical Characteristics p.5)
- TI INA226 (SBOS547C, Section 6.5)
- Bourns CSS2H-2512R-L300F (Rev 01/26, p.1)
- TI SN74AHCT1G125 (SCLS377M, p.5) & SN74LVC1G126 (SCES224W, p.5)
- Worldsemi WS2812B-2020 (V1.0, p.2-3) & Inolux IN-S63BTG (p.3)
"""
import json
import math
from pathlib import Path
def run_calculations() -> dict:
# ---- 1. Brief & Input Rail (2S Li-ion NP-F550) --------------------------
vin_min = 6.00
vin_nom = 7.40
vin_max = 8.40
# ---- 2. LMR33640DDDAR 5.0 V / 4.0 A Buck (TI SNVSB26E) ------------------
fsw_hz = 400_000.0
fsw_min_hz = 360_000.0 # SNVSB26E Section 7.5 min switching frequency
vref_min, vref_typ, vref_max = 0.985, 1.000, 1.015 # SNVSB26E Section 7.5 (-40 to 125 C)
rds_hs_typ, rds_hs_max = 0.072, 0.110 # Hot derated max (72 mOhm * 1.52)
rds_ls_typ, rds_ls_max = 0.041, 0.065 # Hot derated max
ilim_hs_min = 5.20 # SNVSB26E Section 7.5 high-side current limit min (A)
i_out_cont = 2.50 # Continuous heavy walking gait (15x XL330 + Radxa Zero 3W)
i_out_max = 4.00 # Peak burst requirement
# Stocked 1% 0603 Adom Basic Parts feedback divider (SNVSB26E Eq. 3):
# R_FBT = R1 (CQ03SAF4702T5E, 47.0 kOhm) + R2 (CQ03SAF3302T5E, 33.0 kOhm) = 80.0 kOhm
# R_FBB = R3 (CQ03WAF1002T5E, 10.0 kOhm) + R4 (CQ03WAF1002T5E, 10.0 kOhm) = 20.0 kOhm
r_fbt = 47_000.0 + 33_000.0
r_fbb = 10_000.0 + 10_000.0
v_5v_nom = vref_typ * (1.0 + r_fbt / r_fbb)
v_5v_min_wc = vref_min * (1.0 + (r_fbt * 0.99) / (r_fbb * 1.01))
v_5v_max_wc = vref_max * (1.0 + (r_fbt * 1.01) / (r_fbb * 0.99))
# Enable UVLO divider (SNVSB26E Section 7.5: VEN_RISE max=1.32V, min=1.20V, typ=1.26V; hyst typ=0.16V)
# R5 = 0603SAF1503T5E (150 kOhm), R6 = CQ03SAF4702T5E (47.0 kOhm)
r_en_top = 150_000.0
r_en_bot = 47_000.0
v_uvlo_rise_typ = 1.26 * (1.0 + r_en_top / r_en_bot)
v_uvlo_rise_max = 1.32 * (1.0 + (r_en_top * 1.01) / (r_en_bot * 0.99))
v_uvlo_fall_typ = 1.10 * (1.0 + r_en_top / r_en_bot)
v_en_at_vin_max = vin_max * ((r_en_bot * 1.01) / (r_en_top * 0.99 + r_en_bot * 1.01))
# Power Inductor: Wurth 74439346047 WE-XHMI 6060 4.7 uH +-20%
# Datasheet: DCR typ = 13.1 mOhm, DCR max = 14.5 mOhm; Irated = 8.5 A; Isat(30%) typ = 11.0 A
l_nom = 4.7e-6
l_min = 4.7e-6 * 0.80
dcr_l_max = 0.0145
i_rms_rated = 8.50
duty_nom = v_5v_nom / vin_nom
duty_at_vin_max = v_5v_nom / vin_max
duty_at_vin_min_wc = (v_5v_max_wc + i_out_max * (rds_hs_max + dcr_l_max + 0.0003)) / vin_min
delta_i_nom = (vin_nom - v_5v_nom) * duty_nom / (fsw_hz * l_nom)
delta_i_wc = (vin_max - v_5v_min_wc) * (v_5v_min_wc / vin_max) / (fsw_min_hz * l_min)
i_l_peak_wc = i_out_max + 0.5 * delta_i_wc
# Input & Output MLCCs with DC-bias derating
# C_IN: 3x CL21A106KOQNNNG (10 uF 16 V X5R 0805, derated 0.48 at 8.4 V) + 100 nF 50 V 0603
c_in_eff_uF = 3.0 * (10.0 * 0.48) + 0.09
i_cin_rms_wc = i_out_max * 0.50
# C_OUT: 4x CL21A226MPQNNNE (22 uF 10 V X5R 0805, derated 0.45 at 5.0 V) + 100 nF 50 V 0603
c_out_eff_F = (4.0 * (22.0 * 0.45) + 0.09) * 1e-6
esr_out_wc = 0.008 / 4.0
v_ripple_pp_wc = delta_i_wc / (8.0 * fsw_min_hz * c_out_eff_F) + delta_i_wc * esr_out_wc
f_lc_hz = 1.0 / (2.0 * math.pi * math.sqrt(l_nom * c_out_eff_F))
# Worst-case hot losses (using max RDS(on) and max DCR)
p_u1_cont_wc = (i_out_cont ** 2) * (duty_nom * rds_hs_max + (1.0 - duty_nom) * rds_ls_max) + 0.095
p_u1_peak_wc = (i_out_max ** 2) * (duty_nom * rds_hs_max + (1.0 - duty_nom) * rds_ls_max) + 0.145
p_l1_cont_wc = (i_out_cont ** 2 + (delta_i_wc ** 2) / 12.0) * dcr_l_max + 0.025
p_l1_peak_wc = (i_out_max ** 2 + (delta_i_wc ** 2) / 12.0) * dcr_l_max + 0.035
# ---- 3. High-Side Bus Monitor: INA226AIDGST + CSS2H-2512R-L300F ---------
r_shunt_nom = 0.0003
r_shunt_max = 0.0003 * 1.01
v_shunt_at_4a = i_out_max * r_shunt_nom
p_shunt_wc = (i_out_max ** 2) * r_shunt_max
# ---- 4. 3.3 V LDO: AP2114H-3.3TRG1 (SOT-223, fed from 5V_BUS) -----------
v_3v3_min, v_3v3_nom, v_3v3_max = 3.250, 3.300, 3.350 # AP2114H +-1.5%
v_drop_max = 0.750 # AP2114H Rev 5 p.5 max dropout at 1 A (0.45 V at 300 mA)
i_3v3_max = 0.220
p_u2_wc = (v_5v_max_wc - v_3v3_min) * i_3v3_max
# ---- 5. VBAT ADC Divider & Logic Thresholds -----------------------------
r_vbat_top = 100_000.0 # CQ03WAF1003T5E
r_vbat_bot = 33_000.0 # CQ03SAF3302T5E
v_adc_max_wc = vin_max * ((r_vbat_bot * 1.01) / (r_vbat_top * 0.99 + r_vbat_bot * 1.01))
# WS2812B-2020 driven via SN74AHCT1G125DBVR (VCC = 5V_BUS)
mcu_voh_min = 2.90 # STM32G431 datasheet min VOH at VDD=3.25 V, IOH=4 mA
ahct_vih_min_req = 2.00 # SN74AHCT1G125 max VIH threshold across 4.5-5.5 V
ahct_voh_min = 4.40 # SN74AHCT1G125 min VOH at VCC=4.5 V, IOH=-50 uA
ws2812_vih_req = 0.70 * v_5v_max_wc
# Green PG LED (IN-S63BTG, R = 1.00 kOhm CQ03WAF1001T5E)
i_led_pg_typ_ma = ((v_5v_nom - 3.00) / 1000.0) * 1000.0
assert 4.75 <= v_5v_min_wc and v_5v_max_wc <= 5.25, f"5V_BUS out of spec: {v_5v_min_wc}..{v_5v_max_wc}"
assert v_uvlo_rise_max < vin_min, f"UVLO rise max {v_uvlo_rise_max} exceeds Vin_min {vin_min}"
assert duty_at_vin_min_wc < 0.96, "Buck dropout violated at Vin_min"
assert i_l_peak_wc < ilim_hs_min, "Peak inductor current exceeds LMR33640 min HS current limit"
assert v_5v_max_wc < 6.00, "AP2114H Vin abs max violated"
assert v_5v_min_wc - v_3v3_max > v_drop_max, "AP2114H dropout margin violated"
assert mcu_voh_min > ahct_vih_min_req and ahct_voh_min > ws2812_vih_req, "WS2812B level shift margin violated"
return {
"schema": "adom-aiflow-calcs/v1",
"board": "microgoose-spine",
"topology": "buck",
"fsw_kHz": 400.0,
"VIN": vin_nom,
"VOUT": round(v_5v_nom, 4),
"vin_min": vin_min,
"vin_nom": vin_nom,
"vin_max": vin_max,
"vout_nom": round(v_5v_nom, 4),
"passed": True,
"datasheetParameters": [
{"name": "LMR33640 VREF min", "value": vref_min, "unit": "V", "source": "TI LMR33640 SNVSB26E Section 7.5", "kind": "min", "worstCase": True},
{"name": "LMR33640 VREF max", "value": vref_max, "unit": "V", "source": "TI LMR33640 SNVSB26E Section 7.5", "kind": "max", "worstCase": True},
{"name": "LMR33640 fSW min", "value": fsw_min_hz, "unit": "Hz", "source": "TI LMR33640 SNVSB26E Section 7.5", "kind": "min", "worstCase": True},
{"name": "LMR33640 HS ILIM min", "value": ilim_hs_min, "unit": "A", "source": "TI LMR33640 SNVSB26E Section 7.5", "kind": "min", "worstCase": True},
{"name": "Wurth 74439346047 DCR max", "value": dcr_l_max, "unit": "Ohm", "source": "Wurth WE-XHMI 74439346047 p.1", "kind": "max", "worstCase": True},
{"name": "Wurth 74439346047 Irated", "value": i_rms_rated, "unit": "A", "source": "Wurth WE-XHMI 74439346047 p.1", "kind": "max", "worstCase": True},
{"name": "Wurth 74439346047 Isat 30% drop", "value": 11.0, "unit": "A", "source": "Wurth WE-XHMI 74439346047 p.1", "kind": "typ"},
{"name": "AP2114H Vin max operating", "value": 6.0, "unit": "V", "source": "Diodes AP2114H Rev 5 p.4", "kind": "max", "worstCase": True},
{"name": "AP2114H Vdropout max at 1A", "value": v_drop_max, "unit": "V", "source": "Diodes AP2114H Rev 5 p.5", "kind": "max", "worstCase": True},
{"name": "SN74AHCT1G125 VIH threshold max", "value": ahct_vih_min_req, "unit": "V", "source": "TI SN74AHCT1G125 SCLS377M p.5", "kind": "max", "worstCase": True},
{"name": "SN74AHCT1G125 VOH min", "value": ahct_voh_min, "unit": "V", "source": "TI SN74AHCT1G125 SCLS377M p.5", "kind": "min", "worstCase": True}
],
"buck5v": {
"rFbTopParts": ["R1: CQ03SAF4702T5E (47.0 kOhm)", "R2: CQ03SAF3302T5E (33.0 kOhm)"],
"rFbBotParts": ["R3: CQ03WAF1002T5E (10.0 kOhm)", "R4: CQ03WAF1002T5E (10.0 kOhm)"],
"voutNomV": round(v_5v_nom, 4),
"voutRangeWorstCaseV": [round(v_5v_min_wc, 4), round(v_5v_max_wc, 4)],
"uvloRiseTypV": round(v_uvlo_rise_typ, 3),
"uvloRiseMaxV": round(v_uvlo_rise_max, 3),
"uvloFallTypV": round(v_uvlo_fall_typ, 3),
"enPinAtVinMaxV": round(v_en_at_vin_max, 3),
"deltaIlNomA": round(delta_i_nom, 4),
"deltaIlWorstCaseA": round(delta_i_wc, 4),
"peakInductorCurrentWorstCaseA": round(i_l_peak_wc, 3),
"cInEffectiveUf": round(c_in_eff_uF, 2),
"cInRmsWorstCaseA": round(i_cin_rms_wc, 2),
"cOutEffectiveUf": round(c_out_eff_F * 1e6, 2),
"lcResonanceHz": round(f_lc_hz, 1),
"rippleWorstCaseMvPp": round(v_ripple_pp_wc * 1000.0, 2),
"note": "4x 22 uF 10V 0805 X5R kept at 0.45 DC-bias factor giving 39.7 uF effective and 11.7 kHz LC corner."
},
"ldo3v3": {
"part": "AP2114H-3.3TRG1",
"inputRail": "5V_BUS",
"voutRangeV": [v_3v3_min, v_3v3_max],
"worstCaseHeadroomOverDropoutV": round(v_5v_min_wc - v_3v3_max - v_drop_max, 3)
},
"telemetry": {
"monitor": "INA226AIDGST",
"shunt": "CSS2H-2512R-L300F (0.3 mOhm 1%)",
"vShuntAt4AMv": round(v_shunt_at_4a * 1000.0, 3),
"vbatAdcAt8v4WorstCaseV": round(v_adc_max_wc, 4),
"pgLedCurrentTypMa": round(i_led_pg_typ_ma, 2)
},
"hotWatts": {
"U1_cont_2A5_wc": round(p_u1_cont_wc, 3),
"U1_peak_4A0_wc": round(p_u1_peak_wc, 3),
"L1_cont_2A5_wc": round(p_l1_cont_wc, 3),
"L1_peak_4A0_wc": round(p_l1_peak_wc, 3),
"R5_shunt_peak_4A0_wc": round(p_shunt_wc, 4),
"U2_ldo_max_wc": round(p_u2_wc, 3)
},
"powerInputSilkscreen": {
"MC1_VBAT": "VBAT 7.4V (6.0-8.4V)"
}
}
if __name__ == "__main__":
out = run_calculations()
p = Path(__file__).resolve().parent / "calcs.json"
p.write_text(json.dumps(out, indent=2) + "\n")
print(f"OK: wrote {p} (VOUT={out['VOUT']} V, WC={out['buck5v']['voutRangeWorstCaseV']} V, ripple={out['buck5v']['rippleWorstCaseMvPp']} mVpp)")