
🛠️ PLC Programming Exercise: Automated Conveyor Sorting System
🧩 1. Introduction
In this exercise, you’ll design and program a PLC-controlled conveyor system that sorts objects based on size. This mimics automation systems used in manufacturing and packaging lines where products need to be sorted before proceeding to the next stage.
Objects pass through sensors mounted on a conveyor belt. Based on the object size, the system will divert items into different bins using pneumatic pushers. This project strengthens both logical thinking and PLC programming skills in industrial automation.
🎯 2. Learning Objectives
By the end of this exercise, you will:
- Develop ladder logic to handle sensor input and actuator control
- Use timers and rising edge detection to prevent multiple triggers
- Implement a real-world decision-making system on a PLC
- Understand how to structure PLC code for clarity and efficiency
- Troubleshoot and debug control systems
🧰 3. Tools and Components
Hardware Required
- A basic PLC unit (Siemens S7-1200, Allen-Bradley Micro820, etc.)
- Three photoelectric sensors (for small, medium, and large object detection)
- A conveyor belt driven by a motor
- Two pneumatic pushers or DC solenoids for sorting
- A 24V DC power supply
- Emergency stop push button
- Appropriate PLC input/output module
- Relay or motor starter (if using high-powered motors)
- Wires, terminal blocks, and a control panel or breadboard
Software Required
- PLC programming software (TIA Portal, RSLogix 500/5000, Connected Components Workbench, etc.)
- Optional: PLC simulation software like Factory I/O for testing logic
📘 4. Background Concepts
Before diving into the programming, let’s clarify a few important terms:
- PLC (Programmable Logic Controller): A rugged digital computer used for automation, handling inputs (like sensors) and outputs (like motors).
- Photoelectric Sensor: Detects objects by interrupting a beam of light.
- Ladder Logic: A graphical programming language resembling relay logic used in industrial control.
- Actuators: Devices such as solenoids or pushers used to perform mechanical actions.
- Timers and Counters: Functional blocks used to create delays or track events.
🧑🏭 5. Step-by-Step Guide
Step 1: Define the Control Logic
- The conveyor runs continuously unless an emergency stop is pressed.
- As items move along the conveyor:
- If the small sensor is triggered, the item is allowed to continue into bin 1.
- If the medium sensor is triggered, the system activates Pusher A, diverting the item into bin 2.
- If the large sensor is triggered, Pusher B is activated, sending the item into bin 3.
Step 2: Input and Output Assignment
You’ll wire the devices to the PLC using the following general logic:
Inputs:
- Emergency Stop Push Button (normally closed)
- Small Object Sensor
- Medium Object Sensor
- Large Object Sensor
Outputs:
- Conveyor Motor Output
- Pusher A (Medium Object Sorter)
- Pusher B (Large Object Sorter)
You can choose appropriate digital addresses (e.g., I0.0, I0.1, Q0.0) based on your specific PLC model.
Step 3: Programming the Conveyor Start Logic
Use a normally closed contact for the emergency stop in the first network:
[ Emergency_Stop ] (normally closed)
|
+-----> ( Conveyor Motor Output )
This ensures the motor only runs when the emergency stop is not pressed.
Step 4: Object Detection and Sorting Logic
Use edge detection and timers to activate the pushers:
Pusher A Logic for Medium Object:
[ Medium Sensor ]
|
+-----> [ TON Timer T1, 0.5s delay ]
|
+-----> ( Output to Pusher A )
Pusher B Logic for Large Object:
[ Large Sensor ]
|
+-----> [ TON Timer T2, 0.5s delay ]
|
+-----> ( Output to Pusher B )
The timers help ensure that pushers activate only for a short, defined time, preventing multiple activations or prolonged actuation.
Step 5: Optional Counter Logic
You can add counters to monitor how many items have been sorted:
- Connect the output coil of Pusher A to a Count Up block (CU) for medium objects.
- Do the same for Pusher B to track large items.
🔍 6. Testing and Debugging Tips
Test Each Section:
- Ensure the emergency stop disables all outputs.
- Test sensor response individually using diagnostic LEDs or PLC monitoring mode.
- Use manual triggering in the software to test pusher logic without physical items.
- Confirm timers are functioning as expected using simulation or monitoring tools.
Common Issues and Fixes:
- Issue: Conveyor motor doesn’t start
Fix: Check the logic of the emergency stop; make sure it’s normally closed. - Issue: Both pushers activate together
Fix: Confirm that only one sensor is triggered at a time. Adjust sensor positioning or add logic conditions. - Issue: Pusher doesn’t retract
Fix: Use a timer to deactivate the pusher after a short duration (e.g., 0.5 seconds). - Issue: Multiple items triggering the same pusher
Fix: Add spacing between items or debounce logic using timers.
🔄 7. Extensions and Improvements
Once your basic version works, here are some enhancements you can explore:
- HMI Integration: Display real-time object counts and allow user control over sorting behavior.
- Speed Control: Implement variable speed drive (VFD) control of the conveyor via analog output.
- Color Sorting: Use a color sensor to sort by object color instead of size.
- Remote Monitoring: Send sorting statistics to a database or cloud platform via MQTT or Modbus TCP.
- Auto Calibration: Add push-button calibration to automatically set sensor thresholds.