Skip to content
Tactiverge

Textbooks/Introduction to Intelligent Systems/Chapter 1Lite (plain text) version

1Sense, think, act

Version 1 · Technically checked (automated checks only) · 4 source lessons · 8 practice items

Text
All chapters and search
  1. 1. Sense, think, act
  2. 2. Noise and filtering
  3. 3. Machine vision
  4. 4. Search and planning
  5. 5. Decisions under uncertainty
  6. 6. State estimation and sensor fusion
  7. 7. Learning from data
  8. 8. Evaluating intelligent systems honestly

Introduction

A thermostat reacts; a robot vacuum decides. The difference is not cleverness for its own sake but a loop that senses the world, chooses an action from rules or models, acts, and then senses again because the world has changed. This chapter separates automatic from intelligent behaviour, turns sensor readings into decisions with complete rule tables, and shows why real machines run several loops at different rates, fast inside slow.

SenseThinkActworld changes, so the loop repeatsouter loop 50 Hz → period 20 msmotor loop1000 Hz, 1 ms20 inner stepsper outer step
Figure 1.1. Loops inside loops. A sense, think, act loop drawn as three boxes with an arrow back from Act to Sense. The outer loop runs at 50 Hz, a period of 20 ms. A motor loop inside it runs at 1000 Hz, every 1 ms, so it takes 20 inner steps for each outer decision.

Explanation

This chapter is built from 4 School lessons. Each part below is the lesson's own explanation; open the lesson for its predict-and-discover activities.

1.1 Automatic or intelligent?

A music box plays the same tune perfectly every time. A robot vacuum never cleans your room the same way twice. Which one is smarter?

Automatic machines repeat

A music box, a toaster with a timer, or a wind-up toy does the same steps in the same order, whatever is happening around it. That is automatic. It can be precise and useful, but if the world changes, it carries on regardless.

Intelligent machines respond

An intelligent machine senses something about the world, decides what to do using rules, and acts. A robot vacuum feels a bump and turns. A night light measures darkness and switches on. Change the world and its behaviour changes too.

Smart is a spectrum

Engineers rarely mean 'thinks like a person'. They mean 'does the right thing in more situations'. A light that turns on at 7 pm is automatic. One that turns on when it gets dark is a little intelligent. One that also learns when you usually come home is more intelligent still.

Common mix-ups

  • Intelligent machines think like people.
    ✓ In engineering, an intelligent machine senses, follows rules and acts sensibly in changing situations. It doesn't need feelings or understanding.
  • A better sensor makes a machine smarter.
    ✓ Sensors only measure. The intelligence is in the rules that turn measurements into actions.

Open the full lesson: Automatic or intelligent? →

1.2 Sense, think, act

A robot vacuum bumps a chair leg, backs off and turns. In that half second it did three different jobs. What were they?

Sense

Measure something about the world: a distance, a temperature, a colour, whether a button is pressed. A machine can only react to what it can measure.

Think

Compare the measurement with what you want and choose an action. At this level the thinking is usually a rule: if the wall is closer than 20 cm, stop. Rules can be simple and still produce clever-looking behaviour.

Act

Change something in the world: spin a motor, open a valve, sound a buzzer, light an LED. The parts that do this are called actuators.

Then do it again

Acting changes the world, so the next measurement is different. The loop goes round and round, often hundreds of times a second. That repetition is what lets a robot notice surprises and correct itself.

Common mix-ups

  • A robot senses once, makes a plan and follows it.
    ✓ Reliable robots sense again and again while they act, so they can react to changes.
  • Only motors count as actuators.
    ✓ Anything that changes the world on the machine's command counts: valves, heaters, lights, speakers.

Open the full lesson: Sense, think, act →

1.3 From readings to decisions

A sorting machine sees thousands of parts an hour and never gets bored. How does it decide where each one goes?

Thresholds

A threshold is a line you draw across a sensor's range: above it means yes, below it means no. Is it red? Reading > 65. Is it dark? Light < 30. Too hot? Temperature > 24 °C. One number becomes one clear answer a controller can act on.

Rule tables

With several yes/no answers, list every combination in a rule table. Three sensors (red? large? metal?) give 2 × 2 × 2 = 8 rows. For each row you choose an action: which bin. Writing every row stops you forgetting a case, a common cause of machines doing something silly.

Noise near the line

A reading close to the threshold can flip between yes and no just from noise. A thermostat might click on and off every few seconds. Fixes: average readings first, or use two thresholds: heater on below 19.5 °C, off above 20.5 °C. The gap between them is called hysteresis, and it stops the flicker.

