Motors spazzing 1 way

So recently my team and I have discovered a problem with our lift. We have a 6 motor 5 bar lift. In order to lift it we have the two left hand side trigger buttons on the front of the remote programmed to be the up and down. For some reason we can go one way without the motors spazzing but when we try and go the other direction the motors start to spazz and its a really rickety lift or decent. We have determined it is not due to weight though because it can either lift fine or descend fine depending on which way we have the motor controllers plugged in at.

Here is the code if anyone thinks this might be the problem.

#pragma config(Motor, port2, right, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port3, left, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port4, rightLift1, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port5, rightLift2, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port6, leftLift1, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port7, leftLift2, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port8, top1, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port9, top2, tmotorServoContinuousRotation, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

// Negative cuz our motors are flipped.
int speed = -126;

task main()
{
while (true) {
motor[left] = vexRT[Ch3];
motor[right] = vexRT[Ch2];

	if (vexRT[Btn5U]) {
		motor[rightLift1] = speed;
		motor[rightLift2] = speed;
		motor[leftLift1] = speed;
		motor[leftLift2] = speed;
	}
	else {
		motor[rightLift1] = 0;
		motor[rightLift2] = 0;
		motor[leftLift1] = 0;
		motor[leftLift2] = 0;
	}

	if (vexRT[Btn5D]) {
		motor[rightLift1] = -speed;
		motor[rightLift2] = -speed;
		motor[leftLift1] = -speed;
		motor[leftLift2] = -speed;
	}
	else {
		motor[rightLift1] = 0;
		motor[rightLift2] = 0;
		motor[leftLift1] = 0;
		motor[leftLift2] = 0;
	}

	if (vexRT[Btn6U]) {
		motor[top1] = speed;
		motor[top2] = speed;
	}
	else {
		motor[top1] = 0;
		motor[top2] = 0;
	}

	if (vexRT[Btn6D]) {
		motor[top1] = -speed;
		motor[top2] = -speed;
	}
	else {
		motor[top1] = 0;
		motor[top2] = 0;
	}
}

}

Take a look at this thread. It may provide you that answer you’re looking for

link text

Buttons constantly send 0. All your else statements are true the entire time the button is unpressed. You must create if and else statements that account for this fact, such as “if 5U is pressed AND 5D is not pressed: do this”.

It isn’t all that important, but you can check reversed in the motor setup and use a positive speed value.

As mentioned by @Doug Moyers you are constantly resetting the motor value to zero. Try replacing some of your if statements to “else if” like follow…

If(btn up){
Motor = -127;
}Else if(btn down){
Motor = 127;
}Else{
Motor = 0
}

Or something of the sort…

From looking at your code, @Doug Moyers is right. You are constantly sending the motors a value of 0, causing the jittering, you can solve this the way @TurboTech did, or you can use this if you want.
(This is not correct in the fact of names)

motor = (vexRT[Btn1] - vexRT[Btn2]) * 127
motor = (vexRT[Btn1] - vexRT[Btn2]) * 127

This is just an outline, label the right motors, put in while loop, and put in correct button names according to what it should do and this will work. There are other ways to do this like switch case (I don’t know the exact name for it) that will work but this is what I use.

Thank you all so much for your help! Our robot is working great thanks to you guys!