Simulink Model of a Feedback Design

You can run the Simulink model of the feedback design by launching the MATLAB Demo browser and selecting the Scaling a Fixed-Point Control Design demo. You can launch the browser by typing

demo blockset 'Fixed Point'

at the command line, or by opening the Demos block found in the Fixed-Point Blockset library. Alternatively, you can access the model directly by typing its name at the command line.

fxpdemo_feedback

The MDL-file automatically runs the M-file preload_feedback, which populates the workspace with the required parameter values. The feedback design model is shown below.

The model consists of these blocks:

  • Reference - Simulink's Signal Generator block generates a continuous-time reference signal. It is configured to output a square wave.

  • ZOH - Simulink's Zero-Order Hold block samples and holds the continuous signal. This block is configured so that it quantizes the signal in time by an amount tsamp = 0.01 second.

  • Analog to Digital Interface - The analog to digital (A/D) interface consists of a FixPt Gateway In block that converts a Simulink double to a Fixed-Point Blockset data type. It represents any hardware that digitizes the amplitude of the analog input signal. In the real world, its characteristics are fixed.

  • Digital Controller - The digital controller is a subsystem that represents the software running on the hardware target. It is discussed in detail in Digital Controller Realization.

  • Digital to Analog Interface - The digital to analog (D/A) interface consists of a FixPt Gateway Out block that converts a Fixed-Point Blockset data type into a Simulink double. It represents any hardware that converts a digitized signal into an analog signal. In the real world, its characteristics are fixed.

  • Analog Plant - The analog plant is described by a transfer function, and is the object controlled by the digital controller. In the real world, its characteristics are fixed.

Simulation Setup

Setting up the fixed-point feedback controller simulation involves these 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). The main components modeled in this feedback design are the A/D hardware, the digital controller, the D/A hardware, and the analog plant.

  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 - This is accomplished with a Bode plot. The evaluation is idealized since all numbers, operations, and states are double precision.

  4. Simulate the system - The feedback controller design is simulated using Simulink and the Fixed-Point Blockset. Of course, in a simulation environment, you can treat all components (software and hardware) as though their characteristics are not fixed.