Multifunction Mobile Robot, Product Code:PR23

LED Blinking, Walking with Cytron Servo, Displaying RFID, Multi-function Mobile Robot......

Re: Multifunction Mobile Robot, Product Code:PR23

Postby jack » Tue Jun 01, 2010 2:56 pm

Helo

My pr23 now can run smoothly based on the code provided using analog distance sensor.
Based on the source code given, by using analog distance sensor, if the robot will detect an obstacle,it will maintain a certain distance from the obstacle.

But now, I want to make the pr23 capable to follow a moving object with variable speed (sometime fast sometime slow) or let say to keep a distance from the moving object.

So, my question, is it possible to do that and what is the first thing should I do ?
- jack2010
jack
Freshie
 
Posts: 5
Joined: Thu Apr 08, 2010 5:35 am

Re: Multifunction Mobile Robot, Product Code:PR23

Postby ober » Tue Jun 01, 2010 3:12 pm

It is possible with the assumption the object is within the range of infrared sensor and it is flat.

Modifying the source code is a must, but understanding the original source code will help you.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: Multifunction Mobile Robot, Product Code:PR23

Postby lagend » Thu Sep 02, 2010 5:57 pm

Hi,
I have one question. i read a discription, inform can follow line by using sensor. myquestion is this robot can avoid obstacle as a same time. and how i can buy this robot. is it complete install and programming robot or need install ownself. im stay at penang. how i can contact you. please reply my mail soon.thanks
lagend
Greenhorn
 
Posts: 2
Joined: Thu Sep 02, 2010 5:46 pm

Re: Multifunction Mobile Robot, Product Code:PR23

Postby robosang » Thu Sep 02, 2010 8:39 pm

lagend WROTE:Hi,
I have one question. i read a discription, inform can follow line by using sensor. myquestion is this robot can avoid obstacle as a same time. and how i can buy this robot. is it complete install and programming robot or need install ownself. im stay at penang. how i can contact you. please reply my mail soon.thanks


:o Is a DIY project brother, Do It Yourself :mrgreen:
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: Multifunction Mobile Robot, Product Code:PR23

Postby hyng » Thu Sep 02, 2010 8:54 pm

lagend WROTE:Hi,
I have one question. i read a discription, inform can follow line by using sensor. myquestion is this robot can avoid obstacle as a same time. and how i can buy this robot. is it complete install and programming robot or need install ownself. im stay at penang. how i can contact you. please reply my mail soon.thanks


For the given sample code, this robot won't perform both tasks at a same time but you can modify the code to suit your will!
You can buy it online at cytron website. FYI, all the DIY sets are not ready installed. You have to solder the components and assembled it all by yourself in order to learn the soldering skill as well as understand the basic electronic. One more things is you will need a programmer to program the robot.
User avatar
hyng
Moderator
 
Posts: 292
Joined: Thu Apr 16, 2009 11:35 am

Re: Multifunction Mobile Robot, Product Code:PR23

Postby lagend » Fri Sep 03, 2010 4:39 pm

hi thanks for your immediate reply. one more question, so, i need program PIC myself or its already programmed.
lagend
Greenhorn
 
Posts: 2
Joined: Thu Sep 02, 2010 5:46 pm

Re: Multifunction Mobile Robot, Product Code:PR23

Postby sich » Fri Sep 03, 2010 5:31 pm

No, it's not preprogrammed.
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm

Re: Multifunction Mobile Robot, Product Code:PR23

Postby sure05resh » Sun Oct 31, 2010 9:29 pm

hi there.. im doin a project similiar to (similiar to PR 23 : Multifunction Mobile Robot).

i just want the Xbee Module mode only, since im gonna control my car using skxbee from my pc.. but im using DC motor rather than servo motor.

