Kataeb
Member
We have a slave axis following a master axis in degrees. There is a Ratio between the two.
The issue is that we need to read the actual position of the slave, properly in degrees between 0 and 360.
For example if the Ratio is 0.5 then, when the master goes from 0 to 360 degrees, the slave moves from 0 to 180 degrees or from 180 to 360 degrees.
In this case we can multiply the slave drive position by 2, then do the Modulo 360 function to have it again between 0 and 360.
But when the Ratio is 2, the master going from 0 to 360 degrees, the slave goes from 0 to 360 degrees twice, so we should multiply the slave drive position by 0.5 and then the read slave position will be going up to 180 degrees only. Modulo will not help any more.
How can we solve this issue to have the slave position correct between 0 and 360?
The issue is that we need to read the actual position of the slave, properly in degrees between 0 and 360.
For example if the Ratio is 0.5 then, when the master goes from 0 to 360 degrees, the slave moves from 0 to 180 degrees or from 180 to 360 degrees.
In this case we can multiply the slave drive position by 2, then do the Modulo 360 function to have it again between 0 and 360.
But when the Ratio is 2, the master going from 0 to 360 degrees, the slave goes from 0 to 360 degrees twice, so we should multiply the slave drive position by 0.5 and then the read slave position will be going up to 180 degrees only. Modulo will not help any more.
How can we solve this issue to have the slave position correct between 0 and 360?