PID Motor Control and UART

Developed, implemented, and tested a motor control system using a PIC32MX795F512L microcontroller mounted on the Microchip Explorer 16/32 Board. Using C programming, the system is designed to perform bidirectional UART communication with MATLAB while reading a quadrature encoder connected to a gear motor.

Overview
Developed, implemented, and tested a motor control system using the PIC32MX795F512L microcontroller mounted on the Microchip Explorer 16/32 Board. The system is designed to perform bidirectional UART communication with MATLAB while reading a quadrature encoder connected to a “99:1 Metal Gearmotor 25Dx69L mm LP 12V with 48 CPR Encoder” (Hereby referred to as “the Encoder”). The communication results in the system controlling the motor to roughly match the reference angle that it receives from MATLAB. 
This system is designed to implement and compare three different feedback control strategies: 1. ON/OFF Controller: switches motor direction based on the error between reference and current angles. 2. Proportional (P) Controller: scales the error by a proportional gain to generate PWM control output. 3. Proportional-Integral (PI) Controller: combines proportional control with an integral of error to reduce steady-state error. This project also included implementing interrupt-driven routines for encoder reading, button presses, UART communication, and timer-based PWM control. The system displays real-time motor behavior on the LCD and sends data back to MATLAB for transient response analysis.
Back to Top