John Hugo Marcoux III - Systems Engineer
 

Autonomous Robot Line Painter

Home Design Hardware Results Thanks

PCB Design and Hardware

A requirement for this project was that we design a custom printed circuit board. After learning how to use the CadSoft EAGLE software and coming up with a system design, we began the design of our PCB.

The PCB designed for this project was a two layer board that measured approximately 6 by 4 inches and was fabricated by www.pcbfabexpress.com. The PCB houses two dsPIC33FJ128MC802 microcontrollers, one optoisolator, one inverter, four H-bridge drivers, and two H-bridges made out of MOSFETs.

To generate a clock for the dsPICs, each processor has a 20MHz crystal. Each dsPIC also had several power inputs with accompanying capacitors. Both processors were also equipped with two UART connections each as well as an ICSP header, used for programming. The dsPIC in charge of drivetrain control had two quadrature encoder inputs, as well as two PWM outputs and their inverses. The PWM outputs from the dsPIC are fed into our optoisolator. The purpose of the optoisolator is to electrically isolate our dsPIC circuit from our motor control circuit. The outputs from the optoisolator are then fed into an inverter which buffers the PWM signal and in addition, generates an inverse signal for each wheel. What results are four signals, a PWM for the right wheel, its inverse, and a PWM for the left wheel, and its inverse. Each signal is sent into its own H-bridge driver. These H-bridge drivers then send two signals each, which switch the MOSFETs. A pair of MOSFETs are connected to each motor pole: one MOSFET connects the pole to ground and the other MOSFET connects the pole to 24-volts. When sending a 50% duty cycle to the motors, the forward movement is offset by the reverse movement, resulting in the motors remaining stationary. For reserve power there are four 2200 microfarad capacitors separating the 24-volt rail and ground.
Below is the EAGLE rendering of our PCB after designing the schematic, creating the footprints, and routing all of the traces.

EAGLE rendering of our PCB and the populated board

EAGLE screenshot of our PCB

Populated PCB after design and fabrication

Localization

Localization was a key portion to our projects success, as it would not be able to autonomously operate without it. Our robot used the motor's encoders to implement speed matching, which ensured that it is able to drive in straight lines. It also used basic geometric equations to predict how far the robot moved based on the size of the drive wheels and the counts of the encoders. This is however, not enough to guarantee complete localization. Any wheel slippage would cause error, making this scheme open-loop feedback. To close the loop, we implemented laser triangulation to more accurately pinpoint the position of the robot. Positioning three beacons in a straight line fitted with retro-reflective tape gave use enough information to then determine the position of our robot. Using a 38kHz carrier frequency on our infrared laser, we were able to pinpoint our laser signal as it bounced off of the three beacons and returned to the robot.
Below is a diagram showing how we positioned the three beacons during operation. They were arranged in a straight line, and the distance between them was measured to aid in the calculations.

Laser Triangulation Diagram

We used an infrared laser with a 38 kHz carrier frequency as the projected signal for our triangulation. 38 kHz carrier frequencies are found in many every day remote controls or multimedia devices, which was why it was chosen. The carrier frequency allowed us to differentiate between natural infrared light and our laser signal. The laser was projected 360 degrees by a spinning mirror that defects the laser on a horizontal plane. When the mirror pointed at a reflective beacon the sensor on the robot transitions from high to low and an interrupt is triggered on the microcontroller. The rotating mirror is driven by a 12-volt motor with a 131.25:1 gear ratio made by Pololu. There is an encoder on the motor which has 8400 encoder counts per revolution. When the interrupt is triggered on the microcontroller the encoder count is read and saved to be used for the positioning software. The three reflective beacons are set up strategically so that the angles we record can be used for x, y, and theta calculations. For simplicity we placed the beacons in a straight line with an equal distance between each one of them.

Laser Triangulation Hardware Setup