Hi @Patrick,
Original Request: " I could do with some guidance on a task required on a National Instruments (NI) LEM controller currently under build. I have a Simscape system-level model of an plant (engine and linear electric machine combination). I need to embed a simplfied model or function onto the NI hardware (cRIO-9035 RT Controller) that provides a reference signal (velocity or maybe LEM force) to the High Voltage LEM drives (M700). The M700 drives and its current/force-based controller are to be considered as "black-boxes" with unknown dynamics. The "reference trajectory model" inputs are simply pressure [bar] and crank angle position [CA] and for the time being a single output, which is the translator velocity [m/s]. The sample rate for the LEM drives I have been told is 1 m/s. I can export the Simscape signals directly from the data inspector. Has anyone experience of how to train a simplfied model or create a function such as this, that can be embedded in NI hardware, where in real-time the function will receive the plant pressure and crank angle at 1 m/s intervals and output the plant velocity? A function as a transfer-function or non-linear model such as a neural network? I appreciate its a vast topic, however, and suggestions to get me started, would be great."
Response (No Simulink/Simscape access, but research-based guidance): You're right - it's a vast topic! Let me address your specific points:
For your cRIO-9035 embedding requirement: The cRIO-9035 is a rugged, fanless, embedded controller featuring an FPGA, real-time processor running NI Linux Real-Time OS, and embedded UI capability. Applications can be deployed using application components configured during the LabVIEW Real-Time build process.
Training approaches for your pressure [bar] + crank angle [CA] → velocity [m/s] model:
1. Transfer Function: Use System ID with your exported Simscape data 2. Neural Network: The Deep Learning Toolkit for LabVIEW allows you to create, configure, train, and deploy deep neural networks, and Vision Development Module works with frozen TensorFlow models on Linux RT 64-bit systems 3. Lookup Tables: Most deterministic for 1ms real-time requirements
*For M700 "black-box" drives: *
Focus on smooth, physically realizable velocity references that won't excite unknown dynamics.
Real-time implementation at 1ms:
The cRIO-9035's real-time processor should handle this timing requirement effectively.
Getting Started Suggestions: 1. Export your Simscape pressure/crank/velocity time-series 2. Start with simple lookup table approach for reliability 3. Validate against full Simscape model 4. Deploy to cRIO using LabVIEW project targeting the real-time processor
References:
1. NI cRIO-9035 Official Documentation: https://www.ni.com/en-us/shop/model/crio-9035.html
2. cRIO-9035 Technical Specifications: https://www.ni.com/docs/en-US/bundle/crio-9035-specs/page/specs.html
3. Deep Learning Toolkit for LabVIEW: https://www.ni.com/en-us/shop/software/products/deep-learning-toolkit-for-labview.html
4. Deploying Deep Learning Models to NI Hardware: https://www.ni.com/en/shop/data-acquisition-and-control/add-ons-for-data-acquisition-and-control/what-is-vision-development-module/deploying-deep-learning-models-to-ni-hardware.html
5. LabVIEW Real-Time Application Deployment: http://www.ni.com/product-documentation/12919/en/
6. Building Real-Time Applications: https://www.ni.com/docs/en-US/bundle/labview-real-time-module/page/lvrthowto/rt_building_rt_app.html
7. Deep Learning Library Community Discussion: https://forums.ni.com/t5/Example-Code/Deep-Learning-Library-for-LabVIEW/ta-p/4029995
8. Third-party Deep Learning Toolkit: https://www.ngene.co/deep-learning-toolkit-for-labview