The Sense-Think-Act Loop, Formally
Beyond the Simple Version
If you've encountered the sense-think-act loop before, you've likely seen it presented simply: sense, then think, then act, repeat. At this level, it's worth examining more carefully — including some real engineering subtleties that matter once you start building.
The Loop Has a Real-World Frequency
A robot's control loop runs at some actual frequency — say, 100 times per second (100 Hz). This isn't arbitrary: it's determined by how fast your sensors can produce new readings, how much computation your "think" step requires, and how quickly your actuators need updated commands to behave smoothly. A loop that runs too slowly for the robot's speed and environment will react too late — the robot equivalent of a slow reflex.
Latency Is a Real Engineering Constraint
Latency is the delay between something happening in the world and the robot's control loop actually reacting to it. Every step in the loop adds some latency:
- Time for the sensor itself to physically measure something (an ultrasonic sensor's sound pulse takes real time to travel and return)
- Time for the microcontroller to read and process that sensor's signal
- Time for the "think" step's computation
- Time for the actuator (motor) to physically respond to a new command (motors don't reach a new speed instantaneously)
For a slow-moving robot, small latencies rarely matter. For a fast robot navigating a cluttered space, latency stacking up across every stage can mean the difference between smoothly avoiding an obstacle and colliding with one the sensor genuinely did detect — just too late for the robot to react in time.
Sense, Think, and Act Can Run at Different Rates
A subtlety worth knowing: not every part of a robot's system needs to run at the same frequency. A motor's low-level speed control might update thousands of times per second (handled by dedicated, fast hardware/firmware), while a higher-level "which direction should I be heading" decision might only need to update 10 times per second. Real robotic systems are often architected as multiple loops running at different rates, layered on top of each other — a distinction that becomes important once you move beyond simple beginner projects.
Key Takeaway
The sense-think-act loop isn't just a teaching diagram — it's a real engineering system with a frequency, a latency budget, and (in more advanced systems) multiple nested loops running at different speeds. Thinking about the loop this way is what separates "it kind of works" from a robot engineered to perform reliably under real, sometimes-demanding conditions.
Sign up free to carry on with the course, with an AI tutor to help you.
Continue the course
