DSPACE

From PrattWiki
Revision as of 17:53, 12 September 2010 by DukeEgr93 (talk | contribs)
Jump to navigation Jump to search

dSPACE generally refers to a microprocessing card used in the ME 125 labs. As more dSPACE tutorials become available, this page will list them.

Templates

  1. DACtemplate.mdl - containing all eight DACH linkages, including input ports and 1/10x gains.
    DAC template
  2. ADCtemplate.mdl - containing all eight ADCH linkages, including output ports, 10x gains, and a demultiplexer for the first four channels.
    ADC template

Currently there are two useful templates for the dSPACE cards with Simulink. To download, right-click the link to the file name and download it to your computer. Pictures of the .mdl files are shown at right.

To use the templates, simply download them, open them in Simulink, and drag-and-drop the relevant channels into your model. Note, however, that the output port numbers may change as a result of conflicts with other inputs and outputs in your system. After saving the model, you may want to go back and re-number those ports before continuing though that is not required.

In each case, if you want ControlDesk to determine the value being set to the DAC channels or being measured from the ADC channels, you should use "In1" value of the appropriately named "Out" block. For example, to determine the voltage being measured on ADCH7, you would want to look at the "In1" value of the ADC7 block (the rounded-rectangle to the right and below the GainADC7 block).

In Simulink, if you want to set the voltage for a particular DAC channel, delete the appropriate zero constant (C#) and make a new connection to it. If you want to send the ADC output values to another part of the diagram, simply delete the appropriate terminator (T#) block and make a new connection to it.

Files for Labs

  1. Instrumentation Lab: TakeData1.m file

Accessing Values with ControlDesk

With respect to ControlDesk, you will generally want to access the output value of the relevant ADCn gain to get the actual measurement from the channel and you will want to access the output value of the block just before the DGn gain to get the desired voltage sent to the DACHn card. For the template itself, this will be the output of the DACn in port; if you are performing signal processing to assign a voltage value - and have thus removed the in port - you will need to use the output value from whatever block feeds into the DGn block.


Questions

Post your questions by editing the discussion page of this article. Edit the page, then scroll to the bottom and add a question by putting in the characters *{{Q}}, followed by your question and finally your signature (with four tildes, i.e. ~~~~). Using the {{Q}} will automatically put the page in the category of pages with questions - other editors hoping to help out can then go to that category page to see where the questions are. See the page for Template:Q for details and examples.

External Links

References