MULTIPURPOSE ROBOTIC DEVICE
The targeted design goal of this project is to construct a multipurpose robotic device that is capable of performing the following functions:
· a software controlled Disk Launcher which can be used in the field of Defense & Sports
· Object Sorter based on different colors which can be used in Food processing & Packaging industry and many more.
This robot uses touch and light sensors, Infrared Remote Control, infrared tower control via PC, Bluetooth Control to guide & control the Robot.
The Multipurpose Robot is able to perform a number of tasks with just a change in the software program. The “Multipurpose Robot” developed & coded has forward & backward movement control of a conveyer belt, left & right control of a turntable from 0 to 180 degree & a clockwise/anticlockwise rotating motor providing its torque to 2 tyres one moving at a higher speed than the other.
Features of Multipurpose Robot:
· Efficient speed & direction control mechanisms
· Direction control via use of a Turntable to enable the robot to move from 0 to 180 degree
· Forward/Backward movement making use of conveyers to provide a medium for transfer of objects
· Touch Sensor Control for efficient response to the user command
· Light Sensor Control for efficient response to the change in wavelength of light depending on the different objects that pass through the sensor
· IR control via IR Remote
· IR control via USB IR Tower attached to PC
· Manless Control thus providing feature of Automation
Hardware Used:
RCX
3 Motors
Motor A-Controlling the clockwise/anticlockwise movement within an angular range of 180 degrees
Motor B- Controlling the movement of conveyer belt in forward/backward direction
Motor C- Controlling the clockwise/anticlockwise speed of the tyres attached at the front
Wheels
Touch Sensor-It is used to count the number of rotation the turntable has taken & accordingly is used to change the angular position
·Light Sensor- It is used to detect changes in color of the object that passes below the sensor
Turn Table
Worm Gear
Gears
Treads and hubs
Lego Building Blocks
Step-by-Step Approach
Approach / Problem Faced and Solution
The mechanism should be able to rotate to the desired angle with sufficient level of accuracy.
Soln: The entire structure was mounted on a turntable and rotated using a worm gear. The high reduction in the gear ratio provided the required accuracy.
PF: Absence of a rotation sensor which could calculate the angle of rotation
Soln: A combination of a touch sensor and a CAM was used to work as a rotation sensor.
Design of the Feeding Mechanism enabling loading of only one disc at a time.
PF: To lift only one disc at a time entailed usage of two independent motors (one to raise the disc and the other to move it)
Soln: A conveyor belt mechanism with low clearance was used, which allowed passage of only one disc at a time
Design of the Shooting Mechanism with a satisfactory Shooting range.
PF: The disc should be shot at a high speed and should have a high range.
Soln: A conveyor belt was used to move the the disc to the point from where it was shot. At the point where it is thrown, a couple of tyres were placed and rotated in opposite directions. The traveling disc on coming in contact with these wheels is shot from the robot at a very high speed
A mechanism to differentiate between the discs which enables the robot to count the number of disc while shooting and also to determine the type of disc and thus the different discs can be segregated
Soln: A light sensor was used at the top of the conveyor belt. The purpose of the light sensor was to detect the number of disc passed below it (by detecting the change in the intensity of light received.) Also different colours reflect different amount of light which can be detected by the light Sensor and thus they can be segregated on the basis of their colour
Special Features:
The following features were added in the robot to make it more flexible and to be able to fulfill its purpose better:
Variation of the Range: changing the speed of the motors controlling the rotation of the wheels can vary the distance covered by the disc. An increase in the speed leads to an increase in the range covered and correspondingly a decrease in the speed reduces the range.
PC Control: A number of parameters can be fed to the robot from the PC thus making it a more versatile machine. The parameters are:
The frequency at which the missiles are shot that is controlled by the speed of the conveyor on which the discs move.
The speed of the wheels that controls the range of the disc shot.
The direction at which the missile is shot.
Feedback from Robot to PC: the Robot provides on-line feedback to the PC, regarding the number of disc passed below the light sensor.
Sorting Mechanism: A predefined position is allotted for each different type of disc. On encountering a particular type of disc, the object sorter moves to the desired angle before shooting the disc.
Chronological Order of Events
The user is prompted to enter the following parameters on the PC:
§ Frequency at which missiles are fired
§ The speed at which the missile is fired
§ The direction and angle at which the missile is fired.
The PC opens a establishes a connection with the robot (using data streams) and sends the above information in the form of bytes to the robot.
On obtaining the frequency, speed and the desired angle the robot rotates to the specific angle (using a feedback from the touch sensor and CAM). It then adjusts the speed of the conveyor and the wheels according to the bytes received from the PC.
The light sensor is activated as soon the robot starts its motion. .The light sensor enables the robot to count the number of disc and to identify the type of disc.
The above information is sent back to the PC via another data stream.
In case of object sorter, the robot moves to the preset angle as soon it detects the particular type of disc before shooting the disc.
Communications
Communications is a key element in robotics. Sending data from the RCX to your PC, PC to RCX and from RCX to RCX is key. We are already communicating between PC and RCX every time we download a program.
Java programs use streams to communicate. Stream is a conceptual word and defining it is difficult. One definition is a stream is a connection between two independent entities used to transfer data or information. Think about sitting with another person and having a conversation. Our spoken words are a word stream. For most people, the mouth is an output device and the ear is an input device. Streams are based upon connections and have only one direction; mouths can’t hear and ears can’t speak.
Java has an extensive set of packages that deal with communications. The designers of Java generalized the idea of streams to include things that you would not expect. Virtually all communications, with the major exception of graphic user interfaces, GUI, between a program and the real world is based upon streams. Examples include surfing the web, saving a file on a hard drive, typing in the console window, and using a modem. The most basic streams are InputStream and OutputStream.
While people use word streams to communicate, computers use byte streams & data streams. A byte is the smallest primitive data type in Java. As it happens, ASCII characters, letters and numerals, are stored in single bytes. So each ASCII character is sent as one byte in a byte stream. Integers take four bytes so they get sent through the stream as four consecutive bytes. So if a program is on the receiving end of a data stream how can it tell the difference between an int, a byte, a float or whatever? Simple answer is that it can’t. A byte is a byte. What a user has to do is create a protocol.
A protocol is the rules for a conversation that the sender and receiver agree to follow. Protocols are designed to make communication easier. Think about the protocol for using a telephone. The rule of the telephone protocol is that you pick up the phone when it rings.
Applications
I. Disk Shooter-The above robot can be used as a Disk Shooter, which can be used in the field of “Shooting” in sports. It emulates the working of a disk-shooting machine, which can throw the disk in the air with different speeds & trajectories. A user can set various parameters on his PC & then send them to the robot via IR Tower which beams the instruction to the IR receiver in the RCX. According to the kind of instruction received by the RCX the various motors & sensors perform their respective task of moving the turntable, movement of the disk’s & the shooting mechanisms provided by the wheels of different speed. Industry application of this robot is in the field of Sports.
II Missile Shooter- The above robot can be used as a Missile Shooter, which can be used in the field of “Defense & Warfare” . It emulates the working of a missile-shooting machine, which can target the missile at a particular angle & then load the missile & fires it. A user setting in a control station can set the various missile coordinates & no of missiles to be launched with various other related parameters on his PC & then send them to the robot via IR Tower or IR Remote which beams the instruction to the IR receiver in the RCX. According to the kind of instruction received by the RCX the various motors & sensors perform their respective task of moving the turntable, movement of the disk’s & the shooting mechanisms provided by the tyres of different speed. Thus the same robot can now be used in warfare with a minor modification in the software. Further GPS technology can be used to provide the robot with the exact coordinates of the target.
III. Object Sorter- The multipurpose robot can be used for sorting of different items in the field of “Industrial & Mechanical Engineering” which involve joining of huge assemblies but sorting out different components & then assembling them based on the net product.” Food Processing & Packaging” extensively involves separating of various food items for example candies to be packed can be sorted out into different containers using this robot which makes use of a light sensor to detect the kind of object passing beneath it by change in the wavelength & frequency detected.
IV. Ball Spinner & Shooter-This robot can be used to train the sportsman & is extensively used in sports like “Baseball”,” Cricket” & many other sports. A slight modification in the mechanical components of the robot can produce a “Ball Spinner & Shooter Robot”.
A large number of applications are possible with this single robot thus providing it multiple dimensions of usage in different field.
Limitations
· The height of feeding mechanism of disks is high so it needs a separate person or machine to feed in the disks or missiles
· IR communication limits the usage of this robot due to its feature of Line of Sight which can cause the robot to respond late or to loose some instructions if its out of the range of the IR Tower
Future Technology Implementation
· Bluetooth Control- Currently the robot can be controlled by a mobile device, which supports HID. This feature provides the user with keyboard mapping feature.
· SMS Control-An SMS control for the robot can be easily made whereby the PC reads the SMS sent to the control phone attached to the PC. As soon as the PC reads this SMS an appropriate command based on the contents of the SMS can be sent to the Robot via IR tower.
· Remote Location Control via Internet – This feature can provide a revolutionary control to the robot whereby a user sitting in New York can send commands to a PC in India & control the Robot.
Program:
The Program consists of two parts:
Part I : The software running at the PC end.
Part II: The software running at the robot end.
Part I:
import java.io.*;
import josx.rcxcomm.*;
public class MissileSend
{
RCXPort port;// Port to send and receive data from RCX
InputStreamReader stdin;//input stream from console i.e the user input
BufferedReader console;//converts the inputstream from console to BufferReader
int[] data=new int[4];// four data bytes are sent 0 for time; 1 for direction;2 for
frequency;3 for power;
//constructor called to initialize values
public void MissileSend()
{
}
public static void main(String[] args)
{
MissileSend ms=new MissileSend();
ms.missilesend();
}
/* frequency is setting the power for setting the speed of the conveyor belt
power sets the power at which disc is shot i.e Tyres
time is setting the time for which motor is run to obtain the direction
decide sets east or west
direction is input by the user to set the direction
calculate is calculated by compiler by divinding it by 360 & taking that it takes
9 secs for 360
*/
private void missilesend()
{
/* Three functions take input from the user to set the value of
frequency(Motor.C), Power (Motor.B)
& Direction (Motor.A).
For Motor C & B we only get Power
For Motor A we get time & direction i.e Clockwise/ Anticlockwise
After obtaining all the inputs from the user it is send to RCX via the
rcxsend function
*/
getFrequency();
getPower();
getDirection();
rcxsend();
rcxreceive();
}
private void getFrequency()// User input function to input frequency
{
int frequency=0;
String s1;
stdin =new InputStreamReader(System.in);
console =new BufferedReader(stdin);
try
{
System.out.println("Enter the freqeuncy power");
s1 = console.readLine();
frequency = Integer.parseInt(s1);
System.out.println("Power entered ="+frequency);
data[2]=frequency;
}
catch(IOException ioex)
{
System.out.println("Input error");
System.exit(1);
}
}
private void getPower()// User input function to input power
{
int power=0;
String s2;
stdin =new InputStreamReader(System.in);
console =new BufferedReader(stdin);
try
{
System.out.println("Enter the power");
s2 = console.readLine();
power = Integer.parseInt(s2);
System.out.println("Power entered ="+power);
data[3]=power;
}
catch(IOException ioex)
{
System.out.println("Input error");
System.exit(1);
}
}
private void getDirection()// User input function for direction
{
stdin =new InputStreamReader(System.in);
console =new BufferedReader(stdin);
int time,decide;
float direction=0,calculate;
String s3,s4;
try
{
System.out.println("Enter the direction :1 for E/2 for W");
s3 = console.readLine();
decide = Integer.parseInt(s3);
System.out.println("Enter the direction angle");
s4 = console.readLine();
direction = Float.parseFloat(s4);
System.out.println("direction entered ="+direction);
calculate=(direction*18000)/360;//18 seconds for each revolution i.e
360 hence calcuates for user input angle
System.out.println("Calucalted direction="+calculate);
time=(int)calculate;//converting float calculate to integer time
System.out.println("Time send to RCX : "+time);
data[1]=decide;//direction send as 1st element
data[0]=time;//time send as second element
}
catch(IOException ioex)
{
System.out.println("Input error");
System.exit(1);
}
}
private void rcxsend()
{
try
{
port=new RCXPort();
OutputStream os=port.getOutputStream();
DataOutputStream dos=new DataOutputStream(os);
for(int idx=0;idx<=3;idx++)
{
dos.writeInt(data[idx]);// 4 integers send by compiler 1st for direction,2nd for time,3rd for
frequency,4 for power
dos.flush();
}
}catch(IOException e) { System.err.println(e);
}
}
private void rcxreceive()
{
DataInputStream dis;
dis=new DataInputStream(port.getInputStream());
try
{
while(true)
{
System.out.println("Number fired:"+dis.readInt());
}
}catch(IOException ie){}
}
}
Part II:
import josx.platform.rcx.*;
import josx.rcxcomm.*;
import java.io.*;
public class Missile implements SensorListener
{
RCXPort port;
DataInputStream in;
DataOutputStream out;
private int time=0,direction=0,frequency=0,power=0;//time for Motor.A ,direction 1/2 for E/W, frequency for Motor.C and power for Motor.B
private int number;// to count the number of missile fired private boolean detect;// to detect the presence of missile below the light sensor
public Missile()
{ /* the following code Initializes the input stream i.e from Pc TO rCX*/
try
{
port=new RCXPort();
in=new DataInputStream(port.getInputStream()); //
out=new DataOutputStream(port.getOutputStream());
}catch(IOException ie){}
}
public static void main(String[] args)
{
Missile missile=new Missile();
missile.rcxoperation();
}
private void rcxoperation()
{
int number=0;
try
{
while(true)// the while loop scans the input stream & calls the appropriate function after getting all the values
{
if(number==0)//first integer sets the time based on the angle entered
{
time=in.readInt(); number++;
}
else if(number==1)// second integer sets time and move motor A i.e set direction
{
direction=in.readInt();
number++;
}
else if(number==2)// 3rd integer set frequency
{
int frequency=in.readInt();
Motor.C.setPower(frequency);
number++;
}
else if(number==3)//4th integer sets power
{
int power=in.readInt();
Motor.B.setPower(power);
number++; operation();//once all the inputs are read from PC begin their execution
}
else if(number==4)
{
feedbackRCX();//CALLS the feedback from RCX and sends the info to computer
number=0;//resets the number to zero and again waits for command from computer
}
}
}catch(IOException ie) { LCD.showNumber(8888); }
}
private void operation()
{
direction();//sets the required direction
fire();// fires the missile by switching on the conveyor belt and the wheels
}
private void direction()
{
boolean dirnach=false;//checks whether required direction has been achieved or not
Motor.A.setPower(7);
if(!dirnach)// if required direction has not been achieved then continue till we obtain and then
move to moving motor B & C
{
if(direction==1)//if user inputs 1 then take the time calculated
{
Motor.A.forward();
}
else if(direction==2)//if user inputs 2 then add some time to time calculated as motor runs slow
in other direction
{
Motor.A.backward();
time+=1500;//time added as time uneven
}
try
{
Thread.sleep(time);//motor runs for specified time
}catch(InterruptedException e){}
Motor.A.stop(); dirnach=true;
}
}
private void fire()
{
Sensor.S2.setTypeAndMode(SensorConstants.SENSOR_TYPE_LIGHT,SensorC onstants.SENSOR_MODE_PCT);
Sensor.S2.addSensorListener(this);
Sensor.S2.activate();
Motor.B.backward();
Motor.C.forward();
try
{
Thread.sleep(10000);// assuming it takes 10 secs to fire
}
catch(InterruptedException e){}
Motor.C.stop();
Motor.B.stop();
}
private void feedbackRCX()
{
detect=false;
number=0;
out=new DataOutputStream(port.getOutputStream());
while(true)
{
Motor.B.backward();
Motor.C.forward();
}
}
public void stateChanged(Sensor aSource,int Old,int New)
{
if((New>=35)&&(!detect))
{
detect=true;
number++;
LCD.showNumber(New);
try
{
out.writeInt(number);
}catch(IOException ie)
{
LCD.showNumber(8888);
}
}
else
if(New<=32)
{
LCD.showNumber(New);
detect=false;
}
}
}
Screen Shots:


2 Comments:
Conservative bloggers
BELTWAY BLOGROLL Who Matters More, RedState Or James Dobson? The directors at the conservative RedState blog waited less than a day after President Bush picked Harriet Miers for the Supreme Court to proclaim ...
Find out how you can buy and sell anything, like things related to music on interest free credit and pay back whenever you want! Exchange FREE ads on any topic, like music!
I really enjoyed your blog. This is a cool Website Check it out now by Clicking Here . I know that you will find this WebSite Very Interesting Every one wants a Free LapTop Computer!
Post a Comment
<< Home