Skip to content
Tactiverge

School/◇ Explorer/Week 16

Gates at work: safety interlocks and sorting rules

A sorting machine has three sensors and four bins. How can a few gates decide where every part goes?

About 30 min · 3 goals · Checked by automated tests; not yet reviewed by an educator

1.Why should I care?

Real machines combine many conditions: a press must see two hands AND a closed guard; a sorter must check colour, size AND metal. Turning a client's words into exact logic is one of the most important (and most error-prone) jobs in engineering.

  • ◇ Combine gates to express a rule with more than one condition.
  • ◇ Turn a written brief into a rule table for a machine.
  • ◇ Explain why safety interlocks use AND and why 'fail-safe' design matters.

Safety: Interlocks in real machines are designed and certified by qualified engineers. Never bypass a guard or interlock on a real machine.

2.Predict

A guillotine paper cutter should only cut if the guard is down AND both hand buttons are pressed. How many conditions must be 1 at the same time?

Guess first. Being wrong here is how the surprise works.

3.Discover

In the Sorting Machine Build, Level 2, turn the client's four-line brief into an 8-row rule table. Start with the easy rows: any part with metal (M = 1). Then do the others. Watch the belt run your table.

Can't use the interactive? Read a description instead

The Sorting Machine Build's Level 2 shows an 8-row table: every combination of red (R), large (L) and metal (M). For each row you choose a bin. The correct table puts every row with M = 1 in Metal, rows with M = 0 and L = 1 in Reject, R = 1, L = 0, M = 0 in Red plastic, and the all-zero row in Mixed plastic.

4.Understand

Chaining gates

Gates can feed other gates. (A AND B) AND C is 1 only when all three are 1. (A OR B) AND NOT C means 'A or B, but never when C'. Work from the inside out, like brackets in maths.

From words to logic

A brief like 'metal goes in the metal bin; otherwise large parts are rejected; otherwise red parts go to red plastic; everything else to mixed' becomes rules with three bits: R (red), L (large), M (metal). Order matters: the first rule that matches wins. Words like 'otherwise', 'unless' and 'only if' hide NOT and AND, so read them carefully.

Interlocks and fail-safe

An interlock is an AND that stops a machine unless every safety condition is true: door shut AND guard down AND hands clear. Good designs are also fail-safe: if a wire breaks, the signal drops to 0 and the AND output goes to 0, so the machine stops instead of starting.

Explain it another way

An interlock is like a bank vault that needs two managers turning two keys at once. One key alone does nothing.

Worked example 1

Using the sorter's rules, where does a large, red, non-metal part go? (R = 1, L = 1, M = 0)

Check in order. Metal? M = 0, no. Large? L = 1, yes: Reject. The red rule never gets a turn, because 'large' comes first.

Common mix-ups

  • The order of rules in a brief doesn't matter.
    ✓ With 'first match wins' rules, changing the order changes where some parts go. Write the NOT terms to make each rule exact.

5.Practice

Practice, not a test. Wrong answers get a hint and another try.

Practice 1

Using the sorter's rules (metal first, then large → reject, then red → red plastic, else mixed), where does a small, red, metal part go?

Practice 2

A press needs: guard down AND left button AND right button AND foot pedal. Of all 16 possible combinations of these four signals, how many let it run?

Practice 3

A safety interlock uses '1 = guard closed'. The guard sensor's wire snaps, so its signal becomes 0. What happens?

Practice 4 · a fresh version every time

Fill in the 4-row truth table for A AND B (rows AB = 00, 01, 10, 11). How many rows give an output of 1?

6.Apply it

Write the logic for a garage door that closes only if the close button is pressed AND nothing is in the doorway AND the door is NOT already shut. Draw it with gates and give its truth table (8 rows).

Open BUILD 003: Create an Intelligent Sorting Machine →

7.Reflect

Concepts: Logic gates and Boolean algebra · Thresholding and simple classification · Robot safety and ethics