Precise, stable motion is at the heart of effective robotic systems, and that precision begins at the motor level. In this post, we explore the building blocks of low-level control: from how motors are sensed and driven to the algorithms that govern their behavior. This is essential knowledge for anyone building robots that must interact precisely and robustly with the real world.


Content Outline

  1. Why Low-Level Control Matters
  2. Encoders: Measuring Motion Accurately
    • Types and technologies
    • Suppliers and key specs
  3. Motor Drivers: Bridging Logic and Power
    • Architectures and examples
  4. Control Loops and Strategies
    • PID, FOC, cascaded control
  5. Hardware Implementation and Firmware
    • Microcontrollers, RTOS, DMA
  6. ROS Integration and Real-Time Interfaces
  7. Expanded Section: Diagrams, Tables, and Code
  8. Open Source Motor Control Projects

Why Low-Level Control Matters

Low-level motor control translates high-level motion goals (like “move forward 5 cm”) into accurate voltage, current, and timing signals. This is the foundation of robotic movement, ensuring stability, safety, and performance even in the presence of mechanical and electrical nonlinearities.


1. Encoders: Measuring Motion Accurately

a. What Encoders Do

Encoders are sensors that convert the position or speed of a rotating shaft into electrical signals. These signals are fed back into control loops to ensure motors reach the desired position or velocity.

b. Types of Encoders

c. Encoder Technologies

e. Leading Suppliers


2. Motor Drivers: Bridging Logic and Power

a. What Motor Drivers Do

Motor drivers act as power amplifiers. They receive low-power control signals and use them to switch high currents that drive the motor windings. They also often handle safety features and current feedback.

b. Motor Driver Architectures

c. Key Motor Driver Features

d. Notable Driver ICs and Boards


3. Control Loops and Strategies

a. Cascaded Control Architecture

Motor control often uses a nested loop structure:

  1. Current Loop: Fastest loop (~10–30 kHz). Controls torque.
  2. Velocity Loop: Intermediate loop (~1 kHz). Controls motor speed.
  3. Position Loop: Slowest loop (~100–500 Hz). Controls shaft position.
Desired Pos → [Pos PID] → Desired Vel → [Vel PID] → Desired Curr → [Curr PID] → PWM to driver

b. PID Control

The PID controller is a feedback control loop:

\[u(t) = K_p e(t) + K_i \int_0^t e(\tau) d\tau + K_d \frac{de(t)}{dt}\]

Where:

Tuning is essential. Ziegler-Nichols and model-based tuning are common.

c. Feedforward Augmentation

Feedforward terms (like gravity compensation, friction models) are added to improve response and reduce reliance on feedback.

d. Field-Oriented Control (FOC)

Also known as vector control, FOC is the gold standard for BLDC and PMSM motors:

Equations:

e. Quasi-Direct Drive Motors

These use low-ratio gearboxes (e.g., cycloidal or harmonic) with high-torque-density motors:

Example: MIT Mini Cheetah


4. Hardware Implementation and Firmware

a. Microcontrollers

b. Real-Time Operating Systems (RTOS)

c. Control Loop Integration

d. Firmware Libraries and Tools


5. ROS Integration and Real-Time Interfaces

Low-level motor control is often integrated with higher layers like ROS:

Best Practices:


6. Open Source Motor Control Projects

Here are some notable open-source projects on GitHub for motor control:

VESC Project

ODrive

SimpleFOC

MicroMod Motor Control

Trinamic Motion Control

These projects provide different approaches to motor control, from high-performance industrial applications to educational platforms. They’re excellent resources for both learning and implementing motor control systems.


Conclusion

Mastering low-level motor control gives you the tools to build smooth, efficient, and safe robotic systems. Whether you’re designing quadrupeds, manipulators, or mobile robots, this layer is critical.

With careful component selection, precise sensing, and robust control strategies like FOC and PID, robotic motion can become as natural and adaptive as needed.


🔗 Further Reading & Tools


References

  1. Mekre, M., Isaac, L. Differences Between Optical and Magnetic Incremental Encoders TI, 2022.