Electronic Design

Multicore Matters With Mechatronic Models

Complex mechatronic simulation is key to application development, because a device in hand isn't always an option.

Whether it's single microcontrollers handling motor control or an automobile assembly line containing multiple robots, you can be sure mechatronics is in the mix. Simulating such complex systems allows developers to build without having the hardware in hand. This is critical when some or all of the hardware doesn’t exist, but becomes even more valuable when considering “what if ” scenarios.

However, two major issues continue to crop up: speed and complexity. Larger systems, more detailed simulation, and a host of other factors push the need for high-performance host development systems. Tradeoffs between simulation speed and the level of accuracy must often be made because of available resources. Faster processors always help, but the trend toward multicore systems actually works in favor of simulation because the systems being simulated are distributed as well.

The environment is more complex than typical programming environments because of physical concerns. For example, Figure 1 shows a control system for a Stewart platform commonly used in production lines and many other industrial applications. The graphical programming environment is the MathWorks’ Simulink.

The SimMechanics add-on to Simulink highlights the kind of simulation environment needed for today’s mechatronics development requirements. SimMechanics complements the MathWorks’ other simulation tools, including SimElectronics, SimDriveline, SimHydraulics, and SimPowerSystems.

In this case, there are effectively two models: the simulated physical world model and the application model. The latter occurs because Simulink and Matlab are model-based development tools, so the application is a model. The physical model accounts for the physics-based simulated environment. The application model interacts with this environment to simulate the application running in the real world.

The mechanical aspects of the physical world represent just the start in many designs, due to the growing importance of other considerations. For instance, temperature, hydraulics power, and radio transmission often come into play with applications that range from robotics to cell-phone design. Often, this is where the CAD realm merges with the programming realm.

Several CAD vendors, such as Autodesk and Solidworks, have advanced packages designed to handle simulations, though they’re typically oriented toward physical construction versus process-control development. SolidWorks Simulation Premium contains advanced finite-element-analysis (FEA) support. The package can target stress under dynamic load. It also addresses nonlinear analysis like deflection and impact with flexible materials such as foam, rubber, and plastic.

CAD designers are familiar with modular construction. Remmele Engineering uses models of Nook Industries’ actuators and components to create assembly-line designs using SolidWorks (Fig. 2). Also, Remmele Engineering develops products for a range of applications from novel drug-delivery systems to energy-storage systems that require physical as well as control components.

Nook Industries offers a line of linear actuators that typically wind up in computer-controlled systems. The company’s Web site is set up to deliver 2D/3D models of its products so a designer can drop in an array of linear actuators and develop a virtual device or production line. This approach is common for companies that deliver physical devices, but less so when it comes to support for control applications.

Simulation and analysis of physical entities is useful in a design that doesn’t include a computer-based controller. However, if there is one, it can be even more valuable due to this type of system’s greater complexity. Most CAD packages work with software-development tools, too.

Take Solidworks and National Instruments, who have worked together to integrate Solidworks’ COSMOSMotion with National Instruments’ LabVIEW (see “Cooperation Leads To Complex, Real- World Simulations” at www.electronicdesign. com, ED Online 17273). This type of integration allows CAD designers to prepare object models of physical entities like gears, arms, and boxes while programmers concentrate on the feedback and control algorithms that will handle the motors and actuators within the system.

Tying objects together enables the models to cooperate, and rendering systems permit visualization of the models in action. Either modeling environment alone can demand significant amounts of computing power, and rendering can tax the best graphics subsystems. Putting it all together can burden even the most powerful systems when creating large models. At this stage, multicore hosts can make a significant difference.

Continue on Page 2

MULTICARE SPEEDS SIMULATION
Most CAD and model-based design systems already employ multithreaded software that takes advantage of multiple cores. Yet exploiting a large number of cores and clustered systems requires more advanced software architectures, which are now being developed and deployed. Part of the problem is communication between cores.

Mechatronic simulations need time synchronization between the various objects in the environment if their simulation is to be distributed among various cores. In a single-core system, a bit of shared memory often can handle the synchronization. The same tends to be true for symmetrical-multiprocessing (SMP) systems, but cache coherence and memory traffic can become an issue. This becomes even more complex as the number of cores rises, making it a big issue when hundreds or thousands of cores are involved.

Typically, there’s a degree of localization within the simulation, since interaction between objects is limited. For instance, a robotic arm in an assembly line will be able to come in contact with objects within its reach but never something at the far end of the assembly line that’s beyond reach. This distribution can allow the physical modeling to be partitioned. Likewise, the simulation needn’t be in lockstep if the synchronization between partitions is more varied.

Still, the problem arises when the control application model is brought into the picture. That’s because an interaction now exists between physical objects through the control application, which arises from the response time between a sensor reading at one end of the assembly line and the other being nil. This essentially puts everything in lockstep again.

