Designing and Programming Advanced Robotic Platforms

UPI Study › Courses › Introduction to Artificial Intelligence › Free lessons › Lesson 8.5 Free with a free account

Designing and Programming Advanced Robotic Platforms

Introduction to Artificial Intelligence · Chapter 8: Perception, Robotics, and Hands-On AISection 8.5 · lesson 61 of 6914 min · free with a free account

← Mapping and Localization (SLAM) in RoboticsNext lesson: Navigating the Ethical Landscape of AI →

Earn 3 college credits for Introduction to Artificial IntelligenceRecommended for credit by NCCRS · Computer Science 373 · self-paced · one payment, lifetime access

In this lesson

How robot sensors, kinematics, feedback control and software fit together.

  • Distinguish proprioceptive and exteroceptive sensors and compare electric, hydraulic and pneumatic actuators
  • Calculate forward kinematics for a two-link arm and explain why inverse kinematics can have zero, one or several solutions
  • Explain the roles of the P, I and D terms in a PID controller
  • Compare sense-plan-act, subsumption and hybrid architectures, and describe how ROS and simulation support development

Free study notes

Get this lesson's notes by email

The key points and 4 practice questions with answers, in your inbox. One email, free.

One email. Unsubscribe in one click.

Transcript

Everything said in the video, section by section (1,888 words). Read along, or search it.

Opening Question

Lifting a Full Cup of Tea

Ask a robot arm to lift a full cup of tea onto a table. Send its motor one fixed command, and the cup may stop short, or swing past the target. Friction, the cup's weight and gravity all get in the way. A robot is a computer with a body. It senses the physical world, decides, and acts on it. So how do its body, its feedback loops, and its software fit together, so that it acts accurately, and safely?

Sensors

Proprioceptive and Exteroceptive Sensors

Start with the body. Sensors turn physical quantities into numbers, and they come in two groups. Proprioceptive sensors measure the robot's own state. Wheel and joint encoders count turns, an inertial unit measures acceleration and rotation, and a force sensor feels how hard the robot pushes. Exteroceptive sensors measure the world outside: cameras, laser scanners, and ultrasonic sensors that sense the nearest object ahead. Each has a typical limit. Wheels slip, inertial errors accumulate, cameras depend on lighting, and ultrasonic beams are wide and noisy.

Actuators

Motors, Hydraulics, Pneumatics and Gearboxes

Actuators make a robot move. Electric motors are the most common: clean, quiet, precise, and easy to control. Hydraulics deliver very large forces from a compact unit, but they're heavy, noisy, and can leak. Pneumatics are light, fast and springy, but compressed air is hard to control precisely. Electric motors usually spin fast, with little force, so a gearbox trades speed for force. Take a motor giving 0.5 newton meters, at 3,000 rpm. Through a 50 to 1 gearbox, it gives about 25 newton meters, at 60 rpm.

Degrees of Freedom

Joints and the Two Kinematics Questions

A robot's degrees of freedom are the independent ways it can move. A free object in space has six: three positions, and three rotations. A joint that rotates is revolute, and one that slides is prismatic. An arm generally needs at least six joints, to place its hand at any position and orientation it can reach. That raises two questions. Forward kinematics: given the joint angles, where is the hand? That always has exactly one answer. Inverse kinematics: given where the hand should be, what joint angles get it there? That may have no answer, one, or several.

Forward Kinematics

Hand Position of a Two-Link Arm

Take a flat arm with two rotating joints. The upper link is 0.5 meters, and the forearm is 0.4. The hand sits at x equals the first length times the cosine of the shoulder angle, plus the second length times the cosine of both angles added. y is the same with sines. With the shoulder at 30 degrees and the elbow at 60, x is 0.5 times 0.866, plus 0.4 times zero: 0.433 meters. And y is 0.5 times 0.5, plus 0.4 times 1: 0.650 meters. That's forward kinematics.

Inverse Kinematics

Elbow Up and Elbow Down

Now reverse it. For the target at 0.433, 0.650, the squared distance from the shoulder is 0.61. The elbow angle comes from a cosine rule: 0.61, minus 0.25, minus 0.16, all over 0.4. That's 0.5, so the elbow is plus 60 degrees, or minus 60. Each gives its own shoulder angle: 30 degrees, or 82.7. Elbow down, and elbow up: two settings, one gripper position. So the robot must choose, perhaps the one nearer its current pose, or the one that avoids an obstacle.

Reachable Workspace

Targets Out of Reach

Sometimes there's no solution at all. With links of 0.5 and 0.4, the hand reaches only points between 0.1 meters away, folded back, and 0.9 meters, stretched straight. A target 1.03 meters away is simply out of reach.

Quick Check

Which Target Can the Arm Reach

Quick check. A different arm has an upper link of 0.7 meters, and a forearm of 0.2. Three targets sit 0.3 meters, 0.6 meters, and 1.0 meter from its shoulder. Which one can it reach? Pause, and decide. Only the target at 0.6 meters. This arm reaches from 0.7 minus 0.2, which is 0.5 meters, out to 0.9. One meter is past full stretch. And 0.3 meters is the tempting one: it's close, but closer than the arm can fold.

