From 9874e0a5fc0690f2a4784236fc0317861f7a1b2a Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Wed, 8 Sep 2021 12:45:45 +0100 Subject: [PATCH] Add py script for voltage drop calcs --- power_calcs.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 power_calcs.py diff --git a/power_calcs.py b/power_calcs.py new file mode 100644 index 0000000..24befb8 --- /dev/null +++ b/power_calcs.py @@ -0,0 +1,49 @@ +#!/usr/bin/python + +import sys + +cabletype = sys.argv[1] +voltage_limit = 11.5 + +cable_size = { + "13": 1.5, + "16": 2.5, + "32": 6.0, + "63": 16, +} +single_phase = { + 1.5: 31, + 2.5: 19, + 6.0: 7.9, + 16: 2.9, +} +three_phase = { + 1.5: 27, + 2.5: 16, + 6.0: 6.8, + 16: 2.5, +} + +drop = 0 +if "/3" in cabletype: + drop = three_phase[cable_size[cabletype[:-2]]] +else: + drop = single_phase[cable_size[cabletype]] + +print("Voltage Drop (per ampere per metre): {}mV/A/m".format(drop)) + +assumed_load = int(sys.argv[2]) +length = int(sys.argv[3]) + +total_drop = drop * assumed_load * length / 1000 + +print("Total drop at {}A over {}m is: {}V".format(assumed_load, length, total_drop)) +if total_drop > voltage_limit: + print("FAILED: VOLTAGE DROP TOO HIGH") +max_length = (voltage_limit * 1000) / (drop * assumed_load) +print("Maximum length of cable at this load: {}m".format(int(max_length))) + +r = total_drop / assumed_load +pfc = 230 / r + +print("Estimated PFC is {:.1f}A".format(pfc))