GRAPHICAL MODEL-BASED PROGRAMMING
Graphical-based modeling can be helpful with partitioning issues. Graphical-based design is inherent with CAD, but not necessarily when it comes to programming. C and C++ are often used to write control applications for motor control and other mechatronic applications.

Luckily, most graphical programming environments blend well with textbased programming tools. For example, Simulink can handle C and C++ code as easily as Matlab script code. The latter is a complementary tool to Simulink.

The graphical environments hold many advantages over text-based tools, but one key feature is the visual representation of system partitioning and interaction that lends itself to mechatronic applications. This is why these tools are so popular for this application space. They also reduce system complexity from a developer’s standpoint, allowing concentration on the application details.

Students at the Rensselaer Polytechnic Institute (RPI) created their version of the Segway Human Transporter called the Human Object Transport Vehicle (HOT-V). This HOT-V was designed and built from scratch using simulation techniques to tackle the control application’s balancing act (Fig. 3). Also, the HOT-V was programmed using National Instruments’ LabVIEW.

The target control system was National Instruments’ FPGA-based CompactRIO, which is great for lab work and prototypes (Fig. 4). Projects like these also will benefit from the company’s Single Board Reconfigurable IO (SB RIO), announced at this year’s NI Week (see “LabVIEW 8.6: More Multicore And More Embedded,” ED Online 19630).

The project was started using a tethered Light Object Transport Vehicle (LOT-V) and finished with the HOT-V capable of transporting a student on two wheels. The students used the LabVIEW Simulation module to check out their mechatronic algorithms. On the whole it balanced out well.

This kind of research highlights the ability to create sophisticated mechatronic applications using graphical programming tools without extensive programming expertise. Engineering undergraduates completed this particular project in a semester, from theory and design to the final product.

But all is not lost on text-based programming when it comes to simulation. Mathworks recently released Simscape, a text-based simulation programming language that specifically targets mechatronics applications. It’s designed to work with the company’s own Matlab and Simulink products.

Continue on Page 3

Simscape targets co-simulation where programming and CAD intersect. This multi-domain tool ties together the Sim- Electronics, SimDriveLine, SimMechanics, and SimHydraulics tools. Back in Figure 1, the Stewart platform simulation can incorporate electrical, hydraulic, mechanical, and signal flow support in addition to software control of the system.

Also, Simscape is a declarative language that defines implicit relationships between components versus the explicit programming specifications for languages like C and C++, or even graphical dataflow languages such as LabVIEW. Companies like Instron have used SimScape to develop and build a multi-axis test fixture to assist in evaluating race-car designs (Fig. 4).

According to Andew Plummer, manager of control and analysis, Instron was able to perform simulations on the system five times faster, allowing models to be refined more quickly. As with most simulation tools, they were able to detect and fix problems in the physical and algorithmic designs faster.

A MODEL OF INTERACTION
By reducing the amount of expertise required for developing mechatronic applications, developers can expend time and effort on other areas where they do have expertise. Likewise, having a model environment permits a better exchange of ideas and products.

For decades, customers and suppliers have exchanged CAD drawings. The difference these days is the detail within the models being exchanged as objects within a mechatronic application become more advanced. What used to be just dimensions is now something that can be used within a simulation complete with programmable feedback and even application interfaces when a model includes application code.

Such a level of sophistication lets customers specify criteria in a fashion that can be used within a simulation and utilized by the development tools. With the MathWorks’ Simulink Design Verifier, assertion blocks are able to be included within a model so the system can determine whether an object’s use within a system is correct. These may be simple asserts such as “a voltage should not go over 10 V,” or they can be quite complex such as “event X must occur within 25 seconds of event Y.”

Incorporating this type of design information in a model also lets vendors deliver virtual models of products for customers to develop and experiment with. In many instances, the actual product will not be created until the customer provides final specifications for the model.

Standards in this arena are rare given the number of vendors involved with their own development tools, but occasionally you’ll find commonality. For instance, several automobile powertrain vendors provide their customers with compatible product models that allow for testing and experimentation within a simulated environment.

MIX AND MATCH MODELING
This experimentation is crucial to the design process, and it can occur in a mixed environment where real and virtual objects are combined. A real robotic arm may be coupled with a virtual assembly line, for example, if the current task is to determine if the hand on the robotic arm can re-orient an object. Or, maybe it involves stirring a virtual pot of molten plastic.

The key is getting the virtual objects and their control counterparts to interact with the real objects with code that’s running on remote devices. For users of LabVIEW, the development environment readily handles this common occurrence.

Mechatronic development tools continue to improve their functionality and performance, making small projects easy and large projects possible. Increased use of mixed simulation in the development process allows simulation to be used throughout the development cycle and into deployment and on-site testing.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish