Need help with which one to use

Could anybody provide any incite on whether I should use an accelerometer or a gyro on my shooter to get the angle that it is currently at.

I have never used either of them that is why I am a little lost.

Any benefits of either one?

Just a little clarification on the photo, it would be mounted on the c channel that is right below our shooters wheel. To sure where on that the c channel or which side but we want to measure the angle of that side c channel.

I think you should go with a gyro. An accelerometer measures acceleration or change in position, a gyro measures angle. My kids are playing around with using a gyro to help the robot climb up the pole…It isn’t going as smoothly as they would like, but I figure it is about the same for both.

Hope this helps.

Edoga

As Edoga said, gyros work better for determining angle. We always use a gyro to run autonomous code so we can drive in straight lines. The same principle applies for a shooter, just on a different axis than the whole robot.

Personally, I would use a potentiometer attached to the rotation point of your shooter for better feedback. If you don’t have access to one of those, then the gyro would be your best bet. Last time I used a gyro, however, it was quite noisy and you would have to re-zero it several times per match. May be something we were doing wrong though.

For stuff like angles I recommend an absolute encoder. They are not that expensive (from a FRC point of view) and, in my experience, easy to use and reliable. The code for an absolute encoder should be easier to write to.

Edit: I remember something about accelerometers and gyros being sensitive to vibrations (like those from a shooter). It’s not that the vibrations harm the device, they just make it hard to get any useful output data.

I would be inclined to agree with Cecil. Your best option would be to use a potentiometer mounted on the pivot point of your shooter. This method will give you much more useful data, and while it won’t give you an explicit angle but rather a voltage reading it is a matter of doing a simple conversion if necessary. My team used it in our last robot, and it worked wonderfully. Since we mounted it on the pivot point the vibration from the shooter barely affected the readings. We used a vex potentiometer, and if price is an issue, they aren’t very expensive.

Thanks for the helps guys. Is there any examples of how to impliment a potentiometer on it?

That now depends on a few things. First is the design of the shooter. Does the shaft (or other similar pivot point) rotate with the shooter? If not, then is there another rotational point that does?

In the past, my team has used potentiometers similar to these on DigiKey. If you drill out the center of the pivot point and tap a hole for a set screw, it is very easy to grind a flat spot on the potentiometer and hold it in that way. If you go for the Vex potentiometer, you will have to improvise a bit (I have no experience with those).

Programming one is very easy, too. Just wire it into the Analog Breakout in slot 1 of the cRIO to connect it. If you are programming in LabVIEW, you can open an analog input, and get the voltage from it as it spins. From that voltage, you can determine your upper and lower limits, and determine what angle your shooter is at based on those voltages.

Are you talking about elevation/pitch? Or heading/yaw?

Elevation/pitch is best measured with a sensor like a potentiometer or encoder.

Heading/yaw (of the entire robot) is most easily measured using a gyro (or you can use encoders on either side of the robot to derive angle, but once your wheels slip you are screwed). If your shooter is turreted, a potentiometer or encoder is a great way to measure the relative yaw angle between the shooter and the chassis.

Alright thanks for the info guys!

For the record, it is actually possible to use a single or dual axis accelerometer to determine the angle of something, since gravity affects accelerometers as much as any other acceleration. Inclinometers are just special purpose accelerometers that give you feedback in degrees relative to level.

So while using a potentiometer is certainly simpler, an accelerometer or inclinometer would give you the angle of your shooter relative to the ground, which is probably what you actually care about for aiming.

We have used a potentiometer for this application with good results. Just be sure you use one that has a linear taper, not an audio taper (logarithmic).

If the shaft rotates with the component just extend the shaft and make connection to the pot. (rubber tubing has been known to work for this.) If not you will have to use a linkage or something that makes something rotate; then attach the pot to that.

Would this one work? http://www.radioshack.com/product/index.jsp?productId=2062354&filterName=Type&filterValue=Potentiometers

Looks like a perfect one to me. Just be sure that it can support the range of motion appropriately. Some potentiometers only move 3/4 of a turn, and some can turn 10 times before stopping. Know the limits of it, especially before mounting it. You don’t want to torque it off.

It has 1080 degrees of rotation. I think we should be good. Went downtown the local RadioShack to pick um up, the guy just gave them to us! Thanks to everyone for the help.

Gotta love things that are cheap-as-free!