LOGO! 8 Analog Output: Adding Two VFD 4-20mA Signals Correctly

David Krause16 min read
HMI ProgrammingSiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

LOGO! 8 Analog Output: Adding Two VFD 4-20mA Signals Correctly

Siemens LOGO! 8 (6ED1052-xxx08-0BA1 base modules plus the LOGO! AM2 AQ analog output expansion) can read two 4-20 mA signals from frequency converters, perform a math operation, and drive a single analog output to a downstream device such as a Grundfos DME-60 dosing pump. The configuration looks simple, but the default 0-1000 internal unit scaling causes the analog output to saturate the moment the sum of the two inputs exceeds 1000 units. This article explains the root cause, the scaling math, and three field-proven methods to produce a correct summed (or averaged) analog output without clipping.

1. Problem Overview

The reported scenario is a meat-processing line with two tanks. Each tank is emptied by a centrifugal pump driven by a variable frequency drive (VFD). The two VFDs publish their actual flow or speed as a 4-20 mA proportional signal. A LOGO! 8 reads both signals on its onboard analog inputs, executes a Mathematical instruction block to add them, and forwards the result to the Grundfos DME-60 digital dosing pump, which uses the resulting mA value to dose color additive into the tank.

The user observed: "if 1st inverter will give 15 mA and second 0 mA, the value on analog output will be 7.5 mA. It's bad." The expected behaviour is that the LOGO! should report a usable summed value on the analog output at all times, not a half-scaled one when only one VFD is running.

The underlying cause is the way LOGO! 8 maps a 4-20 mA input to its internal 0-1000 unit representation. Adding two of those internal values can produce a result in the range 0-2000, but the analog output driver can only emit 0-1000 units (mapped back to 0-10 V or 4-20 mA depending on the hardware configuration). Anything above 1000 is hard-clipped.

2. Prerequisites

  • Siemens LOGO! 8 base module with firmware FS:04 or higher (8th-generation 0BA8 platform). Verify the firmware in LOGO!Soft Comfort V8.x → Tools → Transfer → Show Version or directly on the device menu under Diagnostics → Product Information. Refer to the LOGO! 8 (0BA8) System Manual for revision specifics.
  • LOGO! AM2 AQ or AM2 AQ2 analog output expansion module (order numbers 6ED1055-1MM00-0BA2 and 6ED1055-1MN00-0BA2 respectively). The AM2 AQ provides one 0-10 V output; the AM2 AQ2 provides one 0/4-20 mA output. See the LOGO! 8 System Manual, Section 4.4 "Analog I/O".
  • LOGO!Soft Comfort V8.3 or later for the Mathematical function block (graphical Ladder/FBD editor). Download from the Siemens LOGO!Soft Comfort download page.
  • Two VFDs with isolated 4-20 mA proportional outputs, sharing the LOGO! analog ground reference.
  • Grundfos DME-60 dosing pump with 4-20 mA control input (or 0-10 V depending on AO module selection). Confirm the dosing pump input impedance; the AM2 AQ2 output is rated 500 Ω maximum loop impedance.
Wiring note. The LOGO! AI1/AI2 onboard inputs are 0-10 V by default; for 4-20 mA you must use the AM2 AI module (6ED1055-1MA00-0BA2) or the AM2 RTD where applicable. The onboard inputs on the 0BA8 base module can be reconfigured to 0/4-20 mA only on selected variants; consult the LOGO! 8 manual for the exact AI pinout of your base (e.g., LOGO! 12/24 RCE, LOGO! 24 CE, LOGO! 230 RCE).

3. LOGO! 8 Analog I/O Hardware Reference

The relevant LOGO! 8 analog specifications are summarized below. All values are taken from the official LOGO! 8 (0BA8) System Manual.

