No history yet

System Architecture Design

The Brains of the Operation

Building a robot is more than just connecting motors and sensors. It's about creating a cohesive system where every part works together. The system architecture is the blueprint for how this happens. It defines how sensing, control, and actuation modules communicate and coordinate.

One of the first big decisions is whether to use a centralized or distributed control system. A centralized system uses a single, powerful processor to manage everything. A distributed system spreads the intelligence across multiple, smaller processors that handle specific tasks and report back to a main controller.

A centralized approach can be simpler to program, since all logic resides in one place. However, the main processor can become a bottleneck, struggling to manage dozens of real-time tasks simultaneously. A distributed system offloads time-sensitive jobs, like precise motor control or high-frequency sensor readings, to dedicated microcontrollers. This frees up the main processor for heavy-duty computation, like navigation algorithms or computer vision.

The Right Tool for the Job

Choosing your processing hardware is a key architectural decision. It's not about which is "better," but which is better for a specific task. Microcontrollers (MCUs) like the Arduino or ESP32 and single-board computers (SBCs) like the Raspberry Pi have fundamentally different strengths.

Lesson image

Microcontrollers are specialists. They run a single program in a loop and excel at real-time control. When you command a motor to turn for exactly 100 milliseconds, an MCU delivers that with high precision because it isn't distracted by an operating system or background processes.

Single-board computers are generalists. A Raspberry Pi runs a full Linux operating system, just like a desktop computer. This makes it powerful enough to run complex software, connect to the internet, and process large amounts of data. But this power comes at the cost of real-time determinism. The OS might decide to pause your code for a moment to handle a network task, which could be disastrous for sensitive motor control.

FeatureMicrocontroller (Arduino, ESP32)Single-Board Computer (Raspberry Pi)
Primary UseReal-time control, direct hardware interfaceComplex computation, multitasking, connectivity
Operating SystemNone (bare-metal)Yes (e.g., Linux)
PerformanceFast, deterministic I/OHigh processing power for applications
StrengthPrecise timing, reliability for simple tasksVersatility, running complex algorithms
WeaknessLimited processing power and memoryNot ideal for hard real-time tasks
Power ConsumptionVery lowHigher

For many advanced robots, the best architecture is a hybrid. A Raspberry Pi acts as the high-level brain, processing camera feeds and making strategic decisions. It then sends simple commands to one or more Arduinos, which handle the low-level, real-time work of controlling motors and reading sensors with precision.

Keeping Everything in Sync

In a distributed system, the different parts need to talk to each other. This is handled by communication protocols, which are like languages for electronic components. Three common protocols you'll encounter are UART, I2C, and SPI.

UART (Universal Asynchronous Receiver-Transmitter) is a simple, point-to-point protocol. It's great for connecting two devices, like a GPS module to a microcontroller, over two wires.

I2C (Inter-Integrated Circuit) is a bus protocol, meaning you can connect multiple devices (like sensors and motor drivers) to the same two wires. Each device has a unique address, and the main controller can talk to them one at a time. It's slightly slower than SPI but uses fewer pins, which is a huge advantage.

SPI (Serial Peripheral Interface) is another bus protocol that's faster than I2C, making it ideal for high-bandwidth data from things like SD cards or some types of displays. It requires more wires than I2C but allows for full-duplex communication, meaning data can be sent and received at the same time.

Finally, don't forget power. A common mistake is trying to power motors directly from the same supply as your sensitive electronics. Motors create a lot of electrical noise and can cause voltage drops when they start up, potentially resetting your microcontroller. A robust architecture always separates the power supply for the logic (processors, sensors) from the power supply for the actuators (motors, servos). This ensures a clean, stable voltage for the robot's brain, preventing unexpected crashes and reboots.

Now, let's test your understanding of these architectural concepts.

Quiz Questions 1/6

What is a primary advantage of using a distributed control system in a robot instead of a centralized one?

Quiz Questions 2/6

For a task that requires precise, repeatable, real-time motor timing, which type of hardware is the most suitable choice?

By thinking about the overall system architecture first, you can design a robot that is robust, scalable, and well-suited for its task.