Monday, August 30, 2010

GUI dev for single robot.


A gist of what I have been developing for the past few days. Matlab had weird bugs. I never changed the code but it started running just today( waste of a week's hardwork on trying matlab to work for silly things ). 

Thursday, August 12, 2010

Driving to a point

Have been meddling with the driving to point business.
Wrote an algorithm that drives to any point in all the four quadrants with angle correction and distance correction. The encoder on the create is not very fine so dont be surprised if the robots turn back (while adjusting angle) or drive back ( while adjusting distance covered).

The entire code is in Drive2PointFB.m
:) Happy day.

Monday, June 28, 2010

travelDist

This function is perfect to make the robot go for a certain distance. 


My code:


% Program to make the robot run by setting specified distance.
comm = strcat('COM', num2str(8));
a = instrfind('port',comm);
[serialObject] = RoombaInit(8) ;
%initialize the port
pause (2)
%  Pause for 2 seconds
travelDist(serialObject,0.2,2)
% travel with speed of 0.2 m/s and distance of given mts.
[Distance] = DistanceSensorRoomba(serialObject);
% Read the distance traveled. 


The actual and experimental distance are almost equal. the error max is about 0.01 m and the actual distance is always higher. {but error is negligible}.
A few limitations: The speed could be set up using this function is in the range of 0.025m/s and 0.5m/s. If negative speed is entered, function uses absolute value. When this and turnAngle commands are used, they use the scripting from create Open Interface thus limiting to the fact tht until these commands are completed, it will not be able to accept any other commands. 


The travelDist function can be edited though!!












btw thanks to Dr.Joel Esposito. 
Citation: Esposito, Joel M., Barton, Owen, Koehler Joshua,  "Matlab Toolbox for the 
Create Robot", www.usna.edu/Users/weapsys/esposito/roomba.matlab/, 
Copyright 2008  




SetFwdVelocity

SetFwdVelocity

This is a function that comes with the Create tool box.  My code looks like this.



comm = strcat('COM', num2str(8));
a = instrfind('port',comm);
[serialObject] = RoombaInit(8) ;
%initialize the port
pause (10)
%wait for 10 sec --time to set the robot on the floor properly. just in case. :)
SetFwdVelRadiusRoomba(serialObject,0.1,1);
% setting the robot with fwd vel of 0.1m/s and turning radius of 2m/s
pause(10)
% wait for another 10 seconds ie run for 10 seconds
SetFwdVelRadiusRoomba(serialObject,0,2);
% setting the robot with fwd vel of 0m/s and turning radius of 2m/s..well ang vel doesnt matter anyway. 
% aka Stop
[Distance] = DistanceSensorRoomba(serialObject);
% reads the distance the robot has travelled since the last reading. 


The problems with this experiment is the distance read from the sensor never actually was in agreement with the expected results. There was always an error between the actual distance and expected distance and always, the actual distance is lesser. 


Also,  an interesting observation is that running this program over and over again, made the error lesser and lesser but it resets back to the same error after 5 or 6 runs. 


Could not find a solution for this except for using another function. 

Bluetooth Problems

Bluetooth connections were absolutely good without any hassle until I reached an infinte loop. When the infinite loop is executed, the robot started running continously when I opted to turn off the robot. And as expected, the power loss resulted in loss of bluettoth connection. At this point it became impossible to re-establish the bluetooth connection back even if the robot was turned on. At this point, the only solution that made things back to normal was the serial connection. { I gave the serial conenction, changed the port in the RoombaInit.m and ran. Luckily, this worked ;) }

Thursday, June 24, 2010

Simulations



Rectilinear Simulations
Both the wheel rotations are same and in the same direction.


Rotation Motion
Both these wheels have same rotations but in the opposite directions. 



Friday, May 28, 2010

Robot Dimensions

Create has a diameter of 13" 
Height: 3.75" : 95.25mm
Weight of robot: 8lbs: 3.62873896  
Radius of larger wheel : r :  1.216"
Radius of castor wheel: ro: 0.930"
Weight of larger wheel;
Wieght of castor wheel:
Weight of castor crank: 
Distance between wheels:l:10.469"
Castor offset  : 0.37625"


a+b : 11.6205"/2 = 5.81025"