Parameter Onboard AI (0BA8 base) AM2 AI (6ED1055-1MA00-0BA2) AM2 AQ (6ED1055-1MM00-0BA2) AM2 AQ2 (6ED1055-1MN00-0BA2)
Channels 4 (AI1-AI4) 2 1 out 1 out
Signal type 0-10 V (default) or 0/4-20 mA (variant dependent) 0/4-20 mA 0-10 V 0/4-20 mA
Resolution 10 bits (0-1000 units) 10 bits (0-1000 units) 10 bits (0-1000 units) 10 bits (0-1000 units)
Input impedance (V) 72 kΩ n/a n/a n/a
Input impedance (I) < 250 Ω (where supported) < 250 Ω n/a n/a
Output load n/a n/a ≥ 5 kΩ ≤ 500 Ω loop
Update time 50 ms typ. 50 ms typ. 50 ms typ. 50 ms typ.
Galvanic isolation No Yes (to logic) Yes (to logic) Yes (to logic)

The internal representation is 0-1000 integer units for any analog value, regardless of physical range. This is the key fact behind the clipping behaviour described in the original support thread.

4. 4-20 mA Scaling Mathematics in LOGO!

LOGO! 8 does not perform a live mA↔unit conversion. The user program (or the analog input special function) maps the raw input to the 0-1000 range using a linear interpolation. The conversion formula is:

Units = (I_measured - I_min) / (I_max - I_min) × 1000

For the standard 4-20 mA span (I_min = 4, I_max = 20, span = 16):

Units = (I - 4) / 16 × 1000

Working through the user's reported values:

  • AI1 = 15 mA → (15 - 4) / 16 × 1000 = 11 / 16 × 1000 = 687.5 (LOGO! rounds to 688 units internally).
  • AI2 = 10 mA → (10 - 4) / 16 × 1000 = 6 / 16 × 1000 = 375 units.
  • Sum = 688 + 375 = 1063 units.
  • AO driver target = 1063 units, but the hardware can only emit the equivalent of 1000 units. The driver clips the result to 1000, which corresponds to 20 mA (or 10 V on a voltage AO).

For a single-input idle case (one VFD at 0 mA, e.g., powered off or in fault):

  • AI1 = 15 mA → 688 units; AI2 = 0 mA → LOGO! treats anything < 4 mA as a wire break and forces the input to 0 units, depending on the program block (the Analog Input block has a wire-break detection option that maps below-4 mA to 0).
  • Sum = 688 units → 688/1000 × 16 + 4 = 15.0 mA. This is actually the correct summed value, not 7.5 mA as the user feared, because both legs are scaled in the same 0-1000 domain before the addition.

The 7.5 mA result the user described happens only if the program divides by 2 (averaging) instead of summing, or if the Mathematical block is fed with the raw 0-1000 unit values from only one side while the other side is held at a fixed half-scale value by mistake. The clipping problem is the real engineering issue; the averaging problem is a separate misconfiguration.

5. Root Cause Analysis: Why the Sum Clips

The mathematical operation the user is performing is:

AO_units = (AI1_units + AI2_units) with no further rescaling.

The maximum possible value of this sum is 1000 + 1000 = 2000, but the analog output driver emits, at most, 1000 units (which the AM2 AQ2 maps to 20 mA). The driver performs a hard clip:

AO_units_emitted = MIN(2000, MAX(0, AI1 + AI2)) = MIN(2000, MAX(0, 1063)) = 1000

The 0-10 V or 4-20 mA physical output saturates at full scale, which is not the same as representing a sum greater than 20 mA. The DME-60 receives a constant 20 mA whenever the sum exceeds 1000, which means it doses at maximum, not at the intended "high flow" rate.

The correct engineering solution is to choose one of the three methods described below, depending on what the user actually wants:

  1. Average of two signals (typical when both pumps carry the same fluid at the same nominal rate).
  2. Sum with proper gain compensation (when the physical output must span 0-20 mA = sum range).
  3. Maximum / dominant signal (when only the higher of the two drives should drive the dosing pump).

6. Method 1 — Average Calculation

Use the Mathematical instruction block configured as Division with two operands, or two cascaded blocks: first an Addition, then a Division by 2 using a constant.

Resulting formula:

AO_units = (AI1_units + AI2_units) / 2

Range: 0-1000 units, mapping cleanly to 0-10 V or 4-20 mA. With the user's example (688 + 375) / 2 = 531.5 units → 4 + 531.5/1000 × 16 = 12.5 mA. This is the half-way point between the two VFD signals, which is the standard interpretation of "add the two and use the result" in a balanced dual-pump installation.

