User:DukeEgr93/DSPACE2

From PrattWiki
< User:DukeEgr93
Revision as of 19:01, 23 July 2008 by DukeEgr93 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Building a Basic Model

Building a basic Simulink model and running it on the dSPACE cards is fairly straightforward:

  1. Start the dSPACE ControlDesk.
  2. Start MATLAB - note that on a PC, the first time MATLAB is run after the PC has been turned on may take quite a bit of time to start.
    • MATLAB must run a configuration script to communicate with dSPACE. In Hudson 149, the script is already set to run. If that is not the case, dspacerc.m must be run. That script is provided with the dSPACE card and software.
  3. In MATLAB, start Simulink.
    • The block library should already include the dSPACE blocksets, though the individual blocks may need to be loaded. To load them, simply expand the dSPACE RTI1104 blockset.
    • In the Simulink Library Browser, go to File->New->Model; when the model comes up, save it inside the folder you chose when creating the experiment
    • The model needs to know the properties of the DSP card in order to compile the model properly. To set these properties, go to 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 following:
      • Device type: "Custom"
      • Byte ordering: "Big Endian"
      • Signed integer division rounds to: "zero"