Technologically thinking...

Information

progress

Planning: 100%

Mechanical: 100%

Electronics: 70%  

Programming: 60%

Overall: 82% 

Technical info 

Name: Rorcle

Cost: 70€

Weight:607 grams.

Hours spent: 10.

Environment: Indoors.

Purpose: Indoors development platform.

What it does: Line following, and object avoiding

Programming language: C

CPU: Arduino

Sensors / Inputs: Sharp IR sensor, and custom made line follower

Actuators / Outputs: Tamiya dual gearbox

Power: 4x AA for motors, 1X 9v for brains. 

16/7/2010

LCD:

Graphical VS 16x2 characters?

Encoders now magnetic, instead of optical.

 

Speaker instead of buzzer, for more complex sounds using soundgin.

 

 

 

 
Some code:
/* Code for driving rorcle,  Wiring as following:

Digital Pins:
Pin 0  = >RX
Pin 1  = 
Pin 2  = Pin 11 of 74HC595, LCD
Pin 3  = Pin 3 of SN754410NE, Left Motor
Pin 4  = Pin 14 of 74HC595, LCD
Pin 5  = Pin 6 of SN754410NE, Left Motor
Pin 6  = N/A
Pin 7  = Pin 12 of 74HC595, LCD
Pin 8  = N/A
Pin 9  = Pin 11 of SN754410NE, Right Motor
Pin 10 = Pin 14 of SN754410NE, Right Motor
Pin 11 = N/A
Pin 12 = N/A
Pin 13 = N/A

ADC Pins:
Pin 0 = Sharp IR sensor
Pin 1 = Left QRD senspr
Pin 2 = Middle QRD sensor
Pin 3 = Right QRD sensor
Pin 4 =
Pin 5 =
Pin 6 =

*/

#include  

// Arduino pins
#define LCD_LINES 2  // number of lines in your display
#define DOUT_PIN  4  // Dout pin
#define STR_PIN   7  // Strobe pin
#define CLK_PIN   2  // Clock pin                                                                               


//create object to control an LCD.  
LCD3Wire lcd = LCD3Wire(LCD_LINES, DOUT_PIN, STR_PIN, CLK_PIN); 
//_______________________________________________INPUTS

int L = 1; // qrd left
int M = 2; // qrd middle
int R = 3; // qrd right
#define SharpIR 0 //self explanatory.
int average = 0;

// —————————————————————————  Outputs

int motor_left[] = {3,5}; // motor esquerdo
int motor_right[] = {9,10}; //motor direito
int Speed = 0;
#define buzzer 13 // buzzer para avisos sonoros

// ————————————————————————— Setup

void setup() {
 
  lcd.init();
  //optionally, now set up our application-specific display settings, overriding whatever the lcd did in lcd.init()
  //lcd.commandWrite(0x0F);//cursor on, display on, blink on.  (nasty!)
  int i;
  for(i = 0; i < 2; i++){
    pinMode(motor_left[i], OUTPUT);
    pinMode(motor_right[i], OUTPUT);
  }
  pinMode(buzzer, OUTPUT);
  digitalWrite(buzzer, HIGH); // ligar o buzzer só uma vez para aviso de inicio de movimento
  delay(200);

}

void loop() {    
  lcd.clear();
  lcd.printIn("Hello LMR!!!");
  delay(500);
  lcd.cursorTo(2, 0);  //line=2, x=0.
  lcd.printIn("All LMR are belong to us.");
  delay(1000);
  
  //scroll entire display 20 chars to left, delaying 50ms each inc
  lcd.leftScroll(20, 100);  
}

// ————————————————————————— Funcs
void follow_line() {
L = analogRead(1);
M = analogRead(2);
R = analogRead(3);
delay(30);


while(M < L & R){
drive_forward();
delay(2);
break;
}
delay(5);


while(L < M & R){
turn_left();
delay(2);
break;
}
delay(5);


while(R < M & L) {
turn_right();
delay(2);
break;
}
delay(5);
}




void avoid() {
    average = analogRead(SharpIR); //I was going to average 10 readings, but decided to just put a delay...
  delay(20);
    if(average > 90) {
      turn_left();
    }else {
      drive_forward();
    }
} 



void accelerate() {  //Still under development, So it accelerates gradually.
  for(Speed=0;Speed<255;Speed++){
    digitalWrite(motor_left[0], LOW);
  analogWrite(motor_left[1], Speed);
 digitalWrite(motor_right[0], LOW);
  analogWrite(motor_right[1], Speed);
  delay(300);
  }
  
  
  

}
  void motor_stop(){ 
  digitalWrite(motor_left[0], LOW);
  digitalWrite(motor_left[1], LOW);

  digitalWrite(motor_right[0], LOW);
  digitalWrite(motor_right[1], LOW);
  delay(25);
}

void drive_forward(){ 

  digitalWrite(motor_left[0], LOW);
  digitalWrite(motor_left[1], HIGH);

  digitalWrite(motor_right[0], LOW);
  digitalWrite(motor_right[1], HIGH);

}

void drive_backward(){  
  digitalWrite(motor_left[0], HIGH);
  digitalWrite(motor_left[1], LOW);

  digitalWrite(motor_right[0], HIGH);
  digitalWrite(motor_right[1], LOW); 

}

void turn_left(){
  digitalWrite(motor_left[0], LOW);
  digitalWrite(motor_left[1], HIGH);

  digitalWrite(motor_right[0], HIGH);
  digitalWrite(motor_right[1], LOW);
}

void turn_right(){ 
  digitalWrite(motor_left[0], HIGH);
  digitalWrite(motor_left[1], LOW);

  digitalWrite(motor_right[0], LOW);
  digitalWrite(motor_right[1], HIGH);
}



 

Rorcle 

 

Rorcle is a round robot chassis made from 3mm thick plexiglas. 

 
Rear wheel Re-used from a tape recorder.
Wheels Reused from printer paper feeder, with untested encoder. 
 
 Videos:
 
 hbxV-uuSgAM               WmJ8Q2r54gk               n8GBxHJscb4