Shop OBEX P1 Docs P2 Docs Learn Events
class project boe-bot + bs2 — Parallax Forums

class project boe-bot + bs2

mikeyjunomikeyjuno Posts: 15
edited 2010-11-30 15:51 in Robotics
Hi, our class is doing a project using boe-bots now that we got a b2s to work with instead of a bs2p we are actually on our way getting the thing going.

attached is our code so far. weve basically have been following the robotics with the boe-bot book and used the whisker code. ive been looking at different codes. i like the idea of having lights for when the whiskers are hit so i put that in there for thought. at the top is a basic rundown of what i want our project to do.

' Boe-Bot uses whiskers to detect objects, and when bumping into them tries to maneuver around them..
'Boe-bot will run while in a light area.
'Boe-bot when in a shaded area will
'stop moving
'activate a servo clockwise for a set amount of time.
'stop for ten seconds
'REVERSE the servo
'Then do a U-turn and continue on its course (start the main routine again..

also attached is a basic rundown of the obstical course we are going to build. we where basically inspired by the video our teacher showed us of a boe-bot that put out a fire. Also is a pic of our wiring so far which is pretty spaghetti atm :o

heres my questiong . i think the boe bot will navigate the course with the whisker code and i know how to call the turn/move commands. So all i need to figure out now is how to code in the photo resistor part. im new to this type of coding and i was wondering how do i add in the activation of the photo resistors as an interupt or do i do it as an other "else" in the main do code? the way i think of it and the way the robotics text describes it. the boebot pulses forward and checks to see if the whiskers are hit. all i want to do is have it look for the whiskers then do another check to see if the photo resistors see dark.

when it sees dark on both resistors it will activate a servo that we are going to plug into the 14 slot and run that for 10-15 seconds clockwise. wait a second then reverse it. this part should be fairly simple it should work just like the wheels. then it will do the left turn twice ect then start back on the origional code. The servo will be "jerry-rigged" to a spool and crane that we got from a fancy legolike toy kit. this will have a magnet on it and basically pick up paperclips or other magnetic material on the other end of the path.
so the overall goal of the project is to navigate to the material in a darkened area and pick it up with its magnetic crane then return with the stuff.
If anyone has an example of how to get a boe bot to do two things at once or how i could add the photo resistor activator ide greatly appreciate it.
thank you.
1280 x 1024 - 505K
819 x 460 - 51K

Comments

  • kwinnkwinn Posts: 8,697
    edited 2010-11-13 09:34
    The photo resistors could be checked either way (interrupt or polled in main loop). If the whiskers are polled the simplest would be to check the photo resistors as part of the same loop.
  • mikeyjunomikeyjuno Posts: 15
    edited 2010-11-13 10:58
    do i add that as another elseif in after the right and left whisker checks in the main loop?
  • mikeyjunomikeyjuno Posts: 15
    edited 2010-11-13 11:55
    heres what i added

    'ADded photo resistor section++++++++++++++++++++++++++++++++++++++

    ELSEIF (IN6 = 0) AND (IN3 = 0) THEN ' Both photoresistors detects ''''PHOTO RESISTOR CODE
    PULSOUT 14, 650 ' activates servo thats plugged into 14...
    PAUSE 10000 'PAUSE FOR ten seconds.
    PULSOUT 14, 900 'reverses the servo on 14
    PAUSE 1000 'waits a sec
    GOSUB Back_Up ' Back up & U-turn (left twice)
    GOSUB Turn_Left
    GOSUB Turn_Left


    ELSEIF (IN6 = 0) THEN ' Left photoresistor detects
    PULSOUT 4, 800
    PAUSE 2000
    ELSEIF (IN3 = 0) THEN ' Right photoresistor detects
    PULSOUT 4, 800
    PAUSE 2000


    '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    it seems to work , the whisker code works and shadows on the photo resistors cause beeps , im glad i could just add it into the main loop cause im a little hazy on coding in this language, Now i just need to add a working servo to the 14 plug and hopefully the project will work.
  • mikeyjunomikeyjuno Posts: 15
    edited 2010-11-20 23:41
    101120-222724.jpg

    we have our crane attached now. Now i just need to code in the routine for dropping the magnet and then backing up and turning out of the shadow. hopefully this works out. Biggest problem now after testing the crane is the servo we found for it is only a 180 servo. we might have to order a continuous rotation one. hopefully parallax ships fast cause we need to try and get this done before finals week .
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-11-21 02:09
    That Boe-Bot crane is fantastic. This is the first time I've seen this. Hope you can post it in the project Forum when complete. Congratulations!
  • WhitWhit Posts: 4,191
    edited 2010-11-21 05:44
    mikeyjuno wrote: »

    we have our crane attached now. Now i just need to code in the routine for dropping the magnet and then backing up and turning out of the shadow. hopefully this works out. Biggest problem now after testing the crane is the servo we found for it is only a 180 servo. we might have to order a continuous rotation one. hopefully parallax ships fast cause we need to try and get this done before finals week .

    Hey mikeyjuno,

    Great crane! If you really get in a bind, you can modify a standard servo into a continuous rotation servo pretty easily. See http://www.instructables.com/id/Modify-a-Futaba-S3001-servo-for-continuous-rotatio/ or http://www.ranchbots.com/club/papers/Modifying%20Hobby%20Servo%20Motors%20for%20Continuous%20Rotation.pdf for the some ideas.
  • ercoerco Posts: 20,256
    edited 2010-11-21 07:52
    Neat Crane, I agree. You're right, a regular servo only has so much throw, it may work if you only need to pick up the object so it's not dragging on the ground. But it will be swinging madly back & forth on that long string, so that may add dynamic problems. Per Bre'r Whit, you can make a continuous rotation servo out of a regular servo pretty easily.

    Good luck, your project looks quite fun!
  • mikeyjunomikeyjuno Posts: 15
    edited 2010-11-21 13:27
    yeah i thought about using it as a lever instead of a crane but its not within the origional project plan that we have to stick with. i did find mods on the servo to make it cont. but its not our servo its one we barrowed from the school. Im just going to order one and hopefully get it soon. Ill post some more maybe even videos when i get it running.
  • kwinnkwinn Posts: 8,697
    edited 2010-11-22 08:42
    mikeyjuno, I got busy and lost track of this thread. Yes, that addition to the code was what I meant.
    Very impressive project.
  • WhitWhit Posts: 4,191
    edited 2010-11-22 08:58
    Will you need some sort of counterweight at the tail wheel end of the BoeBot?
  • mikeyjunomikeyjuno Posts: 15
    edited 2010-11-25 10:53
    i dont think so. im still waiting on the servo to arrive to do some testing but we only want it to pick up some light ferrous material like paperclips or small nuts and stuff. its not a requirement for it to lift anything heavy.
  • WhitWhit Posts: 4,191
    edited 2010-11-26 08:41
    Cool! Hope to see some video of the crane in action.
  • mikeyjunomikeyjuno Posts: 15
    edited 2010-11-30 15:51
    i tried to take a video with my lappy but its huge! definatly wont fit in the attachment limit(its like 800mb). i guess i could try and put it on youtube but ive never posted anything on their before. the code is working great and i tested it out successfully. time to build the crash course for it to drive on.
Sign In or Register to comment.