Rigel 4WD Autonomous Mobile Robot

 

INTRODUCTION

 

Hello there, my username is Vidam and I am submitting this work for the 3rd Society of Robots competition entry. This effort is also part of a workshop I am leading for the DC/MD/VA Robotics and Automation Team. Also this is my first tutorial for SoR! :-)

 

The steps I took to layout the sensors, MCU, batteries, and wiring are illustrated. Rigel will do basic obstacle avoidance and line following behaviors. The project assumes some basic skills in soldering, electronics, and programming. After completing this project you will be ready to implement more advanced sensors on this platform such as GPS, vision, and encoders as this platform is rugged and expandable and can be used indoors or outdoors. If you are under the age of 18, please get a knowledgeable adult to help.

 

Steps 1a-1d guide you through assembling the hardware and programming the actuators with PWM. Steps 2a-2c guide you through setting up the sensors I/O and programming for sensors to test that they work. Step 3a-3c guidle you combining code for sensors and actuators. And finally, step 4a-4c guide you through playing with your robot and showing off to your friends.

 

PROBLEM STATEMENT

 

The Rigel Platform is 4WD and without the use of any kind of encoder it will be nice to know just how bad the error is in dead reckoning tasks. Reducing this margin of error either in code, or hardware will be investigated as part of this work. So let's get started building the robot. (Another problem is I cut my finger and bled over the wires when trying to strip wire. So be careful and don't hurt yourself with the wiring.)

 

 

 

 

 

Figure 1: Assembled Budget Robotics 4WD Rigel Platform

 

 

Step 1: ASSEMBLING HARDWARE

 

Assembling hardware in step 1 includes robot building, wiring assembly, MCU installation, battery configuration, and sensor mounting.

 

Step 1a: Assemble tools and parts :

 

Note you will need the following parts list to complete step 1. The links are places where you can purchase these items.

 

PARTS LIST:

  1. Solder station,
  2. Screwdriver,
  3. Heat shrink tubing,
  4. Cutters and wire strippers,
  5. Qty-2 Tamiya female connectors,
  6. Qty-2 Kyosho male connectors,
  7. 9-Volt Battery
  8. Battery connector,
  9. Battery charger and 5-cell, 6-V, 1700 mah rechargeable NiMH battery,
  10. Qty-2 Sharp GP2Y0A21YK,
  11. Qty-2 IC Sensor phototransistor IR Reflectors, (e.g. phototransistors)
  12. Arduino Decimella microcontroller,
  13. Rigel 4WD Platform from Budget Robotics,
  14. Velcro
  15. Crimpers
  16. Qty-2 of 3" or 6" Y harness
  17. Thumbtacks or superglue
  18. Liquid Paper Whiteout
  19. Small adhesive breadboard
  20. PIN HEADER, 2.54 PITCH
  21. 0.1 Inch Header Pins (Single Row)
  22. 3" Female-Female Header Jumper

 

Step 1b: Assemble the chassis and other components

 

Step 1c: Crimping & Soldering

 

Tip #1-- plan out the design and layout for your sensors, batteries, and wiring before throwing stuff onto your chassis. This plan has been done already for this tutorial. The lower level of the Rigel chassis is the power distribution level for the MCU and sensors. It is where the batteries and other wiring are located. The upper level of the Rigel chassis is the processing level for MCU.

STEP 1d: Connect Arduino, Power, and Actuators.

 

 


Your finished. Now we are ready to proceed to programming the actuators.

 

 

Rigel 4WD Autonomous Mobile Robot - Programming

Step 2: PROGRAMMING

 

Here we assume you already are familiar with PWM or pulse width modulation for servos. If you don't understand it then please refer to this forum post. This code reads the values from the Sharp IR sensors and decides whether it should continue on it's current path or reverse it's direction of travel due to an obstacle in it's path. (Note, one of the phototransistor's wire crossed path's with another wire. I was able to put out the flames before my robot burned down or worse the place where I live ).

 

 

#include <ServoTimer1.h>

// Rigel navigation with library ServoTimer1
// by vidam

ServoTimer1 servo1; // servo instance
ServoTimer1 servo2;
int pin = 9;
int pin2 = 10;
int pulse;
int pulsemin = 500; // in microseconds -- 0.50 ms pulse -- 0 deg -- most clockwise
int pulsemax = 2500; // in microseconds -- 2.50 ms pulse -- 180 deg -- most anticlockwise
int backIR = 0; // the input pin for the front Sharp IR
int frontIR = 1; // the input pin for the back Sharp IR
int front_val = 0; // variable to store the value coming from the sensor
int back_val = 0; // variable to store the value coming from the sensor

void setup()
{
Serial.begin(9600);

// prints title with ending line break
Serial.println("Servo Command");

// wait for the long string to be sent
delay(100);

// setup servo
servo1.attach(pin);
servo2.attach(pin2);
servo1.setMinimumPulse(pulsemin);
servo1.setMaximumPulse(pulsemax);
servo2.setMinimumPulse(pulsemin);
servo2.setMaximumPulse(pulsemax);
}
// to turn left num should be a value between 0 and 90


// to turn right num should be a value between 90 and 180
void turn(int num)
{
delay(100); // allow some time for the Serial data to be sent
servo1.write(num); // write the pulse to servo
servo2.write(num); // write the pulse to servo
}

 


// num is some value between 0 an 90
void forward(int num)
{
delay(100); // allow some time for the Serial data to be sent
servo1.write(num); // write the pulse to servo
servo2.write(90+num); // write the pulse to servo
}

// num is some value between 0 an 90
void backward(int num)
{
delay(100); // allow some time for the Serial data to be sent
servo2.write(num); // write the pulse to servo
servo1.write(num+90); // write the pulse to servo
}
void refresh()
{
servo1.refresh();
servo2.refresh();
}

void loop()
{
front_val = analogRead(frontIR); // read the value from the sensor
back_val = analogRead(backIR);
Serial.println("Front Val 1");
Serial.println(front_val);
delay(1000);
Serial.println("Back Val 1");
Serial.println(back_val);
delay(500);

while(analogRead(backIR) < 100 & analogRead(frontIR) < 100)
{
forward(30);
delay(500);
refresh();
}
Serial.println("Front Val 2");
Serial.println(front_val);
delay(1000);
Serial.println("Back Val 2");
Serial.println(back_val);
delay(500);

while(analogRead(backIR) > 100)
{
forward(30);
delay(500);
refresh();
}
Serial.println("Front Val 3");
Serial.println(front_val);
delay(1000);
Serial.println("Back Val 3");
Serial.println(back_val);
delay(500);

while(analogRead(frontIR) > 100)
{
backward(30);
delay(500);
refresh();
}

refresh();

}

 

Rigel 4WD Autonomous Mobile Robot -- Testing

Testing

 

Questions to ask?

 

How far can 4WD Rigel drive in a straight line?

 

Tune the Sharp IR for different lighting situations?

 

Do encoders improve accuracy in traversing a maze?