LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Angle consideration

Hi,
 
I was wondering for something and I didn't foud the answer.
 
I am getting an angular position from an encoder. If I turn the motor, I see the angle in degrees but instead of seing the angle in a range of [0 360] degrees, there is no limit. After two turns I get 700 instead of 340 degrees.
 
First I wanted to know if you knew if there is an automatic way to do that or if I have to do it myself with operations.
 
Secondly, if I keep 720 degrees (not 0 to 360) and I control the error with a PID or else, and I want the motor to go to 80 degrees.
Will the error be 640 or 280?? Does Labview automaticly consider it is an angle??
 
Thank you very much,
 
Jack
0 Kudos
Message 1 of 2
(2,661 Views)
Just use quotient&remainder to divide the raw value by 360 and use the rmainder for further processing (see A).
 
To find the most direct correction between currenta angle and setpoint, you can do a similar thing, making sure that values in the range 180-360 are taken as value-360. (see B).
 
 


Message Edited by altenbach on 01-25-2008 12:25 AM
0 Kudos
Message 2 of 2
(2,643 Views)