Introduction to the Tutorial

Opening the Demo Model

Open the Simulink model of the feedback design by starting the Help browser, clicking the Demos tab, and selecting "Scaling a Fixed-Point Control Design" from the list of Simulink Fixed Point demos. Alternatively, you can access the model directly by typing its name at the MATLAB command line:

fxpdemo_feedback

The feedback design model is shown here.

About the Demo Model

The Simulink model of the feedback design consists of the following blocks and subsystems:

Simulation Setup

To set up this kind of fixed-point feedback controller simulation, typically you perform the following steps:

  1. Identify all design components.

    In the real world, there are design components with fixed characteristics (the hardware) and design components with characteristics that you can change (the software). In this feedback design, the main hardware components are the A/D hardware, the D/A hardware, and the analog plant. The main software component is the digital controller.

  2. Develop a theoretical model of the plant and controller.

    For the feedback design used in this tutorial, the plant is characterized by a transfer function. The characteristics of the plant are unimportant for this tutorial, and are not discussed.

    The digital controller model used in this tutorial is described by a z-domain transfer function and is implemented using a direct-form realization.

  3. Evaluate the behavior of the plant and controller.

    You evaluate the behavior of the plant and the controller with a Bode plot. This evaluation is idealized, because all numbers, operations, and states are double-precision.

  4. Simulate the system.

    You simulate the feedback controller design using Simulink and Simulink Fixed Point software. Of course, in a simulation environment, you can treat all components (software and hardware) as though their characteristics are not fixed.

Idealized Feedback Design

Open loop (controller and plant) and plant-only Bode plots for the "Scaling a Fixed-Point Control Design" demo are shown in the following figure. The open loop Bode plot results from a digital controller described in the idealized world of continuous time, double-precision coefficients, storage of states, and math operations.

The plant and controller design criteria are not important for the purposes of this tutorial. The Bode plots were created using workspace variables produced by an M-file script named preload_feedback.m.

Digital Controller Realization

In this simulation, the digital controller is implemented using the fixed-point direct form realization shown in the following diagram. The hardware target is a 16-bit processor. Variables and coefficients are generally represented using 16 bits, especially if these quantities are stored in ROM or global RAM. Use of 32-bit numbers is limited to temporary variables that exist briefly in CPU registers or in a stack.

The realization consists of these blocks:

Direct Form Realization

The controller directly implements this equation,

where

The first summation in y(k) represents multiplication and accumulation of the most recent inputs and numerator coefficients in the accumulator. The second summation in y(k) represents multiplication and accumulation of the most recent outputs and denominator coefficients in the accumulator. Because the FIR coefficients, inputs, and outputs are all represented by 16-bit numbers (the base data type), any multiplication involving these numbers produces a 32-bit output (the accumulator data type).

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS