With SimMechanics 2, the latest version of The MathWorks’ mechanical simulation software, engineers now have the ability to simulate their mechanical models on real-time hardware-in-the-loop (HIL) systems, allowing them to test and improve their controller and mechanical designs earlier in the design cycle.
The new version of the software allows users to generate C code from a ‘SimMechanics’ model using ‘Real-Time Workshop’, which creates optimised ANSI C code from Simulink block diagrams.
Real-Time Workshop produces processor-independent code that represents the SimMechanics model exactly, and allows users to run their model as a stand- alone executable. The generated code may be used in a variety of ways, including acceleration of non real-time simulations and use as a system or plant model for real-time testing in a hardware-in-the-loop simulator.
SimMechanics 2 also offers other new capabilities, including improved animation, new spring-damper blocks, and a new variable mass block. Animating models in SimMechanics is easier with several improvements to the MATLAB graphics animation tool. New buttons have been added to toggle the display of co-ordinate systems, centre-of-gravity icons, and bodies.
Users can also create movies of the mechanical system motion, storing the animations as AVI files to be used later in presentations.