Common mix-ups

  • Once you pick a threshold, decisions are always right.
    ✓ Noise near the threshold can still cause wrong calls. Averaging and hysteresis reduce them.
  • You only need rules for the common cases.
    ✓ Machines meet rare cases too. A complete rule table gives every case a planned action.

Open the full lesson: From readings to decisions →

1.4 Fast loops inside slow ones

A balancing robot corrects its motors a thousand times a second but decides where to go only once a second. Why not do everything at 1 kHz?

Rates follow the physics

Each loop should run several times faster than the quantity it controls can change. Motor current changes in microseconds to milliseconds, so current loops run at 10–20 kHz. Wheel speed changes in milliseconds (1 kHz). A robot's position on a map changes over tenths of a second (10–100 Hz). Goals change over seconds (1 Hz or less).

Cascaded loops

Layers are usually cascaded: the planner sends a path, a position loop turns it into speed targets, and a speed loop turns those into motor commands. Each inner loop treats its setpoint as constant between outer updates, which only works if the inner loop is much faster.

The cost of running fast

Running everything at the highest rate wastes processor time and energy, and heavy jobs such as vision may simply not finish in 1 ms. Splitting rates lets each job get the time it needs, often on different processors: a microcontroller for fast loops, a larger computer for perception and planning.

Common mix-ups

  • Faster is always better, so run every loop as fast as possible.
    ✓ Each loop needs a rate matched to its dynamics. Over-fast loops waste computing; heavy jobs may not even finish in time.
  • The update rate is a software detail you can choose later.
    ✓ Rates decide processors, buses and stability, so they belong on the block diagram from the start.

Open the full lesson: Fast loops inside slow ones →

Worked examples

Automatic or intelligent?: example 1

Is a microwave that runs for exactly 2 minutes automatic or intelligent? What would make it intelligent?

Solution

Automatic: it runs for 2 minutes whether the food is frozen or already hot. Adding a steam or temperature sensor and a rule like 'stop when the food reaches 70 °C' would make it respond to the food, which is intelligent.

Sense, think, act: example 1

Split a smart greenhouse fan into sense, think and act.

Solution

Sense: a thermometer reads 31 °C. Think: the rule says 'if hotter than 28 °C, run the fan'; 31 > 28, so run it. Act: the fan motor turns on. Then the loop repeats: when the reading falls below 28 °C, the rule switches the fan off.

From readings to decisions: example 1

A plant-watering rule: water if soil moisture < 30%. Readings over a minute: 31, 29, 32, 28, 30%. What goes wrong, and how would you fix it?

Solution

The readings hover around 30%, so a single-reading rule would switch the pump on and off repeatedly. Fix: average (here: 150 ÷ 5 = 30% → no watering yet), or use two thresholds: start below 28%, stop above 35%.

Fast loops inside slow ones: example 1

A planner runs at 5 Hz and a position loop at 200 Hz. How many position updates per plan, and what is the position loop's period?

Solution

200 ÷ 5 = 40 position updates per plan. Period = 1/200 s = 5 ms.

Interactive figures

Figure 1.2 from Sense, think, actThis robot's 'think' step is one rule. Slide the sensor reading towards the wall and watch the decision change. Each time you move the slider, you are doing one more turn of the loop.
Can't use the interactive? Read a description instead

The rule tester can be replaced by this description: the rule is 'IF distance < 20 cm THEN stop ELSE drive forward'. At 35 cm the condition is false so the robot drives; at 15 cm it is true so it stops; at exactly 20 cm, 20 < 20 is false, so it still drives.

Interactive figure (online). Description: The rule tester can be replaced by this description: the rule is 'IF distance < 20 cm THEN stop ELSE drive forward'. At 35 cm the condition is false so the robot drives; at 15 cm it is true so it stops; at exactly 20 cm, 20 < 20 is false, so it still drives.

Laboratory

Everything runs in your browser. No kit, nothing mains-powered. Simulations are simplified educational models.

Guided practice

Answers are checked on the server; wrong answers get a hint and another try. Signed in, solved items also count towards the source lesson.

Practice 1

Which of these machines is intelligent rather than just automatic?

Practice 2

Put these lights in order from least to most intelligent: (A) on at 7 pm daily, (B) on when it gets dark, (C) on when it's dark AND someone is in the room.

Practice 3

Why must the sense–think–act loop keep repeating?

Practice 4

A robot runs its sense–think–act loop 50 times every second. How many times does it run the loop in 3 seconds?

Practice 5

A machine uses four yes/no sensors. How many rows does a complete rule table need?

Practice 6

A heater keeps clicking on and off every few seconds when the room is near 20 °C. Which fix works best?

Practice 7

Which job should run at the highest rate?

Practice 8

