3.1.7 Robot Arm Design
Objectives:
Plan design, build and program a solution of one of the 7 design problems listed below using VEX components and ROBOTC.
Conclusion Questions
1. Describe the objectives for this project in your own words.
For me, this project was intended to familiarize us with freely programming and designing a more complicated system.
2. What were the most difficult parts of the problem? Describe the difficulties you had with these things.
The most difficult parts were working our way around problems that showed up, but we didn't end up finishing the solutions. For example, the motor we used wasn't powerful enough to lift the arm, and for some reason the claw didn't work.
3. List and describe two features that were not part of the design problem that could be added to improve your design.
We initially intended to add a wrist and a way to lean the entire arm forward, to increase the range of grabbing things, but those fell flat and didn't end up working.
4. Describe how your design and program worked during the official test? Was your design successful? Why or why not?
During the official test, we had errors in the code that didn't allow for anything to work except for the rotating base. However, when it rotated, it rotated well.
5. Describe some things you learned during this project.
I learned that we need to have more time to test the functionality of the project before we present it, and that we should try to keep our designs more simple.
Plan design, build and program a solution of one of the 7 design problems listed below using VEX components and ROBOTC.
Conclusion Questions
1. Describe the objectives for this project in your own words.
For me, this project was intended to familiarize us with freely programming and designing a more complicated system.
2. What were the most difficult parts of the problem? Describe the difficulties you had with these things.
The most difficult parts were working our way around problems that showed up, but we didn't end up finishing the solutions. For example, the motor we used wasn't powerful enough to lift the arm, and for some reason the claw didn't work.
3. List and describe two features that were not part of the design problem that could be added to improve your design.
We initially intended to add a wrist and a way to lean the entire arm forward, to increase the range of grabbing things, but those fell flat and didn't end up working.
4. Describe how your design and program worked during the official test? Was your design successful? Why or why not?
During the official test, we had errors in the code that didn't allow for anything to work except for the rotating base. However, when it rotated, it rotated well.
5. Describe some things you learned during this project.
I learned that we need to have more time to test the functionality of the project before we present it, and that we should try to keep our designs more simple.
CODE: This is the code we used for the robot arm. This code is different from the stuff we learned in class, because we used a vex wireless controller.
#pragma config(Motor, port3, elbowMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, clawMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, baseMotor, tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
/*
Project Title: 3.1.7 Robotic Arm
Team Members: Jacob, Ryan, Timmy, and Maverick
Date: 2.24.2016
Section: 1
*/
task baseControl(); //this is a function declaration for the section of base rotation controlling code
task elbowJointControl(); //this is a function declaration for the section of elbow moving controlling code
task clawControl(); //this is a function declaration for the section of wrist turning code
task baseControl() { //this is the code that controld the base rotation
while (true) //this makes the code loop infinetly so it does not end
{
if ((vexRT[Btn7L] == 1) && (vexRT[Btn7R] == 1)) //if both of the buttons are pressed
{
stopMotor(baseMotor); //stop turning the motor and don't do anything
}
else if (vexRT[Btn7L] == 1) //if the left button on button group 7 is pressed
{
startMotor(baseMotor, 120); //make the moror turn the base CCW
wait(0.05); //wait for 0.05 seconds to let the motor turn and avoid double presses before
} //checking again
else if (vexRT[Btn7R] == 1) //if the right button on button group 7 is pressed
{
startMotor(baseMotor, -120); //make the moror turn the base CCW
wait(0.05); //wait for 0.05 seconds to let the motor turn and avoid double presses before
} //checking again
else //if neither of the left or the right buttons are pressed (group 7)
{
stopMotor(baseMotor); //stop the motor and do nothing
}
}
}
task elbowJointControl() { //this is the code that controls the elbow movement
while(true) { //this makes the code loop infinetly so it does not end
if (vexRT[Btn5U] == 1 && vexRT[Btn5D] == 1) { //if both the up and down buttons from group 5 are pressed
stopMotor(elbowMotor); //stop the motor and do nothing
}
else if (vexRT[Btn5U] == 1) { //if the up button on button group 5 is pressed
startMotor(elbowMotor, 20); //make the moror raise the outer arm
wait(.05); //wait for 0.05 seconds to let the motor turn and avoid double presses before
} //checking again
else if (vexRT[Btn5D] == 1) { //if the down button on button group 5 is pressed
startMotor(elbowMotor, 20); //make the moror lower the outer arm
wait(.05); //wait for 0.05 seconds to let the motor turn and avoid double presses before
} //checking again
else { //if neither of the up or the down buttons are pressed (group 5)
stopMotor(elbowMotor); //stop the motor and do nothing
}
}
}
task clawControl() { //this is the code that controls the claw opening and closing
while(true) { //this makes the code loop infinetly so it does not end
if (vexRT[Btn8U] == 1 && vexRT[Btn8D] == 1) { //if both the up and down buttons from group 8 are pressed
stopMotor(clawMotor); //stop the motor and do nothing
}
else if (vexRT[Btn8U] == 1) { //if the up button on button group 8 is pressed
startMotor(clawMotor, 20); //make the moror close the claw
wait(.05); //wait for 0.05 seconds to let the motor turn and avoid double presses before
} //checking again
else if (vexRT[Btn8D] == 1) { //if the down button on button group 8 is pressed
startMotor(clawMotor, 20); //make the moror open the claw
wait(.05); //wait for 0.05 seconds to let the motor turn and avoid double presses before
} //checking again
else { //if neither of the up or the down buttons are pressed (group 8)
stopMotor(clawMotor); //stop the motor and do nothing
}
}
}
task main() //this is the actual code
{
starttask(baseControl);
starttask(elbowJointControl);
starttask(clawControl);
while(vexRT[Btn6D]==0){}
}