Moak overview

Moak is a systems software for computer numeric control (CNC) machine and a development environment for CNC programming.

What is a CNC. A CNC machine is a computer controlled machine tool able to execute a program to fabricate an end-product.

Moak has been developed for a company machine manufacturer. Moak functionatilies serve machine manufacturers but also machine customers that can customize the machine behaviour.


Machine manufacturers

Machine manufacturer companies use Moak to develop the driver library for the different parts of the machine (pick and place, soldering, shuttles, etc.).

Machine customers

Machine customers companies use Moak to:

  • develop the CNC program
  • execute the CNC program on the machine
  • monitoring machine operation

Moak some technical details

The Moak developing and monitoring module are written in C++ and Delphi under Windows. The execution module is integrally written in C++ and run under QNX (a Unix-like real time operating system). All the code is OOP.

Editor, translator and compiler

The following picture shows the relations between some Moak entities.

Moak developing scheme

To control a CNC machine, Moak permit you to write two different type of codes.

  • A CNC library containing the low level interface to the specific hardware machine
  • A CNC program to perform the manufacturing.


The interface library is a set of functions library written by the machine manufacturer in a object oriented C++ like language. The reason we choose to use a complex language like C++ is his flexibility and power. Here it is an example of this type of code:

//const SERVO_DRIVER_ENABLED                      0x00000001
const RESET_FAULT_ENABLED                       0x00000004

class Axis 
    int IncrementalMode
    double  ActualSpeed
    double  ActualAcceleration
    DigitalInput ZeroProximity

void Axis::Gain(double Gain)
        int Errorflag
        setproportionalgainmsg(Number, Gain, Errorflag)
        if (Errorflag)
                Throw( (Errorflag+SINGLE_AXIS_SYNC_ERROR), ThisId() )

        while (TRUE)

CNC program

The CNC program is developed by the machine customer. Even if there are some test conditions and loops, a CNC program tend to be a sequence of calls to the library. This is the reason why Moak provides a simple object based programming language and an autocompletion editor. The editor permits the user to write syntactically correct code selecting from a contextual menu the possible keywords/object/methods. The user can write code like the following:

CNC program

The CNC program is compiled in P-Code and then ready to be executed on the embedded pc that control the machine.

Execution module

MOAK execution module runs inside one or more embedded pc under the real-time operating system QNX. This part is responsible to execute the CNC progam (the P-Code of the CNC program). For instance it runs instructions like "move the X axis to location 35". In this case Moak needs to manage the acceleration, the final velocity, and deceleration of the axis. Moak also periodically checks (with frequency in the order of millisecond) the axis position and in case of wrong position it corrects the velocity.

In complex environments where Moak manages many embedded pc, each pc has different resources associated (a pc is connected to a loading unit, another to a soldering etc.). Even in this case the CNC programmer writing the soldering routine does not need to know wich pc is the pc connected to the soldering. The programmer just needs to specify the object "soldering". Moak knows wich pc the soldering device is connected to and it runs the soldering routine on the correct pc.

Furthermore the CNC programmer accesses the soldering using high level command. In standard CNC world to open a clamp of a soldering device you should indicate the output port of the clamp. With Moak, you simply write "Soldering.Clamp.Open".

Physical architecture of a Moak system network

In a Moak system there are one or more PCs along the production line to monitor the manufacturing process. Each one of these PCs runs a Moak monitor module on Windows. Through the monitor PC it is possible to check the manifacture status but also to start, stop, or end the process.

The other PCs in a Moak systeam are embedded PC built on QNX real-time operating system. Inside these PCs it runs the Moak Virtual machine that execute the P-Code of the user CNC program. Each CNC program is a set of threads driving a mechanical devices like Pick and place, Shuttle etc. The embedded PC are phisycally connected to the mechanical devices.

Monitoring PCs and embedded PCs communicate through a LAN with TCP/IP and UDP.

Moak manufacturing process

Moak list of technical details

Following is a list of component/technologies Moak contains.

  • An object oriented (OO) language specifically designed to write CNC library
  • An object based (OB) language specifically designed to write CNC program
  • An IDE - Editor, debugger, compiler application
  • A monitor application
  • Hard real time system

Copyright © 2007 Sychene. All rights reserved. - Term of Use - Privacy Policy Home