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.
- What is OEE?
- Architecture
- Setting up ADX
- Setting up IoT Central Application
- Creating ADX Dashboard
- Simulator
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
- Availability: accounts for planned and unplanned stoppages, percentage of scheduled time that the operation is/was available to operate
- Performance: measure of speed at which the work happens, percentage of its designed speed
- Quality: percentage of good units produced compared to the total units planned/produced
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.
Watch a 5 minute overview of the experience
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.
- Create an Azure Data Explorer cluster.
- Create a new database in this cluster.
- Create a
boltmaker
table in this database. Schema can be found in the boltmaker file.
- Create an IoT Central application.
- Import the Boltmaker device template.
- 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.
More information on setting up data export to ADX can be found here.
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.
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.
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
- Max/Linux:
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
Use the make
command to build binaries for all platforms.
use the following commands for building only targeting specific platform:
- Windows:
make windows
orGOOS=windows GOARCH=amd64 go build -v -o bin/starling_windows_amd64.exe
- Linux:
make linux
- Raspberry Pi:
make pi
- 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
To clean up all the binaries, use make clean
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"
}
}
]
}
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.