Robots motors .

Our motors seem to be jittery for some reason.
We have 4 motors, 2 move clockwise 2 move anti-clockwise, and they lift 8 bars.
Can we please get a reply as in why this might be happening as soon as possible? Thank you.

That’s not much information to go on, however, you may want to have a read of this.

Stop your motors jittering

This is usually a programming problem, with multiple different commands sent to the same motors. Post your code here and someone can point it out to you.

don’t forget to stop your motors after each command in autonomous in your programming

This is our jittery code:

#pragma config(Sensor, dgtl5, solenoidLeft, sensorDigitalOut)
#pragma config(Sensor, dgtl6, solenoidRight, sensorDigitalOut)
#pragma config(Motor, port2, frontRightMotor, tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor, port3, backRightMotor, tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor, port4, frontLeftMotor, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port5, backLeftMotor, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port6, upRightMotor, tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor, port7, downRightMotor, tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor, port8, upLeftMotor, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port9, downLeftMotor, tmotorServoContinuousRotation, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

/---------------------------------------------------------------------------]lklllll-------------------------
|* - Dual Joystick Control with 4 Motors - |
|
ROBOTC on VEX 2.0 Cortex |
|
|
|
This program uses both the Left and the Right joysticks to run the robot using “tank control”. |
|
|
|
ROBOT CONFIGURATION |
|
NOTES: |
|
1) Reversing both right-side motors (ports 2 and 3) in the “Motors and Sensors Setup” is |
|
needed with the “VEX Tumbler” model, but may not be needed for all robot configurations. |
|
2) Ch1 is the X axis and Ch2 is the Y axis for the RIGHT joystick. |
|
3) Ch3 is the Y axis and Ch4 is the X axis for the LEFT joystick. |
|
|
|
MOTORS & SENSORS: |
|
* [Name] [Type] [Description] |
|
Motor Port 2 frontRightMotor VEX 3-wire module Right side motor |
|
Motor Port 3 backRightMotor VEX 3-wire module Right side motor |
|
Motor Port 4 frontLefttMotor VEX 3-wire module Left side motor |
|
Motor Port 5 backLeftMotor VEX 3-wire module Left side motor |
*----------------------------------------------------------------------------------------------------
/

//+++++++++++++++++++++++++++++++++++++++++++++| MAIN |+++++++++++++++++++++++++++++++++++++++++++++++
task main()
{

int 		motorupRightMotor_Value;
int			motorupLeftMotor_Value;
int			motordownRightMotor_Value;
int		  motordownLeftMotor_Value;



while(1 == 1)

{
	// Clear to start with

	motor_upRightMotor =  0;
	motor_upLeftMotor =  0;
	motor_downRightMotor = 0;
	motor_downLeftMotor = 0;


	{
		//Right side of the robot is controlled by the right joystick, Y-axis
		motor[frontRightMotor] = vexRT[Ch2];
		motor[backRightMotor]  = vexRT[Ch2];
		//Left side of the robot is controlled by the left joystick, Y-axis
		motor[frontLeftMotor] = vexRT[Ch3];
		motor[backLeftMotor]  = vexRT[Ch3];

}
if(vexRT[Btn6U] == 1)
{
motor[upRightMotor] = - 127;
motor[upLeftMotor] = - 127;
motor[downRightMotor] = 127;
motor[downLeftMotor] = 127;

		}
		else if(vexRT[Btn6D] == 1)
		{

			motor[upRightMotor] = 127;
			motor[upLeftMotor] = 127;
			motor[downRightMotor] = -127;
			motor[downLeftMotor] = -127;
		}
		else
		{
			motor[upRightMotor] = 0;
			motor[upLeftMotor] = 0;
			motor[downRightMotor] = 0;
			motor[downLeftMotor] = 0;
		}


		if(vexRT[Btn6U] == 1)         // If button 6U (upper right shoulder button) is pressed:
		{
			SensorValue[solenoidLeft] = 1;  // ...activate the solenoid.
			SensorValue[solenoidRight] = 1;
		}

		if(vexRT[Btn6D] == 1)         // If button 6U (upper right shoulder button) is pressed:
		{
			SensorValue[solenoidRight] = 0;  // ...deactivate the solenoid.
			SensorValue[solenoidLeft] = 0;
		}
		/*else                          // If button 6U (upper right shoulder button) is  NOT pressed:
		{
		SensorValue[solenoidRight] = 0;  // ..deactivate the solenoid.
		SensorValue[solenoidLeft] = 0;  // ..deactivate the solenoid.
		}
		*/
		
		// send to the motor here
   
			motor[upRightMotor] = upRightMotor_Value;
			motor[upLeftMotor] = upLeftMotor_Value;
			motor[downRightMotor] = downRightMotor_Value;
			motor[downLeftMotor] = downLeftMotor_Value;
    
	}
}


//+++++++++++++++++++++++++++++++++++++++++++++++++

What can be done to make motors work together?*

You are still sending values directly to the motors. Use the four variables you created and send to the motors once at the end.

Scrub the last reply, I had a closer look at your code and all you really need to do is this. No idea what the original problem you had was.

task main()
{
    while(1 == 1)
        {
        //Right side of the robot is controlled by the right joystick, Y-axis
        motor[frontRightMotor] = vexRT[Ch2];
        motor[backRightMotor]  = vexRT[Ch2];
        
        //Left side of the robot is controlled by the left joystick, Y-axis
        motor[frontLeftMotor]  = vexRT[Ch3];
        motor[backLeftMotor]   = vexRT[Ch3];


        if(vexRT[Btn6U] == 1)
            {
            motor[upRightMotor]   = -127;
            motor[upLeftMotor]    = -127;
            motor[downRightMotor] =  127;
            motor[downLeftMotor]  =  127;
            }
        else
        if(vexRT[Btn6D] == 1)
            {
            motor[upRightMotor]   =  127;
            motor[upLeftMotor]    =  127;
            motor[downRightMotor] = -127;
            motor[downLeftMotor]  = -127;
            }
        else
            {
            motor[upRightMotor]   = 0;
            motor[upLeftMotor]    = 0;
            motor[downRightMotor] = 0;
            motor[downLeftMotor]  = 0;
            }

        if(vexRT[Btn6U] == 1) // If button 6U (upper right shoulder button) is pressed:
            {
            SensorValue[solenoidLeft]  = 1; // ...activate the solenoid.
            SensorValue[solenoidRight] = 1;
            }
        else
        if(vexRT[Btn6D] == 1) // If button 6U (upper right shoulder button) is pressed:
            {
            SensorValue[solenoidRight] = 0; // ...deactivate the solenoid.
            SensorValue[solenoidLeft]  = 0;
            }   
        }
}

Thank you for your response. We just tested it, yet we still have the most jittery motors. We have been trouble shooting this issue for over 2 weeks with no luck. We redesigned our arm, changed motors, motor controllers, extension wires, gears, ports, buttons, remote control, vex net key trying to solve it. Time is running out… less than a week for state competition.

To confirm, does the issue persist with the cleaned up code posted by jpearman? Also, double check the Motors and Sensors Setup window; you have all of your motors configured as 3-wire motors, and I’m assuming that they are 269’s or 393’s plugged into the Cortex via Motor Controller 29’s.

Also, which version of ROBOTC is being used? This information can be found under the ‘Help → About ROBOTC’ menu option in ROBOTC, in the bottom left corner of the window that appears.

Finally, what is the exact behavior of the robot when you run the code provided by jpearman? Does the left and right side of the drivetrain work, does the left and right drive train work, when does it work, when does it stop, etc? The more detailed information you are able to provide, the better we will be able to assist you.

Thanks in advance!