Wednesday, July 28, 2010

CMUcam for line following

Using the CMUcam on your robot is easy. This tutorial will detail using the CMUcam1.
Here is the CMUcam manual: http://www.seattlerobotics.com/CMUcamManualv15A.pdf

First apply power to the CMUcam as shown in this diagram:

Then connect the Data wires as shown in this diagram. Be sure to remove the Max232 chip.

Connect the GND wire of the CMUcam to a GND pin on your microcontroller. Connect the SX28 Transmit pin to your Rx pin of the microcontroller( on the Axon I chose to use the Rx of UART0). Connect the SX28 Receive pin to your Tx pin of the microcontroller (on the Axon I chose the Tx of UART0).

Now that the electrical connections are set up , we move on to programming.

NOTE: The following code was made for the Axon microcontroller , but can easily be adapted.

UART Initialization:

uartInit();  // initialize the UART (serial port)

uartSetBaudRate(0, 115200); // set UARTE speed, for Bluetooth , this is the UART port

CMUcam Initialization

void CMUcam_Initialize(void)
{
rprintfInit(uart0SendByte);//change UART to CMUcam
rprintf("RS"); // Reset CMUcam
delay_ms(500); // wait 500 milliseconds
rprintf("cr 18 44"); // Set CMUcam to AutoExposure
delay_ms(500); // wait 500 milliseconds
rprintf("RM 1"); // Set CMUcam to Raw Serial Mode
delay_ms(500); // wait 500 milliseconds
rprintfInit(uart1SendByte);//change UART to USB
rprintf("CMUcam Initialized"); // send out the message through USB
}



Set Tracking of CMUcam
rprintfInit(uart0SendByte);
rprintf("TC 90 250 0 20 0 20"); // set tracking to this specific color

// format is minRed maxRed minGreen maxGreen minBlue maxBlue
delay_us(500); // wait 500 microseconds

Get Tracking Data

int CMUcam_MiddleMass(void) //echos # of characters expected for each command
{
int temp; // set up temporary variable
int counter=0; //set the counter to 0
int echo_counter=0; // set the echo_counter to 0
int temp1;

rprintfInit(uart1SendByte);//change UART to bluetooth
temp = uart0GetByte(); // Get a Byte
while (temp != 255) { // Keep on getting new bytes until the byte = 255
temp = uart0GetByte();
}
rprintf("Start= %d ",temp);
temp = uart0GetByte(); // Get a Byte
while (temp != 77) { // Keep on getting new bytes until the byte = 'M'
temp = uart0GetByte();
}
rprintf("M= %d ",temp);

echo_counter = 8; // expect 8 bytes ( 0 thru 7)
while(1) {
temp=uart0GetByte();//returns -1 if no data present

response[counter]=temp;//store values into an array
counter++; // add one to "counter" array

if(counter == echo_counter) // once the counter equals the echo_counter
{
// successfully captured the entire M packet
uartFlushReceiveBuffer(0);//flush out receive camera buffer to stop phase shifting
delay_us(100);

temp1 = response[0];
rprintf("MiddleMassX= %d ",temp1);


temp1 = response[1];
rprintf("MiddleMassY= %d ",temp1);

temp1 = response[2];

rprintf("MinimumX= %d ",temp1);

temp1 = response[3];
rprintf("MinimumY= %d ",temp1);

temp1 = response[4];
rprintf("MaximumX= %d ",temp1);


temp1 = response[5];
rprintf("MaximumY= %d ",temp1);

temp1 = response[6];
rprintf("Pixels= %d ",temp1);

temp1 = response[7];
rprintf("Confidence= %d ",temp1);


return response[0]; // return MiddleMass of X axis
} //endif

} // end while
} // end sub


Sample Program

int data;


CMUcam_Initialize(); // Initialize CMUcam
rprintfInit(uart0SendByte);

rprintf("TC 90 250 0 20 0 20"); // set tracking to this specific color

// format is minRed maxRed minGreen maxGreen minBlue maxBlue


delay_us(500); // wait 500 microseconds

while(1) {

data = CMUcam_MiddleMass(); // get the MiddleMass value

if (data > 40) {

// do stuff, turn left, etc.

} //end if


if (data <40)>

// do stuff, turn right, etc.

} // end if

} //end while

Heres an example of a robot you can create using my code:

note

>> Lecture Note

· [1] Introduction

· [2] Hardware

· [3] Software

· [4] LED_Button

· [5] LCD

· [6] Timers

· [7] Interrupts

· [8] ADC

>> Additional Reference/Guide

· PIC18F4550 Datasheet

