arrow_back

Back

Motor Controller

Field

Robotics

Development Duration

September 1, 2019 - December 31, 2019

Components

Electronic components

Development Tools

mbed

Kicad

Project type

Personal Project

Overview


I designed and manufactured a motor controller board for controlling the motors of a competition robot.

The board is used in combination with commercially available motor driver boards and can control two DC motors. Rotary encoders and potentiometers can be connected as feedback sensors, and successful PID control was verified through operational testing.

Design


Specifications

  • PID control of two DC motors

  • Cascade connection using LAN cables

  • A follower board receives commands from the main controller board and controls the connected motors

Supported Devices

  • Two AMT102-V rotary encoders

  • Two potentiometers

  • Two Pololu G2 High-Power Motor Drivers

Board Layout

The board consists of the following components:

  1. LAN cable connector

  2. Motor power supply connector

  3. Reset switch

  4. Full-color LED, with only the blue and red channels connected

  5. Motor driver connector for Motor 1

  6. Motor driver connector for Motor 2

  7. Power and I/O output pins

  8. Potentiometer connector for Motor 1

  9. Potentiometer connector for Motor 2

  10. Rotary encoder connector for Motor 1

  11. Rotary encoder connector for Motor 2

  12. Nucleo F042K6 microcontroller board

Circuit Schematic

PCB Layout

PID Parameter Tuning


Procedure

The PID parameters were tuned using the following process.

Step 1 — P Control: Minimize Noticeable Overshoot

At this stage, it was acceptable for the steady-state value to remain significantly different from the target value.

Step 2 — PI Control: Ensure the Output Reaches the Target Value

The integral gain was adjusted so that the motor speed reached the target value. A small amount of overshoot was considered acceptable at this stage.

Step 3 — PID Control: Reduce Sudden Changes and Eliminate Overshoot

The derivative gain was added and adjusted to suppress rapid changes and eliminate overshoot.

Operational Testing

The PID parameters were tuned by connecting an actual motor and evaluating its response.

  • Horizontal axis: Time

  • Vertical axis: Rotational speed

  • Blue line: Target value

  • Red line: Measured value

P Control

Kp = 0.2

PI Control

Kp = 0.2, Ki = 0.04

PID Control

Kp = 0.2, Ki = 0.04, Kd = 0.65

Gallery

arrow_back

Back