← Back to projects
Industrial · PLC Programming · Simulation

Pick & Place — PLC Control & Production Monitoring

Fully programmed Pick & Place system with real-time production monitoring, built from scratch using TIA Portal V17, PLCSIM (S7-1500), and Factory I/O. Designed to demonstrate end-to-end PLC programming skills — from safety logic to sequence control to production analytics.

Context
Personal Project
Year
2025
Category
Industrial Automation · PLC · Simulation
Role
Full project — design, programming, monitoring

The Problem

In manufacturing lines with robotic pick-and-place systems, unplanned downtime is one of the most costly issues. Cycle time degradation — when a machine gradually slows down — often goes unnoticed until a full stop occurs. By the time maintenance is called, production has already been lost.

The Solution

A complete PLC program that controls a Pick & Place cartesian robot and simultaneously monitors production KPIs in real time. The system measures every cycle, tracks statistical trends (average, min, max), and lays the groundwork for early degradation detection.

Program Structure

FC1 — Control
Ladder (LAD)
Safety and master control logic — Start/Stop latching, Emergency Stop, fault detection, reset verification, and forced output shutdown.
FC2 — Sequence
SCL
State machine controlling the pick and place cycle — 10 main steps with two-phase motion pattern, automatic repetition, conveyor coordination.
FC3 — Monitoring
SCL
Real-time production analytics — cycle time measurement, statistical tracking (last, avg, min, max), machine state and fault counting.

Sequence Logic — FC2

The sequence is implemented as a CASE state machine in SCL. Each step controls physical outputs and waits for the appropriate sensor feedback before advancing. Motion axes use a two-phase pattern to avoid false transitions within the same scan cycle.

StepActionTransition
0Idle — waitingRunning = TRUE
1Start entry conveyorSensor_Entry = TRUE
2Stop entry conveyorImmediate
3 / 31Lower Z axisMoving_Z start → end
4Activate gripperItem_Detected = TRUE
5 / 51Raise Z axisMoving_Z start → end
6 / 61Move X to exit positionMoving_X start → end
7 / 71Lower Z at exitMoving_Z start → end
8Release gripper + raise ZItem_Detected = FALSE
9 / 91Return to homeAll axes stopped

Production Monitoring — FC3

Every completed cycle is measured using a TON timer as a stopwatch. FC3 computes a running average and tracks min/max cycle times — giving a real-time baseline for detecting performance degradation before it causes downtime.

CycleTime_Last
Last cycle duration (ms)
CycleTime_Avg
Moving average (ms)
CycleTime_Min
Best cycle recorded (ms)
CycleTime_Max
Worst cycle recorded (ms)
CycleCount
Total pieces completed
MachineState
0=Idle · 1=Run · 2=Fault

Key Technical Decisions

  • Two-phase motion pattern: Factory I/O axis signals are TRUE during motion, requiring a start-detection sub-step before the completion check — prevents same-scan false transitions
  • Separate safety layer: FC1 handles all safety independently from the sequence. If FC2 has a bug, FC1 still forces all outputs OFF on emergency stop
  • TON as stopwatch: Used a TON timer with a long PT as a cycle chronometer instead of system clock reads — simpler and reliable in PLCSIM Standard
  • Exit conveyor always running: Prevents product accumulation at the output — a real production concern, not just a simulation detail
Phase 2 — Python Data Layer (planned)
Connect via python-snap7 or OPC UA → store production logs in MySQL → Streamlit dashboard with OEE, cycle time trends, and predictive degradation alerts based on moving average analysis.