DSPACE

From PrattWiki
Revision as of 23:59, 7 February 2012 by DukeEgr93 (talk | contribs)
Jump to navigation Jump to search

dSPACE generally refers to a microprocessing card used in the Controls labs for ECE 141 and ME 125.

Templates

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

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 that for every channel, there is an "Out" block with an appropriate label - be sure to copy the entire chain of blocks for a particular channel. If you are using any of the first four ADC channels, you may as well drag the entire assembly into your model.

Note, however, that the output port numbers - the value inside the rounded rectangle - may change as a result of conflicts with other inputs and outputs in your system. These numbers do not actually have an impact on how ControlDesk gets information from your system so you do not need to "fix" these. ControlDesk only cares about the name of the block - the text shown below the block itself.

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 the uDAC#. The main purpose of the uDAC# block is to provide a single point of contact for the input value to a DAC channel - the signal will be split between the gain block (needed to reduce the value of the signal by a factor of 10 since dSpace has a built-in gain of 10) and the "Out" block which will be used in dSpace. The other purpose of the uDAC# block is to convert whatever value is being sent to the DAC card to a signal that the "Out" block will recognize. For example, constants directly connected to "Out" blocks will not generate signals that ControlDesk can read, but constants connected through unity gain blocks do.

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 or just make sure to make a connection from the wire coming out of the appropriate gain block.

Accessing Values with ControlDesk

With respect to ControlDesk, you will generally want to access the "In" value of the relevant ADCn or DACn "Out" block to get the voltage measurement or setting from the channel.

Additional Information

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