Real Time MPC Implementation Using NI DAQ Board
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Muhammad
am 15 Dez. 2023
Verschoben: Angelo Yeo
am 25 Dez. 2023
Dear MATLAB Community,
I am replacing PID controller with Model Predictive Controller for Atomic Force Microscopy (a physical Instrument)
I have designed MPC Controller in simulink, at this stage it is not good in disturbance rejection but coming to main point, I want to implement it to the real system using NI DAQ USB 6363, or Compact NI RIO 9024, both are available in my Lab.
How can I use anyone of above device and simulate controller in real time?
I will have one input (Blue arrow) from Simulink to Plant, and one Measured output from Analog sensor to MPC Controller (red arrow).
I think, implementation with real time requires some additional code to calculate the voltage signal and translate my voltage signal etc.
I am looking for some guideline and help regarding this matter. Please guide me in detail.
0 Kommentare
Akzeptierte Antwort
Hyunuk Ha
am 18 Dez. 2023
Verschoben: Angelo Yeo
am 25 Dez. 2023
Hi Muhammad,
You can utilize 'Data Acquisition Toolbox Support Package for National Instruments NI-DAQmx devices' at:
Once you installed,
(MathWorks toolbox) Data acquisition toolbox
Support Package for NI-DAQ
then, you can select you H/W at,
'Configuration(Ctrl+E) -> Hardware Implementation -> Hardware board' with yours.
Then, you can directly access your NI hardware with your algorithm.
For more detailed information,
0 Kommentare
Weitere Antworten (1)
SANKALP DEV
am 19 Dez. 2023
Bearbeitet: SANKALP DEV
am 20 Dez. 2023
Hello Muhammad,
I understand that you are interested in implementing a MPC controller model in Simulink using NI DAQ USB 6363 or Compact NI RIO 9024.To achieve this you can go through following steps:
1) Install Support Package: Install the Data Acquisition Toolbox Support Package for National Instruments NI-DAQmx Devices. You can refer to the following installation guide: https://www.mathworks.com/matlabcentral/fileexchange/45086-data-acquisition-toolbox-support-package-for-national-instruments-ni-daqmx-devices
2) Hardware Connection: To acquire data from a National Instruments device and discover a device that supports input measurements, access the device in the table returned by the “daqlist” command. For detailed instructions on hardware connection and data acquisition, refer to the following link: https://www.mathworks.com/help/daq/acquire-data-using-ni-devices.html
3) Simulink Model Preparation: You must modify your Simulink model to include I/O blocks compatible with the NI hardware. To perform live acquisition, signal processing and generation you can go through the following examples:
- Live Acquisition, Signal Processing, and Generation: https://www.mathworks.com/help/daq/live-data-acquisition-signal-processing-and-data-output.html
- Spectral Analysis on Live Data: https://www.mathworks.com/help/daq/performing-spectral-analysis-on-live-data.html
4) Generate Voltage signals: Once you know the module, slot and the name of the channel, you should create a “DataAcquisition”, set the generation scan rate by setting the “Rate” property and add analog output channels using “addoutput”. For detailed information on acquisition, signal processing, and generation consider exploring the following example: https://www.mathworks.com/help/daq/generate-signals-on-ni-devices-that-output-voltage.html
For additional information on getting started with NI devices, utilizing analog and digital inputs and outputs, and performing simultaneous and synchronized operations, please refer to the following MATLAB documentation: https://www.mathworks.com/help/daq/national-instruments-hardware-examples.html
Thanks, and regards,
Sankalp dev
0 Kommentare
Siehe auch
Kategorien
Mehr zu National Instruments Frame Grabbers finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!