Currently when I use the Ir seeker to try to find the Ir beacon my robot can find it but it does not know when to stop. How could I tell it when to stop? Also the robot is at a angle when it reaches the beacon. Is there a way that I could have it align better with it? Thanks for your help.

Wed Feb 06, 2013 9:32 pm

JohnWatson

Site Admin

Joined: Thu May 24, 2012 12:15 pmPosts: 701

Re: Ftc Autonomous

Would you be able to post your code using the [code] tags? This will help us see where you're at and allow us to debug the program with you.

If the _color sensor is continually reading a value of 17, it will keep both motors moving at 100 power perpetually; again, this does depend on how the robot is set up and what each sensors' function on the robot is, but this would be my initial guess of where the issue may lie.

Sorry for not explaining my problem better. I know that will make it move forever, i just didn't know how to make it stop when it was at the column. The robot first aligns with the center board, facing the 3 column. Then it uses the ir sensor to check if its on column 1, 2, or 3. Then it drives to the column and uses the white line to drive towards it. The problem is it always drives towards the center one. The other problem is it does not know when to stop when its at the column. Thanks for your help.

Fri Feb 08, 2013 2:22 pm

JohnWatson

Site Admin

Joined: Thu May 24, 2012 12:15 pmPosts: 701

Re: Ftc Autonomous

Do you have any other sensors that could keep track of distance (such as encoders on the TETRIX motors or a sonar sensor to detect how far away from an object the robot is)? Without these, the next option would be more time based movements, which isn't the most reliable method of moving a robot.

Either way, the real culprit in this case is the while(true) segment; these loops are called 'infinite loops' and will continue to run forever. There are ways around this, but a much more practical way to control how long the loop runs would be:

Code:

while(SensorValue[sensor] < someValue){//Do things}

or

ClearTimer[T1];

while(Time1[T1] < 10000){//This code will run for 10 seconds}

The first loop will execute the code inside of the while loop until the 'sensor' becomes greater than an certain value. The second loop will run for 10 seconds, using the internal NXT timers to keep track of time. Again, your best option (if applicable) would be the sensor method.

I know that I just did that for testing. The bigger problem is that for some reason it only wants to go to the center column.

Fri Feb 08, 2013 8:40 pm

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1519

Re: Ftc Autonomous

To determine when to stop, you need sensors that tell you how close you are from the column. There are many ways to achieve this. One way is to use an ultrasonic sensor to determine the distance to the bottom cross bar. That's what our team did. Another way is to use IR seekers to do triangulation. There were threads discussing using the raw signal strength of the IR seekers to determine the distance, but in my opinion, this is not very reliable because the raw strength will be different depending on the battery level of the beacon and individual IR seeker. So, I wouldn't recommend it.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum