ROBOTC.net forums
http://robotc.net/forums/

Still having problems with Palm Island inconsistency
http://robotc.net/forums/viewtopic.php?f=55&t=6901
Page 1 of 1

Author:  chris garrett [ Mon Oct 07, 2013 10:59 am ]
Post subject:  Still having problems with Palm Island inconsistency

Sometimes my program works and sometimes the same program steer the bot off on an angle after over or under turning. Same program different results. Some of my students who are not using the encoders but rather time and speed, are having the same problem.

[code][task main()
{

nMotorEncoder[motorB] =0;

while(nMotorEncoder[motorB] < 1236)
{
motor[motorB] = 50;
motor[motorC] = 50;
}

motor[motorB] = 0;
motor[motorC] = 0;
wait1Msec(1000);

motor[motorB] = 50;
motor[motorC] =-50;
wait1Msec(980);

nMotorEncoder[motorB] =0;

while(nMotorEncoder[motorB] < 1400)
{
motor[motorB] = 50;
motor[motorC] = 50;
}


motor[motorB] = 0;
motor[motorC] = 0;
wait1Msec(2000);


motor[motorB] = -40;
motor[motorC] = 40;
wait1Msec(1440);

motor[motorB] = 0;
motor[motorC] = 0;
wait1Msec(2000);


nMotorEncoder[motorB] =0;

while(nMotorEncoder[motorB] < 3250)
{
motor[motorB] = 50;
motor[motorC] = 50;
}

motor[motorB] = 0;
motor[motorC] = 0;
wait1Msec(2000);

motor[motorB] = 50;
motor[motorC] =-50;
wait1Msec(960);



}
/code]

Author:  rcahoon [ Wed Oct 09, 2013 11:18 am ]
Post subject:  Re: Still having problems with Palm Island inconsistency

Time-based movements are less accurate than encoder-based movements, and dead-reckoning in general (whether using sensor feedback or not) is less accurate than navigating using features of the world, such as following a line. This is true in the real world, and we use a physics simulation in the virtual world to replicate the real world as closely as possible, including this phenomenon.

You can make your code more accurate by switching all your movements to use encoders. Also, whether using time- or encoder-based movements, you can generally achieve better accuracy by slowing down the motors, especially when turning.

Also, try resetting your robot to each checkpoint in Palm Island when you reach it. This will help you not have to deal with as much accumulated error.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/