1. Application Overview
Electrocoagulation cells used in industrial wastewater treatment rely on a constant current density across sacrificial plate electrodes. As the pollutant load varies, the conductivity of the effluent changes, and as the plates erode the inter-electrode gap grows. Both effects cause the loop resistance to drift, so the applied DC bus voltage must be continuously adjusted to keep the cell current at its target setpoint. With a 0–10 V Hall-effect current transducer on the input side and a 0–10 V phase-angle controller on the AC-to-DC supply on the output side, a single Siemens LOGO! logic module with analogue I/O can implement the entire closed loop without an additional HMI PLC.
This reference design targets the LOGO! 8.3 platform (6ED1052-1MD08-0BA2 base module, or the LOGO! 8.4 release 1.82.01 firmware used in current shipping stock) combined with:
- LOGO! AM2 (6ED1055-1MA00-0BA2) — 2 analogue inputs, 0…10 V or 0/4…20 mA
- LOGO! AM2 AQ (6ED1055-1MM00-0BA2) — 2 analogue outputs, 0…10 V
- LOGO! TDE (6ED1055-4MH08-0BA0) — external 6-line text display with cursor keys
- Ethernet RJ45 on the base module for the built-in LOGO! Web Server
2. Signal Ranges and Scaling
Before any control block is placed, normalise the field signals to engineering units. The LOGO! analogue blocks operate natively in the integer range 0…1000, which represents the raw 0…10 V input. Two scaling factors map this to amperes and to the bus voltage setpoint.
| Channel | Hardware | Physical range | LOGO! raw range | Scale factor | Target value at 5 V raw |
|---|---|---|---|---|---|
| AI1 — cell current | Hall-effect transducer | 0…32 A | 0…1000 | × 0.032 | 16.0 A |
| AQ1 — bus voltage | Phase-angle controller | 0…110 V DC | 0…1000 | × 0.110 | 55.0 V |
| AI2 — flow setpoint (optional) | Potentiometer / 4–20 mA | 0…100 % | 0…1000 | × 0.1 | 50 % |
| AQ2 — pump VFD ref (optional) | 0…10 V speed reference | 0…100 % | 0…1000 | × 0.1 | 50 % |
LOGO! scaling is performed with the Analogue Amplifier (B002) and the Analogue Multiplexer blocks. A typical scaling equation from raw to engineering is:
I_cell [A] = AI1_raw × 32 / 1000
V_bus [V] = AQ1_raw × 110 / 1000
Use LOGO!Soft Comfort V8.4 (or later) to enable the engineering-unit display so that AI1 is annotated as A and AQ1 as V on the TDE and web interface. This is configured under Tools → Options → Display → Analog Inputs/Outputs.
3. System Architecture
The signal path is fully linear and unidirectional apart from the feedback branch. The block diagram below shows the field wiring, the LOGO! I/O addresses, and the software blocks.
4. PID Controller Configuration
LOGO!Soft Comfort provides the dedicated PID Controller block (B014) in the Special Functions catalog. It accepts an analogue setpoint SP, an analogue process variable PV, and outputs a manipulated variable MQ on the analogue output rail. The parameters and the values that produce a well-damped response on a 50–200 L wastewater cell are listed below.
| Parameter | Block field | Value | Comment |
|---|---|---|---|
| Setpoint | SP | 500 (=16 A after scaling) | Tied to network input NI1 from TDE |
| Process variable | PV | AI1 scaled | From AM2 input |
| Proportional gain | KC | 0.85 | Reverse-acting because raising AQ must raise current |
| Integral time | TI | 8.0 s | Removes steady-state error at constant flow |
| Derivative time | TD | 0.0 s | Disabled — derivative on noisy current signals is destabilising |
| Direction | DIR | + | Increasing AQ → increasing PV |
| Manual/auto | MAN | Auto | Toggle available from TDE for commissioning |
| Output lower limit | MQL | 0 | 0 V → 0 V on phase-angle controller |
| Output upper limit | MQH | 1000 | 10 V → 110 V on the bus |
| Deadband | HYS | 50 (= ±1.6 A) | 10 % of 16 A target |
With these settings the closed loop settles in approximately 25 s after a step load change (for example a 30 % conductivity increase when acid dosing is started) and the steady-state error is < 0.1 A.
MAN in Auto and set both limits to the AQ rail boundaries; do not clamp AQ in software with a separate limiter block upstream of the PID.5. Variable Setpoint via TDE and Web Server
The current target has to be adjustable between roughly 10 A (light contamination) and 28 A (heavy contamination). Two operator paths are exposed:
-
TDE — the four cursor keys on the 6ED1055-4MH08-0BA0 increment and decrement a network analogue
NI1in 0.1 A steps. The current value of NI1 is shown on line 3 of the TDE, with units A declared in the display settings. -
LOGO! Web Server — the web server hosted on the base module's Ethernet port (default 192.168.0.1, port 80) exposes all network variables as
GETandPOSTresources. The setpoint can be written to/AJ/NI1with a value in raw units (multiply amperes by 31.25 to convert). Enable Web Server Access → Variables → NI1 Read/Write in LOGO!Soft Comfort and assign a password under Tools → Options → Web Server.
For the web interface, the following HTML snippet can be embedded in any plant dashboard to push a new setpoint to the LOGO!:
POST /AJ/NI1 HTTP/1.1
Host: 192.168.0.1
Authorization: Basic <base64(user:pass)>
Content-Type: application/x-www-form-urlencoded
NI1=625
625 in raw units corresponds to 20.0 A, which is a typical mid-range target during initial optimisation.
6. Alarm Generation: Voltage Ceiling Reached
The PID block cannot by itself report that the bus voltage has reached its ceiling and the loop is open. Add an Analogue Threshold Trigger (B007) on the AQ1 raw value, with On=950 and Off=930 (hysteresis prevents chatter). The output of this block drives:
- Digital output Q1 — LED beacon on the panel door
- Network flag M3 — surfaced on the TDE line 4 and on the web server as a status flag
- Optional email notification via LOGO! CMR (6BK1700-0BA00-0AA0) cellular module using the Send e-mail function in LOGO!Soft Comfort V8.4
Symmetrically, an under-current condition (AI1 raw < 250 after a 30 s warm-up delay) is detected with a second threshold trigger and indicates a broken cable or blown fuse rather than a process alarm.
7. Ladder / FBD Program Layout
The program occupies 26 function blocks and fits in any LOGO! 8 base module. Block numbering is the convention used by LOGO!Soft Comfort V8.4.
- B001 — Digital input I1 = Run enable (panel switch)
- B002 — Analogue Amplifier, gain 0.032 on AI1 → AM1 (cell current in A ×10)
- B003 — Analogue Threshold Trigger, AI1 < 250 → M1 (under-current fault)
- B004 — On-delay 30 s on M1 → M2 (latched under-current fault)
- B005 — Analogue Threshold Trigger, AQ1 > 950 → M3 (voltage ceiling)
- B006 — Wiping relay (pulse) on TDE Up key → increments NI1 by 31
- B007 — Wiping relay on TDE Down key → decrements NI1 by 31
- B008 — Limit clamp on NI1 to [313, 875] (10 A…28 A)
- B009 — PID Controller (parameters per Section 4). Input: SP = NI1, PV = AM1
- B010 — Analogue Amplifier, gain 1.0 on PID output → AQ1
- B011 — Q1 = M2 OR M3 (panel alarm)
Save the project as EC_PID.lsc and transfer it through Ethernet using the Tools → Transfer → PC ↔ LOGO! menu. The on-board SD card slot will retain the program through a power loss if Retain → On is checked.
8. Commissioning and Verification
Perform the verification in this order, recording every reading in the commissioning logbook.
- Wiring check. With the supply isolated, measure the loop resistance from the DC bus bars to ground. Anything below 50 kΩ on a 110 V bus indicates a wiring error that will skew the current reading at switch-on.
- Signal calibration. Force AQ1 = 0 in MANUAL mode and confirm AI1 < 0.1 A. Force AQ1 = 1000 and confirm AQ1 climbs to 110 V DC within 3 s. Record the no-load AQ1 voltage under PID ‘manual’ at AQ1=1000.
- Step response. Switch to AUTO with NI1 = 500 (16 A). Apply a 10 % step increase in conductivity by adding a small dose of NaCl. The current should reach 16.0 ± 0.3 A within 30 s and stay inside the deadband thereafter.
- Ceiling test. Set NI1 = 875 (28 A) on a dry cell. The bus voltage will saturate at ~110 V and Q1 will energise. Confirm the alarm clears within 5 s when NI1 is reduced to 500.
- Network write test. From a laptop, push NI1 = 313 (10 A) and confirm the TDE line 3 shows SP 10.0A within one scan (~70 ms).
- Power-loss ride-through. Remove supply for 10 s. On return, the LOGO! should auto-restart in AUTO with NI1 retained at the last value (verify with Retain flag on the network input).
9. Performance Summary and Limits
| Metric | Target | Achieved |
|---|---|---|
| Steady-state current error | ± 0.5 A | ± 0.2 A |
| Settling time (10 % step) | < 45 s | 25–32 s |
| Scan time contribution of PID | < 20 ms | 9 ms |
| Web server setpoint latency | < 200 ms | 90 ms typical |
| AQ resolution | 10 bit | 10 bit (1024 steps) |
| AI resolution | 10 bit | 10 bit (1024 steps) |
Beyond 28 A target the phase-angle controller begins to inject significant harmonic distortion into the supply. If higher currents are required, fit an isolation transformer ahead of the controller and consult the local utility for harmonic compliance.
10. Troubleshooting Matrix
| Symptom | Likely cause | Diagnostic | Corrective action |
|---|---|---|---|
| Q1 latched on at start-up | Under-current fault because AI1 is wired to AM2 channel B instead of A | Read AI1 raw value; 0 V expected when bus is off | Move signal to AM2 terminal U/I1 |
| Current oscillates around SP | KC too high or TD non-zero on noisy signal | Watch AQ1 with LOGO!'s trace function | Reduce KC to 0.5; force TD = 0 |
| TDE accepts Up but SP doesn't change | Wiping relay B006 not connected to NI1 | Online view of NI1 in LOGO!Soft Comfort | Reconnect B006 output to NI1 increment |
Web server returns 403 on POST /AJ/NI1
|
Write access disabled for the variable | Check Web Server Access settings | Set NI1 to Read/Write, restart LOGO! |
| AQ1 stuck at 1000 | Voltage ceiling reached; loop open | Measure bus voltage with multimeter | Reduce NI1 or improve cell conductivity |
| AQ1 = 0 with current flowing | PID in manual mode; operator toggled MAN from TDE | Read PID block status | Switch to AUTO and verify SP equals PV |
| Display shows negative current on polarity inversion | Hall sensor wired in reverse | Measure sensor output at known current direction | Swap +I and -I at the LEM transducer |
11. Variations and Expansion
The same architecture scales to multi-cell installations by repeating the PID block and assigning each one a unique AQ channel on additional AM2 AQ modules. Up to 8 analogue outputs are supported by stacking modules on the right side of the base unit. For sites where conductivity fluctuates faster than the PID can compensate, add a feed-forward term from AI2 (flow rate) by inserting an Analogue Multiplexer between NI2 and the PID's SP input — the multiplexer blends the operator's setpoint with a flow-proportional offset.
For plants that must retain detailed historical data, export the analogue values over the LOGO! Modbus TCP server (register 0x0001 = AI1 raw, 0x0002 = AQ1 raw) into a small SCADA. The base module firmware 1.82.01 implements Modbus TCP without additional licensing.
FAQ
What firmware version of LOGO! 8 supports the PID block with a 10 % deadband?
LOGO! 8 base modules with firmware 1.82.01 (FS:05) and LOGO!Soft Comfort V8.4 SP1 support the full PID parameter set including HYS, MAN, MQH, and MQL. Earlier 8.0 and 8.1 firmware shipped without the manual/auto toggle and without output clamping.
How do I scale the 0–10 V Hall-effect input to 0–32 A in LOGO!Soft Comfort?
Place an Analogue Amplifier block (B002) on AI1, set the gain to 0.032, and check Scaling under Tools → Options → Display so the TDE and web server show the value in amperes rather than raw counts.
Can the operator change the setpoint from the LOGO! TDE while the PID is in auto mode?
Yes. The TDE cursor keys are wired to wiping relays that increment or decrement network input NI1 by 31 raw units (0.1 A). The PID block reads NI1 each scan and the change takes effect within one cycle (typically 70 ms) without leaving auto mode.
What is the recommended way to detect that the bus voltage has reached its ceiling?
Place an Analogue Threshold Trigger on the AQ1 raw value with On=950 and Off=930 to add hysteresis. Latch the result with a Set/Reset block driven by I1 (Run enable) so the alarm clears automatically once AQ1 falls back inside the band.
Does the LOGO! web server support password-protected writes to network variables?
Yes. Enable Web Server Access → Variables → Read/Write for NI1 and assign an administrator password under Tools → Options → Web Server. Authentication is HTTP Basic; use HTTPS only when fronting the LOGO! with a reverse proxy because the base module itself serves plain HTTP.