Difference between revisions of "User:DukeEgr93/DSPACE"

From PrattWiki
Jump to navigation Jump to search
Line 3: Line 3:
 
== General Startup ==
 
== General Startup ==
 
The following describes how to begin an experiment from scratch.  More information will be provided later on how to reload an already-completed experiment.
 
The following describes how to begin an experiment from scratch.  More information will be provided later on how to reload an already-completed experiment.
 
  
 
# Start dSpace ControlDesk (CD)
 
# Start dSpace ControlDesk (CD)
Line 17: Line 16:
 
# Create the model (this must be done before variables can be generated in the next step; more information below about different models)
 
# Create the model (this must be done before variables can be generated in the next step; more information below about different models)
 
# Right click the Simulink platform and select Build Variable File.  Save the model if need be
 
# Right click the Simulink platform and select Build Variable File.  Save the model if need be
 +
 +
== Generate a Signal ==
 +
Go through the steps in General Startup, stopping at "Create the model..."  Then:
 +
# Generate the signal - this is easily done by importing a Sources->Clocck and a User-Defined Functions->Fcn block.  Connect the clock to the Fcn block, then put the function you want in the Fcn block.
 +
# Tell dSpace to take data - go to the dSpace RTI1104 blockset in the Simulink library, expand it and click the DS1104 MASTER PPC set within it.  Drag a DS1104DAC_C1 block into your model
 +
# In the model, double-click the DS1104DAC_C1 block to set properties:
 +
#* Unit: pick the channel (for this document, we will use DACH1)
 +
#* Initialization: should already be set to 0 V
 +
#* Termination: make sure the block will set the output to 0 volts on termination

Revision as of 19:42, 21 July 2008

This is a personal sandbox for using the dSpace systems in Hudson 149. Several parts of it will move to the main site eventually.

General Startup

The following describes how to begin an experiment from scratch. More information will be provided later on how to reload an already-completed experiment.

  1. Start dSpace ControlDesk (CD)
  2. In CD, go to File->New Experiment
    • Give the experiment a name, decide where you want all the files to go for the Working root, add author information and a description; when completed, the Experiment tab will have the name of the experiment as well as a .cdd link.
  3. Click on the Platform tab, right click Simulink, and Open Matlab - the first time MATLAB is started on a computer it will take quite some time to start up. When ready, the Simulink logo in the Platform window will be in color
  4. Within the new MATLAB window, type simulink
  5. In Simulink, go to File->New->Model; when the model comes up, save it inside the folder you chose when creating the experiment
  6. In the model's window, go to Simulation->Configuration Parameters
    • Solver: make sure to use a fixed-step solver; change the Fixed-step size if need be
    • Hardware Implementation: choose the Motorola 32-bit PowerPC; this will make the Byte ordering "Big Endian" and the Signed integer division rounds to "zero."
  7. Back in the ControlDesk, the left window should still be Platform (if not, pick the Platform tab). At the bottom of the CD window, pick File Selector and find the Simulink model you have saved. Drag its name to the Simulink platform - the icon will change from the Matlab logo to a small red box with a green arrow, blue rectangle, and pink clock.
  8. Create the model (this must be done before variables can be generated in the next step; more information below about different models)
  9. Right click the Simulink platform and select Build Variable File. Save the model if need be

Generate a Signal

Go through the steps in General Startup, stopping at "Create the model..." Then:

  1. Generate the signal - this is easily done by importing a Sources->Clocck and a User-Defined Functions->Fcn block. Connect the clock to the Fcn block, then put the function you want in the Fcn block.
  2. Tell dSpace to take data - go to the dSpace RTI1104 blockset in the Simulink library, expand it and click the DS1104 MASTER PPC set within it. Drag a DS1104DAC_C1 block into your model
  3. In the model, double-click the DS1104DAC_C1 block to set properties:
    • Unit: pick the channel (for this document, we will use DACH1)
    • Initialization: should already be set to 0 V
    • Termination: make sure the block will set the output to 0 volts on termination