MotorMind AI — Devpost Project Story


Inspiration

I am Hamza Manai, an Electrical Engineering graduate from ISET Radès, Tunisia, currently in my Master's in Mechatronics. My academic background covers PID regulators, discrete systems, signal processing, and industrial automation. But more than the classroom, what shaped this project was what I lived on factory floors.

During my final year project (PFE) at BQube/TTI-ELECSA, I built a 4.0 maintenance system for resistance welding machines — programming an ESP32 to acquire current and voltage data, building a real-time web interface, and training an AI model to detect anomalies. I used a PEM735 power analyzer to collect real industrial data. I saw exactly what happens when you have data but no system to act on it.

At Somef Lighting, I assisted the maintenance manager and watched a production line slow down because nobody caught a motor anomaly early enough. At MCW S.A.R.L, I repaired industrial machines that had failed — machines that gave warning signs days before, but no system was listening.

Every factory I walked into had the same problem: motors everywhere, monitoring nowhere.

This is why I built MotorMind AI.


The Problem

3-phase induction motors are the heartbeat of modern industry. They power pumps, compressors, conveyor belts, welding arms, CNC machines — 70% of all industrial electrical energy passes through them. And yet, they are still monitored by reactive systems: an alarm sounds only after the failure has already happened.

The cost of unplanned downtime in industrial manufacturing ranges from $50,000 to $260,000 per hour, depending on the sector. A bearing fault gives 30–90 minutes of warning before catastrophic failure. A voltage drop causes overcurrent which causes overheating — a cascade that any electrical engineer can predict, but that most factories only discover when the motor trips.

The gap is not technical knowledge. The gap is a system that bridges real-time sensor data, AI reasoning, and human governance — so the right person gets the right information at the right time, and every decision is audited.

That is MotorMind AI.


What It Does

MotorMind AI is a real-time predictive maintenance agent for 3-phase industrial motors, orchestrated by UiPath Maestro BPMN.

The system does 5 things:

1. Simulates a real motor with real physics A 400V / 7.5kW / 1450 RPM three-phase induction motor, simulated using actual electrical engineering equations. When voltage drops, current rises because I = P / (√3 × V × cosφ). Temperature follows Joule heating: T = T_ambient + k × I². This is not random noise — this is real motor behavior.

2. Detects faults using 23 physics-based rules All thresholds are standard-compliant:

  • IEC 60038: ±5% voltage band (380–420V warning), ±10% critical band (360–440V)
  • ISO 10816-3: Vibration Zone B/C boundary at 4.5 mm/s, Zone D at 7.1 mm/s
  • Rules cover: undervoltage, overvoltage, overcurrent, thermal anomalies, cooling failure, bearing faults, RPM drops, trend-based detection, slip anomalies, phase imbalance proxy, stall detection

3. Diagnoses root causes using Gemini AI The AI receives live sensor data and responds like a senior electrical engineer:

  • STATUS: HEALTHY / WARNING / CRITICAL
  • OBSERVATIONS: Specific sensor values with % deviations from rated
  • ROOT CAUSE: Physics explanation (e.g., "Undervoltage forces higher current to maintain torque via I²R heating")
  • RECOMMENDED ACTIONS: Ranked by urgency — IMMEDIATE / THIS WEEK / NEXT MAINTENANCE
  • RISK ASSESSMENT: Time to failure, shutdown recommendation, personnel safety level

4. Orchestrates through UiPath Maestro BPMN The BPMN process:

  • Fetches live motor data from our public API (Alibaba Cloud)
  • Runs the MotorMind Agent for AI diagnosis
  • Routes by severity through an Exclusive Gateway:
    • HEALTHY → logs and loops every 30 seconds
    • WARNING → Engineer Review notification
    • CRITICAL → Emergency Alert with shutdown decision
  • Every diagnosis, every route, every human decision is logged in Orchestrator

5. Provides a real-time web dashboard

  • Motor Start/Stop/Emergency Shutdown controls with realistic ramp-up and ramp-down sequences
  • 0.5-second sensor updates
  • Live trend bars (voltage, current, temperature, vibration, RPM)
  • AI diagnosis panel with full structured output
  • UiPath Messages log — all messages from the BPMN appear here in real time
  • Fault log with CSV export

How I Built It

1 — Foundation Built the motor physics simulator in Python. Validated the equations against real motor datasheets. Built the 23-rule fault detection engine. Integrated Gemini AI for natural language diagnosis. Deployed on Alibaba Cloud (Ubuntu 22.04) with gunicorn.

2 — UiPath Integration

  • Created the Maestro BPMN process in UiPath Studio Web
  • Configured the MotorMind Agent Builder with the GPT-5.4 model, running its own independent diagnosis inside UiPath
  • Built the BPMN flow: Fetch → Diagnose → Gateway → Route
  • Connected the public Alibaba Cloud API to UiPath via HTTP connector
  • Debugged variable naming mismatches (camelCase vs snake_case — 3 hours lost)
  • Built the SimpleApprovalApp for human task handling

3 — Polish and Hardening

  • Added IEC 60038 and ISO 10816 compliant thresholds
  • Built motor control system with realistic startup/shutdown physics
  • Added UiPath Messages log panel to web dashboard
  • Added fault history, CSV export, live trend analysis
  • Fixed all JS async issues, added AbortController timeouts

Tech stack:

  • Python 3.10, Flask, Gunicorn
  • Gemini AI (gemini-3.1-flash-lite via Google AI API)
  • UiPath Studio Web, Maestro BPMN, Agent Builder
  • Alibaba Cloud ECS (Ubuntu 22.04) — public deployment
  • Vanilla JS (no framework) + CSS for the dashboard
  • IEC 60038, ISO 10816-3 standards

Challenges

