VEX Motor speeds up under load in PID control

Hello,

All code is below:

#pragma config(I2C_Usage, I2C1, i2cSensors)
#pragma config(Sensor, dgtl12, killB, sensorTouch)
#pragma config(Sensor, I2C_1, , sensorQuadEncoderOnI2CPort, , AutoAssign )
#pragma config(Motor, port2, rmotor, tmotorNone, openLoop)
#pragma config(Motor, port3, lmotor, tmotorVex393_MC29, PIDControl, encoderPort, I2C_1)
#pragma config(Motor, port4, topmotor, tmotorNone, openLoop)
#pragma config(Motor, port5, pmotor, tmotorNone, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

void StopAll(){
motor[rmotor] = 0;
motor[lmotor] = 0;
motor[topmotor] = 0;
motor[pmotor] = 0;
}

//Stops the program at the push of a button
task eStop(){
while (SensorValue(killB) == 0){
wait1Msec(10);
}
StopAll();
stopAllTasks();
}

task main()
{
//startTask(eStop);

//nMotorEncoder[rmotor] = 0;
nMotorEncoder[lmotor] = 0;

nMotorPIDSpeedCtrl[lmotor] = mtrSpeedReg;
motor[rmotor] = 15;
motor[lmotor] = 15;
wait1Msec(20000);
motor[rmotor] = 0;
motor[lmotor] = 0;
StopAll();

}

It runs find without load. When I apply a load it speeds up!? Any ideas why?

See the video: https://youtu.be/u3P0Wectwco

Mark

Mark

I don’t see any issues with the code you posted, however, that only runs one motor. Can you post the code used in the video? Are all the connections to the motor set correctly, ie. red wire on motor connected to the red wire on the MC29?