· Introduction to Embedded Programming using C

>> Pre-guided for Project

· CMUCam2

· Vexta DC Brushless Motor Driver

· Schematic of UTHM PIC18F4550 Board


>> Download

· Fuzzy Logic Note (Ch1, Ch2, Ch3, Ch4, Ch5, Ch6)

· Fuzzy Logic eBook (Ref1, Ref2)

Monday, July 26, 2010

UTM FKE psm fyp data


Title Year Publication Volume Pages Links
MUHAMAD FAIZ BIN IZAN CYLINDRICAL CLIMBING ROBOT 2009 UTM MAY
details pdf openurl
MUHAMAD FAIZAL BIN ABD RAZAK DESIGN HVDC TO LVAC INVERTER BY USING PWM 2010 UTM MAY
details pdf openurl
MUHAMAD FIRDAUS B ABU SAMAH GROUND METAL DETECTOR 2009 UTM MAY
details pdf openurl
MUHAMAD HANIF BIN HASHIM VLSI IMPLEMENTATION OF PHASE LOCK LOOP FOR PHYSICAL LAYER 10 MBPS ETHERNET 2007 FKE, UTM DECEMBER
details pdf openurl
MUHAMAD HANIF BIN SAIFOLLAH IMPLEMENTATION OF SCADA SYSTEM USING DATA ACQUISITION CARD 2009 UTM MAY
details openurl
MUHAMAD IHSAN BIN SUJANI DEGRADATION OF POLYMERIC POWER CABLE DUE TO WATER TREE UNDER DC VOLTAGE 2010 UTM MAY
details pdf openurl
MUHAMAD KHAIRULHADI BIN MOHD SHUKOR DOWNLINK RADIO ACCESS POINT DESIGN FOR RADIO OVER FIBER SYSTEM 2008 UTM MAY
details pdf openurl
MUHAMAD LUKMAN HAKKIM B. MOHD YUSOF DESIGN OF OPEN MICROWAVE CAVITY FOR HEATING PURPOSES 2010 UTM MAY
details pdf openurl
MUHAMAD MU'AZ BIN YUSOF THREE-PHASE THREE-SWITCH CURRENT SOURCE BUCK RECTIFIER USING SPACE VECTOR MODULATION TECHNIQUE 2009 UTM MAY
details pdf openurl
MUHAMAD NIZAM BIN DERMAWI DEVELOPMENT OF USER INTERFACE FOR DUAL MOTOR SPEED AND DIRECTION CONTROL 2010 UTM MAY
details pdf openurl
MUHAMMAD ABU BAKAR AS-SIDDIQ BIN KHAIRI ENGINEERING ECONOMIC OF GRID-CONNECTED BIPV SYSTEM 2009 UTM MAY
details pdf openurl
MUHAMMAD AIZZAT BIN ZAKARIA I-SCOOT: INTELLIGENT MOBILITY SCOOTER 2010 UTM MAY
details pdf openurl
MUHAMMAD AKHRAM BIN MOHAMED ARIS ELECTROMYOGRAM CIRCUIT WITH DISPLAY UNIT SYSTEM 2010 UTM MAY
details pdf openurl
MUHAMMAD AKIB B ABDULLAH ELECTRONIC BALLAST FOR FLUORESCENT LAMP 2009 UTM MAY
details pdf openurl
MUHAMMAD AL FARABI BIN MUHAMMAD IQBAL RADIO FREQUENCY TRANSCEIVER FOR AMATEUR RADIO 2009 UTM MAY
details pdf openurl
MUHAMMAD ANUAR BIN ABDULLAH DIGITAL PROGRAMMABLE METER 2008 UTM MAY
details pdf openurl
MUHAMMAD ARIF @ MOHD ARIFZANI BIN SELAMAT ASSESSMENT OF LIGHTNING PROTECTION SYSTEM (LPS) FOR ASSET MANAGEMENT ENHANCEMENT: FKE UTM SKUDAI CAMPUS 2009 UTM MAY
details pdf openurl
MUHAMMAD AZFAR BIN ABDULLAH ULTRAWIDEBAND (UWB) WEARABLE ANTENNA 2010 UTM MAY
details pdf openurl
MUHAMMAD AZHAR BIN KHAIRUDDIN USB SOUND CARD USING PIC MICROCONTROLLER 2009 UTM MAY
details pdf openurl
MUHAMMAD AZRI BIN AB RAHIM HUMANOID DESIGN IMPROVEMENT BY USING INERTIA MEASUREMENT (IMU)


<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 >> [26–43] print