Virtual Sensors with AI and Model-Based Design
Upcoming Webinar - December 18, 2024 |
AI with Model-Based Design: Virtual Sensor Modeling |
Why Virtual Sensors?
Virtual sensors are software components that mimic the behavior of a physical sensor by using other measurements or data available to estimate the quantity of interest. They are commonly used in many industries and applications to monitor and optimize processes, or estimate environmental conditions. Figure: Industries and applications virtual sensors can be used for The main benefits of virtual sensors, compared to physical sensors, are improved performance and reduced costs. Consider using virtual sensors, when:- It is difficult or impractical to use physical sensors.
- Additional information is needed beyond what can be directly measured.
- The physical sensors are unreliable, difficult, or costly to maintain.
- Coca-Cola Develops Virtual Pressure Sensor with Machine Learning to Improve Beverage Dispenser Diagnostics
- Poclain Hydraulics Develops Soft Sensors to Measure Motor Temperature in Real Time Using Deep Learning and Kalman Filters
- Gotion Develops Onboard SOH Estimation Using DVA and ICA for LFP Batteries
- Mercedes-Benz Simulates Hardware Sensors with Deep Neural Networks
- Battery SOC and SOH Estimation using a Hybrid Machine Learning Approach
- Onboard Battery Pack State of Charge Estimation Using a Neural Network
Virtual Sensors with AI
This section talks about using AI to design virtual sensors and shows how:- You can quickly train and compare different AI models in MATLAB to implement a virtual sensor or import AI models from other deep learning frameworks.
- Safely, systematically, and thoroughly test your virtual sensor design by simulating different test scenarios before deploying to production.
layers = [sequenceInputLayer(numFeatures) lstmLayer(numHiddenUnits,OutputMode="last") fullyConnectedLayer(numResponses) regressionLayer];Then, you can train the LSMT model by using the trainNetwork function. 2. Train a feedforward, fully connected neural network for regression.
Mdl = fitrnet(X,Y)3. Fit a decision tree for regression.
tree = fitrtree(X,Y);If you prefer a more interactive workflow, you can use low-code apps (Deep Network Designer, Classification Learner, and Regression Learner) for designing, tuning, assessing, and optimizing AI models. MATLAB also offers nonlinear models for capturing system dynamics. You can estimate nonlinear system dynamics using Hammerstein-Wiener and Nonlinear ARX models with machine learning techniques such as Gaussian Processes (GP), Support Vector Machines (SVM), and other representations. Alternatively, you can create neural ordinary differential equation (ODE) models using deep learning to capture nonlinear system dynamics. For an example, see Neural State-Space Model of SI Engine Torque Dynamics. You can use your AI models in combination with other methods, such as Kalman filters. For instance, a neural state space model can be used as the model inside of a nonlinear Kalman filter (example: Online State Estimation Using Identified Models - Nonlinear Models). System Simulation Once you have created or loaded your AI models, you can integrate them into Simulink and test them in simulations. Using Simulink, you can evaluate tradeoffs, such as accuracy, model size, and inference speed, in the context of the larger system that the virtual sensor is part of (BMS in our example). In the SOC estimation example, four models are compared in the Simulink simulation: an extended Kalman filter (EKF), a regression tree, a feed-forward network (DL-FFN), and an LSTM model. Figure: Simulating and comparing four virtual sensors (Kalman filter model and 3 AI models) in Simulink One of the main benefits of using virtual sensors based on AI models is that they could be faster than virtual sensors based on physical models (especially, complicated physical models). On the other hand, AI models are less explainable than Kalman filter models and additional techniques need to be applied to understand the inner workings of an AI model. The lack of explainability is not necessarily an issue (according to engineers at Poclain Hydraulics). By simulating and testing the complete system with the virtual sensors, you can evaluate model performance, such as speed and accuracy, and use results from simulations to inform model selection. Deployment Using MATLAB and/or Simulink you can generate library-free C/C++ code for deploying AI virtual sensors to resource-constrained edge systems. You can also deploy virtual sensors to FPGA devices, enterprise systems, or the cloud. At this stage, you can perform processor-in the-loop (PIL) or hardware-in-the-loop (HIL) testing. You can deploy the entire BMS software (which includes the virtual sensor to estimate the battery SOC) onto the target hardware and run a real-time closed-loop simulation with the plant model, which in this case is the model of battery dynamics. You can test key design parameters of the virtual sensor, such as accuracy, memory usage, and inference speed. Once testing is finalized, the model is ready to be deployed to the production hardware. Figure: Generate C/C++ code for your AI model and deploy to hardware, used in a vehicle. MATLAB and Simulink also automate MLOps processes for regulating the full lifecycle of AI models, including maintaining and monitoring the operation of AI virtual sensors after deployment to production.
Conclusion
MATLAB and Simulink provide engineers with tools to improve data quality, access to popular machine learning and deep learning algorithms, integration with a system-wide simulation environment, and deployment to the real-world system. So, you can choose the best AI technique (or combination of AI technique with other method) not only for designing an accurate virtual sensor, but for designing and deploying a virtual sensor that will run efficiently on the intended system.- Category:
- AI Application,
- Deep Learning,
- Machine Learning
Comments
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.