User:DukeEgr93/DSPACE2
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:
- Start the dSPACE ControlDesk.
- 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.
- 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,
- 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. For this demo, it will be called
OutputDemoModel
. - 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"
- Once done, you can save the model.
- The block library should already include the dSPACE blocksets, though the individual blocks may need to be loaded. To load them, simply expand the
Generating Output Signals
There are several methods in Simulink for generating a signal. Most of these methods can be dynamically adjusted via the ControlDesk once the Simulink model is built and once an appropriate Layout is constructed in ControlDesk. For this documentation, a simple sinusoidal input will be used.