Constructing the encoder feedback

The output of variable GR_local and the output of the sampleHold block are wired into a fixed-point mul block with the following configuration:



You can choose the radix point bits or select auto scaling. This option, together with the global settings in the Tools > Fixed Point Block Set Configure dialog, let you automatically monitor the maximum and minimum values seen by the block, and adjust the radix point bits to yield maximum precision while preventing numerical overflow.

Safely maximizing the dynamic range of each computation is by far the most time-consuming component in the rapid prototyping cycle. Fixed Point blocks reduce this tedious exercise to a few mouse clicks.

Next, the mul output is connected to an abs block to compute the absolute value, which in turn is fed into a fixed-point gain block. The gain output is wired into a map block, which points to the look-up table data file THETA2X.MAP and has a Scaled Int data type. THETA2X.MAP output is fed into the variable xhat.