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

Robot will not go straight
http://robotc.net/forums/viewtopic.php?f=69&t=10837
Page 1 of 1

Author:  VivianaSousa [ Wed Apr 01, 2015 9:25 am ]
Post subject:  Robot will not go straight

Hello, all.
While I was programming my robot, I realised that the forward movements the robot was making were curving. I have a simple forward, turn, then forward again program. I am using 2 driving motors, 1 arm motor, 1 claw motor, and a GyroSensor.
My platform is VEX IQ.

Code:
Code:
   
  resetMotorEncoder(leftMotor);
  resetMotorEncoder(rightMotor);
  forward(375, degrees, 127);
  //Forward
 
  resetGyro(gyroSensor);
  repeatUntil(getGyroDegrees(gyroSensor) > 90)
  {   
     setMotor(leftMotor, -50);
     setMotor(rightMotor, 50);
  }
  //Use Gyro to make a 90 Degree turn
 
  resetMotorEncoder(leftMotor);
  resetMotorEncoder(rightMotor);
  forward(2000, degrees, 127);
  //Forward
 
 
}

Author:  JohnWatson [ Wed Apr 01, 2015 10:27 am ]
Post subject:  Re: Robot will not go straight

Try running just the forward movement, but at a slower speed:

Code:
forward(1000, degrees, 50);


While I was not able to replicate the curving movement with the forward command, the robot did tend to jerk to one side or the other when it started its movement. This is because the robot is starting at a dead stop and is immediately accelerating to full speed (power level 100).

To resolve this, try running at a slightly slower speed as this should help eliminate any unintended movements caused by the high motor speeds.

Author:  VivianaSousa [ Thu Apr 02, 2015 2:17 pm ]
Post subject:  Re: Robot will not go straight

Thanks for the reply.
I figured out that my problem was with the build of the robot, which I got fixed.
Thanks.

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