Motion Master
|
âšī¸ Motion Master v5.x.x and subsequent versions are built from this repository. However, Motion Master v4.x.x, which exclusively supports IgH EtherCAT Master, continues to be built from the igh-release branch in the old repository.
đą This repository is the successor to synapticon/motion-master.
Motion Master is a C++ application that communicates with SOMANET devices over fieldbuses and provides a WebSocket API for client interaction. It also includes a collection of libraries designed for efficient and easy-to-use access to the full range of features supported by general EtherCAT devices, as well as SOMANET-specific functionality.
With Motion Master, clients can perform tasks such as device listing, data exchange, and file management, as well as execute more advanced procedures like encoder calibration and auto-tuning. This makes it a versatile platform for both basic operations and complex system workflows.
Clone this repository along with all its submodules:
Note: If you've already cloned the repository but haven't yet initialized or updated its submodules, you can do so with the following command: git submodule update --init --recursive.
You can configure and build the project using the following commands:
Now run it as follows:
The previous command will use the SOEM EtherCAT master driver, initializing on the network interface with the provided MAC address (20:88:10:7C:62:6D). It will bind the server to the specified WebSocket ports: 63524 for request-response communication and 63525 for publish-subscribe communication. These WebSocket ports are optional; if not specified, the default ports 63524 and 63525 will be used.
We recommend using Visual Studio Code with the following extensions installed:
â ī¸ Important: The verified compatible version of the CMake Tools extension for this repository is 1.20.53.
Visual Studio Code CMake Tools will automatically initialize Vcpkg and and install the libraries specified in the vcpkg.json file.
We follow the Google C++ Style Guide. For a concise summary tailored to this project, refer to our local style guide.
You can run Google's linter on this repository using the following command:
To automatically format all source code files in the motion_master directory, use the following command:
This approach provides greater control over the environment, tools, and Vcpkg caching.
Prerequisites:
To temporarily enable cl.exe in your PowerShell 7 (x64) session, follow these steps:
Run the following command to initialize the Visual Studio environment:
Once the new PowerShell session starts, verify that cl.exe is available by running:
âšī¸ The previous steps are necessary because the Developer Command Prompt for VS 2022 may default to the 32-bit toolset, causing linker failures in 64-bit builds. You can verify this by running cl and checking if the output includes for x86.
To start the self-hosted runner, navigate to the directory where you enabled the Visual Studio compiler, then run the following command in the terminal:
Below is a one-line PowerShell script (run.ps1) that sets up the Visual Studio environment and launches the self-hosted runner:
Next, navigate to the GitHub workflow and trigger it.
Another approach is to use Dependency Walker.
An efficient method to check for missing DLL dependencies and test Motion Master on a newly installed operating system is to use Windows Sandbox.
OBLAC Drives v25.x releases use Motion Master v5.x, which is based on SOEM rather than IgH EtherCAT Master. To run Motion Master v5.x as a Docker container on the OBLAC Box, make sure to stop and disable the EtherCAT (IgH EtherCAT Master) service.
If the MM_MAC environment variable is not set when starting the Docker container, the entrypoint script will automatically extract the MAC address from the /etc/ethercat.conf file. This simplifies setup, requiring only that the EtherCAT service be stopped, with no additional steps needed when starting the container.
There are two methods for accessing the OBLAC Box to perform this task:
Once you have access, stop and disable the current Motion Master Docker container and EtherCAT services by running the following commands:
Alternatively, use the following command, replacing id_rsa with the OBLAC Box's private key and oblac-drives-7dc95497 with the OBLAC Box's hostname:
When prompted for a password, enter: administrator
â ī¸ Important: Ensure that you are running the latest version of the OBLAC Drives Update Service (v3.0.6) before proceeding to the next step.
You can now open the OBLAC Drives Update Service and install the desired v25.x release of the OBLAC Drives.
To manually start the Docker container and specify the MAC address, use the following command:
If you need to revert to using the IgH EtherCAT master, execute the opposite commands:
Open the OBLAC Drives Update Service and install the desired v24.x release of the OBLAC Drives.
Each firmware package contains a file named com_*.bin. This file is a ZIP archive. Extract it using a tool like 7-Zip to obtain two files:
Rename these files as follows:
Create a batch script named flasher.bat with the following content:
Also create a J-Link command script cmdfile.jlink with the following commands:
Now, run the flashing script by executing: