Shop OBEX P1 Docs P2 Docs Learn Events
Radio Control BoeBot — Parallax Forums

Radio Control BoeBot

justinrumpf.comjustinrumpf.com Posts: 5
edited 2008-12-20 05:26 in BASIC Stamp
I have been creating different things with my BoeBot Kit for a while now and looking to try something more advanced.

I want to create a robot that can go from autonomous to RC controlled and I am looking for someone who has done this and has already outlined the project before I buy any expensive parts.

I already have a robot chassis with 2 motors. I want to buy a motor controller and use my RC radio to control the whole thing.

I have played with my RC radio set and am able to pick up signals from the receiver and do certain things, but many motor controllers like Pololu Trex have RC hook-ups to all the RC channels (if needed) and channel 5 toggles between autonomous (serial) and RC.

This sounds just like what I want to do. Has anyone used this, and extra things I need to know about before buying my parts?

Can someone vouch for the Pololu trex? what rc radio set did you use?

Thanks,
Justin

Comments

  • Tom CTom C Posts: 461
    edited 2008-12-17 12:32
    justinrumpf.com

    Take a look at the attached UAV BS2p code as an example.

    Regards,

    TCIII

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
  • justinrumpf.comjustinrumpf.com Posts: 5
    edited 2008-12-18 01:26
    Very nice: +rep
  • J^3J^3 Posts: 121
    edited 2008-12-18 02:48
    Justin,

    ··· I have done something simillar using an old RC transmitter and reciever, a BS2, and a pololou dual·micro motor controller.· I used the BS2 to read the outputs of the reciever with the PULSIN in command, and then scaled the time from 0 to 127, so that I could send that value to the motor controller for the speed of each motor (right and left wheel).· If the BS2 did not see any activity on the throttle line the bot would switch to autonomous mode, and use a Ping )))·sensor to roam the room.· As soon as the BS2 reconized me pulling the throttle trigger it would switch back to manual mode.

    ··· The·drivetrain I used was a set of Tamiya gear boxes with three volt motors.· It was pretty cool, but now I am switching it over to a PS2 controller and using the RF transmitter package from Parallax.· If you have 2 BS2s you can use one to read the PS2 controller and send data with the transmitter, and· have·the other·BS2 with the reciever on the bot.· This is a little more expensive setup, but you will have more options.· I will get some pics posted as soon as I can.



    Hope I was of some help, JJ.

    PS2 controll with RF is a work in progress, but I should have a rough draft done tonight.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are 10 types of people that understand binary, those who do, and those who don't.

    Post Edited (JJ) : 12/18/2008 2:57:57 AM GMT
  • J^3J^3 Posts: 121
    edited 2008-12-18 05:06
    As promised heres a rough draft of the RF PS2 controlled bot
    ' File:PS2_Controller_RF.bs2
    ' Author:Justin Jordan
    ' Date:12-17-08
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    ' {$PORT COM5}
    '----Program Description-------------------------------------------------------
    'Read data from a PS2 Dualshock controller
    'and send DATA to robot using RF modules.
    'Based off code written by John Williams.
    '----PIN Declaration-----------------------------------------------------------
    Clk     PIN 0
    Att     PIN 1
    Cmd     PIN 2
    Dat     PIN 3
    RF_txmt PIN 15
    '----Constants-----------------------------------------------------------------
    Bps CON 84
    '----Variables-----------------------------------------------------------------
    'For PS2 controller
    psxout      VAR Byte
    psxin       VAR Byte
    psxid       VAR Byte
    psxstatus   VAR Byte
    switches0   VAR Byte
    switches1   VAR Byte
    rjoystick_x VAR Byte
    rjoystick_y VAR Byte
    ljoystick_x VAR Byte
    ljoystick_y VAR Byte
    idx         VAR Nib
    'For Motor Controller
    speed0      VAR Byte
    speed1      VAR Byte
    motor0      VAR Byte
    motor1      VAR Byte
    '----EEPROM DATA---------------------------------------------------------------
    '----Initialization------------------------------------------------------------
    DEBUG CLS
    DIRA = %0111
    '----Program Code---------------------------------------------------------------
    Main:
      DO
        GOSUB Get_Data                                  'Get PS2 Data
        IF rjoystick_y > 154 THEN
          speed0 = rjoystick_y*/$0144 -195               'Calculate rev speed0
          motor0 = 0
        ELSEIF rjoystick_y < 101 THEN
          speed0 = -(rjoystick_y*/$0144) + 127           'Calculate Fwd speed0
          motor0 = 1
        ELSE
          speed0 = 0
        ENDIF
        IF ljoystick_y > 154 THEN
          speed1 = ljoystick_y*/$0144 -195               'Calculate rev speed1
          motor1 = 2
        ELSEIF ljoystick_y < 101 THEN
          speed1 = -(ljoystick_y*/$0144) + 127           'Calculate Fwd speed1
          motor1 = 3
        ELSE
          speed1 = 0
        ENDIF
        PULSOUT RF_txmt, 1200
        SEROUT RF_txmt, Bps, [noparse][[/noparse] "#", motor0, speed0, motor1,
                              speed1, switches0, switches1]
      LOOP
    '----Subroutines---------------------------------------------------------------
    Get_Data:
      LOW Att
      psxout = $01 : GOSUB PSX_TxRx
      psxout = $42 : GOSUB PSX_TxRx
      psxid  = psxin
      psxout = $00 : GOSUB PSX_TxRx
      psxstatus = psxin
      GOSUB PSX_TxRx : switches0 = psxin
      GOSUB PSX_TxRx : switches1 = psxin
      GOSUB PSX_TxRx : rjoystick_x = psxin
      GOSUB PSX_TxRx : rjoystick_y = psxin
      GOSUB PSX_TxRx : ljoystick_x = psxin
      GOSUB PSX_TxRx : ljoystick_y = psxin
      HIGH Att
    RETURN
    PSX_TxRx:
      FOR idx = 0 TO 7
        Cmd = psxout.LOWBIT(idx)
        Clk = 1
        psxin.LOWBIT(idx) = Dat
        Clk = 0
      NEXT
    RETURN
      DEBUG "psxid = ", HEX psxid, CLREOL,CR,      'Move inside loop for troubleshooting
          "psxstatus = ", HEX psxstatus, CLREOL, CR,
          "Lft, Dwn, Rgt, Up, Start, Joyr, Joyl, SELECT  = ", BIN8 switches0, CR,
          "sq, x, cir, tri, R1, L1, R2, L2  = ", BIN8 switches1, CR,
          "Rjoystick_X  = ", DEC rjoystick_x, CLREOL, CR,
          "Rjoystick_Y  = ", DEC rjoystick_y, CLREOL, CR,
          "Ljoystick_X  = ", DEC ljoystick_x, CLREOL, CR,
          "Ljoystick_Y  = ", DEC ljoystick_y, CLREOL, CR,
          "Speed0 = ", DEC speed0, CLREOL, CR,
          "Speed1 = ", DEC speed1, CLREOL, CR
    DEBUG HOME
    

    (replace this text with your code)
    

    (replace this text with your code)
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are 10 types of people that understand binary, those who do, and those who don't.
    3072 x 2304 - 716K
    3072 x 2304 - 653K
    3072 x 2304 - 678K
  • J^3J^3 Posts: 121
    edited 2008-12-18 05:09
    Sorry about the clock, selected wrong picture.· Thhis is the code on the bot
    ' File:RF_Bot
    ' Author:Justin Jordan
    ' Date:12-17-08
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    ' {$PORT COM4}
    '----Program Description-------------------------------------------------------
    'Recieve Data using RF modules to control robot.
    '----PIN Declaration-----------------------------------------------------------
    RF_recv PIN 13
    Reset   PIN 14
    M_Data  PIN 15
    '----Constants-----------------------------------------------------------------
    Bps CON 84
    '----Variables-----------------------------------------------------------------
    motor0    VAR Byte
    speed0    VAR Byte
    motor1    VAR Byte
    speed1    VAR Byte
    switches0 VAR Byte
    switches1 VAR Byte
    '----EEPROM DATA---------------------------------------------------------------
    '----Initialization------------------------------------------------------------
    DEBUG CLS
    HIGH M_Data
    LOW Reset
    HIGH Reset
    PAUSE 1000
    '----Program Code---------------------------------------------------------------
    Main:
    DO
      SERIN RF_recv, Bps, [noparse][[/noparse]WAIT ("#"), motor0, speed0, motor1,
                           speed1, switches0, switches1]
      IF switches1.BIT4 = 0 THEN                      'Reset Motor controller
        Reset = 0
      ELSE
        Reset = 1
      ENDIF
      SEROUT M_Data, Bps, [noparse][[/noparse]$80,0,motor0,speed0]       'Send data to motor controller
      SEROUT M_Data, Bps, [noparse][[/noparse]$80,0,motor1,speed1]
    LOOP
    '----Subroutines---------------------------------------------------------------
       DEBUG DEC motor0,CR,CLREOL,       'Move inside loop for troubleshooting
          DEC speed0,CR,CLREOL,
          DEC motor1,CR,CLREOL,
          DEC speed1,CR,CLREOL,
          BIN8 switches0, CR, CLREOL,
          BIN8 switches1, CR, CLREOL
      DEBUG HOME
    

    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are 10 types of people that understand binary, those who do, and those who don't.

    Post Edited (JJ) : 12/18/2008 5:37:46 AM GMT
  • agfaagfa Posts: 295
    edited 2008-12-18 13:25
    Nice bot.

    I like the wheels.

    Resourceful.
  • J^3J^3 Posts: 121
    edited 2008-12-18 22:04
    Completed RF bot

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are 10 types of people that understand binary, those who do, and those who don't.
    3072 x 2304 - 633K
  • GeorgeLGeorgeL Posts: 131
    edited 2008-12-20 05:26
    Hey, I did something quite similar, except its not really autonomous...well in a sense it is. You get to control it and it overrides your control if you crash. This is what I made: http://www.parallax.com/tabid/723/Default.aspx
Sign In or Register to comment.