MustafaMulla29/rp2040-bldc-motor-controller
Hardware assembly metadata and PCB geometry for a controller board with a snap-off rotary-encoder section, plus four parallel 150 µF/50 V bulk electrolytic capacitors filtering the motor supply.
- Version
- 2.0.40
- License
- unset
- Stars
- 0
Use with the tscircuit CLI
tsci is the tscircuit CLI. Install it with npm install -g tscircuit.
tsci clone MustafaMulla29/rp2040-bldc-motor-controller # download the package files into ./rp2040-bldc-motor-controller
tsci add MustafaMulla29/rp2040-bldc-motor-controller # add it to your project as @tsci/MustafaMulla29.rp2040-bldc-motor-controllerIn a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.
scripts/check-oled-power-budget.py
"""First-order electrical budget; NOT measured hardware qualification.
Source limits, extra engineering allowances and open tests are separated in the
report. See docs/oled-power-margin-revision.md. Compiled wiring is checked separately.
"""
import json, math
from pathlib import Path
root=Path(__file__).resolve().parents[1]
e=.001+25e-6*100 # 0.1% initial plus independent +/-25 ppm/K, 100 K excursion
charge_error=.01+200e-6*100
raw_min=3*.98-.015 # Include full TLV700 load-regulation allowance
raw_max=3*1.02+.015
load=.004
cap_min=.0033*.8*.9*.7 # extra .9 reflow allowance is NOT a guaranteed GVL limit
cap_leak_20c=.01*3300*6.3*1e-6
floor=1.8
response_allowance=.005 # engineering allowance to be verified with oscilloscope
def budget(rhi,rlo,c183,sense_min,ready_max,charge_r,charge_tol):
vmin=.775*(1+rhi*(1-e)/(rlo*(1+e)))
vmax=.815*(1+rhi*(1+e)/(rlo*(1-e)))
direct_cap=(c183+1e-6+.1e-6)*1.1*1.15
# Count all VCOMH charge at full VCC, plus 12% temperature allowance.
discharge_cap=direct_cap+4.7e-6*1.1*1.12
rc=(rhi+rlo)*(1+e)*discharge_cap*math.log(vmax/.1)
available=raw_min-load*(charge_r*(1+charge_tol)+.230)
start=sense_min-.080 # maximum LM66100 reverse turn-off offset
hold=cap_min*(start-floor)/load
required=rc+.100+response_allowance
return dict(vccRangeV=[vmin,vmax],vccDirectCapMaxUf=direct_cap*1e6,
dischargeCapModelUf=discharge_cap*1e6,holdStartV=start,loadMa=load*1000,
readyThresholdMaxV=ready_max,readyAvailableV=available,
startupHeadroomMv=(available-ready_max)*1000,holdMs=hold*1000,
hypotheticalVccRcTo0V1Ms=rc*1000,requiredMs=required*1000,
shutdownMarginMs=(hold-required)*1000,
chargeResistorPeakW=raw_max**2/(charge_r*(1-charge_tol)),
feedbackTopResistorMaxW=(vmax-.775)**2/(rhi*(1-e)),
dividerCurrentMaxMa=vmax/((rhi+rlo)*(1-e))*1000,
maximumHeldLoadForSequenceMa=cap_min*(start-floor)/required*1000)
# TPS3808G01: 405 mV +/-2%, hysteresis <=3%; resistor errors, +/-25 nA bias.
rh,rl=54900,10000
fall_min=.405*.98*(1+rh*(1-e)/(rl*(1+e)))-25e-9*rh*(1+e)
ready_max=.405*1.02*1.03*(1+rh*(1+e)/(rl*(1-e)))+25e-9*rh*(1+e)
new=budget(1000,68.1,4.7e-6,fall_min,ready_max,15,charge_error)
old=budget(4020,274,10e-6,2.79*.985,2.79*1.015*1.025,10,.05+.02)
# Count two stuck-low buses AND PNP still requested on; not all persist after reset.
loads={'panel_logic_datasheet_max':.300,'TCA9517_VCCA_both_low_max':1.000,
'TCA9538_operating_allowance':.050,'two_TPS3808_plus_sense_allowance':.016,
'LM66100_and_reverse_leak_allowance':.010,
'both_I2C_pullups_stuck_low':2*raw_max/(4700*.97)*1000,
'reset_CT_ready_pullups_all_low':3*raw_max/(100000*.97)*1000,
'PNP_request_and_EN_allowance':raw_max/(10000*.97)*1000+.040,
'ready_divider':raw_max/((rh+rl)*(1-e))*1000,
'C191_leakage_at_20C_only':cap_leak_20c*1000,'pin_and_cap_leak_allowance':.050}
loads['unallocated_for_hot_leakage_and_backfeed']=load*1000-sum(loads.values())
# Board ambient limit +85 C; 70 C rated resistors derate to zero at 155 C.
derate=(155-85)/(155-70)
vcc=new['vccRangeV'][1];iout=.0445+new['dividerCurrentMaxMa']/1000
vin=3.02;eta=.70 # engineering assumptions, not guaranteed performance
peak=vcc*iout/(vin*eta)+vin*(1-vin/vcc)/(8e-6*850000)/2
checks={
'logic_max_below_panel_3V3':raw_max<3.3,
'PWM_VCC_between_12_and_13V':12<=new['vccRangeV'][0] and vcc<13,
'startup_headroom_at_4mA_exceeds_75mV':new['startupHeadroomMv']>=75,
'shutdown_reserve_at_4mA_exceeds_100ms':new['shutdownMarginMs']>=100,
'unallocated_load_exceeds_300uA':loads['unallocated_for_hot_leakage_and_backfeed']>.3,
'R181_250mW_derated_to_85C':new['feedbackTopResistorMaxW']<.25*derate,
'R185_1W_peak_below_85C_derated_rating':new['chargeResistorPeakW']<derate,
'direct_output_C_upper_below_10uF':new['vccDirectCapMaxUf']<10,
'boost_peak_screen_below_680mA':peak<.680}
result={'status':'CALCULATED_DESIGN_TARGETS_PASS_BENCH_QUALIFICATION_OPEN' if all(checks.values()) else 'FAIL',
'checks':checks,'revised':new,'originalAtSame4mALoadAndAllowances':old,
'heldLoadAllocationMa':loads,'reservoirMinimumModelUf':cap_min*1e6,
'reservoirPart':'GVL0J332M1213 / C52711639',
'nominalReadyFallingThresholdV':.405*(1+rh/rl),
'boostScreen':{'panelPlusDividerMaxMa':iout*1000,'efficiencyAssumed':eta,'inputVAssumed':vin,'peakMa':peak*1000},
'qualificationOpen':[
'Measure total held current <=4 mA over temperature, I2C fault states and collapsing VCCB. TCA9517 limits do not bound the entire brownout transition.',
'Verify C191 effective C >=1663.2 uF and leakage within the load ceiling after reflow, aging and hot/cold operation. Extra reflow derating is an assumption.',
'Panel ESD backfeed and VCOMH can invalidate independent RC decay. Scope VCC, VDD, RESET and EN for abrupt unplug, shorted upstream rail, slow brownout and rapid reconnect.',
'Verify LDO output >=2.925 V at the charge input under the relevant load. TLV700 accuracy is characterized at VIN>=3.3 V; upstream ripple/dropout is not proven by this DC model.',
'Measure startup, charging time, resistor/LDO temperature, VCC 12-13 V including PFM/ripple/overshoot and loop stability. Verify effective biased output C >=0.22 uF.',
'680 mA switch-limit minimum is specified at VIN=3.6 V; validate boost on our 3.3 V rail at maximum display load.',
'Confirm supplier interpretation of VCC disabled/floating and 100 ms timing. No active clamp is added.']}
out=root/'.tscircuit/checks/oled-power-budget.json';out.parent.mkdir(parents=True,exist_ok=True)
out.write_text(json.dumps(result,indent=2)+'\n');print(json.dumps(result,indent=2))
raise SystemExit(not all(checks.values()))