This post was ghost written by Anomaly.
Hi! I’m going to try to answer the most basic questions newer people may have with as much detail as possible to help reverse the trend that motivated me to leave the forums.
Question: Remote won’t connect.
Answer (borrowed from one of my posts):
- Make sure firmware is downloaded. I know you said the firmware is good, but make sure the joystick, cortex, and vexkeys have the latest firmware, and that the robotC version you are using is current. This is most likely the issue.
- Make sure the vex keys don’t have any obvious physical damage. If a vex key is cracked or coming apart, it can cause wireless failures.
- Make sure the orange download cable you’re using is functional. If the download cable is broken, pairing won’t work. To be 100% the download cable isn’t the point of failure, try using another download cable.
- Follow these steps in this order to pair the joystick and the cortex.
a.) Power on the joystick and cortex. Make sure both have good batteries.
b.) Link them together with the orange download cable until the lights on both are green.
c.) Unplug the download cable and plug in the vex keys.
d.) Only after the keys are in, power cycle both the remote and the cortex.
If you are still experiencing issues, it is possible the joystick or cortex is broken.
Question: What are pneumatics and do I need to use them?
Answer: Pneumatics (not hydraulics!) are pressurized air tanks that operate pistons and are controlled with sensors called solenoids. You do not need pneumatics, in fact you can have 12 motors if you don’t use pneumatics and only 10 if you do, but pneumatics are beneficial for many subsystems. Pneumatics have a faster motion than motors and the pistons are lighter, but the tanks are heavier and you will run out of air with more than 40-50 actuations. To increase this upper bound, you can always use a pressure regulator to decrease the air flow into the piston and give you more actuations.
Question: How does skills work?
Answer:
Skills is a 1 minute “match” where your robot is the only on the field. You can score for either alliance, and no highest stack bonus or autonomous bonus is given. Your driver skills score (1 minute of drive control) and programming skills score (1 minute of autonomous) are combined to make a “robot skills” score. By February, the teams with the top 50 scores in the world are automatically invited to worlds. Separately, if too few teams qualify for a state or regional championship, the teams with the highest regional skills scores will qualify.
Question: What kind of lift is best? How should I build it?
This depends on your goal. Scissor lifts and DR4Bs are the tallest linear lifts, 4 bars have the least friction, and 6 or 8 bars are the tall non linear lifts.
How to build a scissor lift (borrowed from one of my posts):
The biggest issue a scissor lift faces is instability caused because the 2 halves of the lift can move independently of one another. To solve this issue, cross bracing, a relatively narrow lift, and independent PID on each side of the lift can ensure the entire lift moves rather than just 1 side. A few other innovations are possible as well:
YouTube
WingusDingusRobotics
VEX 7682 Wingus & Dingus Innovate Award submission 2015
While there is no one most efficient way to construct a scissor lift, using screw joints, reducing friction in each joint, reducing the number of joints, and using rubber bands to cancel the weight of the lift all increase the efficiency of the lift. It’s also possible to increase the speed by adding motors or increasing the gear ratio.
How to build a DR4B lift:
The above video shows a well implemented DR4B from 134D in Starstruck. A double reverse four bar, or DR4B, is built by stacking 2 four bars on top of one another. The 4 bars should be the same or roughly the same length, and they should be mechanically linked. They are almost always geared together, but standoffs between the top and bottom stage or zip ties work as well when weight is a huge concern and strength is not. The distance between the top and bottom bars in each 4 bar will determine how much the DR4B can rack forwards and backwards. A distance of 5-10 holes is conventional, and I recommend 8 holes to prevent forwards-backwards racking. Many DR4Bs have the motors mounted on the lift towers, allowing the motors not to be lifted. However, because this uses extra space and requires extra gears at the bottom, plenty of teams including 134D, place their motors directly on the “middle section” of the DR4B. The main disadvantage of this is the motors must be lifted, increasing the inertia of the lift.
YouTube
134D Robotics
Vex Starstruck Robot Reveal 134D
To rubber band the lift, most teams put bands on both the top and bottom stages. This requires the rubber bands be run at a diagonal across the lift bars, tensioning the lift. See the video of 134D for an example of good rubber banding.
The final point to make about DR4Bs is that they tend to be quite wobbly. To prevent this, it is strongly advised that you run an X made out of c channels or half c channels from the left to the right side of the lift on both the top and bottom of the c channels, and then standoff these Xs together. Here is an example of a DR4B that uses these techniques, built by team 62 in Skyrise.
Personally, I would very strongly advise against using a scissor lift OR DR4B as your first lift, but a DR4B is much easier to build correctly than a scissor lift because there are fewer racking issues. Teams as dominant as 400X have struggled in the past to successfully reinforce scissor lifts. Please take this opinion with a grain of salt because there are a large number of people that disagree with what I just said.
YouTube
Cameron S
VEX Team 62 Reveal Worlds 2015
Question: What is a PID loop? How do I create one? (Answer partially borrowed from one of my posts.)
Answer: A PID loop is a complex feedback loop, and no PID loop for someone else’s robot will work on your robot. As such, you need to learn how to write a PID loop yourself. The basic idea of a PID loop is the robot figures out where it is, where it wants to be, and then assigns the subsystem a motor value based on the distance between the target and the actual.
P, I, and D stand for proportion, integral, and derivative. The proportion tells the motors to go at a speed based on the distance between the target and actual values, the integral sets the motors to a gradually increasing speed if it is very close to but not actually at the target, and the derivative slows down the subsystem when it gets very close to the target to prevent it from overshooting.
If you’ve never used PID before, this can be a bit overwhelming, so I’ll teach you here how to write a basic P loop. A P loop is not quite as precise as a PID loop, but the P is by far the most important part of the loop. Below is the code I use in my P loop.
task liftPID()
{
while(true)
{
errorLift = targetLift - SensorValue(liftPot); //find error between target and actual
motor(leftLift) = motor(rightLift) = errorLift * kpLift; //and set motors accordingly
delay(25);
}
}
As you can tell, this code is extremely simple. To break down the logic, the robot knows know where the lift is thanks to the lift potentiometer, and it knows where the lift want to be because you tell the robot in the code. Thus, the robot needs to figure out the distance between the target and the actual, and set the motors to something accordingly. If the distance between the target and the actual is 1000 tics, the motors will probably need to be set to something very high to move quickly, but if the error is just 10 tics, they will be set to something very low. In the specific case of my code, I calculate the error by subtracting the target from the sensor value of the lift. So, if the target is 1000, and the sensor value is 500, the error becomes 500. Next, I set the motors to that error times the “kp,” or constant of proportionality. You will need to tune your own kp based on your specific lift. If the kp value is too low, the lift will move too slowly, and if the kp value is too high, the lift will oscillate or spiral out of control once it hits the target. Fortunately, tuning the kp only takes a few minutes. If the kp is 0.1, the motors will be set to 500 x 0.1 = speed 50. This will adjust depending on the error every 25 milliseconds.
If you want the lift to go to position 2500 on the potentiometer, you would simply say (in a different task) targetLift = 2500;
If you are interested in creating a PID loop with the I and D values as well, I would strongly recommend checking out MartinMaVexForever’s exceptional youtube series on this topic. I’ve linked the first video below, and this is a great tool for learning PID control.
Good luck with your PID control!
part 1/2