|
Re: Programming Puzzle
1) Measure how much rotation (in degrees) you get from 0 - 5 V of your sensor. Specifically, at 0 V, set the protractor to 0 degrees. Turn your cannon to the 5V reading and read the angle on the protractor.
2) Calculate the conversion factor from voltage to degrees. Let's say in step 1 you determined that at 5 volts the angle was 270 degrees. Then your conversion factor is 270 degrees / 5 V = 54 degrees/V
3) Now in LabVIEW, multiply your sensor reading (0 - 5V) by the conversion factor calculated in step 2. This will tell your code the angle of your cannon in degrees.
4) Use a PID loop to command your motor to any angle (in degrees) you want your cannon to shoot.
__________________
-
An ounce of perception is worth a pound of obscure.
|