LOGO!Soft Comfort implementation:

  1. Drag an Analog Input (AI) block for VFD 1 onto the network. Set Sensor type to 4-20 mA, Min to 0, Max to 1000.
  2. Repeat for VFD 2.
  3. Insert a Mathematical instruction block (mode: Add) and connect AI1 and AI2 to its two inputs.
  4. Insert a second Mathematical instruction block (mode: Divide) with the Add result as input 1 and the constant 2 as input 2.
  5. Connect the Divide output to an Analog Output (AQ) block and assign its address to the AM2 AQ/AQ2 channel.

A single Mathematical block also supports the Average mode (LOGOSoft V8.3+). When available, use it directly to avoid the two-block cascade.

7. Method 2 — Sum with Gain Compensation

When the application genuinely needs the sum of two independent flows (e.g., dosing proportional to combined tank flow), the analog output must be re-ranged so that 2000 units (the maximum possible sum) maps to 20 mA. The cleanest way to do this on LOGO! 8 is to halve each input before adding, then use the full 0-1000 range for the output:

AO_units = AI1_units × 0.5 + AI2_units × 0.5

Alternatively, divide the sum by 2 and then re-multiply the result by 2 (which is a no-op) and accept the average as the physical output — but the dosing pump controller should then be set to interpret 20 mA as "double" its nominal range.

For a true summed output that does not clip, the correct approach is to apply a gain of 0.5 on each input leg before the Mathematical Addition block:

  1. Insert a Mathematical instruction (mode: Multiply) on AI1 with constant 0.5 → result A.
  2. Insert a second Mathematical instruction (mode: Multiply) on AI2 with constant 0.5 → result B.
  3. Insert a third Mathematical instruction (mode: Add) combining A + B.
  4. Connect the Add output to the AQ block.

Verification example: AI1 = 1000 (20 mA), AI2 = 1000 (20 mA) → 500 + 500 = 1000 units → 20 mA. AI1 = 688 (15 mA), AI2 = 375 (10 mA) → 344 + 187.5 = 531.5 units → 12.5 mA. The output no longer clips and the DME-60 receives a value proportional to the average loading of the two pumps.

Important. If the dosing pump must respond to the sum and not the average, change the DME-60 control range. On the Grundfos DME-60 control panel, navigate to Setup → Control → External control → Signal range and set the 20 mA setpoint to twice the nominal value, while keeping 4 mA = zero. This way, the LOGO! output (0-10 V or 4-20 mA averaged) drives the pump across its full scale without clipping on the LOGO! side. See the Grundfos product documentation for the exact menu structure for your DME firmware version.

8. Method 3 — Maximum / Dominant Signal Selection

For applications where only the higher of the two VFDs should drive the dosing (e.g., a single dosing pump is shared and the line must follow whichever tank is discharging faster), use the built-in Analog Comparator and Analog Multiplexer blocks in LOGOSoft:

  1. Insert two Analog Comparator blocks: A = AI1, B = AI2, ON if A > B and A = AI2, B = AI1, ON if A > B.
  2. Insert an Analog Multiplexer block; when comparator 1 is true, route AI1 to output; when comparator 2 is true, route AI2 to output. Tie the default to the higher of the two on tie.
  3. Connect the multiplexer output to the AQ block.

This avoids the clipping entirely and provides deterministic behaviour when one VFD is idle. The user originally suspected an averaging behaviour from the LOGO! (the 7.5 mA value when only one VFD was at 15 mA) — this method produces 15.0 mA in that case, which is what was actually expected.

9. Step-by-Step Implementation (LOGO!Soft Comfort)

