Cloud-Based Manufacturing Optimisation: A Student's Story with Azure and AI

Date Created: November 08, 2024

Date Modified:

Project header image

Have you ever tried to create something while simultaneously learning how to use the tools? My team and I got to experience that in our project with Azure services in our final semester to create a manufacturing optimisation solution.

We survived, learned a ton, and even managed to build something pretty cool. It would be nice to have a demo, but it's our client's. However, please strap in for the ride if you have time.

While the work was divided equally among team members, I took on the role of team leader where I provided a broad overview of the project, architecture design, set expectations, and orchestrated the team's efforts into a coherent product - in this case, a software module integrated into our client's existing system.

The Challenge: Making Machines Smarter

The Picture: You have manufacturing machines generating tons of data through sensors, but that data is just sitting there, not really doing much. So we wanted to create a software solution that could not just monitor these machines, but actually make sense of all that data and help engineers optimise operations.

The core idea was to build a system that could:

IoT Sensor Data Analysis, Anomaly Detection and LLM Integration System

1. Data Collection and Ingestion

Our system was designed to collect key parameters like temperature, speed, torque, and positional data from various sensors installed on the machines. Along with Raspberry Pi devices as edge computing units, we used OPC UA protocol via PLCs (Programmable Logic Controllers) to translate machine signals into readable data.

So the pipeline looks like this:

Edge Device (Raspberry Pi) → Azure IoT Hub → Azure Event Hub → Azure Function Apps → Azure Cosmos DB

2. Data Storage and Processing

Once the data was collected, 2 databases were used:

For data processing, we implement an Event Hub Trigger Azure Function with Python 3.11 runtime to:

3. Anomaly Detection and LLM Integration

For anomaly detection, we used Azure Machine Learning to train a simple model that could predict machine failures based on historical data. The model was then deployed as a web service and integrated into the Azure Function App to raise alerts when anomalies were detected.

Workflow:

4. Digital Twin Integration

Digital Twin Setup
Real-time Monitoring

5. LLM Integration for Log Processing and Optimization

Azure OpenAI Services Setup
Integrating Machine Data with LLM
Optimization Suggestion Workflow

For an example prompt, it goes something like this:


"Analyse the raw data and statistics from the time period and generate a summary.
Your report should include the following sections:
1. Executive Summary
2. Variable Trends
3. Anomalies Detected
4. Potential Faults
5. Optimization Strategies
For each section, provide concise, data-driven insights. Use specific numbers and percentages where relevant."
            

Azure: A Maze

Working with Azure was like exploring a city where every service is its own neighborhood. Some neighborhoods are friendly and work great together, while others... let's just say they need better public transportation.

We used various Azure services for storing data, processing it, and running AI models. But here's where it gets interesting (and by interesting, I mean challenging 🎢).

Combining Azure services is a bit like following a recipe with missing instructions. Here are some fun challenges we faced:

  1. Documentation: Sometimes Azure's documentation felt like a treasure hunt. "Oh, you want these two services to work together? Here's a cryptic clue in the docs!" While slightly exaggerated, the point stands. When designing infrastructure for clients, we couldn't say with confidence if things would work as intended. The amount of documentation diving needed to verify feature availability was too extensive for proposal phases.
  2. The Integration: Getting different Azure services to work together was way harder than it should be (had to thank my teammates for figuring this out before I go ape-****). Often you have two Azure services that you expect to work together nicely, but they don't or require some roundabout way to integrate. For some services, I spent weeks trying to find ways for them to talk to each other, only to realize it wasn't documented anywhere and the only working solution was a roundabout approach using additional services. This problem might not be a big deal if you use the Azure native version of a common technology (like Azure SQL vs Postgres for Azure, Synapse vs Databricks, Cosmos vs other non-structured DBs), but then you hit point number 1 again - oops, that feature in open-source product A isn't in our version yet, it's on the road map or in preview mode.
  3. The "It's Not You, It's Me" Moments: Azure services occasionally decided to take their sweet time responding, like waiting for a text reply that never comes (something like this -> ).

Lessons Learned (The Hard Way)

Don't get me wrong, Azure has the most compelling storyline because it produces the top BI tool on the planet (PowerBI), the most common enterprise RDBMS (SqlServer), the most common business productivity suite (O365), and the most common authentication service (AAD). If I have to guess, probably MSFT doesn't pay as much attention to the DE or developers' side of the business, as many DEs are code-heavy.

The Silver Linings

Despite the challenges, we built something genuinely useful:

And the best part? Everything actually worked together (after some convincing).

Personal Takeaways

Looking back, this project was more of a proof of concept, a prototype for our client rather than an actual staging product, like solving a puzzle where the pieces keep changing shape. Frustrating? Sometimes. Educational? It taught me that in the real world, technical skills are just part of the equation. Problem-solving, persistence, and being able to shrug it off are equally important.

Want to see how it all came together? Check out our project presentation video where we demonstrate the system in action. Our teachers seemed impressed, so we must have done something right.

Back to Home