@@ -228,46 +228,3 @@ def contents(self):
228228 'control' : DigitalSink (),
229229 'gnd' : Ground (),
230230 })
231-
232-
233- class FetPrecharge (Block ):
234- """Precharge circuit that limits inrush current with an resistor, then provides low supply impedance
235- by closing a power FET.
236-
237- TODO: calculate power rating needed for some capacitance instead of spec'ing for DC"""
238- @init_in_parent
239- def __init__ (self , * , precharge_resistance : RangeLike = 100 * Ohm (tol = 0.1 ),
240- pull_resistance : RangeLike = 10 * kOhm (tol = 0.05 ),
241- max_rds : FloatLike = 1 * Ohm , clamp_voltage : RangeLike = RangeExpr .ZERO ):
242- super ().__init__ ()
243- self .gnd = self .Port (Ground .empty (), [Common ])
244- self .pwr_in = self .Port (VoltageSink .empty (), [Input , Power ])
245- self .pwr_out = self .Port (VoltageSource .empty (), [Output ])
246- self .control = self .Port (DigitalSink .empty ())
247-
248- self .precharge_resistance = self .ArgParameter (precharge_resistance )
249- self .pull_resistance = self .ArgParameter (pull_resistance )
250- self .max_rds = self .ArgParameter (max_rds )
251- self .clamp_voltage = self .ArgParameter (clamp_voltage )
252-
253- def contents (self ):
254- super ().contents ()
255-
256- self .switch = self .Block (HighSideSwitch (
257- pull_resistance = self .pull_resistance , max_rds = self .max_rds , clamp_voltage = self .clamp_voltage ))
258- self .connect (self .switch .gnd , self .gnd )
259- self .connect (self .switch .pwr , self .pwr_in )
260- self .connect (self .switch .control , self .control )
261-
262- (self .res_forcein , self .res , self .res_forceout ), _ = self .chain (
263- self .pwr_in ,
264- self .Block (ForcedVoltageCurrentDraw (0 * Amp (tol = 0 ))), # current draw modeled by switch
265- self .Block (SeriesPowerResistor (resistance = self .precharge_resistance )),
266- self .Block (ForcedVoltageCurrentDraw (
267- VoltageLink ._supply_voltage_range (self .gnd , self .pwr_in ) / self .precharge_resistance )),
268- )
269-
270- self .merge = self .Block (MergedVoltageSource ()).connected_from (
271- self .switch .output , self .res_forceout .pwr_out
272- )
273- self .connect (self .merge .pwr_out , self .pwr_out )
0 commit comments