Arm/Motor Problem

Hello,

On our robot, the motor attached to the claw lift is not working. The motor was replaced, and the issue was not resolved. The ports were moved on the micro-controller and the issue was still not resolved. In addition to this, when the micro-controller is turned on, there is extra resistance placed on the claw lift, but as soon as the micro-controller is turned off there is no resistance on the claw lift and we can move it manually.

Sincerely,
roboticshelp123

What does the text on the back of the motor cap say (it should say “Servo Motor”, “393 Motor”, “269 Motor”, etc)? From what it sounds like, you may have installed a positional servo motor on the robot instead of a 393 or 269 motor; this isn’t necessarily a bad thing, but will change how the claw operates.

Also, are you running custom code on the Cortex to control the claw/robot? If so, can you post it using the

 tags (you can click on the # symbol at the top of the forum post editor to add the code tags for you)? We'll need this information in order to debug the issue for you further.

Hello, our motor is the 2 Wire Motor 393.
The code is attached:

Thank You
Robot1-Ard.c (1.81 KB)

If you are using the newer version of ROBOTC for VEX Robotics 4.X, there is one potential issue that you may have run into; the driveLeft and driveRight keywords are now used to describe the left and right side drivetrain motors, as set up in the Motors and Sensors Setup, and will generate errors when used as function names/variable names in ROBOTC.

I updated your current code in case you are running ROBOTC 4.0, to avoid any issues with it in the future:

void leftDrive(int fwd) 
{
	int fwdCmd = 0;

	if(abs(fwd) < 15)
		fwdCmd = 0;
	else
		fwdCmd = fwd;

	motor[botLeft] = -fwdCmd;
	motor[topLeft] = -fwdCmd;
}

void rightDrive(int fwd) {
	int fwdCmd = 0;

	if(abs(fwd) < 15)
		fwdCmd = 0;
	else
		fwdCmd = fwd;

	motor[botRight] = -fwdCmd;
	motor[topRight] = -fwdCmd;
}

task usercontrol()
{
	while (true)
	{
		leftDrive(vexRT[Ch3]);
		rightDrive(vexRT[Ch2]);

		if(vexRT[Btn5U] == 1) 
		{
			motor[clawLift] = 127;
		}
		else if(vexRT[Btn6U]==1)
		{
			motor[clawLift] = -127;
		}
		else
		{
			motor[clawLift] = 0;
		}

		if(vexRT[Btn5D] == 1) 
		{
			motor[claw] = 127;
		}
		else if(vexRT[Btn6D]==1)
		{
			motor[claw] = -127;
		}
		else
		{
			motor[claw] = 0;
		}
	}
}

However, I did not see any issues with the arm control code; this means there may be an issue with the either the configuration of the robot, or how the code is being executed in the competition template.

First, please run the following code on the robot and use the ‘5U’ and ‘6U’ buttons to control the clawLift motor and let me know what the results are.

#pragma config(Motor,  port1,           botRight,      tmotorVex393, openLoop)
#pragma config(Motor,  port2,           topLeft,       tmotorVex393, openLoop)
#pragma config(Motor,  port3,           botLeft,       tmotorVex393, openLoop)
#pragma config(Motor,  port4,           topRight,      tmotorVex393, openLoop)
#pragma config(Motor,  port5,           clawLift,      tmotorVex393, openLoop)
#pragma config(Motor,  port6,           claw,          tmotorVex393, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
	while (true)
	{

		if(vexRT[Btn5U] == 1) 
		{
			motor[clawLift] = 127;
		}
		else if(vexRT[Btn6U]==1)
		{
			motor[clawLift] = -127;
		}
		else
		{
			motor[clawLift] = 0;
		}

		if(vexRT[Btn5D] == 1) 
		{
			motor[claw] = 127;
		}
		else if(vexRT[Btn6D]==1)
		{
			motor[claw] = -127;
		}
		else
		{
			motor[claw] = 0;
		}
	}
}

If the code works without any issues, the problem may be with how you are executing the code while using the Competition template; if the code does not work, there may be an issue with how the robot is physically configured. In either case, let us know what the results are and specifically how you are running the code on the robot, how the motor is attached to the robot, if there are any sensors attached to the robotc, etc.

There are no sensors on the robot. We edited your code to comply with our port numbers. Unfortunately, the revised code did not fix the claw lift issue. We are using RobotC Version 3.62

The revised code is attached

Thank You
John Watson Code 2.c (946 Bytes)

To confirm, are you using a Motor Controller 29 between the motor and the Cortex? You will need one of these Motor Controllers between each two-wire motor you wish to plug into motor ports 2-9.

Also, what is the ‘Robot -> VEX Cortex Communication Mode’ setting set to in ROBOTC?

Yes we are using the Motor Controller 29. It is on competition mode
Thank you

Try changing the Communication Mode setting to “VEXNet or USB” and then power cycle the robot. Then, run the following code on the robot:

#pragma config(Motor,  port1,           botRight,      tmotorVex393, openLoop)
#pragma config(Motor,  port2,           topLeft,       tmotorVex393, openLoop)
#pragma config(Motor,  port3,           botLeft,       tmotorVex393, openLoop)
#pragma config(Motor,  port4,           topRight,      tmotorVex393, openLoop)
#pragma config(Motor,  port5,           clawLift,      tmotorVex393, openLoop)
#pragma config(Motor,  port6,           claw,          tmotorVex393, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
	while (true)
	{

		if(vexRT[Btn5U] == 1) 
		{
			motor[clawLift] = 127;
		}
		else if(vexRT[Btn6U]==1)
		{
			motor[clawLift] = -127;
		}
		else
		{
			motor[clawLift] = 0;
		}

		if(vexRT[Btn5D] == 1) 
		{
			motor[claw] = 127;
		}
		else if(vexRT[Btn6D]==1)
		{
			motor[claw] = -127;
		}
		else
		{
			motor[claw] = 0;
		}
	}
}

If this works, change the Communication Mode back to “Competition (VEXNet)”, load your original code, and try running the code on your robot. When you do so, which method are you using to control the Competition status of the code (Competition Switch or Competition Control Debug window)?