TG Motion  version 502 - 4034/906 cnc 126
TG Motion Documentation

Introduction

TG Motion is universal control system. The system includes single-axis, multi-axis and CNC motion functions like:

  • point to point positioning
  • positioning to brand (indexing)
  • servomotors synchronization (electronic gearing)
  • electronic cam shaft
  • CNC interpolation
  • free programming

User can create motion and can control mechanisms like robots, manipulators, CNC machines, packaging machines, assembly machines, etc.

TG Motion runs on Windows with real-time extension or on a special ARM Linux computer called TGMmini.

What's new in TG Motion 5

  • speed optimizations in CNC module (about 50% speed up on TGMmini)
  • two CNC modules on TGMmini (remains three on PC)
  • number of servo modules for TGMmini has been increased to 64
  • number of I/O modules has been fixed to 16 for both PC and TGMmini

Compatibility changes to TG Motion 421

TG Motion

  • the UNIVERSAL memory has been removed and replaced by GENERAL_MEMORY.
  • several changes in the DIO structure:
    • fields In0..In7, Ext_In0..Ext_In7 has been changed to one array In[16]
    • fields Out0...Out7, Ext_Out0..Ext_Ext7 has been changed to one array Out[16]
    • all the 32 bits bits are used and mapped consecutively (in TGM421 only low 8 bits are used)
  • PLC_DATA structure has been changed: there is only one function for printing text to console. This function accepts only a string, which must be fully formatted inside the PLC.
    Safe template base library function is provided for that (in include/fmt directory).

CNC module

  • the function ToolChainCore_GetPos has been renamed to ToolChainCore_GetPosEx, because it uses only one parameter now, the structure cnc::ACTUAL_GM_VALUES
  • the structure SIMPLE_GM_PARAMS_WIN32 has been reorganized to save memory and speed up execution:
    • the fields m_zero and m_pars has been removed. The zero offset can be get by ToolChainCore_GetPosEx function
    • values in m_pars array have been moved to m_s and m_e fields (for M functions)
  • the function ToolChainCore_GetStructuresSize returns different sizes according to new structures

Interface to user applications

TG Motion runs on dedicated processor core and communicates to the operating system through set of shared memories. Each user-accesible memory and its structure is documented in this manual.

Shared memories

Name Number Structure
TGM_System 0 SYSTEM
TGM_Data 1 Flat memory for Virtual PLC
TGM_Cam_Profile 2 Flat memory for gearing
TGM_Oscilloscope 3 Stores oscilloscope data
TGM_Servo 4 SERVO
TGM_Dio 5 DIO
TGM_General 6 GENERAL_MEMORY for general EtherCAT devices, etc.
TGM_Interpolator 7 INTERPOLATOR
InterpolatorWriteMemory 8 internally used by CNC module
InterpolatorReadMemory 9 internally used by CNC module
TGM_ODS 10 Serves for informational messages
TGM_CNCODS 11 Informational messages of CNC module, passed to ODS memory
TGM_CNCEX 12 Controls CNC module cnc::TGM_CNC_MEMORY

CNC module

TG Motion includes up to 3 CNC modules (PC) or up to 2 CNC modules (TGMmini). CNC module is controlled by G-code. Communication with this module is done by shared library called SF_TCh_5.dll (PC) or libSF_TCh_5.so (TGMmini). The main functions exported by this library are listed here.

The system supports use of plug-in for dynamic G-code recalculation.

Sometimes the CNC module needs to communicate back to the application, for this a system of callback functions is used. This is used for displaying G-code paths, error and warning messages, etc. Some callbacks are used only during simulation or test regimes.

List of main exported functions

Communication library

There is also a specialized library (TGM_Comm_Int_5.DLL on Windows or libTGM_Comm_Int_5.so on Linux) which enables easy connection to all of these shared memories. The library functions and a complete C++ wrapper around this library is described in a class CTGM_COMM_INT_5.

Initialization functions

Informational functions

Access functions

Direct access functions

Helper function