|
|
|
| You can spoil my row any time. |
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Labview Potentiometer Control
We're a couple of never-ever programmers trying to teach ourselves LabView (in the next month...) Can someone help us out with some sample code for a trim potentiometer?
We added an analogue Open into Begin.vi (and gave it a unique DevRefNum based on some sample code for a limit switch), then tried to read values from the Get Voltage vi in the teleop.vi (inside the main loop)... We added a probe to the output of the Get Voltage vi, and it just fluctuates around zero (looks like noise) no matter what the potentiometer does. (The pot is in analogue 1, and we identified it as such in the code.) Thus, if someone has some sample code they would be willing to share, that would be fantastic. Thanks, Patrick |
|
#2
|
||||
|
||||
|
Re: Labview Potentiometer Control
Quote:
How is the potentiometer connected to the cRIO (ie where is each wire going)? Have you measured the pot's signal with a simple voltmeter to ascertain for certain that it is actually providing a signal? |
|
#3
|
|||
|
|||
|
Re: Labview Potentiometer Control
Quote:
Wire one end of the pot to +5V, the other end to ground, and the middle to the signal input. These should be labeled on the shell for the analog breakout. |
|
#4
|
||||
|
||||
|
Re: Labview Potentiometer Control
Quote:
On the 2009 Analog Breakout, I measured about +-15mv of variation. Granted, the regulator was changed to a linear regulator for 2010, so the noise should be less. However, there's a lot of switcher power supplies on the robot (I count 5, excluding any motor controllers). There's probably a lot of noise on the main supply because of this. |
|
#5
|
||||
|
||||
|
Re: Labview Potentiometer Control
Quote:
I would be really helpful if you could post a screenshot of the relevant part of your code and a picture showing how you connected the potentiometer to the cRio it seems like your connection is wrong and you are measuring an input that is not connected to anything. regards, Borna |
|
#6
|
||||
|
||||
|
Re: Labview Potentiometer Control
Quote:
1) Verify the pot actually works. 2) Verify it is connected correctly. 3) See if the code reads as expected. Quote:
One end of the pot is connected to the black wire of a PWM cable. The other end of that black wire needs to be connected to the Gnd. pin on the analog input you selected. The other end of the pot needs to be connected th the red wire of the same PWM cable. The other end needs to be connected to the +5v pin of the analog input. Now the wiper of the pot needs to be connected to the white wire of the PWM cable. The other end of the white wire needs to be connected to the Signal pin of the selected analog input. With these steps verified, you can now use a "probe" to see if the code is working properly. |
|
#7
|
|||||
|
|||||
|
Re: Labview Potentiometer Control
One more thing -- make sure the Analog Breakout has 12 volt power. Its green light should be lit. Without that, it won't be able to supply 5 volts to the potentiometer.
|
|
#8
|
||||
|
||||
|
Re: Labview Potentiometer Control
Just able to get back to this -- very busy week!
Looks like the problem might be wiring. I'll get the electrical kids on that pronto and see where we're at. Thanks for the help, everyone! |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Position Control using potentiometer? | biojae | CAN | 13 | 03-02-2010 20:12 |
| Labview Servo Control Issue | EricWilliams | Programming | 5 | 22-01-2010 14:24 |
| Labview motor control | seanl | Programming | 5 | 11-02-2009 17:02 |
| Labview Revision Control | Joe Ross | National Instruments LabVIEW and Data Acquisition | 2 | 11-05-2008 17:28 |
| Potentiometer arm control | Hazmatt | Programming | 15 | 01-04-2008 21:27 |