No history yet

Actuators and Microcontrollers

Choosing the Right Muscle

Every robot needs to move, whether it's rolling on wheels, swinging an arm, or adjusting a sensor. This movement comes from actuators, the components that convert electrical energy into physical motion. The most common actuators are electric motors. Selecting the right one is a critical design choice that hinges on a trade-off between power, speed, and precision.

Motor TypePrimary StrengthBest ForKey Weakness
DC MotorSpeed & PowerWheels, fans, drillsLow precision
Servo MotorPosition ControlRobotic arms, rudders, grippersLimited range of motion
Stepper MotorPrecise Steps3D printers, CNC machines, scannersLower speed, can skip steps

Let's break down how to choose and control each type.

DC Motors

A standard DC motor is the simplest of the bunch. Apply voltage, and it spins. Reverse the voltage, and it spins the other way. They are workhorses, valued for their high speed (measured in revolutions per minute, or RPM) and power (measured as torque).

Torque is the rotational force the motor can exert. Think of it as the motor's ability to push or turn something heavy. For a wheeled robot, you need enough torque to overcome friction and accelerate the robot's mass. The calculation is straightforward:

τ=F×r\tau = F \times r

A larger wheel might make your robot faster, but it will require more torque to get moving. You must calculate the force needed based on the robot's weight, the incline it needs to climb, and friction. From there, you can determine the minimum torque your motors must provide.

Don't forget to check the motor's stall torque. This is the maximum torque it can produce when stationary. Exceeding this can damage the motor.

Servo and Stepper Motors

When you need precision, DC motors won't cut it. That's where servos and steppers shine. A servo motor is essentially a DC motor with a built-in position feedback system. This allows it to hold a specific angle, typically within a 180-degree range.

Servos are controlled using Pulse Width Modulation (PWM). You send a repeating electrical pulse, and the width of that pulse tells the servo which angle to move to. A 1.5 millisecond pulse usually commands the servo to its centre position (90 degrees), while shorter (e.g., 1 ms) or longer (e.g., 2 ms) pulses command it to move towards 0 or 180 degrees, respectively.

Lesson image

Stepper motors offer a different kind of precision. They move in discrete, fixed-angle steps. By sending a sequence of electrical pulses to its internal coils, you can command it to turn one step at a time. This makes them ideal for applications like 3D printers, where the print head must move to exact coordinates.

To improve their resolution, steppers use a technique called This involves sending a more complex waveform to the motor coils, allowing the rotor to hold positions between the full steps. Instead of just on or off, the current to the coils is varied, pulling the rotor to intermediate positions and resulting in smoother, quieter motion.

Brains of the Operation

Actuators are the muscles, but they need a brain to tell them what to do. This is the job of a controller. The choice typically comes down to a microcontroller versus a microprocessor.

A microcontroller (like an Arduino or ESP32) is a simple, single-chip computer designed for one task. It excels at real-time control: reading a sensor and immediately triggering a motor. It runs one program in a loop, making its behaviour highly predictable and fast.

A microprocessor (the heart of a is a full-fledged computer. It runs a complex operating system like Linux, can multitask, connect to Wi-Fi, and run advanced algorithms for things like computer vision or machine learning. This power comes at a cost: it's not truly real-time. The operating system might pause your motor control code to handle another process, which can be a problem for tasks requiring precise timing.

A common strategy in complex robotics is to use both. A Raspberry Pi handles high-level planning, while dedicated microcontrollers manage the low-level, real-time control of motors and sensors.

Finally, you can't connect a motor directly to your controller's pins. The controller can't supply enough current. You need a motor driver, a circuit that acts as a bridge. The most common design is the H-Bridge It uses a set of four switches to control the direction of current flow through the motor. By opening and closing these switches in pairs, you can make the motor spin forwards or backwards.

Motor driver boards, often called shields, package H-Bridges and other necessary circuitry into an easy-to-use module that simplifies the process of getting your robot moving.

Now, let's test your understanding of these core components.

Quiz Questions 1/6

What is the primary function of an actuator in a robot?

Quiz Questions 2/6

You are building a robotic arm that needs to precisely stop and hold its position at specific angles within a 180-degree range. Which motor type is best suited for this task?

With the right combination of motors and controllers, you can begin to build robotic systems capable of precise and powerful movements.