Hello,
Is there an equation or set of if statements I can use to check if W,P,R values are in a given range? For example, if the planned position W = 180, and tolerance is 1, then acceptable values are -179, 180, 179. Similarly, planned position W = 0, then acceptable values are -1,0,1.
I've tried normalizing the value and using modulo division, but I have issues at the worst case values or when planned W is positive and actual W is negative and vice versa.
Attached is an image of my program where I try normalizing the value based on the tolerance, but I found a situation where it does not work. (AR[1] = Planned Position & AR[2] = Tolerance)