Some notes on using dSPACE equipment:

  1. The boxes are labeled "dspace01" through "dspace10". Boxes 2, 3, and 9 are not working properly and should be avoided. The remaining boxes are working properly, as far as we know; if you discover a box that is not working, please inform Professor Kozick.

  2. The pins for input/output are labeled on the top of the box. The pins most of you will need are "ADC 1" through "ADC 4", "DAC 1" through "DAC 4", and "Analog GND". These are the 4 input channels, output channels, and grounds, respectively.

  3. A real-time implementation needs to contain "DS1102" blocks in the Simulink diagram. The library of these blocks is obtained by typing "dslib" at the Matlab prompt. Use the DS1102 blocks, since that is the model of dSPACE that we have in room 129. You will also need to use "PLUGS" to specify which channels are connected to hardware.

  4. To execute a Simulink block diagram on dSPACE:
        Choose "Code" and "Real Time Options...", then set:
            Step Size:  A number, which is the sample spacing in seconds
            Template Makefile:  rti31.tmf
            Build Command:
                make_rt CLIENT=dspace04
        (Use whichever dspace # you happen to be using!)
        Then click "Build" to download the program.
    

  5. To do real-time update of parameters from Simulink:
        This will allow a program running on the dSPACE to be changed
        "on-the-fly" from the Simulink diagram.  To set this up:
            Under "Simulation", choose "External"
            Then under "External Options...", type
                rtcom31 CLIENT=dspace04
            (or whichever dspace # you are using!)
            Then choose "Start" under "Simulation", and changes will take
            effect on the dSPACE box.
    

  6. A tool called "trace31" is available as a virtual oscilloscope that can be used to probe signals on the dSPACE as it is running. Trace31 is also useful for transferring data from the dSPACE box to the Suns for non-real time analysis. To run trace31 for a system created with Simulink, just type trace31 & at a UNIX prompt, and then load the corresponding .trc file. Running trace31 for a system created as a C program requires a bit more work, which I will provide later.

  7. To download a C program called foo.c to dspace04, type

    down31 foo -c dspace04

    at a UNIX prompt. Once you have compiled a program, you can replace down31 with ld31. This will save some time, since the compile step will be skipped, and the program is loaded and run on the dSPACE box.

  8. The following note is useful when you have trouble downloading a program to a dSPACE box. All communication between the Sun computers and the dSPACE boxes is coordinated by a program called "dsp_daemon" that runs on one of the Sun servers. This program occasionally gets into a "bad state" and does not allow you to download programs.

    This can be fixed as follows. Suppose you are working with dspace04. Then type:

    dcont -c dspace04 -k
    dsp_daemon -c dspace04 -u

    If you still are not able to download a program, try the following sequence of commands (assuming you are downloading C program foo.c to dspace04):

    down31 foo -c dspace04
    ld31 foo -c dspace04
    dcont -c dspace04 -k
    dsp_daemon -c dspace04 -u
    ld31 foo -c dspace04
    ld31 foo -c dspace04