You are on page 1of 16

University of Maribor Faculty of Electrical Engineering and Computer Science Smetanova ulica 17, 2000 Maribor Slovenia INSTITUTE

Of ROBOTICS

ADDA Interface Card Library and Demonstration Examples Technical Documentation

Authors:

Darko Hercog Suzana Uran

dsp2lib version: Terminal version: MATLAB version:

1.5.04 1.5.5 6.5

October, 2005

ADDA interface card demos

TABLE OF CONTENT

TABLE OF CONTENT

1. 2. 3.

ABOUT THIS DOCUMENTATION ....................................................................1 ADDA INTERFACE CARD HARDWARE DESCRIPTION .....................................2 SIMULINK BLOCKS FOR ADDA INTERFACE CARD..........................................4 ADDA ADDA ADDA ADDA analog input 1...................................................................................... analog input 2...................................................................................... analog output ...................................................................................... DSP-2 Interface block ........................................................................... 6 7 8 9

4. 5.

DEMO EXAMPLES FOR DSP-2 ADDA INTERFACE CARD ................................10 APPENDIX ..................................................................................................13

4.1. DEMO EXAMPLE OF DSP-2 LEARNING MODULE AND ADDA INTERFACE CARD .........................10

TABLE OF FIGURES

ii

TABLE OF FIGURES

Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure

1: photo of ADDA interface card ....................................................................... 2 2: The circuit of the ADDA interface card............................................................ 2 3: photo of DSP-2 learning module, ADDA interface card and custom breadboard .... 3 4: ADDA interface card Simulink library ............................................................. 4 5: ADDA interface card blocks in Simulink Library Browser ................................... 5 6: GUI of ADDA DSP-2 Interface block ............................................................... 6 7: GUI of ADDA DSP-2 Interface block ............................................................... 7 8: GUI of ADDA DSP-2 Interface block ............................................................... 8 9: GUI of ADDA DSP-2 Interface block ............................................................... 9 10: ADDA DSP-2 Interface block algorithm ......................................................... 9 11: DSP-2 ADDA interface card demos .............................................................10 12: Simulink block scheme of ADDA simple demo example ..................................11 13: demo example in DSP Terminal..................................................................12 14: DSP-2 learning module connector...............................................................13

CHAPTER 1: ABOUT THIS DOCUMENTATION

1. About this documentation


In this documentation short hardware description of the ADDA interface card is presented. It is assumed that user is familiar with DSP-2 controller, DSP-2 Library for Simulink and DSP Terminal. If this is not the case the user is kindly invited to read the documentation which could be found on the following internet address: http://www.ro.feri.uni-mb.si/projekti/dsp2/documentation.htm Related documentation: DSP-2 Users Manual DSP-2 Library for Simulink Users Manual DSP Terminal Users Manual

CHAPTER 2: ADDA INTERFACE CARD HARDWARE DESCRIPTION

2. ADDA interface card hardware description


ADDA interface card (Figure 1) is an interface between D/A converter and two A/D converters (A/D 1 and A/D 2) of the DSP-2 learning module. The output of the D/A converter is called AO (Analog output). The input for A/D 1 converter is called AI1, and similarly the input for A/D 2 converter is called AI2. The +, - and GND pins are power supply pins for power supply needed in the case of active circuits built on the breadboard. + means +15 V power supply, - means 15 V power supply, and GND is ground (Figure 14).

Figure 1: photo of ADDA interface card

The circuit of the ADDA interface card is shown in Figure 2. It consists of three voltage followers (buffers) and 2 resistor dividers.

Figure 2: The circuit of the ADDA interface card

Detailed description of DSP-2 connector can be found on page 13. The D/A output voltage range is between 0 and 8 V therefore the AO output voltage range is the same. The A/D 1 and A/D 2 input voltage range is between 2 V. The allowed input voltage range for AI1 and AI2 is between +/- 12 V. The two resistor dividers reduce the input voltage range of AI's to the range of A/D inputs.

CHAPTER 2: ADDA INTERFACE CARD HARDWARE DESCRIPTION

Figure 3: photo of DSP-2 learning module, ADDA interface card and custom breadboard

CHAPTER 3: SIMULINK BLOCKS FOR ADDA INTERFACE CARD

3. Simulink blocks for ADDA interface card


In this chapter, Simulink blocks for DSP-2 ADDA interface card are described. Blocks are placed in DSP-2 ADDA Library (Figure 4). To access this library, enter dsp2addalib in MATLAB command window. Blocks are also accessible in Simulink Library Browser under DSP-2 controller -> Plants -> ADDA interface card (Figure 12).

Figure 4: ADDA interface card Simulink library

CHAPTER 3: SIMULINK BLOCKS FOR ADDA INTERFACE CARD

Figure 5: ADDA interface card blocks in Simulink Library Browser

