Hello Mr Rasputin,
Thank you for your reply and advises.
"Try always to mesure directly what you want to control. If the important is to know the angle of the big gear, try to measure this angle and not the motor angle. Better, as this gear should be attached to something else, try to measure this something. Sometimes it's impossible, maybe it's your case.
Measuring angles indirectly with other gears generate errors. There is no perfect contact between two gears, otherwise they wouldn't turn

. If this little error is not a problem for you, okay, don't mind it. But remember: one more gear, one more error (multipled by the ratio). In your case, it is better to measure the motor angle (1/8 ratio) than an small gear angle (1/40 ratio)."
- I am attaching a PDF file of what i am working on. Kindly see the attached. On Page 1 you can see the Base of the Machine, the motor with a small gear. On Page 2, you will see the bigger gear which i am interested on. On the other side of the Base of Machine, I am planning to put another small gear for the purpose of potentiometer reading. Do you think this will work? Can I minimize errors if i will do like this?
"Detecting the transition from 24V to 0v is easy. You can compare two (or more) values, n-1 and n. If n-1 differs from n of more than, let's say, 12 volts, you have a transition. Pay attention to your sample rate and the maximal gear speed. If n-1 is bigger than n, you have a 24V -> 0V transition. If n-1 is smaller than n, a 0V -> 24V transition."
- Do you have an example VI to illustrate this? If it is not asking too much, can I request a sample VI for me to understand it.
"Are you using a control system? PID or something like this?"
- No. I am planning to use a NI cRIO for control.
I have thought of using a Rotary Encoder but the price is a real big difference. Have you had similar application before?
Thanks a lot.