Signals and Systems Laboratory Exercise 1

0 downloads 0 Views 2MB Size Report
Feb 27, 2009 - You will also familiarise yourself with the dSPACE digital signal processing system. ... At the end of the lab, save all of your files to a thumbdrive or a network .... Create the following block diagram in simulink which you wish to ...
Signals and Systems Laboratory Exercise 1 Introduction to Simulink and dSPACE System February 27, 2009

Objective The objective of this lab is to get familiarised with Simulink, which is an extension of MATLAB, learn how to implement systems with given mathematical description and analyse them. You will also familiarise yourself with the dSPACE digital signal processing system. You will use what you have learned in this lab in future labs where various systems will have to be simulated in Simulink or implemented in dSPACE DSP board. This lab is an exception in that it does not have the prelab part, and hence you will not need to hand in any prelab reports at the beginning of this lab. Create a subdirectory ‘Lab1’ in the directory ‘C:\Matlab\R2008a\work\student’. (This directory is a mirror of ’My Documents’) Save your models, plots, data files in the ‘Lab1’ directory you created. At the end of the lab, save all of your files to a thumbdrive or a network disk because the computers in the control lab are wiped daily and all the data not saved to an external location will be lost. You will hand in your lab report at the end of the lab. It should include a brief description of the experiments and their purpose, sketches or plots of the implemented systems with all the relevant information, tables of parameters, plots and comments if necessary.

Assessment The report will be assessed as ‘Pass/Fail’. Percentage mark will not awarded.

1 Simulink 1.1 Building Your First Model Simulink can be started by typing simulink at the prompt in MATLAB’s command window, or by clicking on the Simulink button on the MATLAB toolbar. The Simulink library browser 1

will open.

Figure 1: Simulink Browser window.

Library

Figure 2: A simple model with integrator and differentiator.

To see the content of the blockset, click on the “+” to its left. To create new a model click on the ‘New Model’ icon. A new window will open in which you will build the model. You will create the model by ‘dragging and dropping’ blocks from the library browser to the model window, and by connecting these blocks with lines. If Simulink blockset is not already open, click on the ‘+’ to its left and then click on ‘Sources’. Drag ‘Sine Wave’ block into your model window. From ‘Commonly Used Blocks’ drag ‘Integrator’, ‘Mux’ and ‘Scope’ to the model window. From ‘Continuous’ drag ‘Derivative’ to the model window. You can connect blocks by clicking and dragging between their output and input ports. Alternatively, to quickly connect two blocks, click on one block, and then ‘control-click’ on the other. Arrange and connect the blocks in your model as shown in Figure 2. Type ‘20’ in the duration field, right from the ‘Play’ button. Double click on the scope to open the window with its display, and press the ’play’ button in the model window. You have run your first model and observed its inputs and outputs. Save this model as ‘model1’.

1.2 Simulating a First Order Continuous-time System Now you will model a first order system - a moving vehicle. The second Newton’s Law differential equation for this system can be written as: m

dv = F − bv dt 2

(1)

where m is the mass of the vehicle, v is its velocity, F is the force that causes it to move, and b is the damping factor, which is dependent on the wind resistance, friction etc. We assume that damping in this system is proportional only to the vehicle’s velocity. Equation 1 can be rewritten as: Z F − bv 1 dv = ⇒v= (F − bv)dt (2) dt m m Based on this equation you can now build the model. Use two gain blocks, one sum block, one integrator and scope from ‘Commonly Used Blocks’ and ‘Step’ from ‘Sources’, and connect them as shown in Figure 3. You can double-click the lines to name them after the signals from the equation. Save this model as ‘model2’.

Figure 3: Model of a first order system with step excitation Double-click on blocks to set their parameters to the following values: m = 1500 kg (You will be, in fact setting the gain to 1/1500) b = 40 N s/m (Set the gain to 40) F = 500 N (Leave initial value at 0, and set the final value to 500. Leave ‘step time’ at 1, and ‘sample time’ at 0) Parameters of the simulation, like solver, time step etc. can be set in ‘Simulation’ → ‘Configuration Parameters’. Open this dialog, and set ‘Stop time’ to 500. Do not change other options. 3