Feedback Control

The PID Controller

Even with the right angles, a fixed motor command rarely lands the joint there. Feedback control fixes that: measure the result, compare it with the goal, and correct the command. The difference is the error: the setpoint, minus the measurement. The most widely used feedback controller is the PID controller. Its command adds three terms: a gain times the error, a gain times the error summed over time, and a gain times how fast the error is changing.

PID Terms

What P, I and D Each Do

Each term has a job. P responds to the present error, for a fast, direct correction. Too much makes the joint overshoot and oscillate, and under a constant load, a steady offset can remain. I responds to the error accumulated over time, which removes that steady offset. Too much causes overshoot and slow swings, called integral windup. D responds to how fast the error is changing, which damps overshoot. Too much amplifies sensor noise, and on its own it can't remove an offset.

Simulation Results

Tuning a Joint Under Gravity

A simulated joint, with friction and a constant pull like gravity, has to move to a target of 1. P alone overshoots by 28 percent, rings, and settles at 0.80, about 0.2 short. Adding D removes the overshoot, but it still stops at 0.80. Adding I as well reaches 1.00, with only 0.6 percent overshoot, and settles within 2 percent in about 1.9 seconds. Too large an I term overshoots by 19 percent and takes 3.8 seconds. And a P gain of 40 alone rings violently, with 69 percent overshoot.

Control Architectures

Sense-Plan-Act Versus Subsumption

A robot's software must also decide how sensing becomes action. Two classic designs take opposite approaches. Sense-plan-act, the deliberative approach, senses, builds a model of the world, plans the best action, then acts, over and over. It can solve complicated goals, but planning takes time, and the plan is only as good as the model. Subsumption, introduced by Rodney Brooks in the 1980s, has no central model. Each layer is a small, complete behavior wired from sensors to motors: avoid obstacles, wander, head for the goal. Higher layers can override or add to lower ones, while the lower layers keep running.

Reaction Speed

Why Robots Use Hybrid Designs

The practical difference is speed. Take a robot moving at 1 meter per second. If a full sense-plan-act cycle takes half a second, the robot travels half a meter before it can react to something new. A reflex layer that responds in 0.02 seconds lets it travel only 2 centimeters. These timings are illustrative. So most real robots use a hybrid: fast reactive behaviors underneath, for safety and balance, and a slower planning layer above, for goals and routes.

Quick Check

Distance Before the Planner Reacts

Quick check. A warehouse robot moves at 2 meters per second, and its sense-plan-act cycle takes 0.4 seconds. How far can it travel before its planner reacts to a box that falls in its path? Pause, and work it out. Point eight meters: two meters a second, times four tenths of a second. Point two divides instead of multiplying. And two centimeters would need a reflex layer, which is exactly why fast robots have one.

Robot Software

ROS Nodes, Topics, Services and Actions

Robot software is large: drivers for every sensor and motor, perception, planning and control, often written by different people. A robot framework holds the parts together. The best known is ROS, the Robot Operating System. Despite the name, it isn't an operating system: it's software that runs on one. ROS 2 is the current generation. A node is a program that does one job. A topic is a named channel: nodes publish messages to it, and subscribe to it. The camera driver publishes images, without knowing that a detector and a recorder are both listening. So you can swap in a better detector, or add a logger, without touching the rest. ROS also offers services, a request with one reply, and actions, long jobs with progress updates, plus tools to visualize, record and replay sensor data.

Simulation

Closing the Sim-to-Real Gap

Simulation runs a virtual robot in a virtual world, with tools such as Gazebo, Webots and MuJoCo. It's safe: a crash costs nothing. It's cheap and fast: many tests run at once. And it's repeatable. Its limit is the sim-to-real gap. Virtual friction, sensor noise and lighting never match reality exactly, so a controller tuned only in simulation may fail on the real robot. Teams narrow the gap by randomizing friction, lighting and noise, by calibrating against the real robot, and by moving in stages: simulation, a test stand, a fenced area, and only then the real setting. Each stage catches problems while they're still cheap to fix.

Mobile Manipulators

Redundancy, Coordination and Stability

Put an arm on a moving base, and you get a mobile manipulator, which can travel and handle objects, like fetching items in a warehouse. That brings three new problems. Redundancy: the base adds two or three degrees of freedom to a six-joint arm, so many combinations reach the same point, and the controller must choose. Coordination: wherever the base stops wrong, the error carries straight into the arm, so good localization matters. And stability: reaching out shifts the weight forward, and a heavy load held far out can tip the robot over.

Worked Example

A Tipping Check for a Payload

