A robot works by taking measurements, using a controller to choose a command, and sending that command to an actuator that produces physical movement. Feedback supplies new measurements so the controller can respond to what actually happens. You can understand the process by following one signal from a distance sensor to a wheeled robot’s motor command.
This guide separates those jobs, then walks through a small software example. You do not need a robot kit or a machine-learning model to follow it. The example is a teaching simulation, not a tested hardware build.
On this page: the main parts, sensor measurements, a worked controller example, feedback, and common questions.
The main parts of a robot control system
| Part | Its job | Example in a wheeled robot |
|---|---|---|
| Sensor | Measure something about the robot or its surroundings | Distance sensor or wheel encoder |
| Controller | Use measurements and a goal or rule to choose a command | Software that requests forward movement or a stop |
| Motor driver | Provide controlled electrical power to a motor | Electronics between the controller and wheel motor |
| Actuator | Produce a physical force or movement | Motor turning a wheel |
| Feedback | Return measurements of the resulting state | Encoder readings used to adjust wheel speed |
These parts do different jobs even when they are packaged together. A controller’s signal requests movement. The driver supplies motor power, and the actuator produces the physical effect. Northwestern University’s Modern Robotics control-system overview explains this relationship and how measurements return to the controller.
A sensor gives a measurement that needs interpretation
A distance sensor might report how far away a surface appears to be. A wheel encoder reports information about wheel rotation. Neither reading explains the robot’s whole situation by itself. The controller needs to know what the value represents, its units, and whether it is recent enough for the task.
For a concrete hardware example, Arduino’s Nicla Vision documentation describes a board that can capture distance, motion, sound and camera data. Those are distinct measurements. A distance value and an image are different inputs, even if both help the robot respond to its surroundings.
Consider a fictional encoder configured to report 2,048 counts for one full wheel revolution. A change of 512 counts represents 512 ÷ 2,048 × 360 = 90 degrees of rotation under that counting convention. It does not, by itself, prove how far the robot traveled across the floor. Wheel size and slipping can affect that separate estimate.
The controller chooses a command from a goal and a rule
Imagine a small wheeled robot with a forward-facing distance reading. In our paper example, the controller requests STOP at 30 cm or closer. After stopping, it requests FORWARD only when the reading reaches 40 cm or more. Between those thresholds it keeps the previous command.
The 10 cm gap prevents small changes around one boundary from repeatedly switching the command. This use of separate switching thresholds is called hysteresis. The values are chosen to make the lesson easy to follow. They are not recommended stopping distances for a physical robot, where speed, braking, sensor behavior and delays all matter.
Here is the complete decision rule in pseudocode:
if distance_reading_is_missing_or_invalid:
command = STOP
elif distance_cm <= 30:
command = STOP
elif distance_cm >= 40:
command = FORWARD
else:
command = previous_command
Start with the previous command set to STOP. Then pass these readings through the rule in order. Each row uses the command from the previous row:
| Step | Distance (cm) | New command | Reason |
|---|---|---|---|
| 1 | 80 | FORWARD | At or above restart threshold |
| 2 | 42 | FORWARD | At or above restart threshold |
| 3 | 30 | STOP | At or below stop threshold |
| 4 | 32 | STOP | Keep previous command in the gap |
| 5 | 39 | STOP | Keep previous command in the gap |
| 6 | 40 | FORWARD | At or above restart threshold |
| 7 | missing | STOP | Missing or invalid reading |
| 8 | 65 | FORWARD | At or above restart threshold |
At 30 cm the command changes to STOP. It stays STOP at 32 cm and 39 cm because neither reading reaches the 40 cm restart threshold. A reading of exactly 40 cm restarts the forward command. A missing reading produces STOP in this example. The next valid 65 cm reading permits FORWARD again.
The sequence was checked with a small software calculation. It demonstrates how the rule behaves, including both boundary values and a missing input. It does not show a real motor stopping, validate a sensor, or measure collision avoidance.
An actuator command is different from completed movement
After choosing FORWARD, the controller sends the appropriate command to the motor-control hardware. The motor turns, the wheel interacts with the surface, and the robot may move. Sending a STOP command does not mean the robot is already stationary at that instant.
This distinction is useful when reading a robotics demonstration. Ask which value you are seeing: the requested action, an electrical drive signal, or a measurement of actual motion. A display saying “target speed 0.2 m/s” is a request. A measured wheel speed is evidence about the result, subject to how that measurement was obtained.
The ros2_control hardware-interface documentation makes a similar software distinction between command interfaces, which carry requested values, and state interfaces, which expose measurements. You do not have to use ROS to apply that idea when thinking about a robot.
Feedback closes the loop around the value being controlled
Suppose the goal is to maintain a wheel speed. With feedback control, the controller compares a speed measurement with the target and adjusts its command when they differ. Without that measurement, sending the same drive command tells you little about whether the wheel is turning at the intended speed.
Be specific about which loop you mean. Repeated distance readings help an obstacle-response controller react to its surroundings. They do not automatically provide wheel-speed feedback. A robot may have one loop for wheel speed and another process deciding where it should travel.
Estimating movement also introduces limits. Northwestern’s mobile-robot feedback lesson explains that tracking a trajectory needs an estimate of the robot’s configuration, often combining wheel-based odometry with other sensors. For a beginner, the useful question is: what measurement tells the controller whether this particular goal was achieved?
Where AI fits into this process
The controller rule above uses comparisons and a stored previous command. There is no learning step in it. AI might instead help interpret a camera image or choose among possible actions, but those outputs still need to connect to the robot’s control system and physical hardware.
When evaluating an AI robotics claim, ask what the AI actually does. Recognizing an object, producing a plan, and executing a movement are different tasks. Identify the input, the output and the feedback used to check the result. That gives you a more useful explanation than calling the entire machine intelligent.
Try changing one assumption
Run the table again with a restart threshold of 35 cm instead of 40 cm. Keep the STOP threshold at 30 cm. The 39 cm reading now permits FORWARD, while 32 cm still keeps STOP. This makes the role of the restart threshold visible without changing any hardware.
Then decide what should happen after an invalid reading. Our teaching rule resumes after the next suitable valid reading. A different design might require several valid samples or a manual reset. State that requirement explicitly and add a case for it to the test sequence.
Common questions
Does every robot need AI?
A robot can perform a task using programmed rules and conventional control. The threshold example needs comparisons and memory of the previous command. Whether AI adds value depends on the task, the information available and how its output will be checked.
What is the difference between a sensor and an actuator?
A sensor supplies a measurement. An actuator produces a physical effect. An encoder can report wheel rotation, while a motor can turn that wheel. Feedback is the measurement returning to the controller, rather than another name for the motor.
Can I use the example as robot-control code?
It is pseudocode for understanding decisions. A real implementation needs hardware-specific interfaces, input validation, timing, power control and a suitable stopping strategy. Use the trace table to understand the logic before considering a device-specific design.
Continue exploring robotics
Visit the robotics learning hub for the site’s approach, browse our learning guides, or explore tools by the task you want to do.
Prepared with AI assistance. Primary-source references and the teaching simulation checked on 8 November 2026. Read our editorial standards.