I will be completely honest here. Approximately 60% of my hackathon time was spent fighting platform issues, not building features. I document these fully because I believe honest feedback makes platforms better.

1. Maestro BPMN Publish — Completely Broken

Every Publish attempt returned: "Failed to pack from snapshot: Solution pack failed: No solution tool factory is registered"

I tried:

  • Deleting and recreating the Maestro BPMN project 3 times
  • Editing the BPMN XML directly to fix task types (bpmn:task → bpmn:userTask)
  • Removing all orphaned agent binding references from XML
  • Simplifying to a 2-task BPMN
  • Creating 2 new solutions from scratch

UiPath's own Studio Web AI confirmed: "Maestro BPMN requires the uip maestro bpmn pack CLI command. The backend has no registered factory to bridge this gap."

Workaround: Debug mode deploys correctly even when Publish fails.

2. GPT-5.4 AI Units Exhausted (250/250)

The hackathon Community Plan provides 250 GPT-5.4 units. After development and testing, all units were consumed. Every agent run returned Error 403: "License not available."

Workaround: Kept the two AI layers independent instead of chaining them. The UiPath MotorMind Agent (GPT-5.4) fetches the live sensor values itself and produces its own full diagnosis — STATUS, OBSERVATIONS, ROOT CAUSE, ACTIONS, RISK — visible right in UiPath Studio and Orchestrator's execution trail. Separately, the Python engine calls Gemini to power the same diagnosis in the live web dashboard. Same sensor data, two independent AI opinions, neither one depends on the other — so a units cap on one side never takes down the whole system.

3. Action Center Not Enabled

Error: "Actions is not enabled for this tenant. Actions requires UiPath Automation Cloud."

The Track 2 description explicitly mentions human-in-the-loop as a core feature. But the hackathon Community Plan does not include Action Apps.

Workaround: Human task notifications sent via HTTP POST to Flask API. Engineer decisions logged in the web dashboard fault log with timestamp.

4. Studio Desktop Error 1232

Installed Studio Desktop to bypass Studio Web issues. Sign-in failed: "Could not find unattended robot for user key..."

No robot license assigned on the Community Plan hackathon tenant.

No workaround found. Remained on Studio Web for the entire project.

5. Variable Naming Mismatch (camelCase vs snake_case)

Agent Builder internally converts input names: voltage_v → voltageV. The BPMN passed the variable NAME as a literal string instead of its value. Silent failure with no clear error until deep in the execution trace.

Fix: XML editing of all output source expressions (vars.motorDataRaw → vars.body) and I/O Schema alignment.


Accomplishments

Despite the platform challenges, I am proud of what MotorMind AI became:

  • A real physics engine — not a fake simulation. Real motor equations, real standards.
  • A working end-to-end BPMN flow — Fetch → AI Diagnose → Gateway → Route → Loop. Verified in Orchestrator with full execution trace.
  • A live deployed system — running 24/7 on Alibaba Cloud, accessible from anywhere.
  • A genuine contribution to Industry 4.0 — the architecture (IoT sensor data → Python physics engine feeding two independent AI diagnoses, Gemini for the live dashboard and UiPath's own GPT-5.4 agent for governed orchestration) is directly applicable to real factories.
  • 23 fault rules compliant with IEC 60038 and ISO 10816 — the same standards used in real industrial maintenance.

What I Learned

Technical:

  • How to structure an enterprise-grade agentic process in Maestro BPMN
  • The importance of designing for the orchestration layer from the start, not as an afterthought
  • How BPMN variable scoping works across Send tasks, Service tasks, and Gateways
  • Real-world value of standards compliance (IEC/ISO) vs arbitrary thresholds

Platform:

  • UiPath Agent Builder is genuinely powerful — the ability to define input/output schemas and connect to models is clean and intuitive
  • The Execution Trail and Step Variables debug panel saved me every time something went wrong
  • The platform has enormous potential for exactly this kind of hybrid (UiPath + external AI) architecture

Personal:

  • Building under pressure with a hard deadline changes how you prioritize
  • Documenting every bug as you hit it saves hours of reconstruction later
  • An imperfect working system is worth more than a perfect broken one

A Personal Note to the UiPath Team

I genuinely loved working on your platform. The concept of Maestro BPMN — visually orchestrating humans, robots, and agents through a governed flow — is exactly right for enterprise automation. The Agent Builder is intuitive. The Studio Web environment is clean and surprisingly capable for browser-based development.

But I want to be honest, because that is how platforms get better:

There is still much to repair, much to figure out, and much to upgrade. The lag, the crashing, the slowness, the lack of execution control — these are real friction points that cost real hours. The Publish button not working for the track that requires BPMN publishing is a blocking issue for every Track 2 participant. The missing Action Center on the hackathon plan removes the most compelling human-in-the-loop feature from the very track that is supposed to demonstrate it.

I say all of this because I believe in the platform. I will likely work with UiPath in the future — it solves real enterprise problems in a way that no other orchestration platform does today.

Thank you for this experience. It pushed me technically, reminded me why I care about industrial AI, and gave me a platform to show what predictive maintenance can look like when you combine real engineering with modern AI orchestration.


Built With

python flask gemini-ai uipath-maestro-bpmn uipath-agent-builder alibaba-cloud iec-60038 iso-10816 javascript gunicorn ubuntu


Links


Try It

  1. Open http://8.216.39.121:5000
  2. Press Start — watch the motor ramp up over 4 seconds
  3. Inject a Bearing Fault — vibration rises to 11 mm/s
  4. Run Diagnosis — Gemini explains the physics
  5. Drop voltage to 310V — watch the current spike and temperature rise
  6. Press Urgent Shutdown — see all parameters halt, temperature decays slowly
  7. Check the UiPath Messages panel — see the BPMN routing in real time

Built With

Share this project:

Updates