Here's a simple tipping check. The base weighs 30 kilograms, and its weight acts 0.25 meters behind the front wheels. That gives a restoring effect of 30 times 0.25: 7.5. A payload is held 0.55 meters beyond that front edge. Its tipping effect is its mass times 0.55. 5 kilograms gives 2.75, stable. 10 gives 5.5, stable. 15 gives 8.25, more than 7.5: it tips forward. The limit is 7.5 over 0.55, about 13.6 kilograms. Real designers keep a wide margin, because moving arms and sudden stops add forces this static check ignores.

Humanoid Robots

Human-Shaped Bodies for Human Spaces

A humanoid robot has a human-like body: two legs, two arms, and a head. The reason is practical. Our buildings, tools and vehicles are made for human bodies. The price is difficulty. Walking on two legs is unstable, so the whole body must keep adjusting. And humanoids have dozens of joints to coordinate. Batteries limit how long they work. And a strong, human-sized machine near people needs careful safeguards. Compare the types. A fixed arm, usually six joints, is precise, but can't move to the work. A mobile base travels, but can't handle objects. A mobile manipulator does both, and a humanoid fits spaces made for people.

Back to the Cup

Sensing, Damping and Testing the Lift

Back to the cup of tea. The robot finds the cup with a camera, feels its grip with a force sensor, and tracks its joints with encoders. A swinging, jerky arm calls for more damping, the D term, and the steady weight of the cup calls for an integral term, so the arm doesn't stop short. Test the reaching and grasping in simulation first. Trust the spill-free lift only after tests on the real robot.

Key Takeaways

Robot Platforms in Summary

To sum up. Sensors measure the robot's own state or the world, and actuators move the joints, with gearing trading speed for force. Forward kinematics gives one hand position. Inverse kinematics may give none, one, or several sets of angles. PID control corrects error with three terms: P acts fast, D damps, and I removes steady offsets, but each can be overdone. Real robots use a hybrid of fast reflexes and slower planning, connect their software with ROS, and test in simulation before the real world.

Think About It

Loading a Dishwasher Plate by Plate

Here's something to think about. A home robot must load a dishwasher, plate by plate. Which sensors would it rely on, which control term would you watch most closely, and which parts would you trust only after testing on the real robot?

About Introduction to Artificial Intelligence at UPI Study

Introduction to Artificial Intelligence (Computer Science 373) is a self-paced online course of 69 video lessons in 9 chapters, from intelligent agents and search to game strategy, neural networks, logic and reasoning, machine learning, language, robotics and AI ethics. It carries a NCCRS credit recommendation for 3 semester credits.

Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Compare: AI vs Current Trends in CS and IT

Why take it here

Why students take Introduction to Artificial Intelligence with UPI Study

How machines search, reason and learnIntroduction to Artificial Intelligence covers how AI systems are built: intelligent agents, search and heuristics, game strategy, logic, neural networks, machine learning, language and perception, and the ethics of AI. It is a common upper-level course in computer science degrees.
Credit at a fraction of the priceThe same 3 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Where the credit goes

Universities that work with NCCRS

Introduction to Artificial Intelligence carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.

FAQ

Questions students ask us

About Designing and Programming Advanced Robotic Platforms

What is the difference between forward and inverse kinematics?
Forward kinematics finds where a robot's hand is from its joint angles, and inverse kinematics finds joint angles that put the hand at a desired spot. Forward kinematics has exactly one answer. Inverse kinematics may have none, one or several: a flat two-link arm can reach many points with its elbow up or down, and a target beyond full stretch, or closer than the arm can fold, has no solution.
What do the P, I and D terms do in a PID controller?
The proportional term responds to the present error for a fast correction, the integral term responds to error accumulated over time to remove a steady offset, and the derivative term responds to how fast the error is changing to damp overshoot. Each can be overdone: too much P causes overshoot and oscillation, too much I causes integral windup, and too much D amplifies sensor noise.
What is the subsumption architecture in robotics?
Subsumption is a behavior-based robot architecture introduced by Rodney Brooks in the 1980s that uses no central world model. Each layer is a small, complete behavior wired from sensors to motors, such as avoiding obstacles, wandering or heading for a goal. Higher layers can override or add to lower ones while the lower layers keep running, which gives fast reactions. Many real robots pair such reactive layers with a slower planning layer.
What are nodes and topics in ROS?
In ROS, the Robot Operating System, a node is a program that does one job, and a topic is a named channel that nodes publish messages to and subscribe to. A camera driver can publish images without knowing which nodes are listening, so a detector can be swapped or a logger added without touching the rest. ROS also offers services for a single request and reply, and actions for long jobs with progress updates.

About the Introduction to Artificial Intelligence course

How many college credits is Introduction to Artificial Intelligence?
Introduction to Artificial Intelligence (Computer Science 373) carries a NCCRS credit recommendation for 3 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does Introduction to Artificial Intelligence cost and what is included?
$250, paid once, with lifetime access: all 69 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does Introduction to Artificial Intelligence take?
It is self-paced with no deadlines. The 69 lessons total about 16 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

Ready for the full course? Earn 3 credits in Introduction to Artificial Intelligence.

69 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.

Introduction to Artificial Intelligence
3 credits · NCCRS
Enroll →