PID setting motors to 127

Hey guys,
My team recently built a new robot and we are working on programming it. I use the PID that is included in robotC under the motor and sensor setup along with an Integrated motor encoder. It is a 4 motor single flywheel, and we are using the slave motor function to set all the motors to the same speed as the one with the IME and has PID control enabled. The issue is that it is setting the one PID motor to the desired 60 or so motor power, and the other three motors (one is Y cabled, so it is really only setting two in the code) to a motor power of 127. I am very confused as to why it is doing this, and if anyone could help i would really appreciate it. The code at the moment is very simple, and i cannot see where i am going wrong for the life of me.

here is the code that controls my flywheel. Its pretty simple and there is not much to it…


task usercontrol()
{
	slaveMotor (LeftL, RightFrontL);
	slaveMotor (RightBackL, RightFrontL);
      
      while(true)
	 {
                
                if( vexRT Btn8U ] == 1 )
		{
			motor [RightFrontL] = 65;
		}
		else
		{
			RightFrontL(0);
		}
         }
}

and attached is my full code file. Thank you for any assistance

PORT 3: Motor RightFrontL PID enabled with IME
PORT 4: Motor RightBackL flywheel motor #2
PORT 7: Motor LeftL flywheel motor #3 & #4 Y cabled

I have very similar issue, somebody said in the other threads that IME may not be responding that is why it is sending full power 127. I have basically switched off Cortex, removed the battery and let it sit for couple of seconds then plugged it back in and restarted then all worked fine. I know this is not the right solution, but gives you a temporary fix. I am also looking for the actual root cause and permanent fix.

alright, thank you. the only thing is that the IME is getting sent the correct power… but not the rest of the motors. so i would assume the IME is responding

I tested the code and it was working for me. Make sure you have everything wired correctly, no swaps on the two wire cables, red-red etc. If wiring is reversed all bets are off as the PID control expects that positive control values will make the motor encoder count forwards. Perhaps turn off the PID (you can leave on the slave control), send manual control to the motor and make sure (in the motors debug window) that the encoder is counting up with positive control values.

That worked perfect, thank you. My problem was one wire was wired black to red and red to black, reversing the motor, but the code did not see it as reversed. Your help is much appreciated

Glad you figured it out. The software has to make certain assumptions, it has no way to know how the motors are wired (I guess it could run a test on power up) and must assume that they are not reversed by swapping the wires around. If the motor is reversed by checking the box in motors & sensors setup that will be compensated for.