Shop OBEX P1 Docs P2 Docs Learn Events
Help to draw figure infinity(8) — Parallax Forums

Help to draw figure infinity(8)

HasherHasher Posts: 3
edited 2008-10-28 22:46 in BASIC Stamp
Please any idea to help drawing figure infinity(&#8734[noparse];)[/noparse] using Boe Bot(BS2 & PBasic 2.5).

The specs is as following:
- turn 270 degree for the circle.
- diameter of the circle (almost circle) is 1 meter.
- no sensors are used!

My algorithm:
1- draw left circle forming 270 degree.
2- go straight 1 meter.
3- draw right circle forming 270 degree.
4- go straight 1 meter.
688 x 282 - 20K

Comments

  • SRLMSRLM Posts: 5,045
    edited 2008-10-28 15:23
    You'll need one of three sensors:

    gyroscope
    compass
    wheel encoders

    Otherwise, you won't know which dirrection the robot is facing. The encoders would be the best and cheapest, and allow you to get the most accuracy.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-28 16:09
    Since your problem doesn't permit sensors, you'll have to have the boebot move blindly.

    The speed of the wheel servos is set by the the width of the control pulse sent to the servo. The exact numbers to use in the PULSOUT statement for this has to be determined experimentally. Obviously, one motor has to move faster than the other for the boebot to move in a circle. Write a simple program to make the boebot move in a straight line. Reference the "Robotics with the BoeBot" tutorial for information on using the servo motors. Change the numbers in the PULSOUT statements until you get the boebot turning in a circle in one direction. See how many servo pulses (at 20ms each) it takes to make the boebot move in a 270 degree arc. Then modify your program to make it move the other way in a 270 degree arc. Notice that the servos are reversed and the PULSOUT numbers have to be on the other "side" of neutral (roughly 750).

    You now have 3 programs, one to move in a 270 degree circle one way, one to move in a 270 degree circle the other way, and one to move in a straight line. Duplicate the last and make a larger program with the now 4 pieces executing one after another. The boebot should move through the complete figure (roughly). You may have to fine tune everything, particularly the straight segments, to make it work out right.
  • skylightskylight Posts: 1,915
    edited 2008-10-28 16:17
    No sensors eh? are you allowed to put two pins or rods a measured distance apart?

    If so you could have two arms sticking out that operate a switch when the arm hits the rod and then immediately folds away( a pivoting one shot slide·contact would work)·then the bot does a turn for a set time determined by trial and error after this time it carries on straight hopefully on target for the other arm to hit the other rod and repeat the above procedure of turning in the opposite direction.

    obviously the bot would have to be tweaked to make sure it runs in a true straight line for at least the distance required and stop when the line is completed again. Also the starting position would be critical.

    Looks like Mike has beaten me to it
  • BasicRichBasicRich Posts: 4
    edited 2008-10-28 22:03
    sensors require more code and expertise, i would do what the last guy said, considering that drawing the infinity sign is simple, simple tasks should not be fulfilled by complexity unless its really needed.
  • HasherHasher Posts: 3
    edited 2008-10-28 22:35
    Dear Mike Green,
    idea.gif thanks for excellent ideas. trial & error is in process to accomplish the task!


    Dear SRLM,
    rolleyes.gif no sensors to be used. no intelligence.


    Dear skylight,
    nono.gif no no other hardware or peripherals are allowed. it is only simple programming.


    Dear BasicRich,
    yeah.gif yes that is right. simple programming without sensors but a lot of trial & errors!!
  • ercoerco Posts: 20,256
    edited 2008-10-28 22:46
    hasher:

    Your patience will be tested here. This is similar to a figure 8 contest entry I did for ROBOT magazine, and ultimately won with a Basic Stamp 1 on a Rebound chassis.·Vid at ·http://www.youtube.com/watch?v=ImriJO7DNac

    First, wait until you see how big your·course is. Hope you have a "great room" or basement with a huge open area to practice in. Better yet, practice and tune your program exactly where you need to demonstrate it. You need to strive for consistent conditions at all times.

    Second, no two of your runs will be identical. My chassis was much better than a BOE-BOT at going straight, and yet it was extremely inconsistent and frustrating to tune. I had the luxury of videotaping mine umpteen times and FINALLY getting lucky with the camera rolling. If you have to demonstrate yours live, or worse, for a grade based on one single run, just drop out of school now and head to Mexico...· OK, stay in school.

    Your servo motorss will do wonderfully random things·over a long course like this, and you have many variables to deal with. Carpet versus linoleum will require totally different calibrations. Your worst enemy·may be your batteries; each run will drain them and the next run will be different. Your best bet is to use rechargeable batteries and top them up consistently after EVERY RUN. NiMH AA cells are available at 2500 mAH or better. People will tell you that their voltage is very constant over a long disharge. You'll discover otherwise.

    Start by simply making the robot do a circle of·one meter diameter and get it to stop EXACTLY in the same spot it started. Do that 10 times in a row to gauge your robot's consistency·and start expanding from there. Good luck and don't wait until the last minute!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
Sign In or Register to comment.