Skip to content

Commit

Permalink
[hard] resistor calculation: small improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchiLaser committed Feb 7, 2024
1 parent 96b9d7e commit 04054f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hardware/calc_resistors.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

# calculate the resistor and capacitor ratio for the attenuator
Attenuator_Resistor_ratio = (2 * max(In_Ranges)) / U_max - 1 # R_1 / R_2
print(f"Resistor Ratio for the Attenuator: R_1 / R_2 = {Attenuator_Resistor_ratio}")

# the amplifier has to map a smaller voltage range to the range of the maximum input voltage since the attenuator stays the same for each input range
amp_gains = [max(In_Ranges) / i for i in In_Ranges]
Expand Down Expand Up @@ -67,6 +68,6 @@ def print_results_table(lists: list[list], titles: list[str]) -> None:
"Amplifier Gain",
"Offset Voltage",
"Corrected offset Voltage",
"R_a / R_b for corr. Offset Voltage"
"R_a / R_b corr. Offset"
]
)

0 comments on commit 04054f2

Please sign in to comment.