Skip to content

Controlling iiwa from MATLAB, testing KST

Mohammad SAFEEA edited this page Aug 28, 2018 · 7 revisions

Controlling IIWA from Matlab, testing KST

Introduction

The repository of the toolbox is provided with several examples (Tutorial scripts), those Tutorial scripts are Matlab (.m) files, each Tutorial script starts by the initials (KSTclass_Tutorial). To test the KST, we are going to control KUKA iiwa from Matlab by running one of Tutorial scripts provided in the repository.

Control iiwa from a Tutorial script

In this tutorial the user is going to move the EEF of the robot in arcs by running the example KSTclass_Tutorial_circles.m, to do so the user shall follow the steps:

  1. Make sure that you have followed the steps in the Getting started page.
  2. On a PC that is paired to the robot controller on the port X66. Open Matlab, and change the working directory of Matlab to the folder Matlab_client.
  3. Open the file KSTclass_Tutorial_examples.m.
  4. Make sure that you substitute the correct IP of your iiwa controller into the variable ip in the script file, this is illustrated in the following figure, where the variable ip is circled in red ellipse,:

  1. Run the MatlabToolboxServer application from the teach pendant of the robot. After doing so, you have 60 seconds to connect to the robot from Matlab.
  2. Before the 60 seconds has elapsed, run the example script KSTclass_Tutorial_examples.m from Matlab.
  3. The robot shall move in circles.

Warning: Make sure that nothing and no one is in collision course with the robot during the test, the software is provided as is, under MIT license, the author is not liable for any kind of accident nor any kind of damage.