Society of Robots - Robot Forum
Software => Software => Topic started by: nckspec on March 24, 2008, 11:00:39 PM
-
I was just wondering. How does your microcontroller know when your sensor is facing forward.
-
Why wouldn't your sensor be facing forwards? If you have it on some panning mechanism, say, controlled by a servo, which is probably the easiest way to do pan it, you would probably set delays in the program after telling the servo to go to a specific angle to ensure that it is at that angle when you take a measurement. In this case you are making the safe assumption that nothing will physically prevent the panning servo from pointing the IR rangefinder in the direction you want (given a reasonable amount of time).
-
My firefighting bot Pokey uses a pair of Sharp IR sensors at 90* angles on an array rotated by servo.
The position of the servo is determined by the MCU -- basically pulse width determines orientation. And servos are rated in terms of miliseconds to cross 60* so you can calculate roughly how many msec to traverse a given angle (about 300-400 to sweep 180* in my case). So in other words, you can tell it at what angle to point and wait the appropriate time until the servo is done moving.
Hope this helps
Michael
-
thank you, thats kinda of what i assumed but i wanted to make sure there wasn't a more competent way
I can't wait to do this project. It will be interesting how my dog will react to a robot following it.
-
You could use an encoder if you wanted less of a timer based solution and more of an Interrupt based solution.
-
and what do u mean by that???
-
and what do u mean by that???
http://www.societyofrobots.com/sensors_encoder.shtml
If your robot isn't doing highly accurate mapping, you can have your robot guess the angle. Thats what I did for my Stampy (http://Stampy) robot. It knows the angle within ~20 degrees, and that was good enough.
For more accurate mapping, this is what I did on my iRobot Create:
http://www.societyofrobots.com/robot_iRobot_Create_mod.shtml
And another option would be to use a stepper motor
http://www.societyofrobots.com/actuators_steppers.shtml
-
AND HOW DO U MAKE UR ROBOT GUESS THE ANGLE
IS IT JUST MAKING THE ROBOT GO TO A POSITION HAVING THE BEST PROBABILITY OF FINDING UR OBJECT???
-
i read through the stampy code and the code has a sensor_angle variable and when is greater or less than some set numbers it determines where to turn. It pretty much keeps a record of how much it turns to guess the angle
-
sharp ir's can only tell the distance but not the angle i suppose, then how does the robot realise if it has to turn left or right in order to track the object
-
superchiku, its in the tutorial:
http://www.societyofrobots.com/robot_sumo.shtml
-
ya i readt that :P posted this a long time ago
-
ya i readt that :P posted this a long time ago
4 days ago ... ?
-
lol long time for me ;) coz time is valuable ;D