Motion Master C++ application installation guide

Overview

The Synapticon Motion Master is an application that is used to communicate with the Synapticon SOMANET devices over EtherCAT.

This tutorial describes the steps needed to install and use the Motion Master natively on a Linux client computer and shows how to build and run a simple C++ motion application.

Note

Please note that the Motion Master is for development purposes only and is not supported by Synapticon.

Prerequisites

In order to pull the Motion Master and build the application, the development environment must be installed :

  • Docker CE : Installation guide for Ubuntu

  • Etherlab IgH EtherCAT master (v1.5.2-sncn-6)

    • The Synapticon repository provides a more detailed install script which includes the relevant libraries. Clone the repository here
    • Documentation on how to use the IgH EtherCAT master can be found here
  • ZeroMQ library (>=v4.2.2) Instructions for ZeroMQ 4.2.2

  • C++ binding for ZeroMQ. This link also includes instructions for installing the ZeroMQ library.

  • Google Protocol Buffers library (>= v3.4.1)

Pull the Motion Master

The Motion Master is run as a docker container. From this container the API and the application examples can be pulled.

To pull the Motion Master docker container on your environment, please type in the command:

docker pull synapticon/motion-master

Once the docker is pulled you can run it:

docker run -d -P --network=host --restart=always --privileged --name=motion-master \ --device=/dev/EtherCAT0:/dev/EtherCAT0 \ --volume=/opt/etherlab/bin/ethercat:/usr/local/bin/ethercat synapticon/motion-master

(The previous lines describe one command line, the commands should only be separated by spaces)

Important

Before launching the Motion Master, the IgH EtherCAT master needs to be started. If it is not, the Motion Master will restart automatically until it can find the master in /dev/EtherCAT0

To start the IgH EtherCAT master type:

$ sudo /etc/init.d/ethercat start

You can check your EtherCAT connected devices by running:

$ ethercat slave

To stop your EtherCAT Master driver just run:

$ sudo /etc/init.d/ethercat stop

You can download the Motion Master API and the example applications from this docker container:

docker cp motion-master:/opt/motion-master-client.zip .

Create and run a C++ application

  • The folder API contains a zip file with API files to communicate with the Motion Master.
  • The folder bindings contains a list of simplified functions to easily take a motor into operation. These functions can be used without any knowledge of Google Protobuf or ZeroMQ.
  • The folder examples/C++ contains a demonstration application that simply gives periodically a torque command (demo_simple_commands_client).

To build the application, simply run the make command when you are in the application folder (/examples/C++/demo_simple_commands_client). This creates a bin folder containing the executable application.

To run the application type:

bin/demo_simple_commands_client

You can build your own application on top of this application, or use the script create_application.sh to make your own.

You can find in the file bindings/C++/motion_master_functions.h the list of functions used to control one or multiple drives through the Motion Master.

Important

  • In order to control a servo motor, it should be connected to the computer running the client application and detected by the EtherCAT master.
  • The drive should be first commissioned and configured with OBLAC Drives.