Skip to content
Tutorials Center
My learning

Topics

Lesson 41 of 49 · Quality, Automation and Lean

Automation: CNC axes, PLCs and industrial robots

How factory automation works: CNC servo axes and resolution, the PLC scan cycle and ladder logic, sensors and pneumatics, robot types, forward and inverse kinematics, safety and payback.

A modern factory is full of machines that decide things. A conveyor stops when a photoelectric sensor sees a box. A press will not close until a light curtain says no hand is in the way. A robot picks a casting from a bin and drops it into a machining center, thousands of times a day, within a fraction of a millimeter. Behind these behaviors are a few building blocks that every manufacturing engineer should understand: servo axes, programmable logic controllers (PLCs) and robots.

A PLC scan cycle drawn as a loop of read inputs, run program and write outputs, next to a two-link robot arm with joint angle and reach
Two building blocks of automation: the PLC repeats a three-step scan loop; a robot arm is a chain of links and joints whose tip position follows from the joint angles.

What you will learn

  • The levels of automation and how a CNC axis is controlled.
  • How a PLC executes ladder logic in a scan cycle.
  • Common sensors and actuators, including a pneumatic cylinder force calculation.
  • Robot types, and forward and inverse kinematics of a two-link arm.
  • Safety principles and how to judge the payback of an automation project.

Key terms

Servo axis: a motor with a position sensor and a controller that continuously corrects the position to follow a command.

PLC: a rugged industrial computer that reads inputs, runs a control program and writes outputs in a repeating cycle.

Ladder logic: a PLC programming language that looks like relay wiring diagrams.

Kinematics: the geometry of motion; forward kinematics gives the tool position from joint angles, inverse kinematics the joint angles for a desired tool position.

Repeatability: how closely a robot returns to the same taught point; usually better than its absolute accuracy.

Kinds of automation

  • Fixed (hard) automation: a machine built for one product, such as a bottle-filling line. Very fast and cheap per part at high volume, but inflexible.
  • Programmable automation: the sequence can be changed by a new program, as in a CNC machine or a PLC-controlled line. Suited to batches.
  • Flexible automation: can switch products with almost no setup, such as a robot cell with vision or a flexible manufacturing system with pallets and tool magazines.

Factories are often drawn as a pyramid: sensors and actuators at the bottom, PLCs and drives controlling machines above them, SCADA (supervisory control and data acquisition) giving operators a view, MES (manufacturing execution systems) tracking production orders, and ERP at the top handling orders and inventory. Information flows up, instructions flow down.

CNC servo axes

Each axis of a CNC machine has a motor, a transmission (often a ball screw) and a position sensor (an encoder). A controller compares the commanded position with the measured one many times a second and drives the motor to remove the error. Two numbers describe what you can expect:

  • Resolution: the smallest commanded step: the screw lead divided by the encoder counts per revolution.
  • Feed speed: motor speed times the lead of the screw.

Worked example 1

A ball screw has a lead of 10 mm/rev and the motor encoder gives 4,000 counts/rev (after counting every edge of the quadrature signal).

  • Resolution = 10 / 4000 = 0.0025 mm = 2.5 µm.
  • A feed of 6,000 mm/min needs 6000 / 10 = 600 rpm.

Resolution is not accuracy: errors in the screw pitch, thermal growth and backlash can be larger. High-end machines use linear scales on the axis itself ("direct measurement") to compensate.

PLCs and ladder logic

A PLC repeats a scan cycle, typically every few milliseconds:

  1. Read inputs (buttons, sensors, switches) into memory.
  2. Run the program using that snapshot.
  3. Write outputs (motors, valves, lamps) from memory.

Because the inputs are frozen for each scan, the logic sees a consistent picture of the world. Ladder logic draws conditions as contacts and results as coils. The classic start/stop motor with seal-in needs a start button, a stop button and the motor itself:

TEXT
Motor = (Start OR Motor) AND NOT Stop

Pressing Start turns the motor on. Because the motor's own contact keeps the rung true (the "seal-in"), it keeps running after Start is released. Pressing Stop (wired normally closed, so a broken wire also stops the motor) breaks the rung.

Safety is not ordinary logic. Emergency stops, light curtains and guard interlocks go through certified safety relays or safety PLCs that work even if the normal program fails. Standards such as ISO 13849 define the required reliability by risk.

Sensors and actuators

Sensors. Inductive proximity sensors detect metal without touching; capacitive sensors detect most materials; photoelectric sensors detect objects by a light beam; encoders measure position or speed; load cells measure force; vision cameras check presence, position and quality.

Actuators. Electric motors (servo, stepper, induction with variable-frequency drives), pneumatic cylinders (compressed air: fast, cheap, simple), and hydraulic cylinders (very high force).

Worked example 2: pneumatic cylinder force

A cylinder with a bore of 50 mm at a supply pressure of 6 bar (0.6 MPa = 0.6 N/mm²):

A = π/4 × 50² = 1,963 mm², F = p A = 0.6 × 1,963 ≈ 1,178 N.

Friction and seals reduce the useful force by something like 10 to 20 percent, so size the cylinder with a margin.

Industrial robots

