Shop OBEX P1 Docs P2 Docs Learn Events
EVA My little friend goes to school. — Parallax Forums

EVA My little friend goes to school.

slamerslamer Posts: 52
edited 2007-03-06 05:27 in Robotics
I've been wondering around some of the Robots forums on the web lately just to see what the autonomus guys build. It's funny how most of them have a huge rats nest of wiring in their projects. This is sorta understandable since it takes a lot of wires to talk to even a simple PIC computer and let it control even a simple machine. Anyways I finally got around to modifying EVA to give her a little of both schools of robotic control. EVA is now both Autonomus and a ROV at the flick of a switch on my transmitter. Right now she a little blind since·I don't have her eyeballs intalled but she has 4 switches to tell her little brain·when she runs into things. I call this the Bump and Go mode. One of the problems that·I had to solve was·is the typical wanting a PIC computer to do more than one thing at a time. ·I already knew that yes a Basic Stamp2 can read the signal from a Receiver and yes it can talk to a speed controller. But when you want it to read several receiver channels and keep sending pulses to the speed controllers the computer starts to get loaded up and the motion gets really Jerky. So in this version·I added a servo control board to take the load off of the BASIC stamp2 and now the motion is nice and smooth. ·And by golly it actually works. So at this point I've created my own Rats nest of wiring. It's almost too simple this Tele-Autonomus stuff.



Eva with her little claw and wireless camera and mount for the Tele-operated mode. In teleoperated mode she can actually open the refrigerator door and grab a can

·EVASM3.jpg

Eva and the latest Rats nest of wires. I need to do a bit of clean up now that she's working in both modes

EVASM13.jpg

Eva video doing the refrigerator run in First Person·tele-operated mode I drive her by watching the video feed on a television. Hopefully someday I can teach her how to do this by herself.

http://www.youtube.com/watch?v=_X5_R0a10Bg

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
undefinedundefinedundefinedundefinedSteven Kirk Nelson (slamer)

Team K.I.S.S
Build Safe, Build Mean, Build Strong!

Post Edited (slamer) : 3/6/2007 3:26:46 AM GMT

