◆ Rebuild

Part 10 · Machines

Robots and Automation

Machines that measure what they are doing and correct themselves, then follow a program without a person at every lever. Sensors, controllers and actuators; feedback; stepper and servo motors; the programmable controller that runs a factory; robot arms; and the guards, interlocks and emergency stops that keep people safe around machines that move on their own.

Difficulty
●●●●●
Time
A week for a relay sequencer or a home-made servo; a season for a small robot arm; years to automate a factory line
Steps from zero
75 prerequisites →

You need first

Thermostats and Automatic ControlThe Electric MotorMicroprocessors and Personal Computers

This unlocks

CNC Machines and 3D Printing

Raw materials

hardwood
The full path from nothing — 75 steps before this one
  1. Fire
  2. Cordage and Rope
  3. Stone Tools
  4. Finding and Preparing Clay
  5. Finding and Identifying Ores
  6. Sulfur
  7. Measurement from Scratch
  8. Writing and Numbers
  9. Hunting and Trapping
  10. Basic Woodworking
  11. The Kiln
  12. Pottery
  13. Charcoal
  14. Arithmetic and Fractions
  15. Hides and Leather
  16. Lime
  17. Bricks
  18. Salt
  19. Mercury
  20. Lye and Potash
  21. Fermentation
  22. The Wheel and Axle
  23. Logic and Binary
  24. Glass
  25. Firebrick and Refractories
  26. Bellows
  27. Saltpeter
  28. The Lathe
  29. Gears
  30. Glass Fibre and Glass Wool
  31. Copper Smelting
  32. Iron (the Bloomery)
  33. Lead
  34. Laboratory Glassware
  35. Sulfuric Acid
  36. Pumps
  37. The Waterwheel
  38. Lenses
  39. Blacksmithing
  40. Gold and Silver
  41. The Blast Furnace and Cast Iron
  42. Bronze
  43. Hydrochloric Acid
  44. The Battery
  45. The Vacuum Pump
  46. Magnets
  47. The Thermometer
  48. Steel
  49. Chimneys, Stoves and Heating
  50. Bearings and Lubrication
  51. The Steam Engine
  52. Copper Wire
  53. The Light Bulb
  54. Electrolysis
  55. Photography
  56. Hydrogen, Oxygen and Gases
  57. Centrifugal Pumps and Fans
  58. Machine Tools
  59. The Electromagnet
  60. The Generator
  61. The Vacuum Tube
  62. The Electric Arc Furnace
  63. Ammonia
  64. The Electric Motor
  65. Thermostats and Automatic Control
  66. Ice and Refrigeration
  67. Pure Silicon
  68. Ventilation and Air Conditioning
  69. Semiconductors and the Transistor
  70. Clean Rooms
  71. Integrated Circuits
  72. Making Microchips
  73. The Computer
  74. Programming
  75. Microprocessors and Personal Computers
  76. Robots and Automation

Do them roughly in this order. See it on the tech tree →

Why it matters

Automation is old: a flyball governor holds an engine's speed, a float valve keeps a tank full, a thermostat holds an oven's heat, and a Jacquard loom weaves a pattern from punched cards (Textile Machinery) — each a machine doing its job without a person at the lever.

Robots go one step further: they can be reprogrammed. The arm that welds car doors on Monday can stack boxes on Tuesday. Automation lets a small community make more with fewer hands, take people out of dull, heavy or poisonous work, and hold one standard every time. It also leads to computer-controlled machine tools that can copy almost any part.

This chapter starts with what can be built from relays, cams and home-wound motors, and climbs to the programmable controllers and robot arms of a modern factory, which need Microprocessors and Personal Computers.

How it works

Sense, decide, act

Every automatic machine has three parts:

  1. Sensors tell it what is happening: a switch touched by a moving part, a float, a beam of light broken (Photocells and Sensors), a thermometer, a wheel that counts turns.
  2. A controller decides what to do: a cam, a relay circuit, a clockwork drum, or a computer.
  3. Actuators do it: an electric motor (The Electric Motor), a solenoid that pulls a plunger (The Electromagnet), a cylinder pushed by compressed air (Bellows to Air Compressors) or oil (Hydraulic Presses and Rams).

