Fixed-Point Blockset | ![]() ![]() |
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:
Simulink's Signal Generator block generates a continuous-time reference signal. It is configured to output a square wave.
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.
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.
The digital controller is a subsystem that represents the software running on the hardware target. It is discussed in detail in Digital Controller Realization.
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.
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:
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.
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.
This is accomplished with a Bode plot. The evaluation is idealized since all numbers, operations, and states are double precision.
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.
![]() | Tutorial: Feedback Controller Simulation | Idealized Feedback Design | ![]() |