Skip to content

Commit

Permalink
initial design
Browse files Browse the repository at this point in the history
  • Loading branch information
napowderly committed Feb 4, 2024
1 parent 8d11f9a commit 7613a5d
Show file tree
Hide file tree
Showing 9 changed files with 676 additions and 3 deletions.
Binary file added LV2842XLVDDCR.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion ato.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ato-version: ^0.2.0
builds:
default:
entry: elec/src/lv2842xlvddcr.ato:Lv2842xlvddcr
entry: lv2842kit.ato:LV2842Kit
dependencies:
- generics
266 changes: 266 additions & 0 deletions calcs.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,266 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
"# Configurable parameters for the buck converter\n",
"\n",
"Vin_max = 24 # Assuming a more typical maximum input voltage of 12V\n",
"Vout = 8 # Output voltage in volts\n",
"Io = 0.6 # Assuming a DC output current of 2A\n",
"fsw = 1.1e6 # Correcting the switching frequency to a more typical value, e.g., 500 kHz\n"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"30.303 uH\n"
]
}
],
"source": [
"def calculate_min_inductance(Vin_max, Vout, Io, K_IND, fsw):\n",
" \"\"\"\n",
" Calculate the minimum inductance required for an output inductor in a buck converter,\n",
" correcting the previous misunderstanding in the formula application.\n",
"\n",
" Parameters:\n",
" - Vin_max: Maximum input voltage (V)\n",
" - Vout: Output voltage (V)\n",
" - Io: DC output current (A)\n",
" - K_IND: Ripple factor (expressed as a fraction of Io, e.g., 0.3 for 30%)\n",
" - fsw: Switching frequency (Hz)\n",
"\n",
" Returns:\n",
" - Lmin: Minimum inductance (H)\n",
" \"\"\"\n",
" # Correcting the formula based on the typical approach for calculating minimum inductance\n",
" Lmin = (Vin_max - Vout) * Vout / (Vin_max * Io * K_IND * fsw)\n",
" return Lmin\n",
"\n",
"# Correcting the example values and recalculating\n",
"K_IND = 0.3 # Ripple factor, 30% of Io\n",
"\n",
"Lmin = calculate_min_inductance(Vin_max, Vout, Io, K_IND, fsw)\n",
"\n",
"print(round(Lmin * 1e6,3), \"uH\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2.727 uF\n",
"0.167 Ohm\n"
]
}
],
"source": [
"def calculate_capacitance_and_esr(Iout, fsw, DeltaV, DeltaV_ESR_ratio):\n",
" \"\"\"\n",
" Calculate the minimum output capacitance and maximum ESR for a buck converter.\n",
"\n",
" Parameters:\n",
" - Iout: Output current (A)\n",
" - fsw: Switching frequency (Hz)\n",
" - DeltaV: Total allowable ripple voltage on the output (V)\n",
" - DeltaV_ESR_ratio: The ratio of the ripple voltage due to ESR to the total ripple voltage\n",
"\n",
" Returns:\n",
" - Cmin: Minimum capacitance (F)\n",
" - ESRmax: Maximum ESR (Ohms)\n",
" \"\"\"\n",
" # Calculate minimum capacitance\n",
" DeltaT = 1 / fsw # Time period of one switching cycle\n",
" Cmin = Iout * DeltaT / DeltaV\n",
"\n",
" # Calculate maximum ESR\n",
" DeltaV_ESR = DeltaV * DeltaV_ESR_ratio # Allowable ripple voltage due to ESR\n",
" ESRmax = DeltaV_ESR / Iout\n",
"\n",
" return Cmin, ESRmax\n",
"\n",
"# Example usage based on typical values and assuming 50% of the ripple voltage is allocated to ESR\n",
"DeltaV = 0.2 # Total allowable ripple voltage in volts\n",
"DeltaV_ESR_ratio = 0.5 # Assuming 50% of DeltaV is due to ESR\n",
"\n",
"Cmin, ESRmax = calculate_capacitance_and_esr(Iout, fsw, DeltaV, DeltaV_ESR_ratio)\n",
"\n",
"\n",
"print(round(Cmin * 1e6,3), \"uF\")\n",
"print(round(ESRmax,3), \"Ohm\")\n"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Forward current: 0.75A\n",
"Reverse voltage: 30.0V\n",
"Power dissipation: 0.42W\n"
]
}
],
"source": [
"def calculate_diode_parameters(Iout, Vin_max, Vf):\n",
" \"\"\"\n",
" Calculate the diode parameters for a buck converter.\n",
"\n",
" Parameters:\n",
" - Iout: Output current (A)\n",
" - Vin_max: Maximum input voltage (V)\n",
" - Vf: Forward voltage drop of the diode (V)\n",
"\n",
" Returns:\n",
" - If_max: Maximum forward current (A)\n",
" - Vr_max: Maximum reverse voltage (V)\n",
" - Pd: Power dissipation (W)\n",
" \"\"\"\n",
" If_max = 1.25 * Iout # Maximum forward current\n",
" Vr_max = 1.25 * Vin_max # Maximum reverse voltage\n",
" Pd = Vf * Iout # Power dissipation\n",
"\n",
" return If_max, Vr_max, Pd\n",
"\n",
"# Example usage based on typical values\n",
"Vf = 0.7 # Forward voltage drop of the diode in volts\n",
"\n",
"If_max, Vr_max, Pd = calculate_diode_parameters(Iout, Vin_max, Vf)\n",
"\n",
"print(\"Forward current: \" + str(round(If_max,3)) + \"A\")\n",
"print(\"Reverse voltage: \" + str(round(Vr_max,3)) + \"V\")\n",
"print(\"Power dissipation: \" + str(round(Pd,3)) + \"W\")\n"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"94575.163 Ohm\n"
]
}
],
"source": [
"def calculate_feedback_resistors(Vout, Vref, R2):\n",
" \"\"\"\n",
" Calculate the feedback resistor values for a buck converter.\n",
"\n",
" Parameters:\n",
" - Vout: Desired output voltage (V)\n",
" - Vref: Reference voltage of the control IC (V)\n",
" - R2: Chosen value for R2 (Ohms)\n",
"\n",
" Returns:\n",
" - R1: Calculated value for R1 (Ohms)\n",
" \"\"\"\n",
" R1 = R2 * ((Vout / Vref) - 1)\n",
" return R1\n",
"\n",
"# Example usage based on typical values\n",
"Vref = 0.765 # Reference voltage of the control IC in volts\n",
"R2 = 10000 # Chosen value for R2 in ohms\n",
"\n",
"R1 = calculate_feedback_resistors(Vout, Vref, R2)\n",
"print(round(R1,3), \"Ohm\")\n"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.909 uF\n"
]
}
],
"source": [
"def calculate_input_capacitance(Vin, Vout, Iout, fsw, DeltaVin):\n",
" \"\"\"\n",
" Calculate the required input capacitance for a buck converter.\n",
"\n",
" Parameters:\n",
" - Vin: Input voltage (V)\n",
" - Vout: Output voltage (V)\n",
" - Iout: Output current (A)\n",
" - fsw: Switching frequency (Hz)\n",
" - DeltaVin: Allowable input voltage ripple (V)\n",
"\n",
" Returns:\n",
" - Cin: Required input capacitance (F)\n",
" \"\"\"\n",
" D = Vout / Vin # Duty cycle\n",
" Iripple = Iout * D # Approximate ripple current based on output current and duty cycle\n",
" Cin = Iripple / (2 * fsw * DeltaVin)\n",
" return Cin\n",
"\n",
"# Example usage based on typical values\n",
"DeltaVin = 0.1 # Allowable input voltage ripple in volts\n",
"\n",
"Cin = calculate_input_capacitance(Vin_max, Vout, Iout, fsw, DeltaVin)\n",
"\n",
"print(round(Cin * 1e6,3), \"uF\")\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
31 changes: 31 additions & 0 deletions calcs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
def calculate_min_inductance(Vin_max, Vout, Io, K_IND, fsw):
"""
Calculate the minimum inductance required for an output inductor in a buck converter,
correcting the previous misunderstanding in the formula application.
Parameters:
- Vin_max: Maximum input voltage (V)
- Vout: Output voltage (V)
- Io: DC output current (A)
- K_IND: Ripple factor (expressed as a fraction of Io, e.g., 0.3 for 30%)
- fsw: Switching frequency (Hz)
Returns:
- Lmin: Minimum inductance (H)
"""
# Correcting the formula based on the typical approach for calculating minimum inductance
Lmin = (Vin_max - Vout) * Vout / (Vin_max * Io * K_IND * fsw)
return Lmin

# Correcting the example values and recalculating
Vin_max = 12 # Assuming a more typical maximum input voltage of 12V
Vout = 5 # Output voltage in volts
Io = 0.6 # Assuming a DC output current of 2A
K_IND = 0.3 # Ripple factor, 30% of Io
fsw = 2.1e6 # Correcting the switching frequency to a more typical value, e.g., 500 kHz

Lmin = calculate_min_inductance(Vin_max, Vout, Io, K_IND, fsw)
# print(Lmin)
# convert to uH
Lmin = Lmin * 1e6
print(Lmin)

Large diffs are not rendered by default.

Loading

0 comments on commit 7613a5d

Please sign in to comment.