Conversation
|
I've just located some errors in the frequency values inferred from the datasheet which cause significant errors in the capacitance and resistance calculations. Those errors will need to be fixed before this gets merged, I'll do that soon, this is just a heads up for reviewers. |
luxas
left a comment
There was a problem hiding this comment.
Thanks, LGTM 👍
Mostly minor, for the future comments
| return result | ||
|
|
||
|
|
||
| def resolve_V_out(): |
There was a problem hiding this comment.
comment what this resistor selection is for
|
|
||
|
|
||
| def C1_capacitance(): | ||
| return 1 / (2 * math.pi * R1 * 20000) |
|
|
||
|
|
||
| def voltage_ripple(): | ||
| return dI_L * (R_C_out + 1 / (8 * C_C_out * F_osc)) |
|
|
||
|
|
||
| def C2_capacitance(): | ||
| return min(1 / (2 * math.pi * R3_resistance() * F_z), 15E-9) # Upper limit from the datasheet |
|
|
||
| # Variables | ||
| # TODO: Take these as command line arguments? | ||
| V_in = 24 # Volts, input voltage |
There was a problem hiding this comment.
V_in_max or V_in? We should probably somehow make it explicit that we're treating this as a range.
Maybe we could also output the min-max values of stuff, e.g. voltage ripple, such that the output has columns min, typical, max instead of just one value
| # TODO: Take these as command line arguments? | ||
| V_in = 24 # Volts, input voltage | ||
| A_max = 3 # Amperes, maximum output current | ||
| dI_L = 1.0 # Amperes, inductor ripple current |
There was a problem hiding this comment.
clarify that this is the "typical" load that we expect.
| V_in = 24 # Volts, input voltage | ||
| A_max = 3 # Amperes, maximum output current | ||
| dI_L = 1.0 # Amperes, inductor ripple current | ||
| V_fb = 0.8 # Volts, feedback reference voltage |
There was a problem hiding this comment.
can we treat this as a constant as the datasheet says don't change
| A_max = 3 # Amperes, maximum output current | ||
| dI_L = 1.0 # Amperes, inductor ripple current | ||
| V_fb = 0.8 # Volts, feedback reference voltage | ||
| G_mp = 20 # A/V, current sense gain |
There was a problem hiding this comment.
move to constants instead of variables?
| def resolve_V_out(): | ||
| resolved = False | ||
| (b_voltage, b_R1, b_R2) = (math.inf, 0, 0) | ||
| for d_R1, d_R2 in itertools.permutations(generate_resistors([10000, 100000]), 2): |
There was a problem hiding this comment.
Writing multipliers as multiples of thousands would improve readability
| for d_R1, d_R2 in itertools.permutations(generate_resistors([10000, 100000]), 2): | |
| for d_R1, d_R2 in itertools.permutations(generate_resistors([10E3, 100E3]), 2): |
bd9e302efj.pyis a helper for computing the correct values for peripheral components for ROHM's BD9E302EFJ. This chip will be performing the 12-24 volt input to 5.1 volt conversion on the compute unit BMC.