Simscape Library | HIL testing Simulation in Simulink | Simscape blocks and their application in Simulink | MATLAB/Simulink based simulated HIL testing
Source: MathWorks Website |
Simscape Blocks Libraries
According to MATLAB/Simulink documentation, the Simscape contains all those blocks that have some physical parameters that exist in real life for dynamic modelling of systems. For example we have electrical elements like transformer, diode, MOSFETs, whose transfer functions or state space modelling is not always possible. For that purpose Simulink provide a library with such blocks to model.
It is generally divided into 5 main parts comprising of Electrical and Mechanical basic bodies of simulation. They are:
- Electrical
- Fluids
- Driveline
- Multibody
- Utilities
- Foundation Library
Examples of some basic physical system
1. Spring Mass Damper System
Let's have a spring mass damper system as shown in below figure.
Source: Wikipedia |
It is very easy to determine the transfer function of this system but for a complicated system, it becomes very very tedious job for a person who do not know mathematical modelling so, for that I tried to implement this in Simulink as model and also verified the transfer function (LINK) output of this system with input as step function.
So, if the block is moved x in the given direction, and the transfer function comes out to be
Transfer Function with some units |
The below figure is the simulation of this system using Simscape blocks.
The configuration setting should not be changed for the simulation as it may lead to some error while simulation. The Solver Configuration (f(x) = 0) block is one of the most important element of this simulation as it connects the solver to the Simscape blocks and must be connected to reference points (either electrical ground or mechanical reference). The below figure shows the scope output which confirms the accurate modelling of this system.
Scope Output |
2. Electrical Circuit
Electrical Circuit with given units |
Simulink Modelling of Electrical Circuit |
3. PID Control of Motor using Simscape
Speed in RPM |
PWM Signal to H-bridge |
Advantages of using Simscape
- Easy to use.
- Easy modelling of physical system.
- High coverage of different complex system.
- Can verify Hardware-In-Loop testing on simulation.
- More nearer to hardware approximation and hardware simulation.
- Large community for help in many systems.
- Thermal modelling support of physical systems.
- Inter-domain modelling ease of use.
Disadvantages
- Still in developing phase with some blocks.
- Lack of some PSPICE modelling blocks support.
- Slow response and Solver configuration errors.
- Conversion of continuous to discrete system is also very cumbersome job.
Conclusion
The pros and cons evaluation was done after implementing these circuits and analyzing them with general transfer system approach. These blocks can be new answers to HIL testing without hardware if implemented considering all the constraints. It can be said after going after SIL testing, and before integration in actual hardware, it would be better to test it on Simscape blocks and observe the general behavior of the model/algorithm and after this dSpace, Arduino, TIVA or other evaluation boards could be used for integration testing. People from research and development can be considered as most benefitted from this library as it is not always possible for them to have physical hardware.
Message from me
Hello folks! I hope you all would have got an idea regarding these simulations and workings. I will be updating soon with more electronics related stuffs till then please let me know your feedback about this blog 😀✌✌
Nicely explained
ReplyDeleteEasy language and good explanation. Keep it up!
ReplyDeleteWell explained, good going, kee it up !👍🏻
ReplyDeleteVery Insightful !
ReplyDelete