Skip to content
Tactiverge

Textbooks/Robotics From First Principles/Chapter 1Lite (plain text) version

1Sense, think, act

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

Text
All chapters and search
  1. 1. Sense, think, act
  2. 2. Actuators and drives
  3. 3. Vectors and frames
  4. 4. Rotations and transforms
  5. 5. Forward kinematics
  6. 6. Inverse kinematics
  7. 7. Motion and trajectories
  8. 8. Where am I? Drift, uncertainty and fusion

Introduction

Every robot, from a robot vacuum to a Mars rover, runs the same loop: read its sensors, decide what to do, drive its actuators, and go round again many times a second. This chapter takes the loop apart. What makes a machine automatic rather than intelligent, what sensors can and cannot tell you, what actuators do, and why the loop rate sets a hard time budget for everything inside it.

50 Hz means 20 ms per passsense4 msthink6 msact2 msspare 8 msthen round again, foreverused 12 of 20 ms
Figure 1.1. 50 Hz means 20 ms per pass. A 20 ms time bar for a 50 Hz loop split into sense 4 ms, think 6 ms and act 2 ms, with 8 ms spare. An arrow returns to the start: then round again, forever. Used 12 of 20 ms.

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 Sensors: how machines feel the world

Bats find moths in the dark by shouting and listening. Which robot sensor copies them?

A sensor turns the world into a number

A sensor measures something physical and reports it as a reading the controller can use: a distance in cm, a temperature in °C, pressed or not pressed. Without sensors, a machine is blind and deaf.

A sensor zoo

  • Distance: ultrasonic (sound echoes) or infrared (light).
  • Touch: bump switches, pressure pads.
  • Light: light sensors, cameras.
  • Temperature: thermometers.
  • Movement: wheel encoders count turns; accelerometers feel tilt and shaking.

On/off or a number

Some sensors give just two answers (digital: pressed or not). Others give a whole range (analogue: 0 to 100 cm). A bump switch only tells you that you hit something; a distance sensor tells you how close it is before you hit it.

Common mix-ups

  • A camera is the best sensor for everything.
    ✓ Cameras are powerful but need lots of processing and struggle in the dark. Often a simple sensor does the job better.
  • An ultrasonic sensor's echo time is the time to reach the object.
    ✓ It's the time there and back, so halve it.

Open the full lesson: Sensors: how machines feel the world →

1.4 Actuators: how machines change the world

A robot hand must hold an egg and a steel bolt. Same motor, same fingers. How can it crush one and drop the other?

Actuators make things happen

An actuator is a part that the controller switches or drives to change the world. Common ones:

  • DC motor: spins continuously (wheels, fans).
  • Servo: turns to a chosen angle (joints, steering).
  • Solenoid: pushes or pulls a short distance (locks, valves).
  • Heaters, lights, buzzers.

Joints are degrees of freedom

Each motor-driven joint gives a robot one way to move, called a degree of freedom. A gripper finger with a knuckle and a middle joint has two. More joints mean more possible poses, and more motors to control.

Actuators need feedback

A motor alone doesn't know how far it turned or how hard it's pushing. Pair it with a sensor (an encoder for angle, a pad for touch) and the controller can stop at the right place or the right squeeze.

Common mix-ups

  • Only motors are actuators.
    ✓ Heaters, lights, valves, locks and speakers are actuators too: anything the controller uses to change the world.
  • A stronger actuator is always better.
    ✓ Too much force or speed can damage things. The right actuator, well controlled, beats the biggest.

Open the full lesson: Actuators: how machines change the world →

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.

Sensors: how machines feel the world: example 1

A robot must stop before touching a wall and also know if it has been bumped from behind. Choose sensors.

Solution

Front: a distance sensor (ultrasonic or infrared), because it warns before contact. Back: a bump switch is enough, because it only needs to know that a bump happened.

Actuators: how machines change the world: example 1

Choose an actuator for: (a) the wheels of a robot car, (b) a robot's elbow joint, (c) an automatic door lock.

Solution

