Constructing the Volts to Degrees Converter

As is the case with many sensors, the potentiometer used in this application produces a voltage proportional to the actual quantity being measured: in this case the angle of the paddle from the vertical. Since the set point is in degrees, you must convert the volts corresponding to the actual angle to degrees of actual angle. The principle for modeling the conversion process is quite simple. You measure the voltage at 0o and 90o angles. Assuming a linear relationship between potentiometer volts and actual angle in degrees, the relationship can be written as:

actual angle = (actual voltage0deg voltage) * degrees_per_volt

where degrees_per_volt is obtained from the two calibrating measurements as:

degrees_per_volt = (90deg voltage0deg voltage) / 90

Combining the two relationships yields:

actual angle = (actual voltage0deg voltage) * (90deg voltage0deg voltage) / 90

This relationship can be implemented using standard arithmetic blocks.

Two limit blocks are used to limit the actual volts to be within zero and five volts and the output to be within 0o and 90o. This prevents the Volts to Degrees Converter subsystem from providing out-of-range values to the controller.