Digital Compass (PWM)

The digital compass has two options for interfacing it (I2C, PWM). We tried PWM input capure becasue it seemed like the easier option. Becasue the clock restarts at 40 it took a bit to figure out how to get a reading in degrees from the pulse width capture reading. I got eventually... However, the readings were not really accurate and the values liked to spike sometime for no apperant reason. Since the I2C pins were not being used by anything else so we decided it would be the best option.

Even More Accelerometer

We finally figured out a working example of code that translates the acceleration to a semi accurate distance reading. The averaging still needs tweaking though. However I think we might not end up using the accelerometer at all because the readings are not as acurate as we had hoped for. There are just to many things that throw it off. I think we're just going to end up figuring out the distance travelled by calculating the average speed and including the slip when the robot starts and stop into the equasion.

More Accelerometer

The accelerometer reading were still not as acurate as we wanted them. Most of the day was spent coming up with better way of averaging and figure out how to single out random spikes so the can be exculded from the averaging. We got it working a bit better, but the only solution that really worked was to round the output value a decimal space. It's not the best way to do it, but we're out of ideas.  

Drive Control

Dave left me hanging today so I'm here by myself. I didn't really feel like using my brain today so I decided to figure out the motor control instead of the accelerometer. We were originally thinking of making our own H-Bridge, but we have time restraints and there's no point in reinventing the wheel so we just bought a simple module the will do the job. We bought the L293 QUADRUPLE HALF-H DRIVER NE ic. I got it working on a breadboard and I finished writing the basic functions in mplabs.  

Another Library Workshop...

Read the title, enough said...

Interfacing the IR, Sonar and Accelerometer

Today we got the sonar working. It didn't take a lot of time because the code was almost identical to the IR rangefinder. Also, the equation for converting the analog value to distance is linear so it's even easier. The accelerometer also uses analog to digital so we started on that too. We got a lot of problems with the values it was outputting because they were inconsistent and jumping all over the place. We solved this by adding a decoupling capacitor to the accelerometer's power supply and incorporating averaging into our code. I can tell already that the equation for getting speed from acceleration using this thing isn't going to be easy at all. 

Sensor Interfacing

Before starting a schematic we decided to individually test and debug each of our sensors/modules with the ICE emulator and prototype board. Ilia thought (and I agreed) that it would be a good learning experience for us to write ALL our own code rather than use third party libraries. Today we started with the IR rangefinder by modifying our previously written A to D conversion code. I figured out the equation to convert the A to D value to distance in centimeters

y = 32.14294004 x4 - 195.6090369 x3 + 437.1088864 x2 - 446.8068463 x+ 202.2574821


(No thanks to Ilia who was "sick". Whatever, he wouldn't have helped anyway).

Sensors

The order finally came in:

IR Range Finder














Sharp GP2D12 IR Range Sensor - 10cm to 80cm.

Accelerometer:













ADXL322 2g +/- Buffered Accelerometer.
This will be used for mapping to measure speed and distance traveled. 

Ultrasonic Range Finder















LV-MaxSonar -EZ3.
Will be used for mapping and navigation for object detection/avoidance. 

RF Transmitter/Receiver













On Shine 433MHz. For robot control and robot to robot communication.


Digital Compass
 


CMPS03 Module. For direction orientation during mapping.






A to D and Uart

Continued programming in MPLABS. We moved on to more complex programs (no more leds). We got serial communication going through the Uart port so that we could display debugging information in Hyperterminal. After this, getting analog to digital conversion working was much easier. By the end of the day we were successfully displaying analog readings from the potentiometers in Hyperterminal.

Library...

Library Worshop....  >_<

MPLABS

Started programming with MPLABS. Simple digital input/output (ie blinking leds and pushbuttons)

Block Diagram




After deciding all the sensors/components we wanted to use, the first real step we took in the design process was to make a very general block diagram to get a good idea of how everything was going to interface. All the modules were assigned to specific pins on the PIC microcontroller to ensure that there were enough space to incorporate everything we wanted to.

Wall Following


Wall following seemed like it would be very helpful for room exploration/mapping. We figured the easiest (and cheapest) way to do this was with those analog IR Rangefinders. When you're making two of something, the price likes to add up. $12.63 * 2 per robot * 2 robots  = $50.20....

Wireless


We decided to use RF for wireless communications instead of wifi because of budget restraints. I decided to get the On Shine 433MHz High RF transmitter/receiver pair from Robot Shop. It's cheap and looks like it will cover our needs.

Chassis

Due to time constraints, we decided to purchase a premade chassis opposed to desgning/constructing our own. We chose the Arduino Robot Rover platform from RobotShop. It comes with the drivetrain and it already has mounting spots for most of the sensors/hardware we plan on using so there will be hardly any modification needed. Win win!

Microcontroller


We are using the dsPic30F6014A microcontroller by microchip. We also get to use an MPLAB ICE 4000 emulator with a dsPICDEM 1.1 development board which is awsome for testing and debugging.

Day 1

This was our first day at Mentorship. I met Ilia my partner and Tom MacDonald our mentor. We spent most of the day brainstorming project ideas. After much debate we finally settled on making a robot (or pair of robots) that autonomously search a room for an IR (infrared) beacon.