Open loop and closed loop

An open-loop machine acts without checking the result: a washing-machine timer runs the motor for ten minutes whether the clothes are clean or not; a stepper motor is told to take 200 steps and trusts that it did. Open loop is simple and cheap, and fine when nothing disturbs the machine.

A closed-loop machine measures the result and corrects it. This is feedback, exactly as in the governor and the thermostat. The controller compares what is wanted (the set point) with what is measured, and acts on the difference (the error). The bigger the error, the harder it pushes. Too eager a controller overshoots and swings back and forth (hunting); too timid a one is slow and stops short. The cures are the same as for governors and thermostats: damping, a dead band, and the proportional–integral–derivative (PID) refinements described in Thermostats and Automatic Control and, for valves, levels and flows, in Process Controllers and Control Valves.

Controllers: from cams to computers

Controller How it holds the program Good for
Cam drum Bumps on a slowly turning drum close switches in turn Washing machines, traffic lights, automatic lathes, Automata, Barrel Organs and Player Pianos
Punched card or tape Holes read by pins or light Looms, player pianos, early machine tools
Relay logic The way the relays are wired (The Relay Computer) Lifts, machine interlocks, pumping stations
Programmable controller A program in memory, written as "ladder" diagrams Factory machines, any sequence that changes
Computer Any program (Programming) Robot arms, CNC machines, anything needing arithmetic

What you need

Item Notes See
Relays, contactors, push buttons 24 V DC control circuits The Electromagnet, Wiring and Electrical Safety
Small DC motors, 10–100 W; worm gears 20–100 : 1 Servos and actuators The Electric Motor, Gears
Wire-wound potentiometers, lamps, photocells Position sensing Resistors, Capacitors and Coils, Photocells and Sensors
Transistors Amplifiers and drivers Semiconductors and the Transistor
A small computer Programmable controllers and arms The Computer, Microprocessors and Personal Computers

Where to find it

Nothing here comes straight from nature. Copper windings (Copper Wire), iron cores, Magnets, Bearings and Lubrication and Gears all come from other chapters: automation is a way of using parts you already make.

Sensors for machines

Limit switch

A limit switch tells a controller that a moving part has reached a place: the end of a slide, a door closed, a lift at a floor. It is a lever or plunger, pressed by the moving part, that works a pair of contacts.

  • Make it from a springy brass or phosphor-bronze strip carrying a silver or copper contact, pressed by a lever with a roller on its end. For a clean, quick action, use snap action: an over-centre spring that flips the contact the instant the lever passes a point, so the contact never hovers half-open and arcs.
  • Sizes: a roller lever 25–50 mm long; contacts rated 5–10 A at 230 V AC, or 1–2 A at 24 V DC. A good snap-action switch repeats its operating point to 0.01–0.05 mm, good enough to set a machine's "home" position.
  • Wire stop switches normally closed, so the circuit is complete when all is well and is broken to stop. Then a broken wire or a dirty contact also stops the machine — it fails safe.
  • Good or bad: a good one clicks crisply at the same place every time, and has over-travel — the lever can go on moving past the operating point without breaking the switch. A bad one fizzes, sticks, or gets crushed when the slide overruns.

Rotary encoder

A rotary encoder tells a controller how far a shaft has turned. The simplest kind is a disc with evenly spaced slots that passes between a lamp and a photocell; each slot gives one pulse.

  • Two sensors, a quarter of a slot apart, give two pulse trains that are out of step. Which one rises first tells the direction of turning. This is called quadrature, and counting every rise and fall of both gives four counts per slot.
  • Make it: a brass or blackened steel disc 60–100 mm across, with 50–200 slots cut evenly with a dividing head on the milling machine (Machine Tools). For an 80 mm disc with 100 slots, each slot and bar is 2.5 mm wide together; cut the slots 1.25 mm wide. Mask each photocell with a 1 mm slit so it sees one slot at a time.
  • Absolute encoders have several rings of slots arranged as a binary number, so the controller knows the position at switch-on without counting from home. They use Gray code, in which only one ring changes at each step, so a reading taken mid-change is never wildly wrong (Logic and Binary).
  • Good or bad: turn the shaft slowly through exactly one turn and back; the count must return to exactly zero. Lost counts mean dirt, a weak lamp or slots of uneven width.