CHAPTER 3: SIMULINK BLOCKS FOR ADDA INTERFACE CARD

ADDA analog input 1


Description: ADDA Analog Input 1 block reads analog voltage at the input port AI1 (input of A/D 1 converter) of the ADDA interface card. The range of the input voltage is +/- 12 V. Note: this block should be placed in Simulink model only, if ADDA interface card is attached to the DSP-2 learning module.

Figure 6: GUI of ADDA DSP-2 Interface block

Parameters:

Sample time Sample time must be an integer multiple of the base sample time (Fixed sample time parameter).

CHAPTER 3: SIMULINK BLOCKS FOR ADDA INTERFACE CARD

ADDA analog input 2


Description: ADDA analog input 2 block reads analog voltage at the input port AI2 (input of A/D 1 converter) of the ADDA interface card. The range of the input voltage is +/- 12V. Note: this block should be placed in Simulink model only, if ADDA interface card is attached to the DSP-2 learning module.

Figure 7: GUI of ADDA DSP-2 Interface block

Parameters:

Sample time Sample time must be an integer multiple of the base sample time (Fixed sample time parameter).

CHAPTER 3: SIMULINK BLOCKS FOR ADDA INTERFACE CARD

ADDA analog output


Description: ADDA analog output block sets output voltage at AO port of DSP-2 learning module (output of D/A converter) to the value specified at the input of the block. The range of output voltage is +/- 8 V. Note: this block should be placed in Simulink model only, if ADDA interface card is attached to the DSP-2 learning module.

Figure 8: GUI of ADDA DSP-2 Interface block

Parameters:

Sample time Sample time must be an integer multiple of the base sample time (Fixed sample time parameter).

CHAPTER 3: SIMULINK BLOCKS FOR ADDA INTERFACE CARD

ADDA DSP-2 Interface block


Description: ADDA DSP-2 Interface block contains all blocks that are needed when developing algorithm for DSP-2 ADDA interface card (Figure 10). This interface block contains ADDA analog output, ADDA analog input 1, ADDA analog input 1 blocks (Figure 10). Description of these blocks can be found on pages 6, 7 and 8. Note: this block should be placed in Simulink model only, if ADDA interface card is attached to the DSP-2 learning module.

Figure 9: GUI of ADDA DSP-2 Interface block

Figure 10: ADDA DSP-2 Interface block algorithm

Parameters:

Sample time Sample time must be an integer multiple of the base sample time (Fixed sample time parameter).

CHAPTER 4: DEMO EXAMPLES FOR DSP-2 ADDA INTERFACE CARD

10

4. Demo examples for DSP-2 ADDA interface card


For easier beginning with examples are prepared. MATLAB demos. You can window. In Help window interface card (Figure 11). DSP-2 learning module and ADDA interface card, demonstration All DSP-2 related demonstration examples are placed inside access to DSP-2 demos by typing demos in MATLAB command navigate to Blocksets > DSP-2 Library for Simulink > ADDA

Figure 11: DSP-2 ADDA interface card demos

4.1. Demo example of DSP-2 learning module and ADDA interface card
After the ADDA simple example is selected in ADDA interface card folder (Figure 11), Simulink model shown in Figure 12 will appear.

CHAPTER 4: DEMO EXAMPLES FOR DSP-2 ADDA INTERFACE CARD

11

Figure 12: Simulink block scheme of ADDA simple demo example

In the left above corner of the Simulink block scheme Edit Parameters, Update Parameters, Build and HELP buttons exist. In order to run demo on DSP-2 controller follow the steps: double click Update Parameters button and then double click Build button.

Double click on Build block starts the code generation process for the DSP-2 controller from Simulink block scheme. When the code generation process is completed, DSP Terminal program is automatically invoked and generated code is downloaded to the DSP-2 learning module. On the ADDA interface card place a wire connection between AO port and AI1 port. In DSP Terminal select PG_OUT and AI1. After this, selected signals will appear in Terminal graph (Figure 13). Parameter inspector window (Figure 13) enables on-the-fly parameter tuning. In this demo example, pulse generator amplitude, pulse generator frequency and both gains (AD1_GAIN, AD2_GAIN) are changeable in online mode (meanwhile generated code is executing on DSP-2 controller). More informations about DSP Terminal can be found in DSP Terminal Users Manual: http://www.ro.feri.uni-mb.si/projekti/dsp2/documentation.htm

Now you can place custom plant between AO, AI1 and AI2 ports.

CHAPTER 4: DEMO EXAMPLES FOR DSP-2 ADDA INTERFACE CARD

12

Figure 13: demo example in DSP Terminal

CHAPTER 5: APPENDIX

13

5. Appendix
DSP-2 learning module connector

Figure 14: DSP-2 learning module connector

You might also like