Why must an inner speed loop be much faster than the position loop around it?

  1. Which of these machines is intelligent rather than just automatic?
    • A clock that chimes every hour
    • A garden sprinkler that runs from 6:00 to 6:20 every morning
    • A sprinkler that waters only when a soil sensor reads dry
    • A conveyor belt that always runs at the same speed
  2. Put these lights in order from least to most intelligent: (A) on at 7 pm daily, (B) on when it gets dark, (C) on when it's dark AND someone is in the room.
    • A, B, C
    • C, B, A
    • B, A, C
  3. Why must the sense–think–act loop keep repeating?
    • To use up the battery evenly
    • Because acting changes the world, so there is always something new to measure
    • Because sensors only work once
  4. A robot runs its sense–think–act loop 50 times every second. How many times does it run the loop in 3 seconds?
  5. A machine uses four yes/no sensors. How many rows does a complete rule table need?
  6. A heater keeps clicking on and off every few seconds when the room is near 20 °C. Which fix works best?
    • Use two thresholds: on below 19.5 °C, off above 20.5 °C
    • Move the thermometer next to the heater
    • Make the heater more powerful
  7. Which job should run at the highest rate?
    • Choosing the next delivery shelf
    • Recognising objects in camera images
    • Controlling motor current
  8. Why must an inner speed loop be much faster than the position loop around it?
    • So the position loop can treat the speed as following its command almost instantly
    • Because speed is more important than position
    • It doesn't matter which is faster

Engineering applications

  • Robot vacuums

    A robot vacuum's fast loop keeps its wheels at the commanded speed, a middle loop avoids bumps and cliffs, and a slow loop plans which room to clean next. Each loop trusts the one inside it.

  • Smart irrigation

    A watering controller with a soil sensor, a rain forecast and a rule table is a small intelligent system: it senses, weighs evidence and decides, rather than running on a fixed timer.

Watch

Optional verified videos. Nothing loads from YouTube until you press play.

A lively first look at what people mean by 'intelligent' machines, and what today's AI can and cannot really do.

Length: see YouTube · captions on YouTube · source

Nothing loads from YouTube until you press play.

From factory arms to rovers: how robots sense, decide and move, including a first look at feedback control.

Length: see YouTube · captions on YouTube · source

Nothing loads from YouTube until you press play.

Explains why moving through the real world is hard for a robot, and how sensing and planning work together.

Length: see YouTube · captions on YouTube · source

Nothing loads from YouTube until you press play.

  • What Is Artificial Intelligence? Crash Course AI #1 (CrashCourse)
  • Robots: Crash Course Computer Science #37 (CrashCourse)
  • Robotics: Crash Course AI #11 (CrashCourse)

Chapter summary

  • Automatic machines follow a fixed sequence; intelligent ones choose actions from what they sense.
  • The sense–think–act loop must repeat because acting changes the world.
  • A rule table with every input combination written out leaves no case undecided; hysteresis stops chattering.
  • Fast inner loops handle physics; slower outer loops handle plans, and each must be several times faster than the one around it.

Glossary

Sense–think–act loop
Most robots run a repeating cycle: read sensors, decide what to do, command actuators, then repeat, usually at a fixed rate.
Closed-loop (feedback) control
Closed-loop control measures the output, compares it with the target and adjusts the command to shrink the difference, over and over.
On–off control with hysteresis
On–off control switches the actuator fully on or off; hysteresis uses two thresholds, one to switch on and a different one to switch off, so the output does not chatter around a single value.
Open-loop control
Open-loop control sends commands without measuring the result: 'run the motor at 60 % for 2 seconds' and hope it went far enough.

Definitions from the Field Guide.

Project: Specify a small intelligent machine

Choose a household machine you would like to make smarter. List its sensors, write a complete rule table for its main decision, and draw its loops with their rates. Explain which behaviour makes it intelligent rather than automatic.

Deliverables

  • A sensor and actuator list
  • A complete rule table
  • A loop diagram with rates and periods

Keep your work in your Engineering Journal; it stays private unless you choose to share it.

References

  • Stuart Russell and Peter Norvig (2020). Artificial Intelligence: A Modern Approach, 4th edition. Pearson.

Publication record

Version
1
Status
Technically checked (automated checks only)
Technical review
Automated checks only, last run 2026-11-29. No human, educator or mentor review is claimed.src/content/textbooks/textbooks.test.ts: schema, every lesson, diagram, practice item, video, Field Guide entry, lab and reference resolves; figure numbers recomputed; no practice answers in client payloads.
Written by
Compiled and written by the Tactiverge team with AI assistance, from Tactiverge School lessons that were themselves written with AI assistance.
Licence
All rights reserved by the founders unless a licence is approved.
Corrections
None recorded yet.Spotted a mistake? Use “Report a problem” on any chapter, or see the corrections page.