Motors that move exactly

Stepper motor

A stepper motor turns in exact small steps, one for each pulse its controller sends. Send 200 pulses to a 200-step motor and it turns exactly once, with no sensor needed. It is the open-loop way to precise motion, and drives most 3D printers and small CNC machines.

Step 1: phase A on A A B B C C Step 2: phase B on A A B B C C Step 3: phase C on A A B B C C Opposite poles share one phase. The rotor's teeth jump into line with whichever phase is on. The yellow dot marks one tooth: it moves 30° at each step. Switch A, B, C, A … to turn one way; C, B, A … the other. Stator: iron sheets with six poles, each wound with a coil (red = switched on). Rotor: soft iron with four teeth, no wires.
Fig. 1 A three-phase stepper motor with six stator poles and a four-toothed iron rotor. Each time the controller switches on the next pair of coils, the nearest rotor teeth jump into line with them: 30 degrees per step.

How it works. The simplest kind, the variable-reluctance stepper, has a soft-iron rotor with teeth and a stator with more poles than the rotor has teeth. Energise one pair of opposite stator coils and the nearest rotor teeth swing into line, because iron is pulled to where the magnetic path is shortest. Switch to the next pair and the rotor jumps on to line up with that. With 6 stator poles (3 phases) and 4 rotor teeth, each step is 30°.

The workshop stepper:

  1. Stator: a ring of thin iron sheets, 80–100 mm across, cut with six inward poles (Sheet Metal and Rolling); stack them 20–30 mm deep and rivet. Wind each pole with 150–300 turns of enamelled copper wire 0.4–0.5 mm, opposite poles in series to make one phase.
  2. Rotor: a stack of sheets with four teeth, on a steel shaft in two ball bearings. Air gap between teeth and poles: 0.1–0.2 mm — as small as you can make it without rubbing. The smaller the gap, the stronger the motor.
  3. Driver: three switches (relays or transistors), one per phase, switched on in order A, B, C, A... Reverse the order to reverse the motor. A ring of three relays, a stepping switch or a transistor ring counter (Electronic Counters) does it. Put a diode across each coil, or the switch-off spike will burn the contacts.
  4. Gearing: a 10 : 1 worm reduction turns 30° steps into 3° steps with much more torque.

The industrial hybrid stepper adds a permanent magnet and many small teeth: 50 rotor teeth give 200 steps a turn (1.8°). A 42 mm-square motor gives about 0.3–0.5 N·m, a 57 mm one 1–3 N·m. Transistor drivers can also split each step into fractions (microstepping) for smoother motion.

Good or bad. A stepper must be accelerated gently: start at a slow pulse rate and ramp up. Pulse it too fast, or load it too heavily, and it misses steps without anyone knowing — the controller thinks the shaft is somewhere it is not. Test by running a long programme back and forth, then checking the shaft comes back exactly to a mark. Steppers also lose torque as speed rises; above a few hundred rpm most are weak.

Servo motor

A servo motor (servomechanism) is any motor with a sensor that reports its position, and a controller that drives it until the position matches the command. It is closed loop: if something pushes it off, it pushes back.

Command knoba potentiometer:"go to here" Compareerror =command − position Amplifieror two relays:forward, rest, reverse M Feedback: "I am here"the error shrinks to zero and the motor stops; push the arm away and it pushes back Motorsmall DC, 10–50 W Worm30–60 : 1 Feedbackpotentiometeron the output shaft Output arm
Fig. 2 A home-made position servo. The operator turns the command knob; the controller compares its voltage with the feedback potentiometer on the output shaft and drives the motor until the two agree.