The following procedure implements Method 2 (Sum with 0.5 gain), which is the most general-purpose for a dual-pump dosing application.

  1. Open LOGO!Soft Comfort and create a new project. Select the target base module (for example, LOGO! 12/24 RCE with one AM2 AQ2 expansion).
  2. On the Network 1 canvas, drop two Analog Input blocks. Configure each as Sensor: 4-20 mA, Min: 0, Max: 1000. Connect AI1 to the VFD 1 4-20 mA terminal; AI2 to the VFD 2 4-20 mA terminal. The terminal numbers on the AM2 AI module are I1 / I2 (pin 2 / pin 5) and M (pin 3 / pin 6). Refer to the LOGO! 8 manual, section 4.4.3.
  3. Drop a Mathematical Instruction block. Set Mode to Multiply, input 1 = AI1, input 2 = constant 0.5. Name the output AxHalf1 (use a free flag/marker byte, e.g., AM1).
  4. Drop a second Mathematical Instruction block, mode = Multiply, input 1 = AI2, input 2 = 0.5. Name the output AxHalf2 (e.g., AM2).
  5. Drop a third Mathematical Instruction block, mode = Add, input 1 = AM1, input 2 = AM2. Name the output AO_input (e.g., AM3).
  6. Drop an Analog Output block. Set Reference = AM3, Sensor = 4-20 mA (or 0-10 V depending on AM2 variant), Min: 0, Max: 1000. Bind the AQ block to the AM2 AQ/AQ2 output channel (AQ1 by default for the first expansion).
  7. Compile and simulate with F5 → Simulation. Force AI1 = 688 (15 mA) and AI2 = 375 (10 mA); the AQ block should display 531.5 ± 1 unit due to 10-bit rounding.
  8. Download to the LOGO! with Tools → Transfer → PC ↔ LOGO!. Use Ethernet (for the ...E variants) or the LOGO! USB cable (6ED1057-1AA01-0BA0).
  9. From the LOGO! front panel, navigate to AQ → AQ1 to verify the live output value in mA or V.

10. Verification

Validate the program with the following test cases before connecting the DME-60 dosing pump:

Test VFD1 mA VFD2 mA Expected AQ units Expected AQ mA (AM2 AQ2) Pass criterion
Both idle 4 4 0 4.0 ± 0.2 mA
Single pump mid 12 4 250 8.0 ± 0.2 mA
User case A 15 10 531.5 12.5 ± 0.2 mA
Both max 20 20 1000 20.0 ± 0.2 mA
Clipping check 20 20 1000 (NOT 2000) 20.0 Output must NOT exceed 20.0 mA

Measure the physical output with a calibrated multimeter in current mode (break the loop and put the meter in series with the AO+) or use the LOGO!'s on-screen AQ value as a sanity check. The Grundfos DME-60 must NOT receive more than 20.0 mA under any input condition.

11. Troubleshooting Matrix

Observed behaviour Likely root cause Corrective action
AO = 20 mA all the time when both VFDs > 12 mA Sum exceeds 1000, hardware clips Apply Method 2 (0.5 gain) or use Average mode
AO = 7.5 mA when only VFD1 = 15 mA Program is dividing by 2 (averaging) but only one input is live Verify both VFDs are wired and powered; check the wire-break behaviour of the AI block
AO = 0 mA but VFDs are running Sensor type set to 0-10 V on a 4-20 mA signal (or vice versa) Reconfigure AI Sensor in LOGO!Soft Comfort to match the hardware
AO = 4 mA even when both VFDs are at 4 mA Min parameter on AQ block mis-set (e.g., 4 instead of 0) Set AQ Min = 0, Max = 1000
AO unstable, jumps by 30+ units Shielded cable missing, VFD output not isolated, common-mode noise on AI Use shielded twisted pair, ground shield at VFD end only, install signal isolator
Program runs in simulation but not on the LOGO! Mathematical block operand references an unassigned flag Verify all intermediate variables (AM1, AM2, AM3) are real marker bytes, not VM addresses
AO = 20 mA when VFDs are off (0 mA) AI block is in 0-10 V mode; 0 V reads as 0 units, not wire-break, but the AO driver still holds last value if a previous sum was 1000+ Clear the AQ block on power-on with a positive edge on the first cycle
Safety note. The Grundfos DME-60 dosing pump will dose at maximum flow if it receives a saturated 20 mA input continuously. In a color-additive application, this can over-dose and contaminate product. Always fit a hardware interlock or set a software high-limit on the AQ block in LOGOSoft that holds the output below, for example, 800 units (16.8 mA) until the cause of the saturation is investigated.

12. Application-Specific Notes for Grundfos DME-60

