Jeff's MCAD Blogging
Jeffrey Rowe has more than 40 years of experience in all aspects of industrial design, mechanical engineering, and manufacturing. On the publishing side, he has written well over 1,000 articles for CAD, CAM, CAE, and other technical publications, as well as consulting in many capacities in the … More »
Simulating Mechatronics Systems With LabVIEW 2015
October 9th, 2015 by Jeff Rowe
Simulation has received an increasing amount of attention through acquisition and integration with the CAD world. There have also been cases where simulation companies have acquired CAD technology. In any case, simulation has been a very active area in the realm of engineering and design technologies, and for good reason, simulating designs early saves money and headaches later in the design process.
National Instruments (NI) is an especially interesting simulation company that develops NI LabVIEW software as its flagship product.
I have followed NI for several years and really got interested in the company with LabVIEW 8.5 being used alongside SolidWorks. LabVIEW has followed a natural progression in the evolution of the NI product line for designing and prototyping complex systems, including robots, that are becoming increasingly pervasive in the world around us, and not just manufacturing environments anymore.
LabVIEW (short for Laboratory Virtual Instrument Engineering Workbench) is a system-design platform and development environment for a graphical programming language from National Instruments named “G” (not to be confused with G-code used in CNC machining). Originally released for the Apple Macintosh in 1986, LabVIEW is used for data acquisition, instrument control, and industrial automation on a variety of platforms. The latest version of LabVIEW is LabVIEW 2015, released in August 2015.
National Instruments supports the increasing need for simultaneous simulation of mechanical and electrical systems, also known as mechatronics. As I have been saying for several years, there was a time when mechanical systems and products were strictly mechanical, however, the majority of today’s products continue to become more capable, and more complex, involving the integration of mechanical, electrical, and software subsystems.
A more comprehensive way to view mechatronics is the systematic integration of mechanical, electrical, electronics, and embedded firmware (software) components. When all of the various components are combined the result is an electromechanical system. Maybe a better term is comprehensively functional ecosystem. In this context, mechatronics is characterized by software and electronics controlling electromechanical systems. This description is widely seen in automotive engines and other automotive systems, as well as production machinery and medical equipment.
A continuing trend is that as mechatronics systems get more complex and as functionality demands increase, in many instances software and firmware are replacing or at least supplementing hardware. A benefit of this transition from hardware to the burgeoning emphasis on software is called “postponement,” that is, the ability to include or change major functionality features during the final stages of production via embedded software.
Admittedly, the following video is a few years old, but provides a good overview of the significance of LabVIEW and mechatronic systems.
As mechatronic systems get more complex, the challenges associated with successfully designing and executing them also become more demanding due to the interoperability requirements between electronic CAD (ECAD) and mechanical CAD (MCAD) software.
Mechatronics systems present major design and production challenges because they bring together many different types of physical and digital parts, processes, and personnel to create a successful end product. Designing and producing a mechatronics system requires a well-orchestrated effort by a wide variety of job roles and functions – everything from industrial design to PCB layout to control logic design to production planning.
There are several positive effects of integrating digital simulation and modeling in designing mechatronics, and for good reason – it saves time and money, reduces risk, and results in higher quality, more innovative products. Several of the 3D MCAD packages and mechatronics synergy is the result of working with companies such as National Instruments. This synergy between the companies has resulted in the greatest value being realized in moving from mechanical to electromechanical machine design. Customers have benefited by integrating simulation and controls with the help of National Instruments (with products such as LabVIEW) and 3D modeling and mechanical analysis/simulation.
In the past, simulating the performance of a machine containing both mechanical and electrical components was a difficult and time-consuming process that required skilled specialists. Today, mechatronics design tools from National Instruments and several of the MCAD vendors are bringing the electrical and mechanical worlds together to make simulation and subsequent design easier. With 3D CAD, mechanical engineers can design machine parts and assemblies using a familiar interface with 3D visualization, while also simulating mechanism motion through mechanism dynamics.
While motion analysis packages are well-suited for open-loop motion simulations, a typical electromechanical system involves closed-loop control. For a true closed-loop simulation, engineers need to simulate not only the dynamics of a mechanism but also the controls that act on that mechanism. The LabVIEW interface for mechanical analysis packages provides an interface between the two environments so engineers can simulate closed-loop control for complex electromechanical systems. Closed-loop simulation between mechanical and control development environments can help drive better design decisions for both the mechanical and control aspects of a design.
As said earlier, the programming language used in LabVIEW, also referred to as G, is a dataflow programming language. Execution is determined by the structure of a graphical block diagram (the LabVIEW-source code) on which the programmer connects different function-nodes by drawing “wires.” These wires propagate variables and any node can execute as soon as all its input data become available. Since this might be the case for multiple nodes simultaneously, G is inherently capable of parallel execution. Multi-processing and multi-threading hardware is automatically exploited by the built-in scheduler, which multiplexes multiple OS threads over the nodes ready for execution.
LabVIEW ties the creation of user interfaces (called front panels) into the development cycle. LabVIEW programs/subroutines are called virtual instruments (VIs). Each VI has three components: a block diagram, a front panel and a connector panel. The last is used to represent the VI in the block diagrams of other, calling VIs. The front panel is built using controls and indicators. Controls are inputs – they allow a user to supply information to the VI. Indicators are outputs – they indicate, or display, the results based on the inputs given to the VI. The back panel, which is a block diagram, contains the graphical source code. All of the objects placed on the front panel will appear on the back panel as terminals. The back panel also contains structures and functions that perform operations on controls and supply data to indicators.
Collectively controls, indicators, structures and functions will be referred to as nodes. Nodes are connected to one another using wires – e.g. two controls and an indicator can be wired to the addition function so that the indicator displays the sum of the two controls. Thus a virtual instrument can either be run as a program, with the front panel serving as a user interface, or, when dropped as a node onto the block diagram, the front panel defines the inputs and outputs for the node through the connector pane. This implies each VI can be easily tested before being embedded as a subroutine into a larger program.
LabVIEW Robotics Modules
The NI LabVIEW Robotics Starter Kit (starting at $2,795) is an out-of-the-box mobile robot platform that features sensors, motors, and NI Single-Board RIO hardware for embedded control.
The LabVIEW Robotics software included with the platform includes features for beginners and for those who are more experienced. If you are new to LabVIEW, you can use the high-level LabVIEW Robotics Starter Kit API to quickly get started and control the robot in real time. If you are a more advanced user, you can access the FPGA and perform lower-level customization.
The simplicity of this starter kit makes it ideal for teaching robotics and mechatronics concepts or for developing robot prototypes with the more advanced LabVIEW Robotics module.
The LabVIEW Robotics (starting at $2,070) module can be used to handle everything from autonomous farming vehicles to medical mobile systems. The LabVIEW Robotics platform provides a standard hardware and software development solution for designing your robotic control system. The LabVIEW Robotics Module plugs into the LabVIEW development environment and delivers a robotics library with built-in connectivity to robotic sensors and actuators, foundational algorithms for intelligent operation and robust perception, and motion functions for making a robot or vehicle move.
The LabVIEW Robotics module can be used for designing and prototyping autonomous and semiautonomous vehicles including agricultural and military systems, robot rescue platforms, underwater and aerial vehicles, personal and service robots, and medical robotic devices.
National Instruments is fortunate to sell its products to a diverse customer base of more than 33,000 different companies worldwide, with no one customer representing more than 3 percent of revenue and no one industry representing more than 15 percent of revenue. Customer base diversity is an especially good thing in the technical (or any) software market.
I’ll be the first to admit that LabVIEW is not for everybody. Beginners are apt to find the initial learning curve difficult and the graphical programming interface limiting. That said, though, LabVIEW is one of the most comprehensive and capable packages for assisting in the design and simulation of mechatronics systems – both relatively simple and complex.