Humanoid Robot Control and Programming Basics › Module 1: Getting Started › Lesson 1.1

What Control Means

Free previewLesson 1.1 · about 25 minutes

Get the full course

10 modules of hands-on robot programming — a simulated robot to program and checked exercises in every lesson, in your browser, nothing to install. Lessons 1.1 and 1.2 are free; the rest of the course is Rs. 300 + 18% GST.

Enroll Now — Rs. 354.00

By the end of this lesson you will be able to

  • describe control as a repeating cycle of sensing, deciding and acting
  • tell the difference between acting blindly (open loop) and acting on measurements (closed loop)
  • explain why a robot's program runs as a fast, repeating cycle
  • explain why a person still needs to understand robot code, even when an AI tool has written it
  • find your way around the course: Bramble, the workshop, and how the exercises work
Welcome back to the workshop

You are Eleanor Price, a technician at the Ashdown Robotics Workshop. In the earlier courses you learned to find faults in Bramble, the workshop's humanoid robot, and how its motors, sensors and batteries work. Now Henry Wren, your mentor, wants you to learn the part that ties it all together: the programs that tell Bramble what to do. “Hardware is the body,” he says. “Control is how the body is used.”

This course does not assume that you have taken the other two courses, or that you have ever written a program. Everything you need is explained as you go.

Meet Bramble and the people

Bramble (model HR-7) is a humanoid robot about 1.6 metres tall with a mass of 70 kilograms. It works as a guide in a small museum. It greets visitors, walks them round the rooms and, when asked, carries things. The people you will meet are:

PersonRole
Henry WrenSenior technician at the workshop, and your mentor.
Margaret EllisThe workshop manager. She decides what may be tried on the real robot.
Alice BennettThe curator of the museum where Bramble works. She asks for new things for Bramble to do.
Oliver GrantBramble's daily operator at the museum. He tells you what the robot actually does.
Thomas HaleThe previous technician, who has left, but whose old programs and notes you will sometimes read.

Bramble, the workshop and the people are invented for this course. Bramble's figures are realistic for a robot of its size, but they are not taken from any real product.

What “control” means

To control something is to make it do what you want, even though the world keeps interfering. A person carrying a full cup of tea is controlling it all the time: watching the surface of the tea, feeling the weight, and making small corrections so it does not spill. Nobody plans every muscle movement in advance; they notice and correct, over and over.

A robot does the same thing in three steps, repeated again and again:

  1. Sense. Read the sensors: where each joint is, which way the body is leaning, how hard the feet press on the floor.
  2. Decide. Compare what the sensors say with what is wanted, and work out what to do about the difference.
  3. Act. Send commands to the motors.
Sense Decide Act the motors move the robot, and the world pushes back (loads, slopes, a visitor bumping into it)
The control cycle. The robot senses, decides and acts, and the world changes what it will sense next time. Around the loop, again and again.

Open loop and closed loop

There are two basic ways to make a machine do something.

Open loop is simple and sometimes good enough. Closed loop copes with the unexpected, which is why almost everything a humanoid robot does, from holding a joint still to standing upright, uses feedback. Module 3 shows open loop and its weaknesses; Module 4 builds feedback control step by step.

The control cycle runs fast

A control program does not run once. It runs as a loop, typically 100 to 1000 times a second. Each pass through the loop is one control cycle: read the sensors, decide, send commands, then do it all again. The time between passes is short enough that the robot seems to react smoothly and at once.

Why so fast? A standing robot is always starting to topple. If Bramble checked its balance only once a second, it could lean far enough to fall before it noticed. Checking a hundred times a second, it notices a lean of a fraction of a degree and corrects it before it grows. Lesson 8.3 lets you see what happens when the cycle is too slow.

How this course works

Almost every lesson has short programs for you to run and change, and exercises that are checked automatically. Your programs control a simulated Bramble: a model that lives inside the page and draws what the robot does. When you run a program, you see a replay of Bramble moving, the messages your program printed, and anything worth knowing that happened, such as a joint reaching the end of its travel or the robot falling over.

The programs are written in JavaScript. You do not need to know it already: Module 2 teaches all the programming this course uses.

An honest note about the simulator

The simulator is a simplified teaching model, not a full physics engine. It is realistic about the things this course teaches: joint limits, speed limits, feedback loops, sensor noise, balance on a small foot. But some parts are deliberately simplified. Walking, in particular, is modelled as a sequence of checked steps rather than as real contact between feet and floor. The ideas and habits you learn are the real ones; the exact numbers on a real robot would differ.

Why understand the code when an AI can write it?

AI tools can now write working programs from a description in plain words, including programs for robots. So why should you learn to read and write control code yourself? There are four good reasons, and they matter more for robots than for most software.

  1. Code that looks right can be wrong in ways that hurt. An AI tool can produce a program that runs without errors but uses the wrong unit, turns a joint the wrong way, or forgets to check the stop button. On a web page, a mistake shows a wrong number. On a 70 kg robot next to a visitor, a mistake moves a heavy arm.
  2. Someone must be responsible. Before a program runs on the real Bramble, Margaret Ellis wants a person who can explain what every line does and why it is safe. “The computer wrote it” is not an answer she accepts, and nor would an employer, an insurer or an inspector.
  3. Faults show up as behaviour, not as code. When Oliver reports that Bramble’s arm “shivers” when it holds a tray, you need to connect that to a gain that is too high in a feedback loop (Module 4). That needs understanding, not just the ability to ask for new code.
  4. You can only check what you understand. AI tools are genuinely useful for drafting and explaining code. Using them well means reading what they produce, testing it on a simulator, and spotting what is missing. This course gives you the knowledge to do that.

So the aim is not to compete with AI tools, but to be the person who can judge their work. Lesson 9.4 returns to where AI and machine learning fit into robot control.

What you will learn

Quick check

This lesson has no exercises. Four questions to confirm the main ideas. Choose an answer to see the explanation.

Which list puts the steps of the control cycle in the right order?

“Run the knee motor for 0.3 seconds and assume the knee is now bent to 40°.” What kind of control is this?

Why does a balance program check the robot's lean about a hundred times a second, rather than once a second?

An AI tool writes a program for Bramble that runs without any errors. What is the best next step before it goes near the real robot?

Summary

  • Control means making something do what you want despite interference, by repeatedly sensing, deciding and acting.
  • Open loop acts without checking; closed loop (feedback) measures the result and corrects.
  • A control program runs as a fast loop, often 100 or more cycles a second, so that small errors are corrected before they grow.
  • The course uses a simulated Bramble programmed in JavaScript. It is a simplified model, and it says so where it matters.
  • AI tools can write robot code, but a person must still understand, test and take responsibility for it.

Found a mistake on this page, or something unclear? Report a problem and mention “Control Lesson 1.1”.