The workshop servo:

  1. Motor and gears: a small permanent-magnet or shunt DC motor of 10–50 W, driving the output through a worm and wheel of 30–60 : 1. The worm also holds the load when the motor stops.
  2. Feedback: a potentiometer on the output shaft — a coil of nichrome or constantan wire wound on a fibre ring, with a sliding contact. Fed with, say, 12 V across its ends, its slider gives 0 V at one end of travel and 12 V at the other.
  3. Command: a second identical potentiometer, the knob the operator turns (or a voltage from a controller).
  4. Compare and drive: the difference between the two slider voltages is the error. The simplest controller is two sensitive relays: one closes if the error is more than about +0.2 V and runs the motor forward; the other closes below −0.2 V and runs it backward. Between them is a dead band where neither closes and the motor rests. A better controller is a transistor amplifier that drives the motor harder the bigger the error — proportional control.
  5. Tune it. If the output overshoots and hunts back and forth, widen the dead band, lower the amplifier's gain, or add damping (a small brake, or a tachogenerator on the motor whose voltage subtracts from the drive as speed rises).

The industrial servo is a brushless motor with an encoder of thousands of counts per turn, a brake, and a transistor drive correcting position thousands of times a second.

Good or bad: turn the command knob and the output follows smoothly, stops without overshoot, and settles within a degree or two. Push the output by hand and it should push back firmly and return. A bad servo hunts, buzzes, or creeps.

The programmable controller

For most of the 20th century, factory machines were controlled by cabinets of relays wired to do one sequence. Changing the job meant rewiring the cabinet. A programmable controller (PLC, programmable logic controller) is a small, tough computer that replaces the relay cabinet: the wiring is in its memory, and you change it by editing a program.

It has inputs (usually 24 V DC from switches, push buttons and sensors), outputs (relays or transistors that switch contactors, valves and lamps) and a processor that runs a cycle called the scan, typically every 1–20 milliseconds:

  1. Read every input.
  2. Work through the program from top to bottom.
  3. Set every output.
  4. Repeat.

The program is written as ladder logic: a drawing that looks like a relay circuit, so an electrician can read it. Each rung is one line: contacts on the left, an output coil on the right. A contact [ ] is closed when its input is on; a contact [/] is closed when it is off.

  Motor starter with stop and start buttons
  |---[/ STOP ]---+---[ START ]---+-----( MOTOR )---|
  |               |               |                 |
  |               +---[ MOTOR ]---+                 |

  Tank filling: pump runs from "low" until "high"
  |---[/ HIGH ]---+---[/ LOW ]----+-----( PUMP )----|
  |               |               |                 |
  |               +---[ PUMP ]----+                 |

In the first rung, pressing START turns the motor on; the MOTOR contact in parallel then holds it on ("seals in") after START is released; pressing STOP breaks it. In the second, the pump starts when the water falls below the LOW float switch and keeps running until it reaches the HIGH float. (The real stop button is wired normally-closed, so the program sees it as "on" in normal running — see the safety section below.)

The workshop version comes in three stages:

  1. Relays first (The Relay Computer): the ladder above, wired with real relays. Perfectly good for a pump house or a lift.
  2. A drum sequencer for repeating jobs: a slowly turning drum with adjustable cams, each working a switch — fill, heat, stir, drain.
  3. A small computer (The Computer, Microprocessors and Personal Computers) with input and output boards. Each input passes through an optical isolator (a lamp and photocell in one dark tube, so wiring faults cannot reach the computer); each output drives a relay. The program reads inputs, evaluates the rungs, writes outputs, and repeats.

Good or bad: a good controller has every input and output marked by a lamp you can see, a key switch between "run" and "program", and a watchdog — a timer that stops all outputs if the program ever freezes.

The robot arm

A robot arm is a chain of servo-driven joints, like a human arm, under a computer that can move the tool at its end along any path. It welds, paints, lifts, assembles and packs, and does it the same way ten thousand times.

