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.)

Assemble the Rigel 4WD platform (item 13) according to the instructions provided with the kit using a screwdriver. The platform is shown in Figure 1.

Install the Arduino (Item 12) as shown in Figure 1 with adhesive material such as velcro to keep it in place.

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.

Mount the IR sensors (Item 10) to the front and back of the
Rigel platform. You can use thumbtacks or superglue to mount them to
the chassis.

Solder 4-lead wires to the Phototransistor and mount them underneath Rigel as shown in the pic. Use the datasheet to help you understand the wiring. If you are having trouble interpreting the phototransistor datasheet, read this forum post .

Using a small adhesive breadboard wire up a voltage divider circuit. Use 10 kOhms for each phototransistor. To understand voltage divider circuits read about them in the SoR tutorial.

Mount the rechargeable 5-cell, 6V battery (Item 8) to the first rung of the platform using the velcro to secure it in place..

Next, mount the rechargeable 9-Volt battery (Item 7) to the first
rung of the platform using the velcro to secure it in place. Attach the
9-Volt battery connector (Item 8) and using the crimpers connect the
Tamiya female connector to it (Item 5).

Now connect a 3" female - to - female header jumper from Vin and
Gnd on
the Arduino Decimella to a female Tamaya connector. Plug the 9 Volt
battery connector to the jumper and verify that Arduino PWR LED is
green.

Using the cutters tool remove the
.1 Inch Crimp Housing 3 Pos. from each of the 4 servos.

Separate VCC, Gnd, and Signal wires from each of the 4 servos.

Braid together the red wires (Vcc) on each of the four servos as well as the positive leads on the IR sensors and the 2 phototransistor sensors.

Next, solder the braid to the Kyosho male connector (Item 6) using the crimpers. Use heat shrink tubing (Item 3) to protect your wires from wear and tear.

Repeat the same braiding technique for the black wires (GND) on each of the 4 servos, 2 IR sensors, and 2 Phototransistors.

Solder together the 4 black servo wires, 2 Sharp IR back wires, and 2 phototransistor wires and use heat shrink tubing to protect from wear and tear. Important to splice an additional black wire to the braided set of wires as this ground (black wire) will connect to
GND on the Arduino Decimella (Item 11) in a later step. For now just have this extra wire available.

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

Trim the pin headers and insert the male pin header into the arduino I/O where the sensor, GND, and actuator will later connect. You can use the flush cutter to trim the pin header to the correct size. Cover your eyes with protective goggles when trimming the pin headers. And make sure nobody is nearby when you are cutting them. The tips fling off at high velocity across the room and could stick in someone else's eye if your not careful. You can control where the tips fly by using your hand as a barrier to prevent the cut tips from flying across the room.

Use the female-to-female header jumper to connect to the arduino pin header when it makes sense to do so. This tutorial is just a guideline, and you are left to make your own decisions with the tools and pictures given here.

Connect left side servos to the PWM pins 9 using a Y-harness.

Connect the opposite end servos to PWM 10 using a Y-harness.

Connect the extra gnd wire to Arduino GND.

Connect the VIN and GND on the arduino to the 9-Volt battery

Connect the rechargeable 6-V battery to the connector to power all of the sensors.

Turn on power to the Arduino board and the
servos/sensors. You should see a green LED light up on the Arduino as
well as hear the servos have sign of power. This means you are now
ready to start wiring up your sensors to the Arduino.

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 ).

// 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 90void 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 90void 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(); }