Common types:

  • Articulated (6-axis): a chain of rotary joints; the general-purpose robot for welding, painting, handling and machine tending.
  • SCARA: two rotary joints in the horizontal plane plus a vertical axis; fast and rigid for assembly and pick-and-place.
  • Delta: light parallel arms hanging above a conveyor; extremely fast sorting and packaging.
  • Cartesian (gantry): linear axes in X, Y and Z, simple and precise, covering large areas.
  • Collaborative robots (cobots): designed to work next to people, limiting force and speed so contact is not harmful.

Specifications to compare are payload (what it can carry at the tip), reach, number of axes, speed and repeatability, which for industrial arms is typically of the order of ±0.02 to ±0.1 mm. Absolute accuracy, meaning going to a coordinate computed from a CAD model, is usually worse unless the robot is calibrated.

For a planar arm with link lengths L1 and L2 and joint angles θ1 (at the base, from the horizontal) and θ2 (at the elbow, relative to the first link), the tool tip is at:

TEXT
x = L1 cos θ1 + L2 cos(θ1 + θ2)
y = L1 sin θ1 + L2 sin(θ1 + θ2)

The tip can reach anywhere between |L1 − L2| and L1 + L2 from the base.

Inverse kinematics

Going the other way, to place the tip at (x, y):

TEXT
cos θ2 = (x² + y² − L1² − L2²) / (2 L1 L2)
θ1 = atan2(y, x) − atan2(L2 sin θ2, L1 + L2 cos θ2)

There are usually two solutions (elbow up and elbow down), and none if the point is out of reach. Six-axis robot controllers solve the same problem in three dimensions and also plan smooth trajectories, avoiding singularities (poses where the arm loses a degree of freedom and joint speeds blow up).

Safety

Robots and automated machines can injure. The basics: guard the hazardous zone with fences and interlocked doors; use light curtains and safety scanners where access is needed; keep emergency stops reachable; follow standards such as ISO 10218 (industrial robots) and ISO/TS 15066 (collaborative operation, which limits the force and pressure on body regions), and do a risk assessment for every cell.

Is automation worth it?

A simple measure is the payback period: investment divided by annual savings.

Worked example 3. A robot cell costs $150,000 installed and replaces 2 operators on one shift at $55,000 per year each, but adds $20,000 per year for maintenance and spares: annual saving = 2 × 55,000 − 20,000 = $90,000, payback = 150,000 / 90,000 ≈ 1.7 years. Real analyses also count quality gains, scrap reduction, safety, flexibility, and the risk that product changes make the cell obsolete.

Common misconceptions

"Robots are always more accurate than people." A robot is repeatable, not automatically accurate. Its absolute accuracy depends on calibration, load and temperature.

"A PLC executes all rungs at once." It runs them one after the other in each scan, so the order of rungs and the scan time can matter.

"Automate everything." Automation works best on stable, repetitive tasks. Wasteful, unstable processes automated become expensive wasteful processes. Fix the process first, a core idea of lean.

Try it

Move the sliders to bend a two-link arm and see the tool position from the forward kinematics equations.

Two-link arm: forward kinematics

Next, simulate a PLC scan of the start/stop rung. Each scan reads a snapshot of the inputs, evaluates the logic and writes the output.

Python PLC scan: start, stop and seal-in

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Finally, solve the inverse kinematics of a two-link arm, check it against the forward equations, and draw both elbow solutions.

Python Inverse kinematics: elbow up and elbow down

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check · 5 questions

of 5 answered You scored / 5 · perfect!

  1. 1. A ball screw with a 5 mm lead and an encoder with 2,000 counts per revolution has what resolution?

    Resolution = lead / counts = 5 mm / 2000 = 0.0025 mm = 2.5 µm.
  2. 2. What is the correct order of a PLC scan cycle?

    The PLC first takes a snapshot of the inputs, then executes the logic on it, and finally updates the outputs.
  3. 3. A cylinder has a bore of 40 mm and the air pressure is 6 bar (0.6 N/mm²). What force does it produce (ignoring friction)?

    A = π/4 × 40² = 1,257 mm². F = 0.6 × 1,257 = 754 N.
  4. 4. A two-link arm has L1 = 300 mm and L2 = 200 mm. What is the maximum reach from the base?

    The arm is fully stretched when the links are aligned: L1 + L2 = 500 mm.
  5. 5. Which is true of a robot's repeatability and accuracy?

    A robot can return to a taught point very consistently, but reaching a coordinate computed from a model depends on calibration, so absolute accuracy is usually worse.

Summary

  • Automation can be fixed, programmable or flexible; the automation pyramid links sensors, PLCs, SCADA, MES and ERP.
  • CNC axes use motors, ball screws and encoders; resolution is lead divided by counts, not the same as accuracy.
  • A PLC repeats read inputs, run program, write outputs; seal-in ladder logic gives start/stop motor control; safety functions use certified hardware.
  • Robots have payload, reach and repeatability; forward kinematics gives the tip from the angles and inverse kinematics the reverse, with two solutions for a two-link arm.
  • Judge automation by payback and by risk, and fix the process before automating it.

Next: Lean manufacturing and OEE