MATLAB/Lokomat-Simulink/LokomatControl/setup/data
directory.trajectories_dario.mat
.MATLAB/Lokomat-Simulink/LokomatControl/setup/init_PosControl.m
file to set the settings for the position control model.Load the position control model: MATLAB/Lokomat-Simulink/LokomatControl/models/PositionControl/LokoFree_PositionControl_500Hz.slx
.
Build the model in simulink (see image below).
Note: Make sure you are inside the build folder (MATLAB/Lokomat-Simulink/LokomatControl/build
) before you start to build the model.
Once the model is successfully built, type xpcexplr
in the MATLAB command window. This will open th xPC Targt xplorer (see image below).
Once the model has been successfully built, you should see that a connection to LokoFree has been established. (1)
The built model should also be displayed under Applications, where you have to start the model by right-clicking on the model’s name. (2)
Now connect the Simulink model to the target computer to start the connection with the Lokomat (see image below).
Open MATLAB/Lokomat-Simulink/TreadmillControl/scripts/startTreadmill.m
and execute the first two paragraphs to initiate the UDP treadmill connection (see image below). To execute a single paragraph, select the paragraph and press ‘Ctrl+Enter’.
Note: Ensure that your current folder is correct. Meaning that you are in the folder where the file is located to execute the command successfully. If the connection fails, an error will be displayed in the MATLAB Command Window.
To verify that you are also connected succesfully to the treadmill via the UDP connection, check in the xPc Target explorer if you are also connected to LokoBasis and if the Treadmill_UDP is started (see image below).