Integrated Encoders for RobotC

Hello, My name is Devon and I’m on a 4 year running Vex Team. I’m leading programmer and captain and need help with Integrated Encoders. We have been trying to use them in the skyrise game but they aren’t working. I was wondering how to make the gear count work very accurately. I was also wondering if I put 4000 gear counts on a turn but it didn’t even turn. i also put the gear count at 1000000 and it still didn’t turn. PLZZZZ help

What is the code that is being used to turn the motors? What is the current motor type/internal gear ratio you are using, and what color are the lights on the IMEs when they are plugged in and the program is run?

We will need this information (including a sample program that demonstrates this issue; you can use the

 tags on this forum to post code) in order to determine what the issue could be.

Thanks in advance!

Our Ime are usually green in autonomous and here is the code i usually use to run the code

while (nMotorEncoder[rightbw] > 3000)
{
motor[rightfw] = 100;
motor[rightbw] = 100;
motor[leftfw] = 100;
motor[leftbw] = 100;

}

I’ll need to see the rest of the code (including the #pragmas at the top, if possible) to see how the encoders are configured and what the robot is doing prior to that command call, if possible.

pragma config(I2C_Usage, I2C1, i2cSensors)
#pragma config(Sensor, in2, p1, sensorPotentiometer)
#pragma config(Sensor, in3, p2, sensorPotentiometer)
#pragma config(Sensor, in4, expBatteryPower, sensorAnalog)
#pragma config(Sensor, dgtl5, POLED, sensorSONAR_cm)
#pragma config(Sensor, dgtl7, solenoid, sensorDigitalOut)
#pragma config(Sensor, dgtl8, solenoid2, sensorDigitalOut)
#pragma config(Sensor, I2C_1, rightbwEncoder, sensorQuadEncoderOnI2CPort, , AutoAssign)
#pragma config(Sensor, I2C_2, leftbwEncoder, sensorQuadEncoderOnI2CPort, , AutoAssign)
#pragma config(Motor, port1, innerliftr, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port2, rightfw, tmotorVex393_MC29, openLoop, driveRight)
#pragma config(Motor, port3, rightbw, tmotorVex393_MC29, openLoop, reversed, driveRight, encoderPort, I2C_1)
#pragma config(Motor, port4, innerliftl, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port5, outerliftl, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port6, intaker, tmotorVex269_MC29, openLoop)
#pragma config(Motor, port7, intakel, tmotorVex269_MC29, openLoop, reversed)
#pragma config(Motor, port8, leftfw, tmotorVex393_MC29, openLoop, driveLeft)
#pragma config(Motor, port9, leftbw, tmotorVex393_MC29, openLoop, driveLeft, encoderPort, I2C_2)
#pragma config(Motor, port10, outerliftr, tmotorVex393_HBridge, openLoop, reversed)
so this is my pragma I think everything in configured right but I’m not sure

here a part of the code in autonomous

motor[rightfw] = 100;
motor[rightbw] = 100;
motor[leftfw] = 100;
motor[leftbw] = 100;
wait1Msec(400);

while(nMotorEncoder[rightbw] > 3000)
{
motor[rightfw] = 0;
motor[rightbw] = 0;
motor[leftfw] = -127;
motor[leftbw] = -127;

}
motor[rightfw] = 100;
motor[rightbw] = 100;
motor[leftfw] = 100;
motor[leftbw] = 100;
wait1Msec(700);

Without seeing the full code and all of the movements before this section of code, it will be hard to debug the specific cause of the issue; however, it may be that a prior movement has increased the accumulated value of the IME’s beyond the 3000 count, which makes the while loop’s condition false (and the while loop is automatically skipped).

To confirm, do you reset the encoder values at any point by using a nMotorEncoder[motorName] = 0; command?