“The Internet of Things (IoT) has sparked widespread interest in using artificial intelligence (AI) and machine learning (ML) techniques to monitor the health of machines, including motors, generators, and pumps, and alert maintenance engineers of any looming problems. One of the challenges for AI/ML system designers to implement such predictive maintenance is choosing the most appropriate sensor for the application. Another problem is that relatively few designers have experience building AI/ML applications.
By Clive “Max” Maxfield
The Internet of Things (IoT) has sparked widespread interest in using artificial intelligence (AI) and machine learning (ML) techniques to monitor the health of machines, including motors, generators, and pumps, and alert maintenance engineers of any looming problems. One of the challenges for AI/ML system designers to implement such predictive maintenance is choosing the most appropriate sensor for the application. Another problem is that relatively few designers have experience building AI/ML applications.
To obtain data that can be used by AI/ML systems, designers often choose to pair complex sensors such as three-axis accelerometers with high-performance microcontroller development platforms. But in many cases, combining a simple current sensor with a more common and lower-cost microcontroller development platform can also achieve what is needed.
This article presents the idea of using current transformers to obtain the necessary data to implement AI/ML applications in a simple and affordable way. This paper also presents a simple circuit using a current sensor to monitor the operation of a vacuum pump with an integrated filter, using a low-cost Arduino IoT microcontroller development platform and a current transformer from CR Magnetics Alerts the user when the appliance is blocked. Finally, the paper also outlines the process of creating related AI/ML applications.
Simple Sensors for AI/ML
To collect data for AI/ML applications, designers often choose complex sensors such as three-axis accelerometers; however, this type of sensor can generate large amounts of data that are difficult to manipulate and understand. To avoid this complexity, it’s worth remembering that everything is interconnected. Just as injury to one part of the body can cause referred pain to other parts of the body, a bearing failure in a motor can alter the current that drives that motor. Similarly, a blocked air intake, in addition to causing overheating, also changes the current that drives the motor.
Therefore, by monitoring one aspect of a machine’s operation, other aspects of the machine’s operation can be indirectly learned. Based ON this, the desired monitoring and sensing goals can be achieved by observing a relevant parameter using a much simpler sensor, such as CR Magnetics’ small, low-cost CR3111-3000 detachable current transformer (Figure 1 ).
Figure 1: The CR3111-3000 detachable current transformer provides a low-cost, easy-to-use current detector that can be used as the primary sensor in AI/ML predictive maintenance applications. (Image credit: CR Magnetics)
The CR3111-3000 can be used to sense currents up to 100 amperes (A) (other members of the CR31xx family can be used to sense smaller or larger current values). All members of the family support a frequency range of 20 hertz (Hz) to 1 kilohertz (kHz), covering most industrial applications. Additionally, all CR31xx devices feature a hinge and latch mechanism that allows connection without interrupting current-carrying wires.
Arduino Nano 33 IoT
Arduino’s ABX00032 Arduino Nano 33 IoT is an example of a low-cost microcontroller development platform suitable for prototyping simple AI/ML applications (Figure 2). The Arduino Nano 33 IoT features an Arm® Cortex®-M0+ 32-bit ATSAMD21G18A processor running at 48 megahertz (MHz) with 256 KB Flash and 32 KB SRAM, and is equipped with Wi-Fi and Bluetooth connectivity.
Figure 2: The Arduino ABX00032 Nano 33 IoT provides a low-cost base platform for building AI/ML applications that enhance existing devices (or build new ones) as part of the IoT. (Image credit: Arduino)
data acquisition circuit
The circuit used for the purpose of this discussion is shown in Figure 3 below. The CR3111-3000 converts the measured machine drive current to a much smaller current using a 1000:1 ratio.
Figure 3: This circuit takes a 3.3 volt input and is used to convert the output of the CR3111-3000 into a form that can be used by the Arduino Nano 33 IoT. (Image credit: Max Maxfield)
Resistor R3 is connected across the secondary (output) coil of the CR3111-3000 and acts as a load Resistor, producing an output voltage proportional to the resistance value based on the amount of current flowing through it.
Resistors R1 and R2 act as a Voltage divider, forming a “virtual ground” with a value of 1.65 volts. This allows the value of the CR111-3000 to swing positive and negative without hitting the zero voltage rail, since the microcontroller cannot accept negative voltages. Capacitor C1 forms part of the RC noise filter, which reduces noise from the 3.3 volt supply and nearby stray fields into the measurement, helping the voltage divider act as a better ground.
To provide the demonstration test bench, a vacuum pump with an integrated filter was used. For the purposes of this prototype, a Tripp Lite P006-001 1-foot extension cord was inserted between the power supply and the vacuum pump (Figure 4).
Figure 4: A 1-foot extension cord modified to accept a current sensor. (Image credit: Max Maxfield)
The prototype circuit was implemented using components from the author’s spare parts library (Figure 5). The off-the-shelf equivalent components are as follows:
(1) Adafruit’s 64 breadboard
(1) Twin Industries’ TW-E012-000 preformed wire kit for use with the breadboard
(1) RNMF14FTC150R 150 Ohm (Ω) ±1% 0.25 Watt (W) Through Hole Resistor from Stackpole Electronics
(2) RNF14FTD10K0 10 kiloohm (kΩ) ±1% 0.25 W through-hole resistor from Stackpole Electronics
(1) KEMET’s ESK106M063AC3FA 10 Microfarad (µF) 63 Volt Aluminum Electrolytic Capacitor
Figure 5: This prototype circuit was implemented using a small breadboard and components from the author’s spare parts library. (Image credit: Max Maxfield)
As for the leads of the current sensor, this is done by crimping Pololu Corp.’s 1931 22-28 AWG crimp pins on both ends. These pins are then inserted into a 1904 5 x 1 black rectangular housing with 0.1 inch (in.) (2.54 millimeter (mm)) pitch, also from Pololu.
Create AI/ML applications
To create AI/ML applications, start by grabbing a free trial of NanoEdge AI Studio from Cartesium’s website (see also “Easy to embed artificial intelligence into any industrial system”).
After launching NanoEdge AI Studio, the program invites the user to create a new project and give it a name. The user will then be asked for the processor used (Arm Cortex-M0+ when using the Arduino Nano 33 IoT board), the type of sensor used (current sensor in this case), and the maximum memory dedicated to this AI/ML model size (6 KB was chosen for this demo).
In order to create an AI/ML model, it is first necessary to collect a representative sample of good and bad data (Figure 6). Next create a simple Arduino sketch (program) to read the value from the current sensor. This data can be loaded directly into the NanoEdge AI Studio “in real time” from the microcontroller’s USB port. Alternatively, data can be collected into a text file, edited (to remove spurious samples at the start and end of the run), and loaded into NanoEdge AI Studio.
Figure 6: Comparison of good/normal data (top) and bad/abnormal data (bottom). Other than the difference in color, the graphics don’t appear to be much different to the human eye, but a proper AI/ML model can tell them apart. (Image credit: Max Maxfield)
Good data is collected from a vacuum pump running in normal mode. To collect bad data, block the pump’s air filter with a paper tray.
By leveraging good data and bad data, NanoEdge AI Studio generates the best AI/ML library solution from 500 million possible combinations. Displays its ongoing progress in a number of different ways, including a scatterplot showing how well a normal signal (blue) differs from an abnormal signal (red) with respect to a threshold, in this case set to 90% ( Figure 7).
Figure 7: NanoEdge AI Studio evaluates up to 500 million different AI/ML models to determine the best configuration for normal and abnormal data. Initial models rarely succeed (top), but the tool automatically iterates to get better and better solutions until the developer decides to terminate (bottom). (Image credit: Max Maxfield)
Early models often had a hard time distinguishing between normal and abnormal data, but the system evaluated different combinations of algorithmic elements, iterating to get more and more accurate solutions. In this example, the process stops after evaluating 58,252 libraries. The resulting library (model) is only 2 KB in size.
It is worth noting that the model at this stage is still in its untrained form. Many different factors can affect how a machine operates. For example, two seemingly identical vacuum pumps might be installed in different locations: one might be on a concrete slab and the other on a suspended floor. Or one of the machines might be in a hot and humid environment, while the other might be in a cold, dry environment. Also, one may be connected to a longer metal tube, while the other may be connected to a shorter plastic tube.
So the next step is to incorporate this library into the applications running on it for the microcontrollers and sensors connected to the machines deployed in the real world. AI/ML models on different machines will then train themselves using good data from these real devices. After this self-training period, the AI/ML model can be retained to monitor the health of the machine, look for anomalies and trends, and report its findings and predictions to a human supervisor.
Leveraging AI/ML for predictive maintenance allows engineers to fix problems before they actually break down. However, when implementing a predictive maintenance system, the hardware used must be as simple and affordable as possible; in addition, designers also need ready access to the software they need to perform analysis.
As shown above, rather than choosing a complex multi-axis accelerometer and associated hardware, a simple and small low-cost CR3111-3000 detachable current transformer can be connected to a low-cost microcontroller platform that can also perform the required sensing measurement and data collection. Combined with advances in AI/ML tools and algorithms, non-AI/ML experts can now create complex AI/ML models and deploy them in a variety of simple and complex sensing applications.