VEX Motor speeds up under load in PID control


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){

task main()

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

nMotorPIDSpeedCtrl[lmotor] = mtrSpeedReg;
motor[rmotor] = 15;
motor[lmotor] = 15;
motor[rmotor] = 0;
motor[lmotor] = 0;


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

See the video:



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?