Three beats, one cup
Ask a robot to pick up a cup, and underneath that one smooth motion is a loop with three beats: sense, plan, act. This rhythm is so fundamental that it has a name — the sense–plan–act paradigm — and it is the skeleton inside almost every machine that moves on its own.
Beat one, sense: cameras and other sensors read the world. Where is the cup, exactly? The robot turns raw pixels and distance readings into numbers — say, "the cup is 32 cm forward and 5 cm to the left." Without this step, the robot is reaching in the dark.
Beat two, plan: given where the cup is and where the hand is now, the robot works out a path — a sequence of joint motions that carries the gripper to the cup without knocking over the salt shaker on the way. (Working backward from a target position to the joint angles that reach it is its own deep problem, called inverse kinematics.)
Beat three, act: motors drive the arm along that path. The hand opens, moves, and closes. Then — and this is the part beginners miss — the loop starts over. Sense again. The cup is now in the gripper, or it slipped, or someone moved it. The robot does not finish the motion blind; it checks reality and goes around again.
Why it must be a loop, not a recipe
A recipe runs once, top to bottom. That works when nothing surprises you. But the real world surprises you constantly: the cup is a centimeter off from where the camera said, the table wobbles, the gripper slips. If a robot just executed a plan and never looked again, the first small error would compound into a knocked-over cup.
So the loop closes on itself. Each new sense reading tells the robot how far off it is from where it meant to be, and the next plan corrects for that gap. This idea — compare what you wanted with what you got, then steer to shrink the difference — is the heart of feedback control, and the sense–plan–act loop is feedback control wearing a robot's body.
Splitting the middle beat
Three beats is the clean story, but the "plan" beat hides a lot of work, so modern robots split the loop into named layers. The common version is the perception–planning–control architecture: perception turns sensor data into a model of the world, planning decides what to do over the next second or minute, and control turns that decision into precise, fast motor commands.
Why split it? Because the three layers naturally run at different speeds. A plan to cross a room can be recomputed a few times a second, but the low-level control keeping each motor on target may need to update a thousand times a second. Separating them lets each run at the rhythm it needs without dragging the others down.
You can even nest loops. A fast inner loop holds the arm steady; a slower outer loop decides where the arm should go next. Some systems wrap the whole thing in a behavior tree that picks which goal is active right now — grab the cup, or first move the obstacle out of the way. The three beats are still there; they are just layered.
Think longer or act sooner
Here is the tension every robot designer lives with. Spend more time on the plan beat and you get a smarter, smoother motion — but while you are thinking, the world keeps moving, and your sensor reading goes stale. Plan less and you act sooner, staying responsive, but with a rougher plan that may need more correcting.
A chess-playing arm can afford to think; a drone dodging a branch cannot. So designers tune how long each beat gets. One elegant answer is model predictive control: plan a short way into the future, act on just the first step, then throw the rest away and replan from fresh sensor data. You get the foresight of planning and the freshness of acting often.
The loop across every robot
Once you see the loop, you see it everywhere. A robot vacuum senses a wall with a bump sensor, plans a turn, acts by steering, and senses again — hundreds of times a minute. A Mars rover runs the same loop, just slower and more carefully, because a mistake is millions of kilometers from help. Same three beats, wildly different stakes.
The loop also explains a famous frustration. A robot tuned perfectly in simulation often stumbles in the real world, because its sensed picture and its acted-out motion both differ subtly from the clean simulation. That mismatch is the reality gap, and a tighter, faster sense–plan–act loop is one of the main tools for surviving it.