Clear Filters
Clear Filters

Digital twin for Battery

12 views (last 30 days)
Nalla Muthu
Nalla Muthu on 9 Mar 2023
Answered: Amith on 20 Aug 2024 at 9:31
We are doing digital twin for Lithium ion battery.I have done simulation for constant current source in simulink. But I need current source value can be given from physical model by arduino. I have to compare both simulation and hardware results. Let me know it is possible?

Answers (1)

Amith
Amith on 20 Aug 2024 at 9:31
Hi Nalla,
To compare simulation data from Simulink with hardware results from Arduino, you can try these steps:
1. Run the simulation in Simulink and log the necessary data.
2. Use Arduino to collect data of the same type as your Simulink model.
3. Import the Arduino data into MATLAB. If the data is logged in a CSV file, you can import it into MATLAB from the CSV file or directly from the serial port.
For guidance on reading data from CSV, you can use "readtable" function. To learn more about this function refer to this documentation: https://www.mathworks.com/help/matlab/ref/readtable.html
For guidance on reading streaming data from Arduino using serial port communication, refer to this documentation: https://www.mathworks.com/help/instrument/read-streaming-data-from-arduino.html
4. Compare the data in MATLAB: You can use the Simulink Data Inspector to compare the simulation data with the data imported from Arduino. For more information on the Simulink Data Inspector, refer to this documentation: https://www.mathworks.com/help/simulink/slref/simulationdatainspector.html
Hope this helps!

Categories

Find more on Propulsion and Power Systems in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!