PLC Project for Sorting System: Basic Guide and Example
A
PLC project for a sorting system controls sensors and actuators to detect and sort items based on conditions like size or color. It uses inputs from sensors, logic to decide sorting, and outputs to activate sorting mechanisms such as conveyors or pushers.Syntax
A typical PLC sorting system program uses these parts:
- Inputs: Sensors detecting item properties (e.g., photoelectric sensors).
- Logic: Conditions and timers to decide sorting actions.
- Outputs: Actuators like conveyor motors or pushers to move items.
Below is a simple ladder logic syntax example for sorting based on a sensor input.
ladder_diagram
(* Ladder Logic Example *) (* I0.0 = Sensor detects item *) (* Q0.0 = Sorter actuator *) NETWORK 1 |---[ ]---( )---| | I0.0 Q0.0 | (* When sensor I0.0 is ON, output Q0.0 activates the sorter *)
Example
This example shows a simple PLC program in Structured Text that activates a sorter output when an item is detected by a sensor input. It also uses a timer to keep the sorter active for 2 seconds.
structured_text
PROGRAM SortingSystem VAR SensorInput : BOOL; (* Input from sensor *) SorterOutput : BOOL; (* Output to sorter actuator *) Timer : TON; (* Timer On Delay *) END_VAR (* Read sensor input *) SensorInput := %I0.0; (* Start timer when sensor detects item *) Timer(IN := SensorInput, PT := T#2s); (* Activate sorter while timer is running *) SorterOutput := Timer.Q; (* Write output to actuator *) %Q0.0 := SorterOutput; END_PROGRAM
Output
When sensor input %I0.0 is TRUE, output %Q0.0 activates for 2 seconds to sort the item.
Common Pitfalls
Common mistakes in PLC sorting projects include:
- Not debouncing sensor inputs, causing false triggers.
- Forgetting to reset timers, leading to continuous sorter activation.
- Incorrect addressing of inputs/outputs causing no action.
- Not considering conveyor speed and timing for sorting accuracy.
Always test sensor signals and timer logic carefully.
structured_text
(* Wrong: Timer never resets *) Timer(IN := SensorInput, PT := T#2s); SorterOutput := Timer.Q; (* Right: Timer resets when sensor is off *) Timer(IN := SensorInput, PT := T#2s); SorterOutput := Timer.Q; IF NOT SensorInput THEN Timer(IN := FALSE, PT := T#2s); END_IF;
Quick Reference
| Component | Description | Example Address |
|---|---|---|
| Sensor Input | Detects item presence or type | %I0.0 |
| Sorter Output | Activates sorting mechanism | %Q0.0 |
| Timer | Delays or times actions | TON with PT = T#2s |
| Logic | Conditions to control outputs | IF SensorInput THEN ... END_IF |
Key Takeaways
Use sensor inputs to detect items and outputs to control sorting actuators.
Implement timers to control sorting duration accurately.
Test sensor signals to avoid false triggers and ensure reliable sorting.
Address inputs and outputs correctly in the PLC program.
Consider conveyor speed and timing for precise sorting.