(a) DC motors: they spin continuously. (b) A servo: it turns to a chosen angle and holds it. (c) A solenoid: a short push or pull is all a lock bolt needs.

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.

Figure 1.3 from Sensors: how machines feel the worldSort each part into Sense, Think or Act. Read the explanation after each choice, especially for any you got wrong.
Can't use the interactive? Read a description instead

The sorting activity can be replaced by this list. Sense: ultrasonic distance sensor, bump switch, thermometer, wheel encoder. Think: microcontroller. Act: DC motor, buzzer, servo motor, heater.

Interactive figure (online). Description: The sorting activity can be replaced by this list. Sense: ultrasonic distance sensor, bump switch, thermometer, wheel encoder. Think: microcontroller. Act: DC motor, buzzer, servo motor, heater.

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

'If the soil is drier than 30%, open the water valve.' Which stage is this sentence?

Practice 3

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

Practice 4

A greenhouse needs to know when the soil is dry. Which sensor fits?

Practice 5

Is a speaker a sensor or an actuator?

Practice 6

Which actuator is best for pointing a camera at a chosen angle and holding it there?

Practice 7

A robot arm has a shoulder, an elbow and a wrist, each turned by its own motor. How many degrees of freedom does it have?

  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. 'If the soil is drier than 30%, open the water valve.' Which stage is this sentence?
    • Sense
    • Think
    • Act
  3. A robot runs its sense–think–act loop 50 times every second. How many times does it run the loop in 3 seconds?
  4. A greenhouse needs to know when the soil is dry. Which sensor fits?
    • Light sensor
    • Soil moisture sensor
    • Wheel encoder
  5. Is a speaker a sensor or an actuator?
    • Sensor
    • Actuator
  6. Which actuator is best for pointing a camera at a chosen angle and holding it there?
    • DC motor
    • Servo
    • Buzzer
  7. A robot arm has a shoulder, an elbow and a wrist, each turned by its own motor. How many degrees of freedom does it have?

Engineering applications

  • Robot vacuums

    A robot vacuum senses bumps, cliffs and dirt, decides whether to turn, reverse or keep cleaning, and drives two wheels and a brush. Its whole behaviour is that loop repeated many times a second.

  • Missed deadlines

    If the think step sometimes takes longer than the loop period, commands arrive late and the robot reacts to an old world. Engineers measure the worst case, not the average, and leave spare time in every pass.

Watch

Optional verified videos. 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.

A robot builder shows how trigonometry turns a target position into joint angles on real hardware.

15 min 54 s · captions on YouTube · source

Nothing loads from YouTube until you press play.

  • Robots: Crash Course Computer Science #37 (CrashCourse)
  • How Robots Use Maths to Move (James Bruton)

Chapter summary

  • A robot repeats sense, think, act; the faster and more regular the loop, the more responsive it is.
  • Sensors turn the world into numbers; actuators turn numbers back into motion, light, sound or heat.
  • The loop rate sets a time budget: at 50 Hz every pass, including the worst one, must fit in 20 ms.

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.
IMU (inertial measurement unit)
An IMU combines an accelerometer, which measures acceleration including gravity, and a gyroscope, which measures angular velocity; some add a magnetometer.
Encoder counts and resolution
A rotary encoder reports rotation as a count of ticks. Its resolution is the number of counts per revolution (CPR), often four times the pulses per revolution with quadrature decoding.
Degrees of freedom
The degrees of freedom of a mechanism are the number of independent ways it can move. A rigid body free in space has 6: three translations and three rotations.

Definitions from the Field Guide.

Project: A loop on paper

Design the sense–think–act loop for a robot that follows a line on the floor. List its sensors and actuators, write the rule it applies each pass in plain words, choose a loop rate and give a time budget for each stage with some spare.

Deliverables

  • A block diagram of the loop
  • The rule applied each pass
  • A time budget that fits the loop period with a stated margin

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

References

  • Roland Siegwart et al. (2011). Introduction to Autonomous Mobile Robots, 2nd edition. MIT Press.
  • Peter Corke (2017). Robotics, Vision and Control: Fundamental Algorithms in MATLAB, 2nd edition. Springer.

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.