My next series of posts will go through the various sensors available in VEX robotics, and provide details on what they’re used for, how they work, and how to implement them.
If you’re new to VEX, your team will probably start out programming with basic joystick blocks, and autonomous movements governed by turning motors on for a certain amount of time. This method is a great place to start. When you’re ready for more precision or more sophistication in your robot’s movements—in autonomous or driver control—it’s time to add a sensor (or two).
VEX offers a large number of sensors, and if you’re new to this, you may be a bit stymied by the choices. Sort of like being in the cereal aisle of your grocery store. Sensors cost real-world $$, so as a coach or mentor, you don’t want to spend money on things your team is not likely to use or ever need. My hope is that this series of posts can help with those purchasing decisions.
I group VEX sensors into 3 general categories, shown below (OK, well, 4 really). In my first few posts, I will cover just the items below under “basic sensors,” which also happen to be the most widely used. I’ll cover the others in later posts.
|0. For use with all sensors
|1. Basic sensors||2. Advanced sensors|
|3. Don’t use
Sensors on Competition Robots
Your team has put hours and hours into their awesome competition robot, and makes nifty use of sensors. You’re at a competition and some freak thing happens, and a sensor is damaged or broken. ACK!
Coaches: Make sure that, for all sensors vital to the functioning of your team’s robot, you have one or more extras on hand when competing. At a tournament you may certainly have nice neighbors who will lend you one, but you may not have time to go out and make those requests before the next match. Having your own spare sensors with you at a competition is a good mentoring practice.
Wiring for All Sensors
VEX sensors have 3-prong plugs (photo) that will only fit into the cortex in one orientation; good news—there’s no danger of getting that part backward. The red wire supplies the power, black is ground, and white is what conveys your sensor’s data to the cortex.*
* See special commentary about the red wire’s (lack of) functionality in the bump & limit switches.
Sensors are rarely installed right near the cortex and often require extension wires to get the distance necessary. You need to purchase 3-wire extension cables to make this happen (VEX also sells 2-wire cables, but those are not for use with sensors). When plugging in any 3-wire extension, all colors have to match: line up the red, white, and black wires of each plug you’re connecting or else you will get no data. Remember, if the white data wire gets matched up with the black ground wire, the data will face a dead-end.
These 3-wire extensions come in various lengths: 6-inch, 12-inch, 24-inch, 36-inch, and a multi-pack that includes some of every size (side note: the multi-pack will include some Y-cable extensions, which are not generally used with sensors). When you’re purchasing sensors, be sure to take a look at your own inventory of extension wires, and try to plan ahead for how your team will use them and purchase the extensions at the same time. It’s really disappointing to get a sensor in the mail, but not be able to use it for lack of an extender! (Saves on shipping $$ too.)
You can string these “extension cords” together to make intermittent lengths; however, make every attempt to use the appropriate length (instead of too long, with a lot of excess wire, or pulled really tight). Too-long wires have several drawbacks: (a) excess wire that you’ll have to bunch up & zip-tie somewhere; (b) increased likelihood of excess wire getting crunched in some moving part; (c) greater distance your electrical signal has to travel. Just-barely-long-enough wires, on the other hand, run the risk of being pulled apart as the robot moves. (I’ll extend this commentary to include *all* extension wires, not just those for sensors.)
If you have a cable that has one or more pins broken off of it, it is perfectly legal to repair it. Below is a really clear and straightforward video from Robosource.net on how to do it and the materials and parts needed. Some sensors are quite expensive; if you’ve got a broken pin on a $20 sensor (or a $15 motor for that matter), and you’re at all handy around a wire-stripper, then do consider repairing it; if you have a large program, you’ll probably be doing this task every now & then.
The video on the left is the helpful experts at Robosource.net; the video on the right is probably more realistic. Your mileage may vary. In the video on the right, the coach mentions that he’s using aluminum pins. PLEASE make sure to buy gold-plated pins, because those satisfy the “identical to VEX” requirement, and are more durable.
Here’s a link to the Robosource.net VEX Wire Repair page, where you can purchase the pins, plastic casings, and tools shown in the video. The crimp tool is the most expensive part ($20); you can get $6 wire-strippers from them or your local hardware store. The pins and plastic casings are unbelievably cheap! A 10-pack of the pins & casings is < $3! (They even have another video on how to adjust the crimp tool so it produces the perfect connection.)
Note: The plastic housing used by VEX has an extra little tab sticking out of one side of the casing (called a key) that—conveniently!—makes it impossible to plug them into the cortex the wrong way. However, this style of housing is a VEX-only product. Replacement parts will not have this tab, but, as stated in the video, are nonetheless perfectly fine to use on competition robots. It just means that when plugged into the cortex, students need to make sure to plug them in so that the black wire is on the outside-side of the cortex (matching other items probably plugged in already).
Note 2: Unfortunately, you can’t really go to town on this task the way some engineers would like. In standard engineering design, one would cut all wires so they’re just the right length. However, in VEX, making extension wires in anything other than the sizes listed above is not competition-legal. You can certainly repair an extension wire—unavoidably making it a fraction of an inch shorter than a new one—but you can’t make custom lengths.
Some sensor capabilities for motors will be built-in to the new VEX hardware coming out sometime in 2018. I’ll update these posts as necessary so that they are accurate with the new system. In general, few details have been given in regard to sensors, but it does appear that shaft encoders may be a thing of the past, with that functionality built in to the new “smart motors.”