Semiautonomous Robot Vehicle

Control of 2-Wheel Drive Robot Vehicle

PID Digital Control Serial Communication Embedded Development

This project was a passion project that strengthened my sensors interfacing skills and improved my embedded C development skills.

Learn more about my experience below!

Project Highlights

I tackled this project to improve my technical skills and reinforce my understanding of ARM microcontroller development, configuring interfaces and peripherals on a target hardware, and implementing digital control logic for a DC motor.

Video: Meet Robocar

System Description: The main circuit for the vehicle is made up of a 6V battery, power supply module and H-Bridge driver circuit. The power supply module (shown in video above) receives power from battery pack inside chassis, and supplies a 5V power to the STM32 MCU and H-Bridge driver circuit. The GPIO pins on the STM32 are used to supply PWM current to circuit to control the motor speed. The H-Bridge allows the low current digital signal to control a high current motor and provides directional control of the motors by switching the polarity of the load based on the pin states. The optical mouse provides a feedback signal to the system which is used to compute corrective action control.

RoboCar Diagram

System Diagram

A key design decision I made during the project was the choice of a sensor that would be used to accurately track the progress of the vehicle. I decided to repurpose an old optical mouse for use as a navigation sensor for the vehicle. Using an optical mouse for this application had the advantage of providing 2-D directional displacement information with a resolution of 0.03mm! It was also cost-effective and had low power consumption. I used the Cartesian mouse displacements to obtain an angle-based error signal for the PID controller which was used to compensate between the angular speeds of each motor to guide the vehicle in the intended direction.

One takeaway I had from this experience was learning the PS/2 communication protocol. PS/2 is a synchronous bidirectional communication protocol used to communicate between older mice and computers. I found it interesting learning how the communication works and enjoyed implementing the software to communicate between the STM32 MCU and the mouse. Check out the integration of the optical mouse below!

Video: Integration of optical mouse 2D sensor

Skills

Motor PID Control
Datasheet Analysis
Embedded C Interfacing
PS/2 Communication Protocol

Tools

STM32-F429 MCU (PWM, GPIOs, TIMER, ADC)
Optical Mouse SN754410 Quadruple Half-H Driver

Experience

ARM Development (PWM, GPIOs, TIMERs, ADC).
Implementation of driver software for PS/2 serial communication.
Bench testing on circuit signal by using oscilloscope, related meters and PC tools.
Implementation of DC motor control firmware in C for STM32 F429 ARM MCU target hardware.