Computer Science › Section L · Artificial intelligence › Topic L.6
Robotics
A robot is AI with a body: it must sense a messy physical world, decide what to do and then move without breaking anything, including itself. This topic covers arms and locomotion, sensors and feedback control, the debate between planning and reacting, and how autonomous real robots are.
What makes a robot
Robotics is the study of physical agents that act on their own in the real world. A robot cycles through three jobs: sense its surroundings, decide what to do, and act through motors and other actuators. So robotics draws on every part of AI and on mechanical and electrical engineering. The word itself comes from the Czech writer Karel Čapek's 1920 play R.U.R., in which manufactured workers called robots revolt; robota is Czech for forced labour. Real robots are humbler than fictional ones, but they are everywhere, from factories to living rooms to Mars.
Manipulators
Early robotics centred on manipulators: arms made of rigid links joined by joints, ending in an end effector such as a gripper, welding torch or paint sprayer. Each independent joint motion is a degree of freedom; many industrial arms have six, enough to place a tool at any position and angle within reach. The first industrial robot, Unimate, went to work on a General Motors production line in 1961, handling hot metal castings. Arms are very precise and tireless, but delicate tasks also need a sense of touch: force sensors let a gripper hold an egg or a paper cup without crushing it.
Worked example: where is the hand?
A flat two-link arm has a 30 cm upper link and a 20 cm forearm. The shoulder joint is at 30° above horizontal, and the elbow is bent a further 60°. Where is the hand, relative to the shoulder? 1. The forearm's direction is the sum of the angles: 30° + 60° = 90°. 2. Use
and the same with sines for y. 3. \(x = 30\cos 30^\circ + 20\cos 90^\circ\) ≈ 25.98 + 0 = 25.98 cm. 4. \(y = 30\sin 30^\circ + 20\sin 90^\circ\) = 15 + 20 = 35 cm. 5. Check: the forearm points straight up, so it adds nothing sideways and 20 cm upwards. Computing joint angles from a desired hand position, the reverse problem, is harder and can have several answers.
Getting around
Mobile robots need locomotion. Wheels are simple, efficient and easy to control, but they struggle with stairs and rough ground; tracks and special wheel designs help, as on NASA's Mars rovers, the first of which landed in 1997. Legs can cross rubble and climb steps, but a two-legged robot must constantly adjust its balance or it will fall, so four-legged robots are often more stable. Drones and swimming robots add more options; in 2021 a small NASA helicopter made the first powered, controlled flight on another planet. Designers often copy animals, from snakes to insects.
Sensing the world
A robot knows about the world only through its sensors. Cameras give rich images; lidar measures distances with laser pulses, and ultrasonic sensors with sound; bump switches and cliff sensors detect collisions and drops; GPS gives position outdoors. Internal sensors report the robot's own state: wheel and joint encoders count rotation, and an inertial measurement unit of gyroscopes and accelerometers tracks turning and tilt. Every reading is noisy and some fail at times, so robots combine several sensors, called sensor fusion, to estimate where they are and what surrounds them.
Feedback control
Commanding a motor to run for two seconds and hoping is open-loop control; wheel slip, slopes or a heavy load will spoil it. Closed-loop, or feedback, control measures the result and corrects continually. The error is the gap between the target and the measurement, and the simplest correction is proportional control: act in proportion to the error, \(\text{action} = k \times \text{error}\), with a gain k. Large errors produce strong corrections and small errors gentle ones. Too small a gain makes the robot sluggish; too large a gain makes it overshoot and oscillate. Thermostats, cruise control and balancing robots all use feedback.
Worked example: stopping at a wall
A robot should stop 20 cm from a wall and starts 100 cm away. Each second it measures the distance and moves forward half the error, so k = 0.5. 1. Error 100 − 20 = 80 cm: it moves 40 cm, to 60 cm. 2. Error 40 cm: it moves 20 cm, to 40 cm. 3. Error 20 cm: it moves 10 cm, to 30 cm. 4. Error 10 cm: it moves 5 cm, to 25 cm. 5. Error 5 cm: it moves 2.5 cm, to 22.5 cm. 6. Conclusion: the error halves every second, so the robot closes in smoothly, fast when far and gently when near. With k greater than 1 it would overshoot the 20 cm mark.
Planning versus reacting
One approach gives a robot a detailed model of its world and plans before moving. Mapping an unknown space while working out where you are within it is called SLAM, simultaneous localisation and mapping, and it lets a robot plan routes with the search methods of 'Reasoning: production systems and search'. The opposite approach, championed by Rodney Brooks at MIT in the mid-1980s, builds reactive robots from simple rules tied directly to sensors, ranked by priority: if a cliff is sensed, back away; otherwise, if bumped, turn right; otherwise, drive forward. Reactive robots respond fast and need no map, but they can wander inefficiently. Most modern robots combine the two, planning goals at a high level and reacting at a low level.
How autonomous are robots?
Many factory arms repeat a fixed program inside safety cages, assuming parts arrive in exact positions. Collaborative robots, or cobots, limit their force so they can work beside people. Most surgical and bomb-disposal robots are teleoperated, steered by a human. Self-driving cars show the hardest case: in DARPA's 2004 Grand Challenge no vehicle finished the desert course, in 2005 several did, and in 2007 vehicles completed an urban course among other traffic. The SAE scale grades driving automation from level 0, none, to level 5, full automation in all conditions. The RoboCup competition aims for a robot football team that can beat the human world champions by 2050.
Evolution and learning in robots
Hand-written controllers are hard to get right, so robots also learn. Evolutionary robotics applies the genetic algorithms of 'Additional areas: knowledge and learning' to robot designs: many simulated controllers, or even body shapes and sensor positions, are tested, the best are recombined and mutated, and over generations robots evolve ways to walk or balance. Reinforcement learning lets a robot improve a skill such as grasping by trial and error, often first in simulation, where millions of attempts are cheap. Transfer is difficult, though: a skill that works in simulation may fail on real hardware with friction, noise and wear the simulator left out.
Common mistakes to avoid
First, assuming robots are humanoid: most are arms, vehicles or vacuum cleaners. Second, adding link lengths instead of using angles: in the arm example the hand is not 50 cm along one line. Third, forgetting that a forearm's direction is the sum of the joint angles. Fourth, trusting open-loop commands in an unpredictable world; feedback corrects drift. Fifth, choosing a gain that is too large and causes overshoot. Sixth, treating every robot as fully autonomous, when many are teleoperated or tightly scripted.
Key takeaways
Robots sense, decide and act in the physical world, drawing on all of AI and on engineering. Manipulators have joints, degrees of freedom and end effectors; forward kinematics gives the hand position from the joint angles. Locomotion uses wheels, tracks, legs, rotors or fins. Sensors are noisy, so robots fuse several. Feedback control corrects continually; proportional control acts as k × error. Plan-based robots model their world, for example with SLAM, while reactive robots follow prioritised rules; most combine both. Autonomy ranges from scripted and teleoperated to self-driving, and robots can also evolve or learn their behaviour.
Flashcards
Flashcard
A physical agent that senses, decides and acts on its own
Test your understanding
Question 1 of 5
A flat arm has a 40 cm upper link and a 30 cm forearm. The shoulder is at 0° and the elbow is bent 90°. Where is the hand, relative to the shoulder?
Question 2 of 5
A robot must stop 20 cm from a wall and starts 60 cm away. Each second it moves forward 0.25 times the error. How far from the wall is it after two seconds?
Question 3 of 5
A reactive robot's rules, in priority order, are: cliff sensed → back away; bumped → turn right; otherwise → drive forward. Its bump switch and cliff sensor both fire at once. What does it do?
Question 4 of 5
Which control method is most likely to keep a delivery robot on course when its wheels slip on a wet floor?
Question 5 of 5
A surgeon at a console moves controls that guide a robot's instruments inside a patient. How is this robot best described?