Comments

  • slamerslamer Posts: 52
    edited 2007-03-06 05:27
    The software is a bit messy but at least its working... I'm actually happy with how easy it is to use the examples provided in the parallax books and kits. Most of this program is modified (just a bit) from whats used with the BOE Bot.. ********************

    ··' {$STAMP BS2}
    ······· '{$PBASIC 2.5}

    'radio or autonomus control with the Basic Stamp 2 using the serial servo control board

    'Variables
    ch VAR Byte
    ch1 VAR Byte
    ch2 VAR Byte
    ch3 VAR Byte
    pw VAR Word
    pw1 VAR Word
    pw2 VAR Word
    pw3 VAR Word
    x VAR Byte
    ra VAR Byte 'servo seek rate


    'switch Variables
    leftfront VAR Bit
    rightfront VAR Bit
    leftrear VAR Bit
    rightrear VAR Bit
    dipswitch1 VAR Bit

    Sdat CON 15·· 'serial communication channel pin 15 from stamp to servo control board
    baud CON 396· 'baud rate
    ra = 7· 'servo control board servo seek position rate
    ch = 0 'servo control board output pin
    ch1 = 1· 'servo control board output pin
    x=0

    ·channel0 VAR Word
    ·channel1 VAR Word
    ·channel2 VAR Word
    ·channel3 VAR Word
    ·channel4 VAR Word

    ·'This program READs multiple 75 Mhz radio reciever servo output channels.
    · 'by scanning the Pulse Width Modulation OUTPUT frequency of each channel

    ' Aproxamately a pulsewidth reading of 750 is stick centered on transmitter
    ' test for tranmitter stick movement from center position then jump to subroutines to move servos and robot
    ·· 'Test· 4 Receiver channel outputs with the Pulsin command by reading servo signal line
    '·· Receiver outputs connected to pin zero through pin 3 on the Board of Education

    'Use (1) FOR logic HIGH OR (0) FOR logic LOW in pulsin command trigger threshold


    Receiver:
    ·· 'Read the signals from the receiver and sends the values to the servo control board
    ·· 'the signals from the servo control board is then sent to the speed controllers.
    ·· 'Standard Teleoperated mode unless channel2 variable changes
    DO

    ··· PULSIN 0,1,channel0 'Measure receiver positive pulse pin p0
    ··· PULSIN 1,1,channel1 'Measure receiver positive pulse pin p1
    ··· PULSIN 2,1,channel2 'Measure receiver positive pulse pin p2
    ·· 'PULSIN 3,1,channel3 'Measure receiver positive pulse pin p3····· 'future use
    ·' check receiver to activate autonomus mode actually channel 5 on receiver


    ·IF channel2· > 1000· THEN AutoEVA
    ·· pw = channel1
    ·· pw1 = channel0

    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch1, ra, pw1.LOWBYTE, pw1.HIGHBYTE, CR]

    LOOP

    '**********************************


    'Drive motor controls

    motorstop:
    pw=781
    pw1= 784
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch1, ra, pw1.LOWBYTE, pw1.HIGHBYTE, CR ]
    RETURN
    END

    Forward:
    ·x=0
    DO
    pw=850
    pw1=450
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch1, ra, pw1.LOWBYTE, pw1.HIGHBYTE, CR ]
    x=x+1
    LOOP UNTIL x=30
    IF x=30 THEN GOSUB motorstop
    ·RETURN


    Backward:
    ·x=0
    DO
    pw=450
    pw1=850
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch1, ra, pw1.LOWBYTE, pw1.HIGHBYTE, CR ]
    x=x+1
    LOOP UNTIL x=30
    IF x =30 THEN GOSUB motorstop
    ·RETURN


    Turnright:
    x=0
    DO
    pw=850
    pw1=850
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch1, ra, pw1.LOWBYTE, pw1.HIGHBYTE, CR ]
    x=x+1
    LOOP UNTIL x=30
    IF x =30 THEN GOSUB motorstop
    ·RETURN


    Turnleft:
    ·x=0
    DO
    pw=450
    pw1=450
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch1, ra, pw1.LOWBYTE, pw1.HIGHBYTE, CR ]
    x=x+1
    LOOP UNTIL x=30
    IF x =30 THEN GOSUB motorstop
    ·RETURN




    '****************************
    AutoEVA:


    GOSUB motorstop
    'PAUSE 10000
    DO
    'checkswitchs bump and go mode
    checkswitch:
    PULSIN 2,1,channel2 'Measure receiver positive pulse pin· 2
    IF channel2· < 1000· THEN Receiver· 'check for RC control mode
    'get EVA moving until she bumps into something
    pw=1050 'set speed
    pw1=650 'set speed
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch1, ra, pw1.LOWBYTE, pw1.HIGHBYTE, CR ]

    'enable bump switches
    rightfront = IN4
    rightrear = IN5
    leftfront = IN6
    leftrear = IN7
    dipswitch1 = IN11························· 'future use

    ·'test for collisions
    ·IF (leftfront = 0) AND (rightfront = 0) THEN ' Both front switches detect obstacle
    GOSUB Backward ' Back up & U-turn (left twice)
    GOSUB Turnleft
    GOSUB Turnleft

    ELSEIF (leftfront = 0) THEN ' Left front switch contacts
    GOSUB Backward ' Back up & turn right
    GOSUB Turnright

    ELSEIF (rightfront = 0) THEN ' Right front switch contacts
    GOSUB Backward ' Back up & turn left
    GOSUB Turnleft

    ELSEIF (leftrear = 0) THEN 'Left rear switch contact
    GOSUB Forward
    GOSUB Turnright

    ELSEIF (rightrear = 0) THEN 'Right rear switch contacts
    GOSUB Forward
    GOSUB Turnleft
    ENDIF

    LOOP
    RETURN


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    undefinedundefinedundefinedundefinedSteven Kirk Nelson (slamer)

    Team K.I.S.S
    Build Safe, Build Mean, Build Strong!

    Post Edited (slamer) : 3/7/2007 4:06:53 AM GMT
Sign In or Register to comment.