Package: evpy
evpy is a pyhton library used to predict efficiency in electric power trains given high level component specifications. It can be used to predict motor performance, a motors torque/speed/efficeiency contour, motor size given aspect ratio and torque, losses in an ESC given motor performance, ESC size, a batteryâ€™s voltage given time under a load, and battery mass given duration and specific energy.evpy Functionsevpy.batt_pred(I_load, t_hr, Q_Ah, R_int, n_ser=1, n_prll=1, pkrt=1.2)
predict voltage at a given time under a given loadpredict the entire pack’s instantaneous terminal voltage under load uses empirical state-of-charge curve fit obtained from Chen and Morahttps://doi.org/10.1109/TEC.2006.874229INPUTS:I_load : float, Amps
the current draw at the battery terminalst: float,hours
the instant in timeQ_Ah: float, Amp*hr
the rated capacity of the battery unitR_int: float, Ohms
the internal resistance of the battery unit in the tens of mili-Ohms rangen_ser: int, non-dim (optional)
the number of battery units in seriesn_prll: int, non-dim (optional)
the number of battery units in parallelpkrt: float, non-dim (optional)
the Peukert constant of the batteryOUTPUTS:V_term: float, Volts
the output voltage of the batterydod: float, non-dim
the depth of discharge of the battery (percent depleted)soc: float, non-dim
the state of charge of the battery (percent remaining)SPECIAL NOTES:1.— The applied current (I_load) and the time (t) can be vectors (ndarrays) to calculate the entire discharge curve of the battery. However, BOTH inputs must be vectors of the same length!2.— Ensure that the inputs have the correct units! Hobby batteries are rated in mili-Amphr This code requires you to enter the capacity in Amphr3.— Battery terminology is imprecise. A “pack” and “module” may mean different things to different people.For example, the Thunder Power TP7700-6SR70 is a 7.7 Ah (Amphr) unit which consists of 6 cells in series. To model this battery unit, input 7.7 for Q_Ah and set n_ser = 6 If you had 4 of these units wired in series, set n_ser = 46 If you had 4 of these units wired in parallel, set n_prll = 44.— Normally, you should not deplete a lithium-ion battery below 3.5 V In extreme circumstances, you can delpete a li-ion battery down to 3.3 V NEVER deplete a battery below 3 Vevpy.batt_size(t_hr, e, rho=2037.0)
predict battery mass, size for a given duration, specific energyINPUTS:t: float, hours
time duration of mission or mission phasee: float, Wh/kg
specific energy (energy/mass) of mission or mission phaserho: float, kg/m^3 (optional)
the mass density (mass/volume) of a lipo batteryOUTPUTS:m: float, kg
mass of required battery packU: float, m^3
volume of required battery packSPECIAL NOTES:mass density (mass/volume) of typical lipo is ~2000 kg/m^3 or 2 g/cm^3reasonable usable energy densities:
200 Wh/kg for an extremely well-optimized low-current application 170 Wh/kg for a low-current (fixed-wing) application 140 Wh/kg for a high-current (VTOL) applicationevpy.esc_pred(Im, Pm, V, d, f_pwm=8000.0, Ron=0.01, Ton=1e-06)
predict ESC losses given specs and motor performanceINPUTS:Imn: darray (float), Amps
the current pulled by the motorPm: ndarray (float), Watts
the power pulled by the motorV: float, Volts
the input (DC) voltage to the ESCd: float, non-dim
the non-dimensional throttle setting (duty ratio)f_pwm: float, Hertz
the switching frequency of the ESC, about 8-32 kHzRon: float, Ohms
the R_ds_ON measure of the MOSFETs in the ESC, about 5-20 mOhmsTon: float, s (seconds)
the transition period of the MOSFETs, about 1 microsecondOUTPUTS:I_dc: ndarray (float), Amps
the current draw of the ESCP_dc:ndarray (float), Watts
the power draw of the ESCn: ndarray (float), non-dim
the efficiency of the ESCevpy.esc_size(P_req, sf=2.0)
predict esc size, mass given cont. powerpredict the esc volume and mass using a purely empirical fit empirical data collected from 3 KDE, Castle, and HobbyWing data nearly uniform trends among all three datasetsP = 36.203m where [P] = Watts, [m] = grams P = 52.280U where [P] = Watts, [U] = cm^3INPUTS:P_req: float, Watts
the required continuous power output of the ESCsf: float, non-dim (optional)
a safety factor for the prediction hobby rule of thumb is 2.0OUTPUTS:m:float, kg
the mass of the ESCU: float, m^3
the volume of the ESCevpy.motor_contour(N_rated, T_rated, kt, R, I0, num_pts=100)
roughly predict the motor’s torque/speed/efficiency contourpredicts motor efficiency within the motor’s rated operating window uses 3 high-level component parameters (Rm, kt, I0) applicable to sensorless, six-step commutation brushless DC motors DOES NOT factor in harmonics!Note: kt = kv with SI unitsINPUTS:N_rated: float, rev/min
rated motor speedT_rated: float, N.m
rated motor torquekt: float, Newton-meter per Amp
torque constant of motorRm: float, Ohms
motor resistance (phase to phase)I0: float, Amps
no-load current of motornum_pts:int, non-dim
number of data points along each axisOUTPUTS:N: 2D ndarray (float), rev/min
a 2D array of the motor’s speed up to N_ratedT: 2D ndarray (float), Newton-meter
a 2D array of the motor’s torque up to T_ratedn: 2D ndarray (float), non-dim
a 2D array of the motor’s non-dimensional motor efficiency grid is over the entire torque/speed windowevpy.motor_pred(w, V, d, kt, Rm, I0)
predict motor performance for given specspredict torque, power, current, and efficiency over a range of speed uses 3 high-level component parameters (Rm, kt, I0) and throttle applicable to sensorless, six-step commutation brushless DC motorsNote: kt = kv with SI unitsINPUTS:w: ndarray (float), rads/sec
range of motor speedV: float, Volts
voltage of the DC busd: float, non-dim
non-dimensional throttle setting (duty ratio)Rmf: loat, Ohms
motor resistance (phase to phase)kt: float, Newton-meter per Amp
torque constant of motorI0: float, Amps
no-load current of motorOUTPUTS:T: ndarray (float), Newton-meter
output torque of motorP_out: ndarray (float), Watts
output power (mechanical)I: ndarray (float), Amps
input current to motorP_in: ndarray (float), Watts
input power (AC)n: ndarray (float), non-dim
non-dimensional motor efficiencyevpy.motor_size(T, x, shear=5500.0)
Size a motor for a given torque, aspect ratioPredict mass, diameter, length, figure of merit for given torque, D/L Default shear stress is for sub-500 gram BLDC motorsINPUTS:T: float, N.m
continuous torque required of motorx: float, non-dim
stator aspect ratio (D/L)shear: float, Pa (N/m^2) - OPTIONAL
shear stress used to size the initial volume default value of 5.5 kPa is a conservative est.OUTPUTS:m_tot: float, kg
total mass of the motorU_tot: float, m^3
total volume of the motorDo: float, m
outer motor diameterLo: float, m
outer motor lengthkm: float, N.m/sqrt(Ohms)
figure of merit (motor constant) of the motor