XPC Target Tutorial - r2
XPC Target Tutorial - r2
For more detailed information, see the xPC target manual at: www.mathworks.com
Control Hardware
Connect to your experiment through the network.
IP: 128.113.70.196 xPC target xPC target
Student laptops
IP: 128.113.70.116
Simulink
EXECUTABLE
Simulink
xPCsetup Zoom
Change all settings to match the values shown below, except for the CompilerPath and TcpIpTargetAddress. The compiler path should contain the path to visual C++ on your computer. Use the TcpIpTargetAddress assigned to the box controlling your hardware.
Encoders
D/A converters
Differentiation
Encoder Details
D/A Details
Channel number: There are 2 D/A channels available. Channels 1 and 2 are connected to motor amplifiers. Set the range for both channels: 10 to +10 volts
PD Controller Details
Derivative term in the feedback to avoid reference differentiation
Proportional Gain Derivative Gain
Desired Position Controller Output Actual Position
1. 2.
Click on Browse. Select xPC Target from the pop up menu. Screen should now look like this.
3.
If you already have a compiled application, you can load it with: load(XPCOBJ, APPNAME)
tg.outputlog(:,2) tg.outputlog(:,3)
At the MATLAB prompt: >> time = tg.timelog; >> outputlog = tg.outputlog; >> response =outputlog(:,3); >> plot(time,response);
3. Run Executable 4. Click on blocks to change parameter values during real time.