Skip to content

Latest commit

 

History

History
157 lines (127 loc) · 7.47 KB

README.md

File metadata and controls

157 lines (127 loc) · 7.47 KB

IIoT OEE

IoT Central sample for calculating Overall Equipment Effectiveness (OEE) of industrial equipment. This application simulates devices sending data to IoT Central. The data can be exported to Azure Data explorer to calculate OEE.

picture alt

Contents

  1. What is OEE?
  2. Architecture
  3. Setting up ADX
  4. Setting up IoT Central Application
  5. Creating ADX Dashboard
  6. Simulator

What is OEE?

Overall Equipment Effectiveness (OEE) is a measure of how well a manufacturing operation is utilized (facilities, time and material) compared to its full potential, during the periods when it is scheduled to run. References. OEE is the industry standard for measuring manufacturing productivity. OEE is calculated using 3 atttrbiutes

  1. Availability: accounts for planned and unplanned stoppages, percentage of scheduled time that the operation is/was available to operate
  2. Performance: measure of speed at which the work happens, percentage of its designed speed
  3. Quality: percentage of good units produced compared to the total units planned/produced

Scenario

Parnell Aerospace a fictitious company has launched a Factory of the Future manufacturing initiative to streamline operations and increase production capacity at its plants and production lines. The employees use IoT Central app to assess each shift in the plant based on the signals received from the factory equipment to calculate shift effectiveness and communicate with equipment operators and then adjust the factory equipment accordingly.

picture alt

Watch a 5 minute overview of the experience

Scenario

Architecture

picture alt The above picture shows the architecture of this OEE Application. Devices send telemetry messages to IoT Central application. This data is transformed and exported to Azure Data Explorer using the Continuous Data Export (CDE) in the IoT Central application. Dashboard over OEE database is built using KQL queries on the ADX database.

There is no need for an external application or compute for "cooking the data". It is done in IoT Central at no extra charge.

Setting up ADX

  1. Create an Azure Data Explorer cluster.
  2. Create a new database in this cluster.
  3. Create a boltmaker table in this database. Schema can be found in the boltmaker file.

Setting up IoT Central Application

  1. Create an IoT Central application.
  2. Import the Boltmaker device template.
  3. Set up a new Continuous Data Export of all data coming from Boltmaker devices into ADX that was created earlier. You can get use the JQ Transform that is used below.

picture alt picture alt

More information on setting up data export to ADX can be found here.

Creating ADX Dashboard

Now that the ADX Database and the CDE exports are setup, you can setup the ADX dashbaord using the exported dashboard file. Make sure that you change the datasource ID in the file to your ADX datasource. Feel free to create your own dashboard by looking at the sample queries in this file.

Simulator

You can download binaries and run them as is, skip to running simulator section below.

If you want build the binaries yourself, you need to setup the development environment as follows.

Golang

Follow the instructions to install Go. Pick the appropriate package to install the latest 1.17.x release of Go. This will give you access to the Go toolchain and compiler.

  • If you are on Windows, use the MSI to install. It will set the necessary environment variables.
  • If you installed via the tarball, you will need to add a GOROOT environment variable pointing to the folder where you installed Go (typically /usr/local/go on linux-based systems)
  • You should also check to make sure that you can access the Go compiler and tools. They are available at $GOROOT/bin (or $GOROOT\bin) and should be added to your path if they are not already. You can verify this by running the following:
    • Max/Linux: which go
    • Windows (CMD): where go

Build

Golang produces OS specific executables. You can create a binary targeting any OS from any OS.

To build starling, you can use the makefile. Help can be displayed by running make help.

$ make help
all                            Build for all platforms
build                          Build binaries for all platforms
clean                          Clean all binaries
build-windows                  Build binary for windows
build-linux                    Build binary for linux
build-darwin                   Build binary for darwin
help                           Display available commands

Build binaries

Use the make command to build binaries for all platforms. use the following commands for building only targeting specific platform:

  1. Windows: make windows or GOOS=windows GOARCH=amd64 go build -v -o bin/starling_windows_amd64.exe
  2. Linux: make linux
  3. Raspberry Pi: make pi
  4. macOS: make darwin
$ make
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o bin/IIoTOEE_windows_amd64.exe -v
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/IIoTOEE_unix_amd64 -v
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o bin/IIoTOEE_darwin_amd64 -v

Cleanup

To clean up all the binaries, use make clean

Configure

Create iiot.json file in $src/bin folder i.e. where you have your exe file.

{
    "logger": {
      "logLevel": "Debug",
      "logsDir": "./logs"
    },
    "application": {
      "provisioningUrl": "global.azure-devices-provisioning.net",
      "idScope": "YOUR_SCOPE_ID",
      "masterKey": "YOUR_APP_DEVICE_ENROLLMENT_GROUP_KEY",
      "boltMachineModelID": "dtmi:parnellAerospace:BoltMakerV1;1"
    },
    "plant": [
      {
        "name": "Everett",
        "boltMachine":{
          "count": 2,
          "format": "json"
        }
      },
      {
        "name": "Austin",
        "boltMachine":{
          "count": 1,
          "format": "json"
        }
      },
      {
        "name": "Atlanta",
        "boltMachine":{
          "count": 1,
          "format": "json"
        }
      }
    ]
  }

Running simulator

IIoT OEE simulator has a single executable.

Platform Executable
Windows IIoTOEE_windows_amd64.exe
macOS IIoTOEE_darwin_amd64
Linux IIoTOEE_linux_amd64

If you build binaries from source, they will be in the bin folder. To start the starling simulation server, run the above executable.

Starting Simulator