Hello, we are currently having issues with our reverse 4-bar. During Auto the arm will not go up. We have already checked if they are in the motors (The motors work correctly). The arm is not hitting anything and it is not having anything stuck to it. It will work fine during driver mode, however the arm does have cool downs.
Can you post your code, so we can help you better?
If you are running a separate task to control your arm movement you may be forgetting to start the task in auto.
Okay Here is the program .
l
l
v
#pragma config(Sensor, dgtl12, Piston, sensorDigitalOut)
#pragma config(Motor, port1, LeftDriveFront, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port2, LeftDriveRear, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port3, RightDriveFront, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port4, RightDriveRear, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port5, ArmLeftTop, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, ArmLeftBottom, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port7, ArmRightTop, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port8, ArmRightBottom, tmotorVex393_MC29, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
/---------------------------------------------------------------------------/
/* /
/ Description: Competition template for VEX EDR /
/ /
/---------------------------------------------------------------------------*/
// This code is for the VEX cortex platform
#pragma platform(VEX2)
// Select Download method as “competition”
#pragma competitionControl(Competition)
//Main competition background code…do not modify!
#include “Vex_Competition_Includes.c”
/---------------------------------------------------------------------------/
/* 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()
{
// Set bStopTasksBetweenModes to false if you want to keep user created tasks
// running between Autonomous and Driver controlled modes. You will need to
// manage all user created tasks if set to false.
bStopTasksBetweenModes = true;
// Set bDisplayCompetitionStatusOnLcd to false if you don’t want the LCD
// used by the competition include file, for example, you might want
// to display your team name on the LCD in this function.
// bDisplayCompetitionStatusOnLcd = false;
// All activities that occur before the competition starts
// Example: clearing encoders, setting servo positions, …
}
/---------------------------------------------------------------------------/
/* /
/ 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. /
/---------------------------------------------------------------------------*/
task autonomous()
{
while (true)
{
// autonomous1
SensorValue[Piston] = 1;
motor[ArmLeftTop] = -127;
motor[ArmLeftBottom] = -127;
motor[ArmRightTop] = -127;
motor[ArmRightBottom] = -127;
wait1Msec(500);
motor[LeftDriveFront] = -127;
motor[LeftDriveRear] = -127;
motor[RightDriveFront] = -127;
motor[RightDriveRear] = -127;
wait1Msec(700);
motor[LeftDriveFront] = 127;
motor[LeftDriveRear] = 127;
motor[RightDriveFront] = 127;
motor[RightDriveRear] = 127;
wait1Msec(3035);
SensorValue[Piston] = 0;
motor[LeftDriveFront] = -127;
motor[LeftDriveRear] = -127;
motor[RightDriveFront] = -127;
motor[RightDriveRear] = -127;
wait1Msec(3030);
motor[LeftDriveFront] = -127;
motor[LeftDriveRear] = -127;
motor[RightDriveFront] = 127;
motor[RightDriveRear] = 127;
wait1Msec(1500);
motor[LeftDriveFront] = 0;
motor[LeftDriveRear] = 0;
motor[RightDriveFront] = 0;
motor[RightDriveRear] = 0;
wait1Msec(20);
motor[LeftDriveFront] = 127;
motor[LeftDriveRear] = 127;
motor[RightDriveFront] = 127;
motor[RightDriveRear] = 127;
wait1Msec(1000);
motor[LeftDriveFront]= 0;
motor[LeftDriveRear] = 0;
motor[RightDriveFront] = 0;
motor[RightDriveRear] = 0;
wait1Msec(70);
//Arm up
motor[ArmLeftTop] = 127;
motor[ArmLeftBottom] = 127;
motor[ArmRightTop] = 127;
motor[ArmRightBottom] = 127;
wait1Msec(3000);
motor[ArmLeftTop] = 0;
motor[ArmLeftBottom] = 0;
motor[ArmRightTop] = 0;
motor[ArmRightBottom] = 0;
wait1Msec(70);
motor[LeftDriveFront] = 127;
motor[LeftDriveRear] = 127;
motor[RightDriveFront] = 127;
motor[RightDriveRear] = 127;
wait1Msec(50);
SensorValue[Piston] = 1;
motor[LeftDriveFront] = 127;
motor[LeftDriveRear] = 127;
motor[RightDriveFront] = -127;
motor[RightDriveRear] = -127;
wait1Msec(2000);
motor[ArmLeftTop] = 127;
motor[ArmLeftBottom] = 127;
motor[ArmRightTop] = 127;
motor[ArmRightBottom] = 127;
wait1Msec(500);
motor[LeftDriveFront] = 127;
motor[LeftDriveRear] = 127;
motor[RightDriveFront] = 127;
motor[RightDriveRear] = 127;
wait1Msec(1000);
SensorValue[Piston] = 1;
motor[LeftDriveFront] = -127;
motor[LeftDriveRear] = -127;
motor[RightDriveFront] = -127;
motor[RightDriveRear] = -127;
wait1Msec(2500);
motor[LeftDriveFront] = 127;
motor[LeftDriveRear] = 127;
motor[RightDriveFront] = -127;
motor[RightDriveRear] = -127;
wait1Msec(1500);
motor[ArmLeftTop] = -127;
motor[ArmLeftBottom] = -127;
motor[ArmRightTop] = -127;
motor[ArmRightBottom] = -127;
wait1Msec(1500);
motor[LeftDriveFront] = 127;
motor[LeftDriveRear] = 127;
motor[RightDriveFront] = 127;
motor[RightDriveRear] = 127;
wait1Msec(1500);
SensorValue[Piston] = 0;
motor[ArmLeftTop] = 127;
motor[ArmLeftBottom] = 127;
motor[ArmRightTop] = 127;
motor[ArmRightBottom] = 127;
wait1Msec(1500);
motor[LeftDriveFront] = 127;
motor[LeftDriveRear] = 127;
motor[RightDriveFront] = -127;
motor[RightDriveRear] = -127;
wait1Msec(1500);
motor[LeftDriveFront] = 127;
motor[LeftDriveRear] = 127;
motor[RightDriveFront] = 127;
motor[RightDriveRear] = 127;
wait1Msec(2500);
SensorValue[Piston] = 1;
}
}
// …
// Insert user code here.
// …
// Remove this function call once you have “real” code.
/---------------------------------------------------------------------------/
/* /
/ 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()
{
while(true) // Loop Forever
{ //v Xmtr2
if(vexRT[Btn5UXmtr2] == 1) // If button 6U (upper right shoulder button) is pressed:
{
SensorValue[Piston] = 1; // …activate the solenoid.
}
else // If button 6U (upper right shoulder button) is NOT pressed:
{
SensorValue[Piston] = 0; // …deactivate the solenoid.
}
//MOTOR
motor[LeftDriveFront] = vexRT[Ch3];
motor(LeftDriveRear) = vexRT[Ch3];
motor(RightDriveFront) = vexRT[Ch2];
motor(RightDriveRear) = vexRT[Ch2];
if(vexRT[Btn6UXmtr2] == 1) /* Xmtr2*/
{
motor[ArmLeftTop] = 127;
motor[ArmLeftBottom] = 127;
motor[ArmRightTop] = 127;
motor[ArmRightBottom] = 127;
}
else if(vexRT[Btn6DXmtr2] == 1)
{
motor[ArmLeftTop] = -127;
motor[ArmLeftBottom] = -127;
motor[ArmRightTop] = -127;
motor[ArmRightBottom] = -127;
}
else
{
motor[ArmLeftTop] = 0;
motor[ArmLeftBottom] = 0;
motor[ArmRightTop] = 0;
motor[ArmRightBottom] = 0;
}
}
}
(This is the program)
Is everything else (driver motors, pneumatics) working in auton?
Yes, everything else seems to be working perfectly fine.
Like, the arm will try to go up.(You can tell it is trying)
The arm of our robot is not going up in autonomous. In autonomous our arm does not move at all, including that the motors aren’t moving so there isn’t motors or gears forcing against each other. The drive and pneumatics work perfectly. Everything is plugged in to order. Along with the arm moving in driver control, however, it stops in mid-section? Where we have to wait. I don’t know if there is a connection between the two.
Please help!
At the beginning of your auton, you’re setting all of your arm motors to -127. (I’m assuming this is down), and you keep them running downwards for about 10 seconds. This is probably tripping the PTCs and stopping the arm from going up later on
I don’t have this problem but my friend did. I can refer you to her. Just tell me yes or no.