Double-click on each of the scopes to open their windows, click on the ‘Parameters’ button (next to the ‘Print’ button), go to ‘Data history’ tab and deselect ‘Limit data points to last’. This will enable you to see the whole trace in each window. Run the simulation by pressing the ‘Play’ button. You should see the results on the scope screens. Right-click on each of the scope screens, and click on ‘Autoscale’ to adjust the traces’ scale. We showed F and v on two different scopes because their orders of magnitude are different. When showing quantities of the same order of magnitude you can use one scope preceded by a ‘Mux’ block with appropriate number of inputs. Now modify your model as shown in Figure 4 to find the system’s impulse response (although this is not a recommended way of finding the impulse response). You can find the ‘To File’ block in ‘Sinks’. Modify them so that for one the filename is ‘F.mat’ and the variable name is ‘F’, and for the other the filename is ‘v.mat’ and the variable name is ‘v’. These blocks save the specified variables into matlab data files. Save this modified model as ‘model3’.

Figure 4: model of a first order system with impulse excitation Change the final value for Step1 to 10000. Modify the added ’Step’ block so that its step time is 1.1, initial value is 0 and final value is -10000. Run the simulation and observe the results. Compare ‘v’ with the result from the previous model. Load files ‘F.mat’ and ‘v.mat’ and verify that variables ‘F’ and ‘v’ now exist in MATLAB workspace. This is an alternative way of exporting variables to the workspace. Plot each variable in a separate figure and compare with the scopes’ output. (Note that variables saved in ‘mat’ files will be vectors with two rows. One row contains the simulation time, and the other the desired variable.)

4

1.3 Simulating a Second Order Continuous-time System A second order system is described by the differential equation of the form: d2 v dv + a1 + a0 v = F 2 dv dt

(3) 2

To build a Simulink model from this equation, we solve it for ddt2v , and integrate it twice: Z Z dv v = ( (F − a1 − a0 v)dt)dt (4) dt The model built in Simulink is shown in Figure 5.

Figure 5: Model of a second order system with step excitation The ‘To Workspace’ blocks can be found in ‘Sinks’. They export the variables from your simulation into MATLAB workspace, where they can be analysed or manipulated further. For each of the blocks you have to set the variable name, data limit and the format in which they will 5

