My team wants a robot that you press a button and a “ramp” moves so many degrees up or down. So, like a limit switch but without the absolute endpoints. I know an encoder can do that, but I never worked an Encoder before. I went through the LabVIEW examples till I created the vi below (all the proper open boxes are there). Which starts the motor, but it doesn’t stop. Basically, I’m asking how to make an encoder control a motors set output.
Your problem is probably that the encoder does not measure in degrees. An encoder measures ticks per second, which is more suitable for measuring speed and distance than measuring angles.
I think your main problem, though, is that you’re getting your current angle by dividing your Distance reading by 360 and taking the remainder. The Distance output will probably read something like inches or feet, depending on how you configured the encoder in Begin.vi. I would just experiment with different positions and find a more appropriate setpoint and process variable.
Or, if you really want to work with angles, you could try mounting a gyro sideways on your ramp. I don’t think that’s your best option, though.