Main | February 2006 »

Sun, January 29, 2006

Software Strategy

The controllable inputs are the vehicle's absolute acceleration (more precisely, the current given to the DC motor to drive the wheels) and the magnetic sensor data for tracking the position of the track's magnetic strip relative to the NATCAR (we can extract in software an approximation of velocity relative to the strip from this data as well). We will implement one of two possible controllers to follow the strip, the output being the actuation to the steering axis, since this directly alters the position relative to the strip. First, we could easily construct an open-loop proportional control algorithm that might have the performance we desire. However, this might result in choppy steering. Alternatively, if we can derive a mapping from car velocity and steering angle to position relative to the track, we could use a PD-feedback controller (an integrator term would be unnecessary for the always-changing track). We believe this would result in smoother convergence over the strip, but the practicality is discouraging.

The other output, motor torque, will act as brake control, rather than acceleration. By default the car will run at its highest torque with braking proportional to the track displacement error. If this results in drastic course overshoot, we will cap the torque according to a maximum car speed.

We also are interested in recording track data after one lap and implementing a pattern matching control strategy. If the car knows it is over a straightaway, it can safely accelerate until predictive braking is necessary to avoid overshoot at the coming turn. In order to achieve course learning, the microcontroller will maintain a record of x-y positions, which are updated by integrating the vehicle speed with steering angles. Once the positions overlap with similar velocity vectors (must avoid false-positives from track cross-over), the predictive braking will be enabled.

Block Diagram for Open-Loop Proportional Control:

software-diagram(openloop).png

Block Diagram for PD-Feedback Control:

software-diagram(PD).png

Block Diagram, Take 2

Unfortunately, the ideal ATmega2560 part isn't yet available, and the ATmega2561 just doesn't have enough pins to give us everything we need. So, I've added an I2C ADC to help us out. I've also finished the pin assignments. Hopefully this will allow us to do everything we want.

BlockDiagramV2.png

Sat, January 28, 2006

BlueSMiRF and ATmega32 UART Works!

Pretty cool. I ordered a BlueSMiRF Bluetooth serial modem from SparkFun. It arrived today, and I added it to my desktop ATmega32 breadboard…thing. I got it powered up and bonding with the PowerBook, and I was able to configure the modem using AT commands via ZTerm.

Then I watched some TV, 'cause I'm so freakin' tired.

Then I came back to the BlueSMiRF, and decided to add some serial port code to the ATmega32 firmware. It basically takes a single character off the UART (from '0' to '9'), uses that value as an index into a table, and sets the PWM duty cycle on the motor driver accordingly. Voilá! It works! I now have wireless control over a brushed DC motor.

Cool.

Thu, January 26, 2006

First Stab at Controller Block Diagram

Here are the required and desired elements that will interface with the microcontroller (click the image for a bigger version).

BlockDiagram.png

From here I'll map the various resources, then begin the schematic.

Got Java Serial Working

I got a little test app running. It opens a port and waits for characters to come in. It works on Mac OS X, hopefully one of my teammates can figure out how to get it to work on Windoze.

EE192 Begins

Our team is set, our basic car is built, and now we begin the exciting last-semester project: build an autonomous car to race around a track and crush the competition.

Our team, Team 9, is John Breneman, Bobby Gregg and Rick Mann.

Tue, January 17, 2006

Introduction

UC Berkeley's EE192 Mechatronics course is a semester-long project in which teams of three students each build an autonomous electric car based on a 1/10-th scale R/C car chassis. We are allowed to use an off-the-shelf servo for steering, drive motor and MCU board, but the rest must be designed and built from scratch (this includes the motor drive power electronics, DC-DC boost converter and sensor board).

The cars sense a 75 kHz, 100 mA RMS current in a wire laid down on the floor to serve as a track. There are crossings and steps (sudden left or right doglegs). The teams compete in time trials, and the winning team gets to compete against other universities in the National Semiconductor-sponsored NatCar race.

Our team chose some additional challenges: we are designing our own MCU board based around the Atmel ATmega128 running at 16 Mhz. We are also using a brushless DC motor, commutated by the ATmega128. A commercial BLDC driver chip would have been acceptable, but we wanted to see if we could do it ourselves.

Through this blog we will attempt to document our design plans, successes and failures.