Three-Phase Power Monitoring with Siemens LOGO! 8 for Automatic Transfer Switch Load-Based Source Selection
1. Application Overview: Three-Source ATS with Load-Based Selection
The described system is a three-source Automatic Transfer Switch (ATS) that switches between:
- Utility mains (preferred source, normally energized).
- Large alternate source (e.g. diesel genset 200 kVA).
- Small alternate source (e.g. diesel genset 50 kVA).
Selection logic: when utility fails, the controller measures the running three-phase load and transfers to Source 2 if load > threshold A, or to Source 3 if load ≤ threshold A. This avoids starting a 200 kVA genset to feed a 30 kW load and wasting fuel.
Reference architecture:
2. LOGO! 8 Platform Capabilities and Hard Limits
LOGO! 8 base modules (6ED1052-1MD08-0BA1 with display, 6ED1052-2MD08-0BA1 without) support the following relevant features for this application:
| Feature | LOGO! 8.3 / 8.4 Specification | Implication for Power Calc |
|---|---|---|
| Onboard digital I/O | 8 DI / 4 DO (basic) or 8 DI / 4 DO + 4 AI (0-10 V) on BM with AI | Onboard AI is voltage only, 0-10 V |
| Analog input module AM2 | 6ED1055-1MB00-0BA2, 4 AI, 0-10 V or 0/4-20 mA | Required for 4-20 mA CT transducers |
| Analog input module AM2 RTD | 6ED1055-1MA00-0BA2, 2 AI + 2 PT100/PT1000 | Use for PT100 RTDs, not CTs |
| AI resolution | 10-bit, 0-1000 normalized integer | 1 LSB ≈ 0.01 V or 0.02 mA |
| Math block | 16-bit signed integer (±32 767) | No native float, no sqrt, no trig |
| Analog amplifier | Gain 0.00-10.00 (decimal entry), bias ±10 000 | Decimal UI; underlying value still integer |
| Maximum blocks per program | 400 (LOGO! 8.3), 400 (8.4) | Adequate for 3-phase power + ATS |
| Maximum user program size | 8500 bytes (LOGO! 8.3), 8500 bytes (8.4) | Sufficient headroom |
| Retention | Up to 250 parameters, battery-backed | Hold kWh across power cycles |
| Communication | Ethernet (LOGO! 8.1+), Modbus TCP server, S7 communication, OPC UA server (8.3+) | Send measurements to SCADA |
For the full hardware reference see the LOGO! 8 System Manual.
3. Three-Phase Power Measurement Theory
Three-phase apparent power in a balanced or unbalanced system:
S = √3 × V_LL × I_line (balanced, three-phase line current)
P = √3 × V_LL × I_line × cos φ
For unbalanced per-phase measurement:
P_total = Σ V_phase-n × I_phase-n × cos φ_n for n = 1, 2, 3
In SI units, divide by 1000 to obtain kW or kVA:
P_kW = (√3 × V_LL × I_line × cos φ) / 1000
3.1 Input scaling required by LOGO!
The original attachment specified 230 V supply with 0-10 A primary CTs and 4-20 mA secondary. To compute kW inside LOGO!, scale the inputs to a usable integer range:
| Physical quantity | Sensor output | LOGO! AI scaling (integer) | Engineering range |
|---|---|---|---|
| Phase current L1 | 4-20 mA from CT transducer | 0-1000 raw (4 mA = 0, 20 mA = 1000) | 0-10 A × 10 = 0-100 (A × 10) |
| Phase current L2 | 4-20 mA | 0-1000 raw | 0-100 |
| Phase current L3 | 4-20 mA | 0-1000 raw | 0-100 |
| Line-to-line voltage | Assumed fixed 230 V (no VT) or 0-10 V from VT | 2300 (constant) or 0-1000 raw | 230 V × 10 = 2300 (V × 10) |
| Power factor cos φ | Assumed constant 0.85 (typical inductive load) | 85 (fixed integer constant) | 0.85 × 100 = 85 |
Recommended scaling convention: multiply all physical quantities by 10 to preserve one decimal place, so current is stored in 0.1 A units (0-100 for 10 A range) and voltage in 0.1 V units (2300 for 230 V).
4. Current Transducer and Signal Conditioning
The 4-20 mA current loop requires a current transformer (CT) with an integrated burden resistor and 4-20 mA output, or a separate CT plus a signal conditioner. Common industrial choices:
| Manufacturer / Family | Model example | Primary range | Output | Notes |
|---|---|---|---|---|
| Siemens 7KT16xx | 7KT1650 | 0-50 A or 0-100 A configurable | 4-20 mA + 0-10 V | DIN rail, 24 V loop powered |
| Phoenix Contact MACX MCR | MACX MCR-SL-CUC-200-I | 0-200 A AC | 4-20 mA | Pass-through, no CT required |
| Schneider Electric iEM3000 series | iEM3155 + A9MEM3155 | CT-fed, Modbus | Modbus RTU/TCP | Use with LOGO! Modbus TCP client (8.3+) |
| Carlo Gavazzi EM | EM210 | CT-fed | Modbus RTU | RS-485 to LOGO! via CMK2040 |
Wiring topology:
4.1 Voltage measurement decision
The source assumes a fixed 230 V line-to-line supply. If the system can operate at any other nominal voltage (e.g. 380-400 V, 480 V) or if ±10 % tolerance materially changes the kW reading, install a voltage transducer (e.g. Siemens 7KT1651, 0-500 V AC / 4-20 mA) on AI4 of the AM2 module and scale to 0-5000 representing 0-500 V. If the voltage is genuinely constant (regulated utility, captive supply, or downstream of a stabilizer), hard-code 2300 in the calculation to save an AI channel and reduce program size.
5. LOGO! 8 Wiring, AI Configuration, and Scaling
5.1 Hardware assembly
- Mount the LOGO! 8 base module (e.g. 6ED1052-1MD08-0BA1) on DIN rail.
- Snap an AM2 analog input module (6ED1055-1MB00-0BA2) to the right of the base. AM2 accepts up to 4 analog inputs, jumper-selectable as 0-10 V or 0/4-20 mA in pairs (AI1+AI2, AI3+AI4).
- Set the AM2 jumpers to 4-20 mA for AI1, AI2, AI3. Leave AI4 jumpered for 0-10 V if a voltage transducer is used, or as 0-20 mA for cos φ signal from a power meter.
- Wire the 4-20 mA loop: transducer (+) → AM2 AI_n, transducer (−) → 24 V DC common (LOGO! power supply or external).
- Power the base module with 24 V DC (or 115/230 V AC variant 6ED1052-1HB08-0BA1) and connect the LOGO! Ethernet port to the commissioning PC for LOGO! Soft Comfort V8.4 (or later).
5.2 Block configuration in LOGO! Soft Comfort
For each phase current input, create an Analog Amplifier block to convert 0-1000 raw (representing 4-20 mA) into 0-100 (representing 0-10.0 A in 0.1 A units):
| Block | Parameter | Value | Comment |
|---|---|---|---|
| AI1 (I_L1) | Sensor type | 4-20 mA | AM2 jumper + LOGO! config |
| Amplifier 1 | Gain | 0.10 | 10 A / 100 raw |
| Amplifier 1 | Bias | 0 | 4 mA offset removed by sensor config |
| Output range | Min/Max | 0 / 1000 | 0-100.0 A |
| AI2 (I_L2) | Duplicate the above | ||
| AI3 (I_L3) | Duplicate the above | ||
6. Ladder / FBD Implementation: Integer-Only Power Calculation
Because the LOGO! Math block cannot perform floating-point operations, the per-phase kW calculation must be reformulated as integer arithmetic. The classic three-phase formula with constant V and cos φ reduces to:
P_kW_total = (I_L1 + I_L2 + I_L3) × V × cos φ × √3 / 1000
Substituting our scaled integers (I in 0.1 A units, V in 0.1 V units, constant cos φ = 85 representing 0.85, √3 = 87/50 approximation):
P_scaled = (I_L1 + I_L2 + I_L3) × 2300 × 85 × 87 / (50 × 10 × 10 × 10)
This is a four-multiplication chain; LOGO! can do it with four Math blocks. To stay within the ±32 767 limit at every intermediate step, scale the result down at the end.
6.1 Program structure
- Block B001: Addition — Inputs I_L1, I_L2, I_L3. Output A1 = I_L1 + I_L2 + I_L3 (0-300 for full 30 A balanced load).
- Block B002: Multiplication — Inputs A1 and 2300. Output A2 = I_total × V_scaled. Max = 300 × 2300 = 690 000, overflows 16-bit.
- Pre-divide: divide A1 by 10 first (Math B002) → 0-30, then multiply by 2300 → 0-69 000, still overflows. Divide A1 by 100 → 0-3, then multiply by 2300 → 0-6900, fits.
- Use the Analog Amplifier with Gain = 1.00 and Bias = 0 to hold a 32-bit value? No — amplifier output is still 16-bit normalized integer.
Recommended: scale I to 0.01 A units (1 unit = 10 mA) and V to 1 V units before multiplying. This is the only reliable way to keep the product inside 32 767 with a 30 A / 230 V load.
6.2 Rescaled computation (recommended)
| Step | Block | Operation | Inputs | Result (units) | Max value |
|---|---|---|---|---|---|
| 1 | Amplifier × 3 | 4-20 mA → 0-1000 | AI1, AI2, AI3 | 0.1 A (0-1000 for 100 A) | 1000 |
| 2 | Math add | I_L1 + I_L2 + I_L3 | A1, A2, A3 | 0.1 A summed | 3000 |
| 3 | Math div | Sum / 10 | B1, const 10 | 1.0 A (0-300) | 300 |
| 4 | Math mul | × 230 (V) | B2, const 230 | V·A | 69 000 (close to limit) |
| 5 | Math div | / 10 | B3, const 10 | V·A / 10 | 6 900 |
| 6 | Math mul | × 85 (cos φ × 100) | B4, const 85 | kW × 100 / 10 | 58 650 (overflows) |
| 7 | Math div | / 10 | B5, const 10 | kW × 100 / 100 | 5 865 |
| 8 | Math mul | × 87 (√3 × 100 ≈ 173.2) | B6, const 87 (truncated) | kW × 100 / 100 × 0.87 | 5 104 (fits) |
| 9 | Math div | / 10 | B7, const 10 | kW × 100 / 1000 | 510 (kW × 10) |
The result is an integer representing kW × 10 (so 510 means 51.0 kW). Use an Analog Threshold block to compare this value against two setpoints (e.g. 350 = 35.0 kW threshold) and produce the Boolean "use S2" / "use S3" decision.
7. ATS Source Selection State Machine
The source selection logic is a four-state machine. Implement it in LOGO! using an S/R (Set/Reset) flip-flop per source plus a priority encoder.
7.1 State machine truth table (per ATS standard, simplified)
| State | Condition to enter | Contactor S1 | Contactor S2 | Contactor S3 | Mechanical interlock |
|---|---|---|---|---|---|
| S1: Utility | V_utility OK for ≥ 30 s AND no fault latched | Closed | Open | Open | S1 ↔ S2, S1 ↔ S3 |
| S2: Big genset | V_utility fail ≥ 1 s AND P_meas > 35 kW AND genset 2 running (V & Hz OK) | Open | Closed | Open | S2 ↔ S1, S2 ↔ S3 |
| S3: Small genset | V_utility fail ≥ 1 s AND P_meas ≤ 35 kW AND genset 3 running (V & Hz OK) | Open | Open | Closed | S3 ↔ S1, S3 ↔ S2 |
7.2 LOGO! implementation tips
- Use three latching relays (S/R flip-flops)
B011(S1),B012(S2),B013(S3). Only one may be set at a time — enforce with mutual reset on the Set inputs. - The "load above threshold" decision must be latched for 5 s (On-delay timer) to avoid chattering when motor inrush pushes the current above the threshold momentarily.
- Add a 3-second off-delay on the contactor dropout to ensure the ATS has mechanical dead time before the alternate source closes.
- Use a 5-minute Off-delay timer for genset cool-down (B021) — the genset keeps running unloaded for 5 min after retransfer to utility.
- Wire the genset start signal as a sustained Q output (not a momentary pulse). Use the Set output of a latching relay to hold the start command until the genset reports "running" (V & Hz within window) plus the cool-down completes.
8. When LOGO! Is Not Enough: S7-1200 Migration Path
If the calculation requires true floating-point, real cos φ measurement, or harmonic content, the LOGO! platform is the wrong tool. The recommended replacement is the SIMATIC S7-1200 entry-level PLC. The minimum configuration for a three-source ATS with full power measurement:
| Module | Order number | Function | Qty |
|---|---|---|---|
| CPU 1214C DC/DC/DC | 6ES7214-1AG40-0XB0 | 14 DI / 10 DO, 2 AI (0-10 V), PROFINET | 1 |
| SM 1234 AI4/AO2 | 6ES7234-4HE32-0XB0 | 4 AI ±10 V / 0-20 mA, 2 AO | 1 |
| SM 1231 AI8 | 6ES7231-4HF32-0XB0 | 8 AI current/voltage, 13-bit | 1 (if more channels needed) |
| SB 1221 DI4 | 6ES7221-3AD30-0XB0 | 4 DI 24 V DC for source status feedback | 1 |
The S7-1200 CPU supports REAL (32-bit IEEE 754) arithmetic natively. The ATS logic in SCL (Structured Control Language):
// S7-1200 SCL example - three-phase real power
// Inputs: ia_raw, ib_raw, ic_raw = 4-20 mA scaled 0.0-10.0 A (REAL)
// vll = line-to-line voltage (REAL, V)
// cosphi = assumed or measured power factor (REAL)
#i_avg := (#ia_raw + #ib_raw + #ic_raw) / 3.0;
#s_kVA := SQRT(3.0) * #vll * #i_avg / 1000.0;
#p_kW := #s_kVA * #cosphi;
// Source selection
IF #vll > 200.0 AND NOT #fault_latch THEN
#cmd_source := 1; // Utility preferred
#cmd_gen_start := FALSE;
ELSIF #p_kW > 35.0 THEN
#cmd_source := 2; // Big genset
#cmd_gen_start := TRUE;
ELSE
#cmd_source := 3; // Small genset
#cmd_gen_start := TRUE;
END_IF;
This 8-line block replaces the 9-step integer chain on the LOGO! and delivers ±0.5 % accuracy with no manual scaling constants. The same logic can be implemented in ladder with ADD, MUL_R, and SQRT instructions.
For commissioning see the S7-1200 System Manual.
9. Energy Meter S0 Pulse Alternative
If true rms three-phase metering is required but the LOGO! must remain in scope (cost, panel space), use a dedicated energy meter with an S0 pulse output and count the pulses in LOGO!. This sidesteps the float-math limitation entirely because the meter performs the power calculation in its own firmware and reports energy as a pulse rate proportional to power.
Configuration per the Siemens LOGO! Energy Monitoring application note:
- Install a 3-phase energy meter (e.g. Siemens 7KT1260 or PAC1600 / PAC2200) on the load side of the ATS.
- Wire the S0 pulse output (opto-isolated, open-collector) to a fast digital input of the LOGO! 8 base module (I1-I8; 10 kHz supported on I3-I6 in counter mode).
- Configure a High-speed Counter block with the meter's pulses-per-kWh constant (e.g. 1000 imp/kWh → 1 pulse = 1 Wh).
- Compute instantaneous kW by sampling the count over a fixed window (e.g. 60 s using a pulse generator + latched counter) and converting Δpulses to kWh × (3600 / window_seconds).
| Method | Accuracy | LOGO! program complexity | Hardware cost | Recommended for |
|---|---|---|---|---|
| Direct 4-20 mA CT (this article) | ±2-5 % (integer scaling) | 9 blocks / 3 phases | 3× transducer | Fast dynamic load tracking |
| S0 pulse from energy meter | Class 1 (±1 %) | 1 high-speed counter | 1× meter + CTs | Billing, slow ATS decisions |
| Modbus energy meter via CMR2020 | Class 0.5 S | Modbus client FB | 1× meter + LOGO! CMR2020 | SCADA-integrated metering |
10. Commissioning, Verification, and Calibration
10.1 Step-by-step verification
- Sensor check (no load): with all contactors open and no load, AI1/AI2/AI3 must read raw 0 (4 mA live zero). If not, adjust AM2 jumper or apply bias in the amplifier block.
- Single-phase test load: apply a known resistive load of 1 kW (e.g. 4.35 A at 230 V) on L1 only. The summed kW result (B7 in §6.2) should be approximately 100 (kW × 10 / 10 = 1.0 kW × 10 = 10; multiplied by √3/100 factor gives ~9; tolerance ±15 %).
- Three-phase balanced test: apply 3 × 1 kW balanced. Expected reading: 30 (= 3.0 kW × 10). Compare with a clamp-on power meter (e.g. Fluke 435) reading; deviation should be within ±5 %.
- Source transition test: simulate utility fail with a test switch. The ATS should transfer within 1.5 s to S2 or S3 depending on the load condition present.
- Re-transfer test: restore utility. After 30 s of stable utility, the ATS should open the alternate source contactor and close S1. The genset should continue running unloaded for 5 min (cool-down) and then stop.
10.2 Calibration constants to record
| Constant | Value | Source |
|---|---|---|
| CT ratio | e.g. 100/5 A → use 100/5 transducer | CT nameplate |
| cos φ assumption | 0.85 (verify with clamp meter) | Field measurement |
| V_LL | 230 V (or measured) | Nameplate / multimeter |
| Threshold P_high | e.g. 35.0 kW | Application |
| Threshold P_low | e.g. 5.0 kW (hysteresis) | Application |
11. Troubleshooting Matrix
| Symptom | Likely cause | Diagnosis | Fix |
|---|---|---|---|
| AI reads 0 with current flowing | AM2 jumper in 0-10 V position | Check jumper on AM2 module | Move jumper to 4-20 mA |
| AI reads 1000 (max) with no current | Open loop or 4-20 mA configured as 0-20 mA | Measure mA at AM2 terminal | Check wiring polarity, sensor config in LOGO! |
| kW calculation overflows (negative or jumping values) | Math block product exceeds 32 767 | Monitor intermediate B1-B7 in online mode | Add a divide step earlier in the chain (see §6.2) |
| ATS chatters between S2 and S3 | Threshold comparison on instantaneous value | Check P_meas trend in LOGO! display | Add 5 s on-delay before decision; add hysteresis (P_high vs P_low) |
| Calculation off by factor of 10 | Scaling constant mismatch (e.g. cos φ entered as 85 not 8.5) | Inspect amplifier gain and Math constants | Re-derive constants using §6.2 table |
| LOGO! Web server shows wrong value | Variable mapping mismatch on HMI/web page | Verify the VM mapping in LOGO! Soft Comfort | Re-map VM address to B7 output |
| No transfer on utility fail | Source-OK signal not wired to DI | Check I1 (utility OK) state | Wire phase monitor relay to a free DI |
12. Recommended System Architecture Summary
| Criterion | Use LOGO! 8 | Use S7-1200 |
|---|---|---|
| Load below 30 kW, fixed V, constant cos φ | Recommended | Overspec |
| Variable load, dynamic PF, harmonics | Not suitable | Recommended |
| Billing-grade kWh metering | Not suitable | Required (or use dedicated meter) |
| SCADA / Modbus / OPC UA integration | Possible (LOGO! 8.3+ OPC UA server) | Native, full suite |
| Panel space < 12 DIN modules | Fits | Larger |
| Cost target < €800 for full controller | Achievable | Not achievable |
For projects where the calculation must hold ±1 % accuracy over the full load range with real power factor measurement, plan the controller as an S7-1200 from the start. For low-cost ATS controllers feeding a well-characterized load (e.g. fixed motor pump station, telecom shelter, residential block), the LOGO! 8 + AM2 + 3 current transducer architecture described here is functional and field-proven.
Frequently Asked Questions
Can LOGO! 8 actually perform three-phase power calculation?
Yes, but only as scaled integer arithmetic. The Math block operates on 16-bit signed integers (−32 767 to +32 767), so the formula must be rearranged with integer divisors at each step to prevent overflow. The achievable accuracy is roughly ±2-5 % assuming constant voltage and constant cos φ.
Why not just use floating-point in LOGO! like the Analog Amplifier seems to allow?
The Analog Amplifier block accepts decimal entry in the editor (e.g. gain 1.732) but the runtime value is still a scaled 16-bit integer. The Math instruction block has no sqrt, sin, cos, or power function. Real floating-point arithmetic requires an S7-1200 or higher CPU.
How many current inputs can I read on a single LOGO! 8?
Each AM2 module (6ED1055-1MB00-0BA2) provides 4 analog inputs. You can stack up to 8 AM2 modules on a single LOGO! 8 base, giving 32 analog inputs total. For this 3-phase application one AM2 is sufficient (3× CT transducers + 1× voltage transducer optional).
What is the S0 pulse alternative and when should I use it?
An S0 pulse output is a digital open-collector pulse train from a dedicated energy meter. Counting pulses in LOGO! avoids all float-math issues and delivers Class 1 accuracy (±1 %). Use the S0 method when the load varies widely, when you need energy totals for billing, or when you want a simpler program. Reference the Siemens energy monitoring application note for the wiring and counter block setup.
What happens if the load exceeds 32 767 in a Math block intermediate result?
LOGO! truncates the result to fit the 16-bit signed range, which causes the value to wrap around (e.g. 35 000 becomes −31 536) and the rest of the chain produces garbage. Always check the maximum product at every Math block and add an extra divide step earlier in the chain to keep the intermediate result inside ±32 767.
Which S7-1200 should I pick if I migrate away from LOGO!?
For an ATS with full power measurement, the CPU 1214C DC/DC/DC (6ES7214-1AG40-0XB0) plus one SM 1234 AI4/AO2 module (6ES7234-4HE32-0XB0) is the minimum. The S7-1211C has only 2 onboard AI and is too small for three current inputs plus a voltage input plus a cos φ input.