Author Topic: Robot  (Read 3061 times)

0 Members and 1 Guest are viewing this topic.

Offline MasterRykoTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Robot
« on: June 18, 2007, 10:09:32 AM »
I am building a robot that follows light.  I have a two motor setup with the front motor being a servo that controls either going left or right, and a rear drive motor.  My plan is to use 2 photoresistors to control the servo for steering, and a Sharp IR range finder to control the rear motor so that if it comes to close to the light source it will stop automatically.  Does sound like a logical design? 

Offline Dosbomber

  • Jr. Member
  • **
  • Posts: 33
  • Helpful? 0
Re: Robot
« Reply #1 on: June 24, 2007, 12:40:35 PM »
It's more common to see the two motors on either side of the robot (left and right), with each motor increasing or decreasing speed relative to the other to make it turn one direction or the other.  In other applications it also allows a zero-point-turn.

It should work, more or less, but be advised that a wheel configuration such as this will mandate a "turning radius" which may cause problems in some circumstances.

I'm interested in seeing a picture of your "motorcycle-like" wheel configuration.
Dosbomber

Offline maverick monk

  • Robot Overlord
  • ****
  • Posts: 204
  • Helpful? 0
Re: Robot
« Reply #2 on: June 24, 2007, 05:56:10 PM »
if it must only travel on a flat surface maby it could be a 3 wheeler, 2 drive wheels in back and a servo driving a 3rd steering wheel

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Robot
« Reply #3 on: June 27, 2007, 06:59:28 PM »
http://www.societyofrobots.com/programming_differentialdrive.shtml

Quote
and a Sharp IR range finder to control the rear motor so that if it comes to close to the light source it will stop automatically.
This will work.

Another method I have used is this:

if (light_sensors detect a really bright light) // robot is close to light source
   then stop_motor();

Offline MasterRykoTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Re: Robot
« Reply #4 on: July 13, 2007, 10:19:46 AM »
http://www.societyofrobots.com/programming_differentialdrive.shtml

Quote
and a Sharp IR range finder to control the rear motor so that if it comes to close to the light source it will stop automatically.
This will work.

Another method I have used is this:

if (light_sensors detect a really bright light) // robot is close to light source
   then stop_motor();
How would you do this : if (light_sensors detect a really bright light) // robot is close to light source
   then stop_motor();
 so far my coding for my photoresistors looks like this:
int main(void)
{

int sensor_left=0;
int sensor_right=0;
int threshold=4;


while(1)
{

sensor_left=a2dConert8bit(5);
sensor_right=a2dConvert8bit(4);

if(sensor_left > sensor_right && (sensor_left - sensor_right) > threshold)
         {
         
         PORTD |=1<<PD2;
         PORTD &= !(1<<PD1);
         PORTD |=1<<PD4;
         
         }

      else if(sensor_right > sensor_left && (sensor_right - sensor_left) > threshold))
         {
         
         PORTD &=!(1<<PD0);
         PORTD |=1<<PD3;
         PORTD |=1<<PD4;
         
         }
   
   }

One other question I have is, If i set a port to low, is it considered to be grounded?  If not, is there a way to set a port to ground? 
Thanks

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Robot
« Reply #5 on: July 15, 2007, 02:51:24 PM »
Quote
How would you do this
http://www.societyofrobots.com/downloads/sbs_source_photovore_v1.zip

Quote
One other question I have is, If i set a port to low, is it considered to be grounded?
For all intents and purposes, yes.

 


data_list