I need urgent help regarding the programming since im kinda weak in interrupt :(

below is my idea hw the programming should b:

from hyperterminal(computer)-> press 8 on keyboard
V
SKXBee will transmit (connect to computer using USB)
V
SKXBee(mounted at the car) will receive the data
V
PIC( receive the data by UART)
V
DC motor rotate(car move forward)

hope u guys can help to solve my problem.. thx

CODE: SELECT_ALL_CODE
//   include
#include <pic.h>

//   configuration
__CONFIG ( 0x3F32 );


unsigned char data[0] = {0};
unsigned int result;
unsigned int To=0,T=0,TH=0;
unsigned char REC;
unsigned char i=0;
unsigned int us_value (unsigned char mode);

//   function prototype
void init(void);
void wireless_xbee(void);
void forward(void);
void stop (void);
void backward (void);
void reverse (void);
void left(void);
void right(void);
unsigned char uart_rec(void);

//   interrupt prototype
static void interrupt isr(void)
{
   if (TMR0IF)         // TMR0 is overflow
   {
      TMR0IF = 0;    // clear flag bit
      To +=0x100;   // count number of TMR0 overflow ( make it to 16bit TMR)
   }
      
   if(RBIF)         // there is change bit on RB4-RB7
   {
      RBIF = 0;      //                                           ____
      if (RB4)      // Rb4 is 1 mean is rising form 0  __|         
      {
         TMR0 = 0;   // clear all counter involved, start new count for period of RB4 high
         To = 0;
      }
                                          //                                                   ___
      else TH = TMR0 + To;   // RB4 is 0 mean is falling form 1       |_____  // save TH, RB4 high period
   }

   if(RCIF)
   {
      RCIF = 0;                  // clear flag bit

      if (RCREG == 'R') data[i=0]= RCREG;      // check if start byte 'R' is met       
      else if (RCREG == 100) data[i=0]= RCREG;   // check if start byte 'd'(decimal 100) is met
      if ((data[0] == 'R'))data [i++] = RCREG;   // save the data in data array
      if (i>4) i = 4;   // if the data array reached max, set the index to 4
   }
}


//   main function

void main(void)
{
   
   init();         // initiate cnfiguration and initial condition
                     
   while(1)               // loop
   {
      wireless_xbee();      
   }
}


// Initailization
void init()
{

   // Tris configuration (input or output)
   TRISD = 0x00;            //set all PORTD pin as output

   // TMR 0 configuation
   T0CS = 0;                  
   PSA = 0;                  
   PS2 = 1;                  // prescale 1:32
   PS1 = 1;                  //
   PS0 = 1;                  //
   TMR0IE = 1;                  // TMR0 Interrupt
   TMR0 = 0;

   //setup UART
   SPBRG = 0x81;                  //set baud rate to 9600 for 20Mhz
   BRGH = 1;                     //baud rate high speed option
   TXEN = 1;                     //enable transmission
   TX9 = 0;
   CREN = 1;                     //enable reception
   SPEN = 1;                     //enable serial port
   RX9 = 0;
   RCIE = 1;                  //enable interrupt on eachdata received

   // enable all unmasked interrupt   
   GIE = 1;
   PEIE = 1;

   
   TX_PIN = 1;
   stop();                                 
}



//Mode 4 :  Xbee
// Description : Control the robot using UART ( XBEE or an UART wireless module.
void wireless_xbee (void)      
{
while(1)                                          // looping forever
   {
      if( data[0] ==  100)      // check if UART start byte is met
      {
         while(1)
         {
         
if (RCREG =='8')                                    // if character '8' is detected, the robot move forward
            {
               forward();
            }

else if (RCREG == '2')                                 // if character '2' is detected, the robot move backward
            {
               backward();
            }
else if (RCREG == '6')                                 // if character '6' is detected, the robot turn right
            {
               right();
            }

else if (RCREG == '4')                                 // if character '4' is detected, the robot turn left
            {
               left();
            }

else if (RCREG == '5')                                  // if character '5' is detected, then stop the robot
            {
               stop();
            }

            else                                              // else then stop the robot
            {
               stop();
            }
         }
      }
      else
      {
      }
   }
}


// Motor control function
// Description : subroutine to set the robot moving direction

void forward ()
{

}
void backward ()
{

}
void left()
{

}
void right()
{

}
void stop()
{

}


// uart function
unsigned char uart_rec(void)      //function to wait for a byte receive from uart
{
   unsigned char temp;
   while(RCIF==0);               //wait for data to received
   temp=RCREG;               
   return temp;               //return the received data
}

sure05resh
Newbie
 
Posts: 13
Joined: Thu Oct 14, 2010 12:34 pm

Re: Multifunction Mobile Robot, Product Code:PR23

Postby robosang » Mon Nov 01, 2010 9:33 am

Just realize that you have posted multiple same question :shock:
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: Multifunction Mobile Robot, Product Code:PR23

Postby shiyan » Mon Nov 01, 2010 9:51 pm

robosang, where? So should I reply here?
User avatar
shiyan
Amateur
 
Posts: 189
Joined: Wed Jun 09, 2010 10:59 am

PreviousNext

Return to DIY Project Set

Who is online

Users browsing this forum: No registered users and 18 guests

cron