1 2 3 4 5 6 reach 0.5–3.5 m Joint motorservo + reduction gear+ spring brake Elbow (3)copper: motor in each joint End effectorgripper, torch, sucker Emergency stopon the fence, by the gate Fence Teach pendantwith enabling switch Controllercomputer + servo drives Joints: 1 waist, 2 shoulder, 3 elbow, 4 forearm roll, 5 wrist bend, 6 tool twist.
Fig. 3 A six-axis industrial robot arm. Each joint has a servo motor and a reduction gear; the first three joints place the wrist anywhere in reach, the last three point the tool. The cell is fenced, with an interlocked gate and an emergency stop.

Anatomy of an industrial arm:

Part What it does Typical size
Base and waist (joint 1) Swings the whole arm round ±170°
Shoulder and elbow (joints 2 and 3) Reach out, up and down Reach 0.5–3.5 m
Wrist (joints 4, 5, 6) Points and twists the tool Payload 3 kg to over 1 t
Reduction gears Turn fast motors into strong slow joints 50–160 : 1, with almost no backlash
Servo motors One per joint, each with encoder and spring-applied brake Brakes hold the arm when power fails
End effector The tool: gripper, vacuum cup, welding torch, spray gun Changed for each job
Controller and teach pendant Computer, servo drives, and a hand-held box for teaching positions Repeats a position to ±0.02–0.1 mm

The controller works out by trigonometry (Geometry and Trigonometry) the joint angles that put the tool at a given place, and moves all six joints together so the tool travels in straight lines and smooth curves. The joints use special gearboxes with almost no slack — strain-wave (harmonic) drives, where a flexible toothed cup is squeezed into an oval inside a rigid ring, and cycloidal drives — made, like the servos and computers, by a few specialised factories.

The workshop arm. Start smaller and simpler:

  1. Three joints and a gripper. A turntable waist, a shoulder and an elbow, each turned by a worm drive (30–60 : 1) from a stepper or a home-made servo. Arms of hardwood or aluminium, upper arm 25 cm and forearm 25 cm, give about 45 cm of reach and lift 200–500 g.
  2. Balance gravity. A spring or counterweight on the shoulder so the motor only has to move the arm, not hold it up.
  3. Sense position. Potentiometers on every joint, or limit switches to find "home" at switch-on for steppers.
  4. Teach it by hand. The oldest robots were taught by being led: switch off the motors, move the arm through the job by hand, and have the controller record the potentiometer readings every tenth of a second. Then play them back.
  5. Or go Cartesian. A gantry with three straight slides on lead screws (X, Y and Z) is easier to build and program than an arm and is the start of CNC Machines and 3D Printing. Most pick-and-place work in a small workshop is better done this way.

Good or bad: send the arm to the same point 20 times from different directions and mark where the tool lands. A good one lands within a millimetre every time; a bad one wanders because of slack in the gears and bending of the arms.

Machines that run themselves safely

A person beside a machine can see danger and stop. A machine running itself cannot, unless you build that in. Every automatic machine needs:

  • Guards: fixed covers over gears, belts and cutters, removable only with a tool.
  • Interlocks: a switch on every gate into a working area that cuts power when opened. With a trapped key, the gate key can only be taken from the panel when the power is off.
  • Fail-safe design: stop circuits normally closed, brakes applied by springs and released by power, so a broken wire or power cut means a stop, not a runaway.
  • A watchdog on every computer controller.
  • Slow speed near people: arms move at no more than 250 mm per second while being taught, and the teach pendant's three-position enabling switch lets the arm move only while held half in — let go or clench in panic, and it stops.
  • Two-hand controls on presses: two buttons a body-width apart, pressed within half a second of each other.
  • Lockout: during repair, the repairer padlocks the main switch off and keeps the key.

Emergency stop button

