![]() |
Potentiometer issues
My team is trying to set up a string potentiometer and we are having trouble reading the voltage that it gives out. I tried running the robot in test mode to see all variables, and I see the potentiometer that we had in the code (and for some reason I also see the "potentometer" that we misspelled but fixed later) and it doesn't waver from ~0. I'm confused as to why this could be happening because when we check the voltage with a voltmeter, it is outputting the correct number of volts. Even when pulling on the screen it doesn't change. In the code all we have is something that just gets the potentiometer, the code doesn't do anything besides that.
Thanks in advance for your help! |
Re: Potentiometer issues
<Same team as OP>
I guess our main question is: What code do we need to read the 1-60 mV output of the potentiometer? We have it wired into Analog breakout 1, and using a multimeter on the prongs shows the correct mV output as the string is retracted. What we currently have is based on this analog input guide from team 358 http://team358.org/files/programming...utExample2.jpg When we boot up and enter test mode, we see the output from "potentiometer" and it appears to be live (its constantly changing) however it only changes from -0.0001 to 0.0001 and doesn't appear to be reading any real voltage values. |
Re: Potentiometer issues
How do you have it wired? The two "ends" of the pot need to be connected to +5 and (-) on the Analog Breakout, and the "wiper" goes to the SIG pin.
|
Re: Potentiometer issues
We had difficulties as well. We were attempting to link a potentiometer to the tilt axle on our shooter and use the voltage drop as a way of calculating the tilt position. I added a carbon resistor to the low side of the circuit, because I was afraid of creating a high current situation. When I put a multimeter across the circuit, I always was able to detect a clear and repeatable change on the signal wire, but when trying to read the value it would read as a nonsense value. Someone told me I should have a capacitor in the circuit as well, but I don't really understand why.
We replaced the potentiometer circuit with an absolute position rotary encoder from the KOP a few years ago and we were able to do what we wanted, but we had some problems with that as well....and I think the potentiometer solution would have been better if we had gotten it to work. Can anyone suggest what they have used in applications like this? The entire travel of the axle is only about 110 degrees from full up to full down. |
Re: Potentiometer issues
A properly wired potentiometer is an "absolute rotary encoder" with an analog output. What sort of high current situation did you think you might encounter? What kind of value were you seeing on the signal wire when you measured it, and how were you powering it?
|
Re: Potentiometer issues
Quote:
|
Re: Potentiometer issues
What value potentiometer are you using?
|
Re: Potentiometer issues
Quote:
|
Re: Potentiometer issues
A megohm is quite a large value. That's likely to result in a lot of noise on the Analog Input. A 10k to 100k pot is typical for a sensor in an FRC robot, with lower values giving better noise immunity but requiring more current.
If you're worried about "variable resistance", then you might not be understanding the proper use of a potentiometer. You're supposed to connect +5 and (-) across the device, and the wiper goes to the Analog Input. 5 volts is always across the pot. The output is a voltage which is proportional to the turning of the shaft. The only way you'd need to be concerned with excess current is if you improperly connected the wiper to one of the power supply pins (or if you used a pot with much too small a value). |
Re: Potentiometer issues
Quote:
For educational purposes - Why is a larger value potentiometer value synonymous with additional noise? |
Re: Potentiometer issues
Quote:
|
Re: Potentiometer issues
Thank you for the much needed lesson...
We are currently picking up the signal from our encoder and multiplying it by 72 to simulate degrees around the circle. The problem we're having is that the break point between 360 and 0 (between 5 volts and 0 volts from the encoder) is very close to the top of our travel, and there were times when we over drove the tilt and surpassed the maximum point on the circle. Then, our autonomous code read the current angle to be something like 3 degrees (rather than 355 degrees) and tried to raise rather than lower the shooter to reach the desired set point. We should have rotated the magnet as soon as we discovered this, but we thought we could handle it by adjusting the limit switch location...hind sight! Can I install a potentiometer in the manner discussed here without any significant code changes (except perhaps the multiplier and the desired "set point") and read the value just like we're reading the encoder value? |
Re: Potentiometer issues
Quote:
|
| All times are GMT -5. The time now is 08:52. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi