I know how to obtain the value from the pot,
but when I use it to determine speed of the motor
it gives one constant speed.
I have the input in a while loop, so I don’t understand why the speed isn’t adjusting.
Also, the values on the front panel are nearly all within a small standard deviance.
Help?
Are you reading the pot inside the loop? It sounds like you are reading it once outside the loop and then acting forever on that one value.
Greg McKaskle
I do have the Get Dig In inside the while loop.
also, the values returned are changing, just very very slightly.
It appears the the value is being update constantly.
Then is it that the pot’s range isn’t what you expected? You may want to look at the panel and turn it to a few known locations to learn the needed mapping.
Greg McKaskle
pardon my ignorance…mapping?
So it isn’t possible to run the value through a scale factor and have that be the value sent to the motor?
How exactly do you have it connected? Remember, a pot doesn’t count rotational speed, it senses position.
aha.
I have the pot as a analog input on the driverstation.
using the position from the voltage return, I figured that I could multiply that value by 100, and use it to control the speed of the motor.
Ah. OK.
You are seeing the pot value change, right? If so…
Then you multiply it by 100. So 1 volt = 100, 2 volts = 200… Remember the max range ofr a Victor for example is 0 to 254 - do you see a scaling issue here?
OK. Find the minimum value of your pot (say it is zero) and the maximum value (say it is 5.1). Then find the min and max valuse you can send to the Victor or Jaguar (say it is 0 and 254) (NOTE: Your values may be different, deoends on how you do it)
Then 0 = 0, and 5.1 = 254. Multiply the pot by (254/5.1 = 49.8 and it should be OK.
This assumes that you can control the speed of the motor manually - that is, set the output to 200 and it goes one speed, and 230 it goes another speed. That has to be working!
I am multiplying the value return by 100 because the value returned is all in the millionths. or .001 place. yeah.
and the set motor function in labview uses the values between -1 and 1 to set the outputs, so that shouldn’t be an issue.
Scaling and mapping are related. Scaling is just multiplying by a number, mapping usually involves an offset, scale, and offset to linearly map one numeric range to another.
Probe the number going into the motor and see if it makes sense.
Greg McKaskle
ahh.
So that’s what that probe whatchamacallit is for.
Haha
I will try that and get back later.
How exactly do you have this pot wired? It doesn’t sound like it’s giving much of a voltage to the Driver Station input pin.
If you’re using GetDigIn, you’re trying to get a digital value, aren’t you? The pot is analog. You should be using the GetAnalogIn VI (I think that’s what it’s called, if not, it’s something similar). Unless “Dig” stands for digit, in which case that’s a really screwed up VI…
oh.
typo.
I am using tthe analog.