An emergency stop button is the last line of defence: a big red mushroom-headed button on a yellow background, placed where anyone can hit it with a palm in an instant — at every work position and every gate.

  • It cuts power directly, through its own normally-closed contacts wired in series with the coil of the main contactor. It does not ask the computer to stop. Software can freeze; a broken contact cannot keep a contactor closed.
  • It latches: once pressed it stays down until deliberately twisted or pulled out. Releasing it must not restart the machine; that needs a separate reset and start.
  • Make it from a turned hardwood or fibre mushroom 40–60 mm across on a plunger, a detent spring that holds it down, and two sets of contacts in series (so one welded contact does not defeat it). Paint the head red, the plate yellow.
  • Test every emergency stop each week: press it with the machine running, and check that everything stops and stays stopped.

How to tell it worked

  • Servo: steps of command are followed quickly and without hunting; pushed off position, it returns.
  • Stepper: after 10,000 steps out and 10,000 back at working speed, the shaft returns exactly to its mark.
  • Controller: switch each input by hand and watch the right output lamps respond. Pull a wire from any stop circuit: the machine must stop.
  • Safety: open each guard gate while the machine runs; it must stop before you can reach the moving part.

Note Troubleshooting. Servo hunts back and forth → gain too high or dead band too narrow; slack in the gears; add damping. Servo stops short of the command → dead band too wide or friction too high; raise the gain a little, or add a slow integral correction. Stepper stalls or loses position → accelerating too fast, too much load, or too low a supply voltage; ramp the speed, gear it down, or use a higher driving voltage with current limiting. Relay ladder chatters → a sensor flickering at its threshold; add a time delay or a snap-action switch. Encoder count drifts → dirt, a weak lamp, unevenly cut slots, or electrical noise on long wires; shield the wires.

Dangers

Danger Machines that start by themselves. An automatic machine can sit still for minutes and then move suddenly, with full force, because a sensor or a timer told it to. Most injuries from automation happen to people who reached in because it looked stopped. Never enter a guarded area or reach into a machine without first switching it off at the main isolator and locking it. A robot arm can strike faster than you can react; stay outside its reach whenever it is powered.

Danger Stored energy. Cutting the power does not always make a machine safe. Springs, raised weights, compressed air, hydraulic oil and capacitors can all move parts or shock you after the switch is off. Lower or block loads, bleed air and oil pressure, and check capacitors with a meter before touching.

  • Pinch points between a moving part and a fixed one crush fingers even at low force. Guard them.
  • Mains wiring in control cabinets: keep control circuits at 24 V wherever you can (Wiring and Electrical Safety).
  • Over-trust. A sensor can fail. Design so that a sensor failure leads to a stop.

What this unlocks

Feedback and stepping motors are the heart of CNC machines and 3D printers. Programmable controllers run Water Treatment for a Town works, pumping stations watched from afar by Telemetry and Remote Control, the Power Lines and Distribution, Railway Signalling and Safety and every modern factory. Small servos and sensors lead to self-steering Electric Vehicles and Smartphones. Above all, automation lets a small population make what once needed thousands of hands.

How it was first done

Ancient engineers such as Ctesibius of Alexandria (3rd century BC) used float valves to regulate water clocks. In 1785 Oliver Evans in Delaware built a flour mill in which elevators and screw conveyors moved the grain through every step without hands. Joseph-Marie Jacquard's punched-card loom (1804) was the first machine to follow a changeable program. The word robot comes from Karel Čapek's Czech play R.U.R. (1920), from a word for forced labour; the word automation was popularised at the Ford Motor Company around 1947. George Devol applied for a patent on a programmable arm in 1954, and with Joseph Engelberger built the Unimate, which began unloading hot die-castings at a General Motors plant in New Jersey in 1961. In 1968 General Motors asked for a replacement for relay cabinets; Dick Morley's company Bedford Associates answered with the Modicon 084 in 1969, the first programmable controller. Electric arms followed, from Victor Scheinman's Stanford Arm (1969) to the robot-filled car plants of the 1980s.

Source: content/entries/mechanics/robotics-and-automation.md