|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: Potentiometer use in Labview
A properly wired potentiometer provides a variable voltage that is proportional to the angle at which it is turned. Voltages are analog signals, and get connected to the Analog Breakout.
Each set of three pins on the Analog Breakout provides exactly what you need to connect to a potentiometer. Wire one end of the pot to the +5 pin (center). Wire the other end of the pot to the Ground pin. The Signal pin goes to the wiper of the pot. Usually, the wiper is the middle one of three connections on the pot. On a typical PWM cable, Ground is black, +5 is red, and Signal is white. Read the value using an Analog Get function. |
|
#2
|
|||
|
|||
|
Re: Potentiometer use in Labview
Thank you.
Can someone also give an example of how it supposed to look like? |
|
#3
|
|||
|
|||
|
Re: Potentiometer use in Labview
Anyone?
|
|
#4
|
||||
|
||||
|
Re: Potentiometer use in Labview
Have you looked in the Example Finder? There is a Potentiometer with Driver Station example. It's not for the robot side of things, but it does show a potentiometer - the wiring idea is the same. I'll look into adding a robot side potentiometer example to the Example Finder.
|
|
#5
|
|||||
|
|||||
|
Re: Potentiometer use in Labview
I have a simple example of the basic code side on this page about a quarter of the way down, labeled Analog Input example.
But what you're looking for is probably the PID Example close to the bottom. That demonstrates the use of a steering potentiometer to position a motor based on the position of a joystick. For your fixed position arm you'd replace the whole joystick input with just a constant = the exact voltage you'd want the arm potentiometer to read when the arm is where in a fixed position. You'd have to add a case statement to chose the different values you want the pot to have. Last edited by Mark McLeod : 21-01-2011 at 16:34. |
|
#6
|
||||
|
||||
|
Re: Potentiometer use in Labview
Its pretty easy once you get started, the starting from the example Mark posted, the Analog get returns the value of the potentiometer as a voltage, you can start making this.
You should change the .5 to whatever value you want the motor to run at, and the 2.4 and 2.5 to where you want the motor to stop at which value on the potentiometer, you should also change the way this is done once you get used to PID controls, as this is a really mediocre way to code this, but it works as a proof of concept. |
|
#7
|
|||
|
|||
|
Re: Potentiometer use in Labview
Thank you all very much, u helped me a lot
![]() Last edited by Arthur But' : 21-01-2011 at 18:02. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|