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;
}
}
}