Developing Control Applications

Developing Control Applications

Motorcortex makes developing real-time motion control applications simple. It reduces your development time and effort greatly by providing solutions for the most complex software tasks:

  • multi-threaded hard-realtime task management
  • realtime, thread-safe and secure communication, for internal and external communication (directly to the Webborwser)
  • EtherCAT fieldbus driver with CiA402 and SERCOS motion protocols
  • a variety of tools to log events, handle errors, load and save configurations and monitor signals
  • a component model to build and structure control systems
  • libraries of control components (like PID controllers, filters, switches, lookup tables and many, many more)

To get started with developing with Motorcortex you need:

  • a PC to use as a controller (ARM or x86), a virtual machine works too
  • Motorcortex Hard-Realtime Linux (MCX-OS) or regular (Ubuntu) Linux (not hard-realtime) installed on your controller
  • Motorcortex-core library (Debian package)
  • a development PC/Laptop with Windows/Linux/MacOS

Setup your Development Environment

Motorcortex control applications are built and deployed using CMake. Recommended IDEs are CLion or Visual Studio Code, but any IDE that supports CMake should work. For CLion plugins are provided that can generate an application framework with the features you need. You only have to fill in the blanks.

Development of the applications can be done in three ways:

  1. on a local Ubuntu system, to also run locally,
  2. directly on the remote Motorcortex (MCX-OS) target system
  3. cross-compile on the local Motorcortex system and then deploy the executable to the target system.

Local development

If you have an Intel-based Ubuntu PC, you can install the Motorcortex-core library and other dependencies locally and compile and run your application on your local machine. You need to have a recent GCC (version 8+) or Clang (version 5+) compiler and CMake installed.

Remote development

Remote development of the applications means that your code is compiled on the Motorcortex Target System. This method is easy to set up, it does not require cross-compilation tools and dependencies to be set-up on your local machine. However, the downside is that it may be (much) slower to compile on your target (the controller) because generally this has less computing power than your normal PC.

Cross-compilation

With the Motorcortex SDK it is possible to cross-compile the code for the remote Motorcortex Target System on your local system. This is very useful, because it allows you to build applications for the Target system without having access to the Target. Also, usually, your local PC is (much) faster than the Target System and cross-compiling will significantly decrease the compile time for large projects.


Environment Setup

Motorcortex Application Template

MATLAB & Simulink

Description how to use MATLAB & Simulink with motorcortex.

Motorcortex Core API