Sizing a Diesel Generator for Industries From Power Logger Data: A pandas Walkthrough


Ask a factory how big its backup set should be and you'll usually get a number someone added up from motor nameplates. We at Enpower see those sums on most enquiries for a diesel generator for industries, and they tend to be wrong twice over. They're too high on running load, because no plant runs every motor flat out at once. And they're too low on what happens in the first few seconds after a restart.
If someone at the plant can write a bit of Python, there's a better route. Clip a power logger onto the incoming supply for a week, export the readings and let the data settle the argument. Picking the engine brand is the easier half, and our comparison of the four engine brands we supply for factory loads covers that part. This post is about getting the size right first.
What to log, and for how long
Use a three-phase power quality analyser or energy logger on the main incomer, downstream of the point where the generator will connect. You want kW, kVA, power factor and current on each phase. One-minute intervals are fine for demand. For motor starts you need one-second data, or an analyser that captures inrush events separately.
Log for at least a full production week. That should include a shift change, a weekend wind-down and, if you can catch one, a restart after a load-shedding trip. Season matters too. In a Faisalabad weaving unit or a Lahore food plant, the June afternoon with every AC and chiller running is the load that decides things. A January log will undersize the set.
If you can log individual feeders as well as the incomer, do it. You'll need that split later.
Loading the export
Every logger exports a slightly different CSV, so rename the columns first. The script below assumes one-second readings with a timestamp, kW, kVA, power factor and three phase currents.
import pandas as pd
df = pd.read_csv("incomer_log.csv", parse_dates=["timestamp"])
df = df.set_index("timestamp").sort_index()
expected columns: kw, kva, pf, i_l1, i_l2, i_l3
per_min = df.resample("1min").mean(numeric_only=True)
running = per_min[per_min["kw"] > 1] # ignore the plant-off hours
summary = {
"peak_1min_kw": per_min["kw"].max(),
"peak_15min_kw": per_min["kw"].rolling("15min").mean().max(),
"p99_kw": per_min["kw"].quantile(0.99),
"min_running_kw": running["kw"].min(),
"worst_pf": running["pf"].min(),
"largest_step_kw": df["kw"].diff().max(), # needs 1-second data
}
phases = running[["i_l1", "i_l2", "i_l3"]]
spread = (phases.max(axis=1) - phases.min(axis=1)) / phases.mean(axis=1)
summary["worst_imbalance_pct"] = 100 * spread.max()
for name, value in summary.items():
print(f"{name:22s} {value:10.1f}")
Run it on the whole week, then on the worst day on its own. The two summaries are rarely the same.
Five numbers that matter more than the peak
Sustained demand. The highest 15-minute average is what the engine actually has to carry. A one-minute peak above it is usually a start or a short burst.
The 99th percentile against the absolute peak. If they're far apart, find the timestamp of the peak and ask what happened. It might have been a test, a fault or a one-off that nobody wants on backup.
Largest step. This is what the generator feels when loads come back. A set handles a sudden step much worse than the grid does. ISO 8528-5 sets the frequency and voltage dip limits for each performance class, and the engine maker states what load step its set can accept.
Minimum running load. Long hours at very light load lead to wet stacking. If your nights are much lighter than your days, that's a design question, maybe a smaller set or two sets.
Worst power factor and imbalance. A generator is limited by current. Poor power factor eats into its kVA, and the most loaded phase decides how far you can go.
Strip out what won't run on backup
Very few plants put everything on a diesel generator for industries, and yours probably shouldn't either. A spare compressor, the admin block's ACs or a non-critical line can usually wait for the grid. If you logged those feeders separately, subtract their series from the incomer and run the summary again. If you didn't, log them for a day or two now.
Then model the restart. After a FESCO or LESCO trip, everything with a contactor tries to come back at once unless someone has set delays. Group your large loads into restart steps, sum the starting demand of each group from your one-second data, and the biggest group becomes your step figure. That number is often more useful than the peak.
Turning the numbers into a diesel generator for industries rating
Divide the sustained kW by the worst realistic power factor to get kVA. Then decide which rating you're sizing against. Under ISO 8528-1, standby and prime ratings mean different things, and a set that runs several hours a day through load-shedding should be chosen on its prime rating.
Next comes site derating. Datasheet output assumes a reference ambient temperature and altitude, and a 45°C plant room in Multan or Sukkur isn't that. The manufacturer's derating table tells you what's left at your site. Add the machines production expects to install over the next couple of years, then check your step figure against the load acceptance of each set on your shortlist.
Where logger data misleads you
One-minute averages hide motor starts completely, so never take a step figure from them. Check the scaling too. A wrong CT ratio in the logger setup gives you numbers that look sensible and aren't. A quick sanity check is to compare your peak against the MDI on the plant's electricity bill.
If the plant has a lot of VFDs or UPS systems, log harmonic distortion as well. Those loads affect how an alternator behaves, and the engineer sizing the set will want to see that data.
Hand over the data, not a guess
When you send an enquiry, attach the summary, the worst-day plot and your restart groups. An engineer can do far more with a week of measurements than with a list of nameplates, and the quotes you get back will be much easier to compare. That's how we'd want any diesel generator for industries to be specified, whoever ends up supplying it.
If you'd like a second pair of eyes on your logger export before you go out for quotes, the engineering team at Enpower is happy to look through it with you.