The Grundfos DME-60 is a digital diaphragm dosing pump with a 4-20 mA proportional control input. The pump's dosing capacity is configured in the control panel under Setup → Capacity → Max capacity and the analog input is interpreted linearly between 4 mA (zero flow) and 20 mA (max capacity). When feeding it from a LOGO! AM2 AQ2 module, ensure:

  • The AQ2 4-20 mA loop is wired with correct polarity: LOGO! pin I (current output) goes to DME-60 terminal +; LOGO! pin M (ground) goes to DME-60 terminal −. See the AM2 AQ2 wiring diagram in the LOGO! 8 manual.
  • The DME-60 input impedance is less than 500 Ω (within the AM2 AQ2 specification).
  • The dosing pump's capacity scaling is set so that 20 mA matches the maximum expected combined flow from both tanks. If the actual combined flow never reaches the 1000-unit / 20 mA point under normal operation, use Method 1 (Average) instead, which gives finer resolution over the operating range.

13. Quick Reference: Scaling Math

For quick field reference, the three most common transformations for a 4-20 mA signal in LOGO! 8 are:

Direction Formula Notes
mA → units U = (I − 4) / 16 × 1000 I in mA, U in 0-1000 internal units
units → mA I = 4 + (U / 1000) × 16 U in 0-1000 internal units, I in mA
units → V (0-10 V) V = (U / 1000) × 10 Only valid for AM2 AQ voltage output
Sum to AO units (Method 2) AO = 0.5 × AI1 + 0.5 × AI2 Avoids clipping; range 0-1000
Average to AO units AO = (AI1 + AI2) / 2 Identical to Method 2 for two inputs

The choice between "sum with gain compensation" and "average" comes down to whether the downstream device (in this case the DME-60) should interpret 20 mA as "max capacity" or "double max capacity." For most dosing applications, average is the correct answer; the AO block's gain of 0.5 on each leg implements average without further scaling.

14. Frequently Asked Questions

Why does my LOGO! 8 analog output stick at 20 mA when both VFDs are running above ~12 mA?

Because the analog output driver in the AM2 AQ/AQ2 module can only emit 0-1000 internal units, which maps to 0-10 V or 4-20 mA. Adding two 0-1000-unit values can produce up to 2000 units, and the driver hard-clips the result to 1000. Apply a 0.5 gain to each input leg (or use Average mode in the Mathematical block) so the sum never exceeds 1000 units.

What is the correct LOGO!Soft Comfort function block to add two analog inputs?

Use the Mathematical Instruction block from the Special functions palette. Set Mode to Add for a sum, Sub for a difference, or choose Average on firmware V8.3 or later for a direct average. Configure inputs as AI1 and AI2 (raw 0-1000 unit values) and the output as a marker byte (AMx) that feeds the Analog Output block.

Can I connect a 4-20 mA VFD signal directly to the LOGO! 8 onboard analog input?

On most 0BA8 base modules (LOGO! 12/24 RCE, LOGO! 24 CE, LOGO! 230 RCE) the onboard AI1-AI4 are 0-10 V by default. To read 4-20 mA, either add an AM2 AI expansion module (6ED1055-1MA00-0BA2) or use a base-module variant whose AI hardware supports current. Refer to the LOGO! 8 system manual, Section 4.4 for the exact input configuration of your model.

How do I prevent the dosing pump from over-dosing if the LOGO! output saturates?

Set a software high-limit on the Analog Output block in LOGO!Soft Comfort. Reduce Max on the AQ block from 1000 to, for example, 800 (16.8 mA). The pump will then never receive more than 16.8 mA regardless of the input sum, providing headroom to detect and respond to a saturated condition. Combine this with a digital alarm flag driven by an Analog Threshold block set to trigger when the pre-limit sum exceeds 900 units.

What is the update rate of the LOGO! 8 analog I/O?

The typical scan-to-scan update time is 50 ms for the on-board analog inputs and the AM2 AI/AQ/AQ2 expansions. The program cycle adds 0-30 ms depending on the number of blocks. For closed-loop dosing control of the DME-60, this is fast enough (effective loop rate > 10 Hz) but not fast enough for high-speed flow profiling. If you need faster updates, move to a SIMATIC S7-1200 with SM1232 AQ module, which has a 1 ms settling time.

Back to blog