motors stalling

When the arms of the claw on our robot push together for to long, or have to much resistance for more than a few seconds they lock up as seen at 0:13 in the video. As of posting this we have tried the following: switching motor controllers, fixing dead zones in programming, changing from rubber bands to latex tubes, changing the gears inside the motors from torque to 1:1 ratio.
We don’t think that any circuit are tripping because we are using the power expander and the claw will continue to work after a few seconds. Has any one else had this issue, or does anyone have an idea as to what causes this?

here’s our code in case it’s a software issue:
#pragma config(Sensor, dgtl1, btn, sensorTouch)
#pragma config(Motor, port1, front_one, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port2, back_one, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port3, back_two, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, tower_left, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, tower_right, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, tower_left_2, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, tower_right_2, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port8, claw_one, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port9, claw_two, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, front_two, tmotorVex393_HBridge, openLoop, reversed)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

#pragma platform(VEX2)
#pragma competitionControl(Competition)
#include “Vex_Competition_Includes.c”

int thresh = 15;
/---------------------------------------------------------------------------/
/* Pre-Autonomous Functions /
/
/
/
You may want to perform some actions before the competition starts. /
/
Do them in the following function. You must return from this function /
/
or the autonomous and usercontrol tasks will not be started. This /
/
function is only called once after the cortex has been powered on and /
/
not every time that the robot is disabled. /
/
---------------------------------------------------------------------------*/

void pre_auton()
{
bStopTasksBetweenModes = true;
}

/---------------------------------------------------------------------------/
/* /
/
Autonomous Task /
/
/
/
This task is used to control your robot during the autonomous phase of /
/
a VEX Competition. /
/
/
/
You must modify the code to add your own robot specific commands here. /
/
---------------------------------------------------------------------------*/

void moveForward(int time){
motor[front_one] = 127;
motor[front_two] = -127;
motor[back_one] = 127;
motor[back_two] = 127;
wait1Msec(time);
}

void moveBackwards(int time){
motor[front_one] = -127;
motor[front_two] = 127;
motor[back_one] = -127;
motor[back_two] = -127;
wait1Msec(time);
}

void pivotLeft(int time){
motor[front_one] = 127;
motor[back_one] = 127;
motor[front_two] = 127;
motor[back_two] = -127;
wait1Msec(time);
}

void openClaw(){
motor[claw_one] = -127;
motor[claw_two] = 127;
wait1Msec(1500);
}

void closeClaw(){
motor[claw_one] = 127;
motor[claw_two] = -127;
wait1Msec(1500); //1500
}

void lift(int time){
motor[tower_left] = 127;
motor[tower_left_2] = 127;
motor[tower_right] = 127;
motor[tower_right_2] = 127;
wait1Msec(time);

}

void specLift(int time){
motor[tower_left] = 127;
motor[tower_left_2] = 127;
motor[tower_right] = 127;
motor[tower_right_2] = 127;
closeClaw();
}

void resist(){
motor[tower_left] = 10;
motor[tower_left_2] = 10;
motor[tower_right] = 10;
motor[tower_right_2] = 10;
}

void stopWheels(){
motor[front_one] = 0;
motor[front_two] = 0;
motor[back_one] = 0;
motor[back_two] = 0;
}

void leftAutono(){
//Get into position to lift cube
moveForward(1380);
pivotLeft(1300);
moveForward(850);
lift(150);
//Stops motors
stopAllMotors();
openClaw();
lift(200); //200
resist();
moveForward(590); //590
pivotLeft(1300); //1300
stopWheels();
moveBackwards(1300);
stopWheels();
lift(1200);
specLift(200);
resist();
stopAllMotors();
}

void will(){
stopAllMotors();
}

void rightAutono(){
pivotLeft(1000);
}

task autonomous()
{
leftAutono();
will();

}

/---------------------------------------------------------------------------/
/* /
/
User Control Task /
/
/
/
This task is used to control your robot during the user control phase of /
/
a VEX Competition. /
/
/
/
You must modify the code to add your own robot specific commands here. /
/
---------------------------------------------------------------------------*/

task usercontrol()
{
// User control code here, inside the loop

while (true)
{
if (thresh <= abs(vexRT[Ch2Xmtr2])) {
motor[claw_one] = -vexRT[Ch2Xmtr2];
motor[claw_two] = vexRT[Ch2Xmtr2];
}

else if (thresh > abs(vexRT[Ch2Xmtr2])){
	motor[claw_one] = 0;
	motor[claw_two] = 0;
}

	motor[tower_left] = vexRT[Ch3Xmtr2];
	motor[tower_left_2] = vexRT[Ch3Xmtr2];
	motor[tower_right] = vexRT[Ch3Xmtr2];
	motor[tower_right_2] = vexRT[Ch3Xmtr2];

	motor[claw_one] = -vexRT[Ch2Xmtr2];
	motor[claw_two] = vexRT[Ch2Xmtr2];

	motor[front_one] = vexRT[Ch3];
	motor[back_one] = vexRT[Ch3];

	motor[front_two] = -vexRT[Ch2];
	motor[back_two] = vexRT[Ch2];

	if (vexRT[Btn7L] == 1){
		motor[front_one] = -127;
		motor[back_one] = 127;
		motor[front_two] = 127;
		motor[back_two] = -127;
	}

	if (vexRT[Btn7R] == 1){
		motor[front_one] = 127;
		motor[back_one] = -127;
		motor[front_two] = -127;
		motor[back_two] = 127;
	}

}

}

It’s not an error. Your motors are temporarily burning out from too much resistance. You can either change the way you drive, programming, or something mechanically to keep this from being as big of an issue, but ultimately running two motors against each other at full power for long periods of time has bad consequences.

You probably should have your claw motors not exceed a value of approximately 10 to 15 for very long, like when the claw is gripping and holding things.

Are you sure this is really what you want to say? Maybe I’m missing something here but this line seems confusing to me:

if (thresh <= abs(vexRT[Ch2Xmtr2]))

It’s just another way of saying


if( abs(vexRT[Ch2Xmtr2]) > thresh )

There’s no right or wrong way to do this, sometimes instead of this.

if( x == 10) {
}

we will write

if( 10 == x ) {
}

In fact, some programmers always prefer to do it that way around so that mistakes made by using a single “=” sign will cause a compile error.

OK. So I guess he’s using thresh as part of a joystick deadband. I thought maybe that was the place where he might have been trying to limit the claw motor to a value of thresh and the code somehow got messed up.

This is a bit of code that I wrote, if you used this you would be able to do away with the idler gears in the middle, thus reducing weight. clawangleleft and clawangleright are the potentiometers on each side of the claw. The code is such that the further away a claw arm is from its desired position, the more power it sends to the motor.

int clawset = 0
if(VexRT[Btn5U] == 1)
{
clawset = (clawset + 2)
}
if(VexRT[Btn5D] ==1)
{
clawset = (clawset - 2)
}
if((VexRT[Btn5U] == 0) && (VexRT[Btn5D] == 0)
{
}
while(true)
{
motor[clawArmReft] = ((0.3)*((clawset) - (sensorValue[clawangleleft])));
motor[clawArmRight] = ((0.3)*((clawset) - (sensorValue[clawangleright])));
}