|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Range Finder Help
If I used an Analog Setup to use my range finder like the labview example,could I use the voltage output from the AnalogChannelGetAverageVoltage.vi and connect that into the output channel of a MotorSetOutput.vi?
|
|
#2
|
|||||
|
|||||
|
Re: Range Finder Help
The Motor Set vi uses a range of -1 (full reverse) to +1 (full forward). Transform the Analog Voltage Get vi result to turn distance (0.01 volts per inch) into whatever power you want to run the motor at. You'll probably want something a little fancier than a simple multiplication -- a basic lookup table where input is distance and output is power should be about right.
|
|
#3
|
||||
|
||||
|
Re: Range Finder Help
Quote:
|
|
#4
|
||||
|
||||
|
Re: Range Finder Help
I would suggest experimenting with your shooter to make sure that your kicker works on along a linear equation(ie. does a .01 voltage increase equal a inch), and then derive an equation to match your found voltages to get the ball in the basket.
|
|
#5
|
|||||
|
|||||
|
Re: Range Finder Help
The "Interpolate 1D" vi is an easy way to implement a lookup table. Provide it with two arrays, one of input values and one of the assocated output values. See the "1D Interpolation.vi" LabVIEW example to play with how it works.
|
|
#6
|
|||||
|
|||||
|
Re: Range Finder Help
Or, more simply:
You experiment, and find that at a distance of (0.73 volts = 73 inches), setting your motor control to +0.48 makes the shot 9 out of 10 times. You also find that at 1.45 V (145") a motor control of +0.83 is 'perfect'. You create a table: Code:
Measured Motor Distance Voltage 73 +0.48 145 +0.83 With such a table, you might be able to assume that a distance halfway between 73 and 145 (=110) should use a motor control of halfway between 0.48 and 0.83 (=0.65). Doing this kind of math to 'guess' at what might be a good value in between known-good values is called "interpolation". Or, you can just experiment every 12 " and see what you get, and use the value in the table that's closes to the measured distance. Be sure to take into consideration what to do if there's a robot between you and the spot you want to measure from. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|