System Overview
A hydraulic waste compactor reduces the volume of mixed refuse by driving a hydraulically actuated ram into a sealed compaction chamber. From a control-engineering standpoint the machine has a small but well-defined state machine: a single start impulse runs the engine contactor, the ram cycles between a high-position and a low-position limit switch, and the controller must release the contactor and idle the system after a fixed number of cycles.
This article documents a complete Siemens LOGO! implementation of a three-cycle compactor driven by a single start button (I2) and two end-of-stroke limit switches (I3 high, I4 low). The design is portable across the LOGO! 8 (6ED1052-1xx08-0BA1 family) base module, the LOGO! 8.3 generation, and the LOGO! 8.4 firmware branch, with only minor block-numbering differences between releases.
Hydraulic compaction systems in this class typically operate at 100-200 bar working pressure with a 25-second full-stroke period; the 25-second figure supplied by the integrator is consistent with a mid-sized single-ram compactor rated at 5-15 kW of connected electric load. For mechanical reference and force/pressure sizing, see the Design and Analysis of an Hydraulic Trash Compactor study on ResearchGate, and verify the cylinder bore, ram area, and pump flow-rate against the integrator's nameplate before sizing the LOGO!'s output contactors.
Prerequisites
Before commissioning, gather the hardware, software, and reference documentation listed below. The Siemens LOGO! documentation set is the canonical reference; cross-check all parameter values against the latest manual revision for the firmware build loaded in the base module.
| Item | Specification | Notes |
|---|---|---|
| LOGO! base module | LOGO! 8.3 (or 8.0+) | 12/24 RCE: 6ED1052-1MD08-0BA1; 230 RCE: 6ED1052-1HF08-0BA1 |
| LOGO! Soft Comfort | V8.3 or higher | FBD/Ladder programming environment |
| MicroSD card | Up to 32 GB, FAT32 | Program card, data log, firmware update |
| 24 V DC supply | PSU sized for I/O and valve coils | 2 A minimum for valve and contactor coil |
| Contactor | 3-pole motor contactor with 1 NO aux | Aux contact wired to I1 |
| Hydraulic valve | 4/3 directional control valve, 24 V DC coils | Two solenoid coils for extend/retract, spring centred |
| Documentation | LOGO! 8 system manual | Siemens support entry 109741041 |
| Documentation | LOGO! Soft Comfort online help | Siemens LOGO! product page |
I/O Assignment
The integrator's specification is a 4-input, 3-output application that fits a single LOGO! 8.3 base module without expansion. Inputs and outputs are wired in sink (PNP) configuration for 24 V DC base modules, or in compliance with the 230 V base module's AC-input requirements when using a 230 RCE unit.
| Address | Type | Signal | Field device |
|---|---|---|---|
| I1 | DI | Contactor feedback (NO aux) | Motor contactor auxiliary, closed when Q1 is energised |
| I2 | DI | Start pulse (NO pushbutton) | Operator panel, momentary, normally open |
| I3 | DI | High-position limit switch | Mechanical or inductive, NO, closes at full extension |
| I4 | DI | Low-position limit switch | Mechanical or inductive, NO, closes at full retraction |
| Q1 | DO | Motor contactor coil | 3-pole contactor, 24 V DC or 230 V AC per base module |
| Q2 | DO | Forward solenoid (ram extend) | 4/3 DCV solenoid A |
| Q3 | DO | Reverse solenoid (ram retract) | 4/3 DCV solenoid B |
The I1 feedback line lets the LOGO! detect a contactor that has been commanded ON (Q1) but has not actually closed. The same input can be used for an Emergency-Stop crosscheck or to drop the cycle if a thermal overload has opened the auxiliary contact.
Cycle State Machine
The compactor has four logical states. Although the LOGO! does not expose a generic state-machine block, the same behaviour is produced with two SR (set/reset) bistable elements, an up/down counter, and a small number of AND gates.
State transition table for the controller, in textual form:
| From | Event | To | Outputs |
|---|---|---|---|
| IDLE | I2 rising edge | FORWARD | Q1 = 1, Q2 = 1 |
| FORWARD | I3 rising edge | REVERSE | Q1 = 1, Q3 = 1 |
| REVERSE | I4 rising edge, count < 3 | FORWARD (counter++) | Q1 = 1, Q2 = 1 |
| REVERSE | I4 rising edge, count = 3 | COMPLETE | Q1 = 0, Q2 = 0, Q3 = 0 |
| FORWARD / REVERSE | I1 = 0 while Q1 = 1 > 2 s | FAULT | Q1 = 0, Q2 = 0, Q3 = 0 |
Because the machine is required to start in the low (retracted) position, the first FORWARD transition does not need I4 to be active. The integrator should fit a position interlock so that a start pulse with the ram already at the high position triggers REVERSE first, then completes the cycle count correctly.
LOGO! Program Construction
The program is built in LOGO! Soft Comfort V8.3 as a single FBD (function-block diagram) circuit. The blocks below appear in the order they are wired, not in the order they are evaluated. Use the comment field on each block to record the network purpose; this makes the project portable when the original laptop is lost.
Network 1: Run Latch
Use an SR (set/reset) bistable element, block B01. The Set input is the rising edge of I2, AND-gated with the inverse of the counter-done flag (B06.Q) so that further start presses after completion are ignored. The Reset input is the counter-done flag, OR-gated with the inverted, time-filtered I1. A 2-second off-delay on I1 detects contactor dropout that is too long to be a normal pull-in transient.
B01: SR Bistable
S = I2 (rising edge) AND NOT B06.Q
R = B06.Q OR (NOT I1 after 2 s on-delay)
Q = M1 (Run)
The I1 filter is implemented with an on-delay timer B02 (TV = 2.0 s). A normal contactor pull-in settles within 200-300 ms; any dropout longer than 2 s is a fault, not a transient.
Network 2: Forward Latch
B03: SR Bistable
S = M1 AND (I4 rising edge OR first-cycle flag)
R = I3 rising edge
Q = M2 (Forward)
Retention = enabled
The "first-cycle flag" is a one-shot pulse generated by M1's rising edge. In LOGO! Soft Comfort this is the output of an edge-triggered pulse generator (B04) clocked on the M1 transition from 0 to 1. M2 must be retentive: if power is lost mid-stroke, the LOGO! should resume in the FORWARD state, not the IDLE state, when power returns.
Network 3: Reverse Latch
B05: SR Bistable
S = I3 rising edge AND M1
R = I4 rising edge AND M1
Q = M3 (Reverse)
Retention = enabled
Network 4: Counter for 3 Cycles
B06: Up/Down Counter
Cnt = I4 rising edge (count forward strokes)
Dir = +1 (always count up)
On = M1
Off = NOT M1 OR (CV reaches Par)
Par = 3
Retention = enabled
Q = M4 (CycleDone)
The counter uses the rising edge of I4 so that the I4 contactor bounce cannot double-count. Bouncing mechanical switches typically settle in 5-20 ms; if the field switch is particularly noisy, route I4 through a 50 ms on-delay (B07) before the counter clock input. The Par (parameter) value is set to 3 in the block properties dialog and is preserved on power-down in the LOGO!'s retentive memory.
Network 5: Output Assembly
Q1 = M1
Q2 = M2 AND M1
Q3 = M3 AND M1
M1, M2, M3 are the markers (internal flags) defined by the SR latches. The Q1 line drives the engine contactor; Q2 and Q3 are interlocked through the latches so that both solenoids cannot be energised simultaneously, eliminating a hydraulic short-circuit.
Counter Logic for 3 Repeatable Cycles
The "3 repeatable cycles" requirement is the single most-misunderstood part of the application. The integrator's wording is ambiguous and the LOGO! program can implement any of the following:
- If 3 means "the ram shall compress 3 times at the high position", count the rising edge of I3 and stop when the count reaches 3.
- If 3 means "the ram shall perform 3 complete forward-and-back strokes", count the rising edge of I4 (return to the low position) and stop when the count reaches 3. This is the most common interpretation in waste-compactor specifications and matches the integrator's stated "3 times push forward, 3 times retract, then stop".
- If 3 means "the operator presses the start button and the system runs 3 times in succession", count the rising edge of I2 and re-trigger the entire Run flag from the COMPLETE state.
The implementation above uses the second interpretation. The counter parameter Par = 3 is set inside the block. The block's On and Off inputs gate the counter to the Run state, so a counter increment cannot occur while the engine contactor is open.
For installations that need cycle programmability from the HMI, replace the fixed Par value with an analog multiplexer fed by an integer constant on the LOGO!'s VM (variable memory) area, then expose the parameter to the LOGO! webserver or to an operator text display (LOGO! TDE). The webserver URL is http://<logo-ip>/index.html once the webserver is enabled in Tools → Options → Webserver access.
Limit Switch Debouncing
Mechanical limit switches driven by hydraulic pressure produce 5-30 ms of contact bounce. The LOGO! 8.3 digital inputs sample at roughly 1 ms; a 50 ms on-delay on each limit switch is sufficient to suppress bounce without noticeably extending the cycle time (a 25 s cycle has a 0.2% margin).
B07: On-Delay Timer (Debounce)
Trg = I3 (high-position limit)
Par = 0.05 s
Q = I3d (debounced)
B08: On-Delay Timer (Debounce)
Trg = I4 (low-position limit)
Par = 0.05 s
Q = I4d (debounced)
Use the debounced signals (I3d, I4d) as the clock and reset inputs to the SR latches. The raw I3 and I4 are still used for the high/low position interlock in the output network, but the latching edge is taken from the debounced copies to avoid the counter reading a bounce as a return-to-low event.
Wiring, Contactor and Safety
The 4/3 directional control valve (DCV) must be centred-spring or detent-centred so that loss of both Q2 and Q3 stops the ram, not accelerates it. Hydraulic-pack safety practice for compactors typically follows ISO 4413 (Hydraulic fluid power - General rules for systems) for general design and ISO 13849-1 (Safety of machinery - Safety-related parts of control systems) for the emergency-stop and guard-interlock functions. Verify all safety categories against the local regulatory regime rather than against the PLC's internal diagnostics.
| Circuit | Wire colour (IEC 60204-1) | Conductor |
|---|---|---|
| 24 V DC supply | Red / Red-white | 1.5 mm² Cu |
| DC common | Blue | 1.5 mm² Cu |
| PE / chassis | Green-yellow | 2.5 mm² Cu |
| Limit-switch signals | Yellow | 0.75 mm² Cu, shielded near VFD |
| Contactor coil | Black | 1.0 mm² Cu |
| Valve solenoids | Brown / Violet | 1.0 mm² Cu |
Wire the auxiliary contact of the engine contactor to I1 only after the contactor has been wired and mechanically checked. If I1 reads 1 while Q1 is 0 (or 0 while Q1 is 1 for > 2 s), the LOGO! drops the cycle; this catches welded contacts, blown coil fuses, and missing thermal-overload auxiliaries. Use the LOGO!'s on-line → I/O status view to confirm I1 toggles in step with Q1 during the first manual cycle.
Commissioning and Verification
Commission the program in four phases: bench, dry-run, manual-cycle, and full automatic. Do not skip phases; the LOGO! will not detect a miswired limit switch until the second or third cycle has run.
- Bench test (no hydraulic power). Power the LOGO! and use LOGO! Soft Comfort's online mode (Tools → Simulation) to drive I2, I3, I4 from the simulation panel. Verify that the SR latches transition as expected and that the counter reaches 3 after three I4 pulses. The on-screen markers M1-M4 should toggle in real time.
- Dry-run with engine contactor wired but not energised. Disable the Q1 output in the LOGO! parameters and cycle the program with the hydraulic pack switched off. Verify that the Q2 and Q3 relay LEDs follow the latches.
- Manual cycle (operator at the panel). Have an operator press the start button with a clear view of the ram. Cycle the machine exactly once, then once more, then for the full three cycles. Listen for the hydraulic short-circuit that would indicate both Q2 and Q3 active at once.
- Full automatic with fault injection. Use a temporary switch on I1 to simulate a contactor dropout in mid-stroke. The LOGO! should drop Q1, Q2, Q3 within 2 s. Restore the switch and verify a normal restart.
Save the working program to the LOGO!'s microSD card (inserted in the base module's card slot). The card is hot-swappable and can be used to clone the program onto a replacement module if the original is damaged. See the LOGO! 8 system manual section on "Program card (microSD)" for the file layout and naming convention (file extension .lsc for Soft Comfort projects, .lld for the binary load image).
Troubleshooting Matrix
| Symptom | Likely cause | Diagnostic | Corrective action |
|---|---|---|---|
| Engine does not start on I2 | Counter already at 3 from previous cycle | Check B06.CV (counter value) in online mode | Reset the counter manually in LOGO! Soft Comfort, or add a power-on reset network |
| Engine starts, ram does not move | Q2 contactor or valve coil not energised | Measure Q2 voltage at the terminal | Check wiring, replace valve coil, verify 24 V DC PSU sizing |
| Ram overruns high position | I3 stuck closed, bouncing, or wired NC | Inspect I3 with a meter in both states | Reverse the limit-switch contact from NC to NO; tighten the cam; check for mechanical damage to the ram stop |
| Counter increments twice per stroke | I4 bouncing into the counter input | Add B07/B08 on-delay; observe B06.CV | Set 50 ms on-delay; replace worn limit switch |
| Cycle runs 4 times instead of 3 | Counter Par value mis-set | Open B06 in LOGO! Soft Comfort | Set Par = 3, transfer program, re-test |
| Engine contactor chatters | I1 filter missing or set too short | Check B02 on-delay | Set B02 TV to 1.5-2.0 s for the contactor pull-in time |
| Both Q2 and Q3 active simultaneously | Program has both latches set | Inspect M2 and M3 markers | Verify the SR latches are cross-resetting; check I3/I4 wiring polarity |
| Lost program after power cycle | Retentivity disabled or microSD card removed | Check block properties → retentivity | Enable retention on B03, B05, B06; re-save to microSD card |
| LOGO! reports "Card missing" on power-up | Card not seated or wrong format | Remove and re-insert the microSD | Re-format as FAT32; copy the .lsc file to the card root |
| Cycle never starts even though I2 LED is on | Edge-detection on I2 is wrong | Check the rising-edge block wiring | Add an explicit edge-triggered pulse generator in front of B01.Set |
For applications that need remote diagnostics, the LOGO! 8.3 built-in webserver exposes every marker, counter value, and I/O state over HTTP. Enable the webserver under Tools → Options → Webserver access and set a strong password; the integrator should never expose the LOGO! directly to the public internet.
Program Recovery After a Failed Base Module
The integrator's original LOGO! "died" and the program could not be uploaded to the PC. This is a common field issue: the LOGO! stores the executable on internal flash, but the upload path is closed unless a program card (microSD) was used or unless the project was archived on a PC before the failure. Recovery options are:
- Read the microSD card from the failed module (if accessible) and load the
.lscor.lldfile into LOGO! Soft Comfort V8.3. - If no card is available, replace the base module with a same-generation unit (6ED1052-1xx08-0BA1 or later), transfer the new project from a PC backup, and document the I/O mapping in the panel.
- Use the rebuilt FBD described in this article as the reference. The block order, marker numbering, and parameter values reproduce the integrator's intent: 3 cycles, start on I2, direction change on I3/I4.
After any program recovery, run the four-phase commissioning procedure above before the machine is returned to service. Add a printed I/O map and a commented program listing to the panel door so that the next engineer can re-create the project without the original PC.
FAQ
How do I count three compactor cycles reliably on a Siemens LOGO!?
Use the built-in Up/Down counter block (B06) with the rising edge of the low-position limit switch I4 as the count input. Set the block parameter Par = 3 and route the counter's Q output into the run-latch reset. Add a 50 ms on-delay on I4 to suppress mechanical-switch bounce.
Can I make the cycle count adjustable from the operator panel?
Yes. Replace the fixed Par value in the counter with an analog-network value or read a number from the LOGO! TDE text display's cursor keys, then write it into a variable-memory word. The LOGO! 8.3 webserver also lets you change parameters over HTTP from any browser on the same network.
What happens if the operator presses Start in the middle of a cycle?
Wire I2 through a rising-edge detector (LOGO!'s "edge-triggered pulse" instruction) so only the 0-to-1 transition starts a new sequence. Mid-cycle presses are ignored while the run latch is already set; they become valid again only after the counter reaches 3 and the run latch resets.
How do I prevent the hydraulic valve from receiving both Q2 and Q3 at the same time?
Use the SR latch cross-reset shown in Networks 2 and 3. Each latch is reset by the opposite limit switch, so the forward and reverse outputs are mutually exclusive. For an additional hardware interlock, fit a 4/3 directional-control valve with centred springs that returns to neutral when both coils are de-energised.
Which LOGO! firmware should I use for this application?
LOGO! 8.3 (device series 6ED1052-1xx08-0BA1) is the current production firmware and is fully backward-compatible with the FBD blocks used in this article. The blocks are also supported on the original LOGO! 8 (0BA8) firmware and on later releases; confirm the exact firmware build in LOGO! Soft Comfort under Tools → Options → Device Information.
What happens if power is lost mid-cycle?
Enable retention on the Forward latch (B03), the Reverse latch (B05), and the Counter (B06). The LOGO! 8.3 retains the current counter value and the active direction latch across power cycles; when power returns, the Run flag is re-asserted if I1 still indicates a healthy contactor and the start conditions are still valid.