How do I Implement a Discrete Derivative in my Simulation Loop? Primary Software: LabVIEW Development Systems>>Professional Development SystemPrimary Software Version: 8.5 Primary Software Fixed Version: N/A Secondary Software: LabVIEW Modules>>Control Design and Simulation Module
Problem: The LabVIEW Control Design and Simulation Module includes a Discrete Integrator for Discrete Linear Systems, but not a Discrete Derivative. The Module does include Integrator and Derivative functions for Continuous Linear Systems. How can I calculate a derivative for a Discrete Linear System in a Simulation Loop? Solution: You can calculate a discrete derivative in a Simulation Loop in many different ways. Perhaps the simplest way is to drop down a Derivative x(t) PtByPt.vi into the Simulation Loop. After inserting the Derivative x(t) PtByPt.vi, right-click on this VI, select SubVI Node Setup..., and choose Discrete under Simulation subVI execution type.
Derivative x(t) PtByPt.vi on the Block Diagram Functions Palette under Signal Processing»Point By Point»Integral & Differential PtByPt.Another method for calculating a discrete derivative inside a Simulation Loop involves using the Discrete Unit Delay VI. You may refer to the attached DiscreteDerivs.vi program for a demonstration of how to use each method for calculating a discrete derivative inside of a Simulation Loop. Please note that the Derivative x(t) PtByPt.vi uses a 2nd Order Central derivative method where the derivative is calculated over two time steps instead of a single time step. The 2nd Order Central method is described in the detailed help for the Derivative x(t).vi as follows:The differentiation f(t) of a function F(t) is defined as
If method is 2nd Order Central, Y is given by the following equation:
where n is the number of samples in x(t), x–1 is the first element in initial condition, and xn is the first element in final condition. Related Links: NI LabVIEW Control Design and Simulation Module Attachments:
Report Date: 12/28/2007 Last Updated: 01/11/2008 Document ID: 4GR8P7Q7 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||


