Our base has started having some stuttering issues. The base can turn left and right, but can’t drive forward and backwards. when we do, the motors stutter and skip. Our wiring is as follows: 2 Left Motors on “Y” cable port 2, 2 Right Motors on “Y” cable port 3, Claw lift 1 port 4, Claw lift 2 port 5, Claw motor 1 port 6, Claw motor 2 port 7, Lifter motor 1 port 8, Lifter motor 2 port 9. We found that by multiplying the joystick value, it can smooth out the motor rotations, but we are looking for an actual solution, as this is not perfect, and we have never seen anyone use it before. Code is below. Please note that we have LCD screen code, but it may cause interference, so we commented it out. We are using RobotC.
#pragma config(Sensor, in1, expanderBatterY, sensorAnalog)
#pragma config(UART_Usage, UART2, uartVEXLCD, baudRate19200, IOPins, None, None)
#pragma config(Sensor, dgtl1, encoderLeft, sensorQuadEncoder)
#pragma config(Sensor, dgtl3, encoderRight, sensorQuadEncoder)
#pragma config(Motor, port2, leftBaseMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port3, rightBaseMotor, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port4, clawLift1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, clawLift2, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port6, clawMotor1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, clawMotor2, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port8, liftMotor1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port9, liftMotor2, tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
bLCDBacklight = true;
string primaryBattery, expanderBattery;
while(true)//this makes the code loop forever
{
motor[leftBaseMotor] = vexRT[Ch1] * 1.5; //this makes it when jostick goes to the left, the robot pivots to the left
motor[rightBaseMotor] = -vexRT[Ch1] * 1.5; //this makes it when jostick goes to the right, the robot pivots to the right
if(vexRT[Btn5UXmtr2] == 1) //this makes when button 5 up is pressed, the claw goes up
{
motor[clawLift1] = 120;
motor[clawLift2] = 120;
}
else if(vexRT[Btn5DXmtr2] == 1) //this makes when button 5 down is pressed, the claw goes down
{
motor[clawLift1] = -120;
motor[clawLift2] = -120;
}
else //this makes when no buttons are pressed, keeps the speed at zero
{
motor[clawLift1] = 0;
motor[clawLift2] = 0;
}
motor[clawMotor1] = vexRT[Ch3Xmtr2] / 2.75; //This uses the joystick of the partner controller to controll the motors at varioius speeds.
motor[clawMotor2] = vexRT[Ch3Xmtr2] / 2.75;
if(vexRT[Btn6UXmtr2] == 1) //This activates strong arm!
{
motor[clawMotor1] = vexRT[Ch2Xmtr2] / 2;
motor[clawMotor2] = vexRT[Ch2Xmtr2] / 2;
}
motor[leftBaseMotor] = vexRT[Ch3] * 1.5; //this makes it when you make joystick go up, robot goes foward
motor[rightBaseMotor] = vexRT[Ch3] * 1.5; //this makes it when you make joystick go down, robot goes backwards
if(vexRT[Btn7UXmtr2] == 1) //this makes when button 7 up is pressed, the lift goes up
{
motor[liftMotor1] = 120;
motor[liftMotor2] = 120;
}
else if(vexRT[Btn7DXmtr2] == 1) //this makes when button 7 down is pressed, the lift goes down
{
motor[liftMotor1] = -120;
motor[liftMotor2] = -120;
}
else //this makes when no buttons are pressed, keeps the speed at zero
{
motor[liftMotor1] = 0;
motor[liftMotor2] = 0;
}
/*clearLCDLine(0);
clearLCDLine(1);
displayLCDString(0, 0, "Primary: ");
sprintf(primaryBattery, "%1.2f%c", nImmediateBatteryLevel/1000.0,'V');
displayNextLCDString(primaryBattery);
displayLCDString(1, 0, "Expander: ");
sprintf(expanderBattery, "%1.2f%c", SensorValue[expanderBatterY]/280.0, 'V');
displayNextLCDString(expanderBattery);
wait1Msec(100);*/
}
}