|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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! |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||||
|
|||||
|
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.
|
|
#4
|
||||
|
||||
|
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. |
|
#5
|
|||||
|
|||||
|
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?
|
|
#6
|
||||
|
||||
|
Re: Potentiometer issues
Quote:
|
|
#7
|
||||||
|
||||||
|
Re: Potentiometer issues
What value potentiometer are you using?
|
|
#8
|
||||
|
||||
|
Re: Potentiometer issues
I used a 1 meg linear taper potentiometer and a 10K carbon resistor....thinking was at full, the 1 meg made the 10k essentially nothing, thus nearly all of the 5 volts would drop across my variable resistance.
|
|
#9
|
|||||
|
|||||
|
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). |
|
#10
|
||||
|
||||
|
Re: Potentiometer issues
Quote:
For educational purposes - Why is a larger value potentiometer value synonymous with additional noise? |
|
#11
|
|||||
|
|||||
|
Re: Potentiometer issues
It's a matter of source impedance. The higher the resistance, the less able it is to overpower any noise being induced on the signal.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|