01 Preventive maintenance (cdk)

For this Lab we will focus on:

  1. Setup of the AWS IoT Environment with AWS CDK.

  2. SAP OData Setup instructions with ABAP zprogram.

➡️ Simulation Environment

  1. For this workshop you can use any IDE of choice also on your local machine (example) AWS code 9 or Visual Code.
  2. Install CDK in your local environment. Follow the steps outlined in lab preparation section.
  3. See AWS IoT documentation to get general understanding of broad and deep IoT services.
We will use the following AWS IoT services this LAB.

➡️ Architecture Flow

A Chapter
  1. Simulation environment: Use AWS Cloud9 or Own IDE to execute to simulate the temperature reading to AWS IoT core. Simulation is created for Equipment type Compressor. For any production workloads, AWS IoT Core supports devices and clients that use the MQTT and the MQTT over WebSocket Secure (WSS) protocols to publish and subscribe to messages, and devices and clients that use the HTTPS protocol to publish messages. All protocols support IPv4 and IPv6.

  2. Security and Connectivity: AWS CDK deploys AWS IoT Core to register the IoT thing and generate X509 signing request certificate which is installed on your simulation environment to establish connectivity for MQTT messages. Simulated data is sent to AWS IoT Core using MQTT Test Client to view each MQTT message payload. Equipment type Compressor is maintained in IoT Core Thing Registry.

  3. Message payload parsing: AWS IoT action rules listens for specific MQTT payload(noisy data) from the simulator, formats the data and send the data to AWS Analytics services for further processing.

  4. Monitor messages in real time: AWS IoT Analytics Channel receives the data from the AWS IoT Core services to analyze data. AWS IoT Analytics validates that the data is within specific parameters you define by creating an AWS IoT Analytics channels. Here we will setup the Set ID, source, and data retention period and routes the channel to appropriate pipelines.

  5. Process data: Configure AWS IoT Analytics pipeline activities to enrich or transform message attributes, filter entire messages. Here you chain the activities together enables you to process and prepare messages before storing them.

  6. Enrich data: As part of AWS IoT Analytics pipeline activities, you can use enrich feature to enrich the data from the IoT core before sending the data to the AWS IoT Analytics data store. An activity that adds data from the AWS IoT device registry to your message.

  7. Normalize data: Remove Attributes feature activity in AWS IoT Analytics, remove attributes from a message to normalize the IoT payload message to filter the required data at the root level.

  8. Transform data with Lambda: Using AWS IoT Analytics setup you can call Lambda to transform the and enhance the upstream message to get the product range from the Dynamo DB. Through this activity, Aws IoT Analytics can understand the standard temperature range for a given device by calling Dynamo DB to determine if there is a temperature fluctuation in the data sent from the IoT simulator (example - Compressor used for this blog example)

    • In addition, Dynamo DB setup includes the SAP attributes which is mapped against the device name (Compressor). Here the IoT Analytics retrieves the SAP product information for further downstream processing.
  9. Data Store: AWS IoT Analytics data store receives and stores your messages. It is not a database but a scalable and queriable repository of your messages. Here we, configure a SQL query to select the most recent average of temperature reading over the period. Also note that the range from Dynamo was previously injected into the message and the most recent value is selected here.

  10. Anomaly Detection: Using AWS IoT Events Detector model you define conditional (Boolean) logic that evaluates the incoming inputs to detect a significant event(over or under temperature). When an event is detected, it changes the state and triggers additional actions to IoT events model to alert after consecutive Temp Alarms mappings (example alert if the temperate is under or over for greater than 15 minutes). For this demonstration, this model is configured to call the SAP to create a SAP service notification in SAP using AWS Lambda py-odata connector.

  11. API integration to SAP Lambda OData proxy: This sample package contains a Lambda layer to connect with SAP and consume the OData services as a REST API. When an anomaly is detected, IoT Event detector Model sends and message to Lambda with SAP equipment number and functional location to create a Service notification in SAP.

  12. Create Service Notification: Connection is established using the SAP Gateway API enablement. Post request is initiated with the above payload to call your Service Notification OData SAP service using the environment variables (Entity-Set Name, Service-name, SAP-host, SAP-port and SAP authentication) provided as part the CDK deployment and returns the http response with Service Notification number.

  13. Alert Message: Lambda will receive a response with SAP service notification number which is parsed and sent to SNS Topic to alert the subscribers (Maintenance team).

Understanding SAP Plant Maintenance

What is SAP SAP PM (Plant Maintenance)?

SAP PM is an SAP functional module mostly used in manufacturing operrations.

This component contains the functions for Plant Maintenance

  1. Plant Maintenance comprises the following activities:

    • Inspection
  2. All measures which establish the actual condition of a technical system

    • Preventive maintenance
  3. All measures which maintain the ideal condition of a technical system

    • Repair
  4. All measures which restore the ideal condition of a technical system

    • Other measures taken using the maintenance organization

➡️ SAP PM is integrated with below functional modules:

  • Use cases related to equipment spares management, planning, reservation, equipment external servicing, refurbishment process and for reporting. (SAP Materials management)

  • Use cases related to production planning by the production team by considering the equipment availability for precise planning and their production output (PP (SAP Production planning).

  • Use cases related to maintenance labour planning (SAP Human resource).

  • Use cases related to equipment calibration process and to capture the related reports (SAP Quality management).

  • Use cases related to maintenance work order process and cost calculation on maintenance labour & equipment master data update (assets in FI). Addition use cases include asset depreciation value calculations and to check on assets installation location. (SAP FICO)

➡️ Lab Agenda: Move from reactive to Preventive maintenance and service with the AWS Internet of Things (IoT). By executing this learn you can learn:

  1. Guidance to create OData service (ABAP Sample) within SAP Gateway Foundation (SAP_GWFND)software component.
  2. How to capture and analyze IoT-enabled Preventive maintenance data, monitor equipment behavior remotely.
  3. Setup AWS Integration using AWS Lambda runtime to auto-create SAP service notification by consuming SAP Odata service for equipment failure based on the threshold parameters.

Please note: Audience simulate the equipment failures using Raspberry Pi or an AWS Cloud9 instance. See the getting started section to begin.