Fixed-Point Blockset    

Simulation Results

Using Simulink and the Fixed-Point Blockset, you can easily transition from a digital controller described in the ideal world of double precision numbers to one realized in the world of fixed-point numbers. The simulation approach used in this tutorial follows these steps:

  1. Take an initial guess at the scaling. For this tutorial, an initial "proof of concept" simulation using a reasonable guess at the fixed-point word size and scaling is the first step in simulating the digital controller. This step is included only to illustrate how difficult it is to guess the best scaling.
  2. Perform a global override of the fixed-point data types and scaling using double precision numbers. The maximum and minimum simulation values for each digital controller block are logged to the workspace.
  3. Use the automatic scaling procedure. This procedure uses the doubles simulation values previously logged to the MATLAB workspace, and changes the scaling for each block that does not have its scaling fixed.
  4. Perform a simulation on the "fixed" hardware block by overriding the data type with doubles. This simulation determines whether the A/D hardware warrants modification or replacement.

The feedback controller simulation is performed with the Fixed-Point Blockset Interface tool. You launch the Interface tool by selecting the FixPt GUI block within the fxpdemo_feedback model, by selecting Fixed-Point from the Tools menu in the model window, or by typing

at the command line. The four simulation trials are described in the following sections. The quality of the simulation results is determined by examining the input and output of the analog plant.


 Digital Controller Realization Simulation 1: Initial Guess at Scaling