be exported. Set the variable names to ‘F’, ‘v’, ‘d2v’ and ‘dv’ and as shown in Figure 5. These are for the force, the speed and its first and second derivative. For each block make sure that the ‘Limit data points to last’ is set to ‘inf’, and that the export format is ‘Array’. Set the values of parameters a1 and a0 to 0.2 and 1.1 respectively, by double-clicking on appropriate gain blocks. Set the simulation time to 50, run the simulation and observe the results on the scope. It shows you the step response of a second order system. Verify that variables ‘F’, ‘v’, ‘dv’ and ‘d2v’ have been exported to MATLAB workspace. You will also notice the variable ‘tout’ which was generated automatically and represents the simulation time axis. Plot each of the exported variables against the time (use the ‘subplot’ command to generate four plots in one figure. Change a1 from 0.2 to 0.1, run the simulation again and comment on the differences in the response. You will encounter this type of systems again in one of the future labs.

1.4 Simulating a Second Order Discrete-time System In discrete-time systems the observable quantities exist only in discrete instants of time. Unlike continuous-time systems, where these quantities are described by functions of a continuous time variable, in discrete-time systems they are described by number sequences. The systems themselves are described by difference equations (as opposed to differential equations for continuoustime systems). In general discrete-time system would be described by an equation of the form: y[n]+a1 y[n−1]+a2 y[n−2]+· · ·+aN y[n−N ] = b0 x[n]+b1 x[n−1]+b2 x[n−2]+· · ·+bM x[n−M ] (5) As an example we will look at a simple second-order system described by the equation: y[n] = b0 x[n] + b1 x[n − 1] + b2 x[n − 2]

(6)

In order to build a Simulink model, we first solve this difference equation for the most recent sample of the output y[n] This one is already given in that form, hence we can build the system shown in Figure 6. The coefficients are: b0 = b2 = 0.5 and b1 = 1. In addition to the blocks you already used, you will find the integer delay blocks in the ‘Discrete’ group in the ‘Simulink’ blockset, and the discrete-time sine wave source in ‘Signal Processing Sources’ in the ‘Signal Processing Blockset’. For the first source set the amplitude to 5, frequency to 1 Hz and sample time to 1/50. For the second source, leave amplitude at 1, set frequency to 24 Hz, and sample time to 1/50. Set the number of delays for both delay elements to ‘1’. The ‘To Workspace’ blocks are set up as previously described (Set one variable name to ‘in’, the other to ‘out’, and set export format for both blocks to ‘Array’). Since this is a discrete-time system, we need to set the solver appropriately. Go to the parameters configuration dialog (‘Simulation’ → ‘Configuration Parameters’, or press ‘Ctrl + E’), and set the solver type to ‘Fixed-step’ and ‘discrete (no continuous states)’. Set the stop time to 10. Run the simulation, and observe the result on the scope. Compare the input and output signals. What does this second order system do? 6

Figure 6: Model of a discrete second order system

2 dSPACE The dSPACE system is high performance digital control system based on the MPC8240 processor and the TMS320F240 DSP processor, a breakout panel and the software tools. It is directly interfaced with MATLAB/SIMULINK running on a PC. a SIMULINK block diagram is converted to real time C and plotting variables in real time in the DSP. In this part of the lab, you will familiarize yourself with some of the capabilities of the dSPACE system including the implementation of transfer functions and the ability to provide step inputs and to plot the resulting step responses of the systems under consideration. Your PC workstation in the control lab contains a dSPACE DS1104 DSP board. This board can be connected to the outside world via the breakout panel.

2.1 Creating a dSPACE Block Diagram We present a case study of using the dSPACE system. In order to use the dSPACE system, you must construct block dagrams on MATLAB/SIMULINK and run them on your dSPACE board. Create the following block diagram in simulink which you wish to implement on dSPACE; see Figure 7 Note that the ADC and DAC blocks included in this block diagram are specific to dSPACE and should be obtained from the dSPACE RTI1104 (DS1104 MASTER PPC) folder of the 7

Figure 7: Model of a discrete second order system simulink library browser. Also, ensure that you use the correct board which is ds1104. It is most convenient if you save this block diagram under the name ”lab1.mdl” throughout this part of the laboratory exercise. Make sure that MATLAB is set to the same directory where you saved this model by checking MATLAB’s file browser. (This way all the files required for building a ControlDesk experiment will be in the same directory where your model is) The signal applied to a dSPACE ADC channel must be in the range -10 to 10 volts. A signal of +10 volts gives an internal value of 1.00 within simulink. The dSPACE DAC converts give an output in the range of -10 to 10 volts. An internal value of 1.00 gives +10 volts on the DAC.

8

2.2 Compiling and Downloading Simulink Block Diagram In order to generate C code for your block diagram, go to the ‘Tools’menu and select ‘RTW options’ (‘RTW’ stands for ‘Real Time Workshop’), shown in Figure 8.

Figure 8: Options of RTW under ”Tools” menu This is necessary in order to configure simulink C code generation for use with dSPACE. (a) Select ‘Solver’ in the tree in the left pane and choose ‘Fixed-step’ and ‘ode1 (Euler)’ in ‘Solver options’. Set the ‘Fixed step size’ to a suitable value in seconds, (Say from 0.001 to 0.0001). This determines the sample period used in the real time implementation of the system. Smaller step size provides better resolution in dSPACE, but costs larger working space or memory space that displaying of some desired signals longer than one second cannot be done. Make sure the ‘stop time’ in ‘Simulation time’ box is set to “inf ”. If this is not done, the system will stop working after the specified time. The details are shown in Figure 9. (b) Select ‘Optimization’ in the tree and make sure that the status of ‘Block reduction’ is unchecked. (c) Go to the ‘Tools’ menu and select ‘RTW’ → ‘Build Model’. This will compile the block diagram and download it to the dSPACE board. Before compiling make sure that MATLAB is set to the same directory where you saved your model. The details are shown in Figure 10 (d) From now on, if you change the block diagram and do not need to change the ‘fixed step size’, you can compile the block diagram simply by going to the tools menu and choosing ‘RTW’ → ‘Build Model’.

2.3 The ControlDesk Package This is a powerful dSPACE software package used to interact with the program you have running on the dSPACE DSP board. In particular, it is used to change parameters in the model and to plot variables and signals in the DSP. 9

Figure 9: Simulink configuration setup for ‘Solver’ and ‘Optimization’

Figure 10: Build simulink configuration setup and corresponding successful compilation results

10

The following write up gives some basic instructions on the use of the ControlDesk package. However, in order to use the package correctly you will need to use the online help. The online help package is called “dSPACE HelpDesk”. To run this package choose the windows menu items as follows Start → Programs → dSPACE Tools → dSPACE HelpDesk Alternatively, you can run helpdesk by choosing ‘help’ from within ControlDesk. This online help system contains all the information about the ControlDesk package. In particular, if you can’t do something in ControlDesk, try looking it up in HelpDesk.

2.3.1 Overview

Figure 11: ControlDesk Window Main Window A typical ControlDesk window is pictured in Figure 11. As illustrated in the Figure, the main window contains a number of main elements: • Menu Bar. These Menus allow for the various commands to be given to ControlDesk. The menus are dynamic and depend on the view and element selected in the Navigator. • Tool Bar. These provide quick ways of given ControlDesk commands rather than using the menus. The tool bars can be turned on or off. • Working Area. This is the area in which a ControlDesk instrument layout is constructed and used. 11

• Navigator. The Navigator panel provides access to the different parts of a real-time experiment. These are, the Hardware View, the Experiment View and the Instrument View. The current view is controlled by the tabs at the bottom of the Navigator panel. • Tool Window. This window is used for various tools controlling the experiment depending on the view chosen from the Navigator. Most commonly used is the variable manager which enables the selection variables from a simulink model. • Status Bar. This displays some information about the state of the ControlDesk system.

2.4 Creating basic requirements ControlDesk allows you to collect the various files you need for a particular model in an ‘Experiment’. An experiment can consist of: (A) Hardware specification: This specifies which board the program runs on (In our case there is only one DSP board to worry about). (B) Variables: The ControlDesk package requires a ‘.sdf’ file corresponding to the simulink model which is running on the DSP board. This file is automatically generated when the simulink block diagram is complied as described in section 2.2. This file is specified for the given experiment in the Variable Manager section. (C) Instrumentation layout: In control desk, the instrumentation layout is used to display signals from the DSP and to adjust parameters in the DSP model. For each experiment, you must construct a layout to display the required variables and adjust the required parameters. 2.4.1 Creating a simple experiment We now outline how to create a simple experiment which is based on the simulink block diagram above. The aim of this experiment is to display the output signals, ‘Integrator1’, for this system using an oscilloscope type display. A gauge which displays the model ‘turnaround Time’ will be included. This is useful if we want to know how short we can make the system sample time (It must be at least greater than the turnaround time.). Start ControlDesk Start dSPACE ControlDesk from the Windows Start menu. Create a new experiment

12

Figure 12: Create a new experiment and specify the experiment name Go to the ‘File’ menu and select ‘New Experiment...’. In the ‘New Experiment’ window, you should then specify ’Experiment name’ “Lab1” for your experiment and specify the ‘Working root’ folder as ‘C:\Matlab\R2008a\work\MATLAB\Lab1’. The details are shown in Figure 12 It is most convenient in this laboratory, if the experiment is named “Lab1” which is the same name as the folder previously created. Click on the green ‘Platform’ tab (Pl...). This should indicate that a program is running on your ds1104 board (by the green triangle). If not, you can drag and drop the corresponding .obj (in the file selector window) file onto the ds1104 icon to download this program. And, click on the pale blue ‘Experiment’ tab. You should now see the hardware icon included in the experiment.

Figure 13: Program running on DS1104 board and hardware icon included in the experiment

Adding variables Add the required ‘.sdf’ file to the experiment, go to the ‘File’ menu and choose ‘Open Variable File...’. In the ‘Open’ window, select the ‘.sdf’ file corresponding to the simulink block digram constructed in previous section. Details of this point are shown in Figure 14. This should open a new ‘Tool’ window with your model name and also a window listing some variables for your model, shown in Figure 15. 13

Figure 14: Open variable file and the required variable file

Figure 15: new ‘Tool’ window and associated variables window

14

Also, you may wish to add your simulink block diagram to the experiment. This ‘.mdl’ file is not used by ControlDesk directly but it is useful to keep track of it. To add this file, go to the ‘File’ menu and choose ‘Import Files...’, which should lead to a new ‘External Files’ section in the ‘Experiment’ window with your ‘.mdl’ file included, shown in Figure 16

Figure 16: Add ”.mdl” file to experiment and the associated ‘experiment’ window

Adding Instrumentation Layout To construct an instrumentation layout for the experiment, go to the ‘File’ menu, click on ‘New’, and choose ‘Layout’. This should create a blank layout window as Working area, shown in Figure 11. Click on the ‘Instrumentation’ tab. You should then see a virtual instrument panel. Details for this step are shown in Figure 17 Click on ‘Data Acquisition’ panel and then click on the ‘Plotter Array’. Then move to the ‘Layout’ panel and draw a rectangle which will determine the size of your plot. (it should take up about half the available area but can be adjusted later if desired.) The plotter array is a container that can hold various plotters (for instance time plot, XY plot). Right click on it and select plotter. A set of axes should appear on your layout panel. The details are shown in Figure 18 The procedure for setting up the plotter to plot the desired variable is as follows: First move to the ‘Tool’ window and click on Model Root. The variable panel should display a list of variables associated with the simulink block diagram. Click on the variable denoted ‘Integrator1’, the output signal ‘Out1’ and its changeable value ”InitialCondition” corresponding to the simulink block labelled ‘Integrator1’ appear on the next window. Now drag and drop ‘Out1’ to the area just to the left of the plotter y-axis in the ‘Layout’ panel. The y-axis now should be lablelled ‘Integrator1’ and a red square appears indicating the color of the plot for 15

Figure 17: Construct an instrumentation layout and the associated view in ‘Instrumentation’ window

Figure 18: ‘Data Acquisition’ panel and a basic plot on ‘Layout’

16

this variable. Another way of achieving this is to simply drag the variable to the plotter array container. The plotter will automatically be created. Details of this point are shown in Figure 19

Figure 19: Model Root with variables corresponding to the simulink, and the assigned plot with ‘Integrator1’ The parameters of the plotter can be adjusted by right clicking on the plotter area and then

Figure 20: Plotter ‘Properties’ choosing the ‘Plotter Properties’ menu item. Then click on the axes tab. At this stage, the only thing we will adjust will be the Y-min value to −0.06 and the Y-max value to 0.06. Details for this point are shown in Figure 21. The time and triggering of the plotter can be controlled by using a ‘CaptureSettings’ instrument in ‘Data Acquisition’ panel. Click on the ‘CaptureSettings’ instrument icon and then draw a suitable rectangle in the ‘layout’ panel (About half of the available area.). Double click in the ‘CaptureSettings’ instrument on the ‘Settings...’ button, ‘dSPACE CaptureSetting Control Properties’ window will come out. Click on the ‘Capture’ tab. In the Capture window, click on the right down arrow and choose the only option available ‘DSP - lab1 - HostService’. Also, set the length variable to ”1” (second). Then click ‘OK’. In this case, the trigger variable will be the same variable that we are going to plot. Hence, again click on ‘Out1’ in ‘Variable’ panel and drag and drop it in the trigger window (just below the words ‘level’ and ‘delay’) in the capture instrument panel. 17

Figure 21: Set time and triggering of the plotter Details in this step are shown in Figure 21. Furthermore, you can then adjust the plot interval and trigger level to suitable values depending on the signal you are plotting. If the signal applied to the filter is a 1 Hz sine wave with amplitude of 10 V, then a suitable length is 1 sec. Turn the trigger on with AutoRepeat and leave the trigger level at 0. Running the experiment Connect the output of the signal generator to the dSPACE ‘ADC’ input of the dSPACE connector box (the input must match the ADC block in the Simulink model) and to the CRO channel 1 (use the provided T-piece). Set the signal generator to produce a 1Hz since wave with 5 Volts peak to peak. Connect the dSPACE ‘DAC’ output to CRO channel 2. The output must match the DAC block in the Simulink model. To start plotting (assuming that the signal generator has been connected to the DSP board connector panel), go to the ‘File’ menu, choose ‘Instrumentation’, and then select ‘Animation Mode’.

Figure 22: Start or stop plotting by choosing ‘Animation Mode’ or ‘Edit Mode’ respectively (There is also a corresponding button in the menu bar which can be used to start animation mode.) This should commence the interaction between your instrumentation layout and the DSP board. To stop, go to the ‘File’ menu, choose ‘Instrumentation’, and then select ‘Edit Mode’.

18

Plotting the results You can print the plots by right clicking on the plotter window and choosing the desired plotting option. You can choose the network printer as the output, or a PDF printer which will create a pdf file on the hard disk. Another possibility to print plots is to use screen capture (press ‘Alt + Print Screen’). Then run the ‘Paint’program and paste the capture into the program. The required plot can then be printed or saved. If you wish to save your traced data to a file so that it can be later loaded into MATLAB and printed, make the following adjustment to the properties of the capture instrument:

Figure 23: Save traced data process: during and after saving Click on the ‘setting’ button in the ‘CaptureSetting’ instrument. Select ‘Acquisition’ tab and check ‘Autosave’. Then specify a filename, in which the data will be stored: e.g., ‘output.mat’, in the coming up window. Then run the animation again. It is best to tick off ‘Autorepeat’ this time since every time a trace is plotted, it will also overwrite this file. After the capture is complete, you can open this file and plot it from your MATLAB command window as follows: >> load output >> plot(output.X.Data,output.Y.Data) This plot can then be printed if required. Adding Virtual Instrument

19

The final step in this example will be to add a gauge to our layout which displays the program turnaround time. With the layout in ‘Edit Mode’, click on the ‘virtual instrument’ button in the ‘virtual instrument’ panel and then click on the ‘Gauge’ instrument icon. Then draw a suitable size rectangle in the layout panel for the gauge. A gauge should appear in the layout. To get this gauge to display the turnaround time, click on the ‘Timer Task1’ item in the Tool Window (click the ‘+’ in front of ‘Task Info’ if necessary). The variable panel should then display various variables associated with the program running on the DSP board. Drag and drop the ‘turnaround Time’ item onto the gauge instrument in the panel layout panel. The gauge should now be labelled ‘turnaroundTime’.

Figure 24: Creating turnaround time Right click on the gauge instrument and choose properties as Figure depicted in Figure 25 in ‘Gauge’ and ‘Tics’ panel. Restarting the animation, this gauge should now display the turnaround Time in micro seconds. Adding Instrumentation Layout to Experiment This complete the layout for this experiment. The layout can be added to the experiment by right clicking on the layout panel and then choosing ‘Add layout to Experiment’ (This will also you to save your layout to disk which you should do). A new Instrumentation element should appear in your experiment listing which contains the corresponding layout file. Experimental Result 20

Figure 25: Set turnaround time properties The final ControlDesk window should be something like this:

Figure 26: Final ControlDesk Window

2.4.2 Using dSPACE to find a step Response The best way to use the dSPACE system to construct a step response is to add a ‘constant’ block to your simulink block diagram which will provide the step input. Then use the ControlDesk package to control the step and view the resulting step response using a ‘plotter’ instrument. Providing Step Input

21

To provide the step input, we do NOT use the standard simulink step block. (The step would be over before we had time to set things up.) Rather we add a ‘constant’ block whose value will be adjusted by ControlDesk to provide the step input at the required time. Also, the ADC and DAC blocks can be removed. This leads to the following simulink block diagram:

Figure 27: Simulink block diagram for step response Compile the system shown in Figure 27. ControlDesk Return to ControlDesk and modify the existing layout as shown:

Figure 28: Instrument layout for step response

22

(A) In this layout, the plotted signal is the output of the system ‘Integrator1’. Also, plotted on the same graph is input to the system ‘Constant’. This is achieved by dragging corresponding signals of these variables to the Y-axis of the plot. (B) The ‘CaptureSetting’ instrument is set up as depicted in Figure 28. In this case, the ‘trigger’ variable is the variable ‘ P Value’ of ‘Constant’. The ‘Length’ of time is 10 sec and the downsampling factor is set to 10. ‘Downsampling’ is used to ensure the DSP does not run out of memory with this long time interval. Triggering needs to be set up for the rising edge, with the trigger level of 0.5. Also, the data can be saved to a file and loaded into MATLAB as explained earlier. (C) A step input is achieved by using ”On/Off” function of the ‘RadioButton’ instrument in

Figure 29: Create RadioButton ‘Virtual Instruments’ panel to control the ‘Constant’ block in the simulink block diagram. To achieve a step input, click on the ‘RadioButton’ instrument icon in ‘Virtual Instruments’ panel and then draw a suitable rectangle in the ‘layout’ panel as depicted in Figure 29. Click on the ‘Constant’ variable in the ‘Tool’ window. Drag the value parameter variable ‘ P Value’ to the drawn rectangle. Double click this rectangle to set the properties of this instrument as shown in Figure 30 Select ‘Button-ID’ panel and click on "Button 00". Change “Button 00” to “On” in ‘Text:’ of ‘Button-Properties’ and set the ‘Value:’ to ”1”. Change ‘Button 01’ to “Off” with ‘Value:’ of “zero” in the same way. (D) The above layout also includes two Display instruments. One displays the input value parameter variable ‘ P Value’ and the other displays the output signal‘Out1’ of variable ‘Integrator’. To achieve this, click on the ‘Display’ instrument icon in ‘Virtual Instruments’ panel and then draw a suitable rectangle in the ‘layout’ panel as depicted in Figure 31.

23

Figure 30: RadioButton properties

Figure 31: Create Display

24

(E) Double click this rectangle to set the properties of this instrument Select ‘Digits’ panel and change ‘DigitCount:’ to ‘3’. Double click ‘Display Format...’ and change ‘Precision:’ in ‘Type Settings’ on the coming up ‘Display Format’ window to ‘2’. Details of this point are depicted in Figure 32 (F) After setting properties, copy the ‘Display’ rectangle and paste a new one, which has the same properties of the original one. Click on the ‘Constant’ variable in ‘Tool’ window. Drag the value parameter variable ‘ P Value’ to one of ‘Display’ rectangles. And, drag the output signal ‘Out1’ of the variable ‘Integrator1’ to the other ‘Display’ rectangle.

Figure 32: Display properties (G) To use this ControlDesk experiment, the layout should be put in animation mode and then the ‘Constant’ value set from ”Off” to ”On”. This should trigger the data capture and produce the resulting step response.

25