top of page

The front view of my robot

Side view of the robot

  • My final project for Northwestern's Advanced Mechatronics Course 

  • 2 weeks between initial mechanical CAD design and final assembled product

  • Created a custom printed circuit board (PCB) for a PIC32 micro-controller and peripheral electronics

  • Coded an android app to send camera data from a smartphone to the PIC32 via USB

  • Created closed loop motor control on DC motors with rotary encoders

​

Objective: Build a line following robot using an Android smartphone, a PIC32 microcontroller and 2 DC motors

​

Circuit Design:

A prototype of the circuit was made with a breadboard. The course instructor provided the necessary components:

  • PIC 32MX250 micro-controller

  • Micro-usb connector (to connect with convenient 5v laptop usb power)

  • MCP1702 voltage regulator    (Pic runs on 3.3v ) 

  • CSTLS8M00G53-B0   8 MHz crystal resonator (The Pic runs at 48 MHz)

  • Various wires, resistors, capacitors, and LED's

​

The instructor also stipulated the required functionality of the circuit. Data sheets for relevant components were used to figure out ideal connections between components. The micro-controller was programmed with some LED blinking tests to ensure everything worked properly.

Example of tooling that matched aesthetic features

The Breadboard Prototype for the PIC 32

Printed Circuit Board (PCB)

I used Autodesk EAGLE to design a 2 layer PCB which was ordered from PCBway 

I soldered the relevant components to the board when it arrived and ensured the test code ran correctly.

The schematic view of my PCB in EAGLE

IMG_2280.jpg

The fully soldered board

Laser-cut Robot Structure:

I wanted to rapidly iterate the structural elements of the robot, so I decided to make everything out of acrylic or wood which could be laser cut into desired shapes in minutes.

​

I designed a set of interlocking pins to attach the motors and circuit boards to the robot's main plate. The fits had to be very tight to function effectively, so I used NX to implement a tolerancing system. I modeled basic dimensions for each part and used the NX expression tables to add (or subtract) a variable equal to offset the kerf of the laser beam which cut the parts out. I specified these dimensions in NX in the same way tolerances are specified to a shaft or hole basis.

Vector outline used by the laser cutter

Underside of the robot

Notice the acrylic housing for the motors (blue) and electronics (red)

Before a session of cutting, I would measure the thickness of the material being cut and change my offset variable to quickly update dimensions for a perfect fit. Just 0.001" difference in the thickness of material was enough to upset the fits, so this system was very handy. I would also adjust the laser's focus to minimize the taper of the kerf in the work-piece (Figure 3 in that link shows the theoretical taper).

​

Each wheel is a rubber gasket stretched around a central disk and sandwiched between two slightly larger disks. These gaskets provided the desired traction for the surface on which the robot traveled.

​

CHALLENGES

  • Tuning PID control scheme for motor control and line following

  • Using OpenCV code with limited camera frame-rate from smartphone for line-following

  • Controlling tight fins for locking pins which secured various parts

​

On a sad note, I was unable to test the robot's line-following capabilities because the right motor's tiny gearbox got clogged with debris, likely debris from the ashy laser cut wooden surfaces near it. There weren't any spare motors and repeated attempts to clear the debris were unsuccessful. Thus, I unfortunately could not validate my final project's success. In the future I will take special care to protect delicate exposed components like that motor gearbox to ensure a robust drive system.

​

On a happier note, this was an incredibly educational class, one of my favorites from college. I learned so much about writing low-level software, interpreting component datasheets, and debugging electronics with oscilloscopes and logic analyzers. It was a good first robot, and will not be my last : )

bottom of page