NI SoftMotion for SolidWorks - FAQ

Overview

This document answers frequently asked questions about virtual prototyping. Use this document to learn how to install and evaluate the virtual prototyping tools and how to get started with this new technology. This document lists links to other useful resources and provides valuable information that helps you get up to speed quickly.

Table of Contents

Basics

  1. What is virtual prototyping? What is NI SoftMotion for SolidWorks?
  2. What resources are available to help get me started?
  3. Where should I go to find support information, ask questions and report bugs?

Installation and Licensing

  1. What software is required?
  2. Are evaluation versions of the software available? How do I purchase the tools?
  3. Is the NI SoftMotion for SolidWorks module included with the academic site license?

How To

  1. How do I activate NI SoftMotion for SolidWorks?
  2. How do I enable motion simulations in SolidWorks?
  3. How do I create a LabVIEW project that connects to my SolidWorks assembly?
  4. How do I start and stop the SolidWorks Simulation from LabVIEW?
  5. How do I include digital proximity sensor feedback in my motion control application?
  6. How do I simulate friction?
  7. How do I simulate spring/damper effects?
  8. How do I perform collision detection?
  9. How do I deploy my motion control application to the physical machine using NI CompactRIO?

Tips and Tricks

  1. What are some important things to know about motors, sensors and simulations?
  2. What are some LabVIEW motion programming tips and tricks?
  3. How do I get the fastest simulation performance?

Debugging

  1. What are some top debugging suggestions?
  2. What are the known technical issues for NI SoftMotion for SolidWorks?
  3. Can I export curves from SolidWorks and use in my motion control application?

Can I do this?

  1. Is velocity mode supported with SolidWorks motion simulations?
  2. Can I use the regular NI SoftMotion shipping examples with SolidWorks?
  3. Is there a way to automatically log the SolidWorks simulation data to disk?
  4. Can I use NI SoftMotion for SolidWorks to tune my PID control loops or simulate an advanced closed loop control algorithm?
  5. Can I run real-time simulations? Why are the simulations slower than real life?

Design Analysis and Optimization

  1. How can I calculate the peak and RMS torque and velocity in LabVIEW for motor and actuator sizing?

Motion Control Concepts

  1. What is a motion axis and how can I use one?
  2. What is a coordinate space and when should I use one?
  3. What is a table and when should I use one?

 

What is virtual prototyping? What is NI SoftMotion for SolidWorks?

NI SoftMotion for SolidWorks enables mechanical, electrical and control engineers to collaborate by creating a virtual prototype of the motion control system that integrates mechanical simulation, motion control software, and sensor feedback. As soon as you have a CAD drawing, you can begin prototyping the machine design long before you incur the expense of building a physical machine. The new tools enable you to:

  • Visualize realistic machine operation
  • Validate and iterate on the mechanical, control and electrical aspects of your design
  • Estimate the cycle time performance
  • Check for collisions or other programming mistakes
  • Calculate force/torque loads for stress analysis 
  • Select and size motor and mechanical transmission components
  • Improve communication between the engineers on your team and with customers

Go back to Table of Contents

What resources are available to help get me started?

A variety of self paced tutorials, web training videos, and software help documentation are available to help you get started and become proficient in virtual prototyping.

Self Paced Tutorials

LabVIEW Getting Started Tutorials and Guided Tour

Self Paced: Connect to SolidWorks and Create a Virtual Prototype

Getting Started Guide for NI SoftMotion for SolidWorks 

Free Web Based Training Videos

LabVIEW-SolidWorks Digital Prototyping Training

Demonstration Examples

To find shipping examples that demonstrate all of the different motion commands available, launch LabVIEW 2009 and navigate to Help>Find Examples. Then in the Example Finder go to Toolkits and Modules>Motion Control>NI SoftMotion. You can find SolidWorks specific examples under the Mechatronics>SolidWorks subfolder.

Software Help Documentation

To access the online help, launch LabVIEW and navigate to Help>>Find LabVIEW Help. Under the Contents section, expand the NI SoftMotion Module tab and then go to Motion Resources>>Working with SolidWorks Assemblies.

For more resources, visit these sites: 

NI Virtual Prototyping Portal

Virtual Prototyping Community Site

Go back to Table of Contents

Where should I go to find support information, ask questions and report bugs?

Post your questions and comments to the Virtual Prototyping Community portal. Please also use the community site to discuss your application, share tips and tricks and comment on the virtual prototyping tools.


Go back to Table of Contents

What software is required?

The following software versions are required:

NI LabVIEW 2009 f2 (32-bit) or later (base, full, or professional)

NI SoftMotion Module Standard or Premium for LabVIEW (purchase includes activation for NI SoftMotion for SolidWorks)

SolidWorks 2009 Service Pack 2.1 or later or SolidWorks 2010 and SolidWorks Motion Simulation (included with SolidWorks Premium, Simulation Premium, or Simulation Professional)


Go back to Table of Contents

Are evaluation versions of the software available? How do I purchase the tools

 

LabVIEW and the NI SoftMotion Module are both available for 30-day evaluation and can be purchased online. To purchase or evaluate SolidWorks, contact your local reseller.

  Purchase Evaluation
LabVIEW 2009 LabVIEW 2009 LabVIEW 2009*
NI SoftMotion Module NI SoftMotion Module** NI SoftMotion Module**
SolidWorks 2009 (SP2.1 or higher) or SolidWorks 2010 Contact your SolidWorks reseller Contact your SolidWorks reseller

* You can upgrade your evaluation version to a fully licensed version without reinstalling. To do this, purchase the software and apply the activation code you receive using the NI License Manager.

** Includes NI SoftMotion for SolidWorks.

Note: You will be prompted to install critical updates during the installation. Please apply these updates or follow these links to download the updates manually.

LabVIEW 2009 f2 Patch

LabVIEW NI SoftMotion Module 2009f1 Patch


Go back to Table of Contents

Is the NI SoftMotion for SolidWorks module included with the academic site license?

Yes. The NI SoftMotion Module and NI SoftMotion for SolidWorks is part of the Control Design and Embedded Systems option for the site academic license (more details).

Learn more about the NI product offering for education and research.


Go back to Table of Contents

How do I activate NI SoftMotion for SolidWorks?

NI SoftMotion for SolidWorks requires an additional activation that must be applied in addition to the NI SoftMotion activation. This additional activation is included at no additional charge with the purchase of the NI SoftMotion Module Standard or Premium. The activation is done by applying a special serial number.

Complete the following steps to activate this product:

1.      Launching the NI License Manager (Start>Programs>National Instruments>NI License Manager).

2.      Click Activate in the dialog box that appears. The NI Activation Wizard launches.

3.      Select Automatically Activate through a secure Internet connection and click Next.

4.      Enter the serial number S12M00101 next to LabVIEW 2009 NI SoftMotion for SolidWorks.

5.      Follow the prompts to complete the activation process.

6.      Restart LabVIEW.

Notes:

  • You must first activate the NI SoftMotion Module and then you can activate NI SoftMotion for SolidWorks.
  • After 30 days you will be automatically prompted to activate NI SoftMotion for SolidWorks (when you open a LabVIEW project containing a SolidWorks assembly or add a SolidWorks assembly to the LabVIEW project.) Also, you can activate it ahead of time using the NI License Manager.
  • In order to use NI SoftMotion for SolidWorks, you must also have a licensed version of the LabVIEW NI SoftMotion Module. Visit ni.com/motion/softmotion for information about the different versions of the LabVIEW NI SoftMotion Module and to purchase.

Go back to Table of Contents

How do I enable motion simulations in SolidWorks?

After launching SolidWorks, you must enable the Motion Simulation add-in enabled from the Tools menu in SolidWorks. If you place a checkmark in both the left and right checkboxes then you don’t have to re-enable the add-in each time you use NI SoftMotion for SolidWorks.

Go back to Table of Contents

How do I create a LabVIEW project that connects to my SolidWorks assembly?

First, configure the motors in your SolidWorks motion analysis study for distance mode and confirm that the simulation is working correctly in SolidWorks.

Now you can link to the assembly from LabVIEW and use NI SoftMotion function blocks to create motion profiles using any available move type. Complete the following steps to add a SolidWorks assembly to the LabVIEW Project:

  1. With the SolidWorks assembly open, launch LabVIEW and select File»New Project to display the Project Explorer window.
  2. Right-click My Computer and select Properties. Navigate to the Scan Engine tab and check the box for Start Scan Engine on Deploy.
  3. Right-click My Computer and select New»SolidWorks Assembly from the shortcut menu to open the Import Axes from Assembly File dialog box.
  4. Select the SolidWorks assembly to add to the LabVIEW project. If a SolidWorks assembly is currently open, the Import Axes from Assembly File dialog box contains the path of this assembly. Click Browse to select a different assembly file if necessary.
  5. Click OK. The selected SolidWorks assembly is added to the Project Explorer window including all motors contained in the SolidWorks motion study.
  6. Right-click My Computer and select New » NI SoftMotion Axis. In the Axis Manager, click Add New Axis. This creates a new motion axis in LabVIEW and binds it to a SolidWorks motor resource.
  7. Optional: Right-click on Axis 1 and selectProperties. Click the left-most icon to configure the axis settings. Select Enable Drive on transition to Active Mode. This eliminates the need to use the Power function in your LabVIEW application to manually enable the drive.

For screenshots of the steps above and instructions on what to do next, open this self-paced hands on training guide.

Details:

  • If the SolidWorks assembly contains multiple motion studies, choose the motion study to add to the project using the Select Motion Study dialog box. To change the motion study used in the project after adding the assembly, right-click the SolidWorks assembly item in the project tree and select Change Motion Study from the shortcut menu.
  • The SolidWorks assembly is added under My Computer. All motors configured in the SolidWorks assembly are added under the SolidWorks assembly LabVIEW Project icon using the names from the SolidWorks assembly. You can now associate the SolidWorks motors with NI SoftMotion axes and configure the I/O as necessary for your application.
  • When opening a LabVIEW project with an associated valid SolidWorks assembly, LabVIEW prompts you to launch SolidWorks if it is not already open and opens the correct model. If you choose not to launch SolidWorks at this time you can open the assembly later by right-clicking the SolidWorks assembly in the Project Explorer window and selecting Synchronize to Assembly.

Go back to Table of Contents

How do I start and stop the SolidWorks Simulation from LabVIEW?

SolidWorks simulations start when the NI Scan Engine mode switches from Configuration mode to Active mode and stop when the NI Scan Engine switches from Active mode to Configuration mode.

Starting a SolidWorks Simulation

After you add a SolidWorks assembly to the Project you can only start the SolidWorks simulation using LabVIEW, not by clicking the Calculate button in SolidWorks.

You can start the SolidWorks simulation in one of the following ways:

1.) Deploy an NI SoftMotion resource either for the first time or with updated information. You can deploy all resources at the same time by clicking each resource while pressing <Ctrl>, then selecting Deploy from the shortcut menu. 

Note:  If you deploy an axis but have not made any configuration changes to any of the associated resources, the simulation does not start because the NI Scan Engine did not switch to Active mode. In this case you must manually switch to Active mode using one of the other methods.

2.) Switch to Active mode manually by right-clicking the SolidWorks assembly in the Project Explorer window and selecting Utilities»Scan Engine Mode»Switch to Active from the shortcut menu. You must have already deployed your motion items for this to work correctly.

3.) Switch to Active mode manually using the NI Distributed System Manager. You must have already deployed your project information for this to work correctly.

Notes:

  • If you have made changes to your SolidWorks assembly since the last simulation, rebuild your assembly in SolidWorks before starting a new simulation.
  • You cannot click Calculate in SolidWorks, then switch to Active mode in LabVIEW and run a simulation. The only way to start the simulation in SolidWorks is for the NI Scan Engine to switch to Active mode either manually or during deployment.
  • If the SolidWorks simulation does not start after switching to Active mode there may be a fault on one or more axes. You can view NI SoftMotion faults from the Interactive Test Panel.
  • The default values for the SolidWorks Maximum Step Size in the Assembly Properties dialog box and the default NI Scan Engine Scan Period in the Scan Engine page in the target Properties dialog box may result in an Access Fault on the axes. If this occurs, decrease the Maximum Step Size so that it is less than the Scan Period to prevent this fault.

Stopping a SolidWorks Simulation

You can stop the simulation in SolidWorks in one of the following ways:

1.) Switch to Configuration mode manually by right-clicking the SolidWorks assembly item in the Project Explorer window and selecting Utilities»Scan Engine Mode»Switch to Configuration from the shortcut menu.

2.)Switch to Configuration mode manually using the NI Distributed System Manager.

Note: It is not recommended to click Stop from within SolidWorks. In this situation, NI SoftMotion returns fault FF82 (External Termination Fault) on all axes and the NI Scan Engine remains in Active mode, but SolidWorks does not perform further motion calculations. You must manually switch to Configuration mode, then back to Active mode to restart a simulation.


Go back to Table of Contents

How do I include digital proximity sensor feedback in my motion control application?

You can associate Measurements sensors configured for your SolidWorks assembly with available digital inputs and limit inputs. Measurement sensors monitor a dimension in your SolidWorks assembly. For proper operation, sensors you configure in SolidWorks must have a properly configured alarm condition. When the specified condition is met, the alarm state changes to TRUE. You can read this state using the Digital Line or Motion I/O method of the Read function block, depending on what input type you have mapped the sensor to in the Map Sensors dialog box.

To open the configuration dialogue, right-click the SolidWorks assembly item in the LabVIEW project and select Map Sensors.

Notes:

  • You must deploy the SolidWorks motor or NI SoftMotion axis to which the motor is bound, not the SolidWorks assembly item, to ensure that any mapped sensors are deployed to your LabVIEW project.
  • When using the Read function for sensor feedback, always use the is valid signal. An example is shown below.

  • The data polarity is active low by default with respect to the alarm in SolidWorks. If you want the polarity to match the SolidWorks alarm status, use a Not function as shown above or change the Motion I/O Active State via the axis configuration properties.

Go back to Table of Contents

How do I simulate friction?

To add friction to a mate in SolidWorks, right-click the mate and select Edit Feature. Then click on the Analysis tab, check the Friction box and configure the friction parameters. Refer to the SolidWorks help documentation for details.

Note: You can also simulate friction by adding a 3D Contact to your motion study via the Motion Manager Toolbar. However, simulation performance is typically much slower when 3D Contacts are used.


Go back to Table of Contents

How do I simulate spring/damper effects?

To add spring and damper effects (mechanical compliance) to a mate in SolidWorks, right-click the mate and select Edit Feature. Then click on the Analysis tab, check the Bushing box and configure the stiffness, damping and preload force parameters. Refer to the SolidWorks help documentation for details.

Note: You can also simulate springs and dampers by adding a Spring to your motion study via the Motion Manager Toolbar.

Go back to Table of Contents

How do I perform collision detection?

There are two ways you can perform collision detection.

1. After the your motion control application is finished running, switch the scan engine to configuration mode. (To do this, right-click on My Computer >Utilities>Scan Engine Mode.) Then, in the SolidWorks motion study Motion Manager Toolbar, right-click on the top item in the tree (which has the same name as your assembly) and select Check Interference. Then click on the parts you want to check for collisions on, and select Find Now. If collisions occured, SolidWorks will tell you the time of the collisions and the volume of overlap.

 or 

 2. You can use a distance sensor to detect collisions. In this case, LabVIEW can monitor the sensor while the motion simulation is running and take action (such as stopping the move and alerting you) if the sensor value changes.  This also enables to to detect a "near miss" where the parts came too close for comfort but didn't actually collide. To include proximity sensor feedback in your LabVIEW control applications, add a dimension to your SolidWorks assembly and connecting it to a Measurement sensor in SolidWorks with an Alert configured (for example, alert if the distance is less than 5 mm). Then in LabVIEW, right-click on the SolidWorks assembly item in the LabVIEW project and select Map Sensors. For an example, launch the LabVIEW Example Finder (Help>Find Examples) and try running the shipping example called "Basic SolidWorks Sensors.lvproj".


Go back to Table of Contents

How do I deploy my motion control application to the physical machine using NI CompactRIO?

When you configure your CompactRIO motion axes, be sure to set the scaling so the units match your SolidWorks simulation (mm for linear travel or degrees for rotary travel).

For more information on deploying your motion control application to the NI CompactRIO programmable automation controller (PAC) platform, see this site:

http://www.ni.com/motion/

Go back to Table of Contents

What are some important things to know about motors, sensors and simulations?

The following lists some of the top tips, tricks and caveats to consider when creating and using SolidWorks assemblies with NI SoftMotion:

Motors

  • All motors configured in SolidWorks must be displacement motors. The most common type for this is a Distance motor.
  • When using a linear motor, NI SoftMotion assumes a conversion rate of 1 count/mm for encoder counts/unit.
  • When using a rotary motor, NI SoftMotion assumes a conversion rate of 1 count/degree for encoder counts/unit.
  • When using a rotary motor, velocities greater than 360 degrees in one scan period are not supported.  Note: The Scan Period is configured on the Scan Engine page of the RT Target Properties dialog box.

Sensors

  • All sensors must be Measurement sensors and only the alert state of the sensor is returned to NI SoftMotion.
  • Sensors can only be used if they are in the top level sensor folder in SolidWorks, not part of a subassembly.
  • You cannot map a sensor to the home switch.

 Simulations

  • You can only have one LabVIEW project open at a time when performing motion simulations.
  • Because NI SoftMotion for SolidWorks projects use the NI Scan Engine, make sure the Start Scan Engine on Deploy checkbox in the Scan Engine page of the My Computer Properties dialog box contains a checkmark.
  • Deploy all LabVIEW Project items before running the VI. Running the VI before deploying the resources and switching the NI Scan Engine to Active mode may result in errors returned by function blocks.
  • When you start a simulation in LabVIEW, only SolidWorks motors that are already deployed are controllable in LabVIEW. If you have not deployed the SolidWorks motor and associated NI SoftMotion axes, the SolidWorks motors move according to the profile configured in the SolidWorks assembly.
  • Due to the intense nature of the simulation calculations on the SolidWorks side, a scan period is not guaranteed to last the amount of time you configure. For example, it may take 200 ms to complete a scan period configured for 5 ms. The simulation is correct with respect to simulation time, but it appears to move slower than actual hardware during calculations. After the simulation is complete and you have switched the Scan Engine to Configuration mode, you can play back the simulation in SolidWorks to view the calculated simulation in real-time speed and verify the speed of the assembly in reality.
  • NI SoftMotion for SolidWorks is a memory and processor-intensive application. National Instruments recommends a system with at least a 3 GHz Intel Pentium 4 processor or equivalent and 2 GB of RAM for optimal performance.
  • You can only have one LabVIEW project open and connected to a SolidWorks assembly at a time. If you get an Access Denied error when trying to deploy, close any other open projects.

Motion Programming Functions

You cannot use the following NI SoftMotion function blocks or function block methods with SolidWorks axes:

  • The Capture function block.
  • The Compare function block.
  • The Relative to Capture method of the Line function block.
  • The Index method of the Reference function block.
  • The Capture Data and Analog Line methods of the Read function block.
  • The Analog Line and Digital Line methods of the Write function block.

Go back to Table of Contents

What are some LabVIEW motion programming tips and tricks?

The following tips may help you when programming with NI SoftMotion function blocks in LabVIEW.

  • Function blocks must be executed in a VI that is part of a LabVIEW project.
  • Function blocks must always be run in a loop. Depending on your application requirements, you can use either a While loop timed using a Wait Until Next ms Multiple Function, or you can use a Timed Loop synchronized to the NI Scan Engine if your application requires that the function blocks execute at the scan period.
  • Use the function block status outputs to determine the order of function block execution, and not standard LabVIEW programming methods. For example, do not place function blocks inside a case structure.
  • You must initialize all array outputs outside the application loop so that the function block does not allocate memory. This reduces drift and jitter in the system.

Go back to Table of Contents

How do I get the fastest simulation performance?

LabVIEW

For faster simulation performance, you may want to increase the Scan Period from 5 ms to 10 ms when simulating with SolidWorks. To do this, right-click on My Computer and go to Properties. Then in the Scan Engine tab and set the Scan Period to 10 ms. Finally, select all of the motion items in the project and deploy again. 

SolidWorks

Information on how to configure SolidWorks for faster performance will be added. Visit the Virtual Prototyping Community portal for the latest information and to post questions.

Go back to Table of Contents

What are some top debugging suggestions?

  • Test the motion simulation in SolidWorks first, before trying to control it with NI LabVIEW. Also check the properties of each motor in SolidWorks to make sure all of the motors you plan to control with LabVIEW are set to Distance mode.
  • You may want to review the step by step instructions in this getting started tutorial.
  • Make sure the SolidWorks Motion add-in is active. To do this, navigate in SolidWorks to Tools->Add Ins and mark the check boxes on the left and the right of the SolidWorks Motion item.
  • Make sure the Scan Engine is enabled for your LabVIEW project. By default, it is not enabled. In the LabVIEW project, right-click on My Computer and got to Properties. Then go to the Scan Engine tab and make sure the box is checked next to Start Scan Engine on Deploy. You may also want to set the Scan Period to 5 ms or 10 ms if it's not already. If the value is between 5 ms and 10 ms you'll get a warning message when you deploy but this is typically okay for motion simulations. 
  • Make sure the motion axes are being enabled. To do this, individually select each of the motion axes in your project and do the following. First, move your mouse over the motion axis in the LabVIEW Project. Then right-click and select Properties. Click the left-most button to configure the Axis Setup. Make sure the box is checked for Enable Drive on Transition to Active Mode. Alternately, you can use the Power function in LabVIEW to programmatically enable the axes.
  • Now select all of the motion items (including My Computer) in the LabVIEW Project, right-click and select Deploy. Normally, since this is your first deployment it will start the SolidWorks simulation running and so you are ready to run the LabVIEW shipping example. If not, right-click on My Computer and select Utilities>Scan Engine Mode>Switch to Active.
  • Once you are in active mode and the simulation is running, right-click on the motion axis and go to the Interactive Test Panel. This should show you that the axis is enabled and there are no faults or errors. When you are finished, close the test panel and run your LabVIEW motion control application. 

Go back to Table of Contents

What are the known technical issues for NI SoftMotion for SolidWorks?

Visit this page for a list of known technical issues.

LabVIEW 2009 NI SoftMotion Known Issues

If you encounter a new issue or need technical support, please post your comments and questions to the Virtual Prototyping Community. Be sure to include screenshots of the issue and a detailed description of the problem.

Go back to Table of Contents

Can I export curves from SolidWorks and use in my motion control application?

If you want to draw a 2D or 3D curve in SolidWorks and have LabVIEW execute it as a motion profile, you can export the curve feature from SolidWorks as a text file. Then in your NI LabVIEW SoftMotion Module application, add a contour move function. A contour move is a move expressed as a series of positions that the software uses to extrapolate a smooth curve between the points.

I. Export the curve from SolidWorks and prepare it for reading in LabVIEW:

1. First, change the units and dimensions standard for your SolidWorks assembly to MMGS (millimeter, gram, second). To do this, navigate to Tools>Options>Document Properties>Units.

2. Right-click on the curve item in SolidWorks and select Edit Feature. Save the curve data as a file.

3. Open the .sldcrv text file in Notepad and navigate to Edit>Replace. In the Find What box type "mm". Leave the Replace With box empty and click Replace All. Finally, save the file as a .txt file. Now you are ready to import the file into the LabVIEW project as described above.

4. If you need to change the time interval between data points in the curve, you can read the text file into LabVIEW, use resampling feature of the Align & Resample Express VI to adjust the interval, and then save the new file using the Write to Spreadsheet File VI.

II. Import the tab delimited text file for the curve into the LabVIEW project:

1. Right-click on My Computer and select New>NI SoftMotion Table. Browse to the tab delimited text file you prepared which contains the curve data points.

2. Wire the SoftMotion table resource you created into the table input of the LabVIEW contour move function block.

Go back to Table of Contents

Is velocity mode supported with SolidWorks motion simulations?

Yes. NI SoftMotion for SolidWorks does support velocity mode. Just right click on your Straight Line Move function block and navigate to Select Method>Velocity. This executes the straight-line move at the specified velocity until a Stop Move is commanded, a limit is encountered, or you execute a move at a new velocity. You do not specify target positions in velocity mode. The direction of motion is determined by the sign of the specified velocity.

Go back to Table of Contents

Can I use the regular NI SoftMotion shipping examples with SolidWorks?

Yes. There are two ways to do it.

1. Adding a shipping example VI to an existing project: You can open any of the shipping examples and copy the VIs into a project you have set up to target a SolidWorks assembly. For example, you could open the Coordinate Straight Line Move example project and copy the Coordinate Straight Line Move.vi into the project you are using for digital prototyping with SolidWorks.

2. Changing a shipping example project to link to SolidWorks: Right-click My Computer to add a SolidWorks assembly to the project. Then click on the motion axis and select Bind to Different Resource to change the binding from a Simulated Axis to a SolidWorks motor. Finally, hold down shift or control to select all of the motion items in the project (including My Computer) and then right-click and Deploy. Normally, since this is your first deployment it will start the SolidWorks simulation running. In this case, you are ready to run the LabVIEW shipping example VI. If not, right-click on My Computer and select Utilities>Scan Engine Mode>Switch to Active.

Note: Most of the shipping examples assume you are using a stepper motor without the axes scaled to degrees or millimeters. However, motion control with SolidWorks always assumes rotary motors are controlled with degree units for rotary motors or millimeter units for linear motors. So you'll normally want to use a smaller number than the default values for the position command. For example, in the Coordinate Straight Line Move.vi example I changed the position commands from 10000, 7500, 5000 (steps) to 100, 75, 50 (millimeters).

Go back to Table of Contents

Is there a way to automatically log the SolidWorks simulation data to disk

Yes. You can log the simulated position, velocity, acceleration, and torque data to a LabVIEW Measurement format file by enabling the Log Data checkbox in the Assembly Properties dialog box. Logging starts as soon as the simulation starts and completes when the simulation stops, either by switching the NI Scan Engine to Configuration mode or by stopping the simulation from within SolidWorks. When the simulation is stopped from within SolidWorks, log data is not available until the NI Scan Engine switches to Configuration mode, but no more data is added to the file. Refer to Starting and Stopping a SolidWorks Simulation in LabVIEW for more information.

The log file units depend on the SolidWorks motor type, as shown in the following table:

Motor Type

Log File Units

Linear
  • Position: mm
  • Velocity: mm/s
  • Acceleration: mm/s2
  • Torque: Newton (Force applied by the Linear Motor)
Rotational
  • Position: degrees
  • Velocity: degrees/s
  • Acceleration: degrees/s2
  • Torque: Newton-mm (Torque applied to the Rotational Motor)

Note: Simulation data is logged when the NI Scan Engine mode switches to Configuration mode. This means that if you deploy new data when the NI Scan Engine is in Active mode, the NI Scan Engine switches to Configuration mode to apply the changes, and then back to Active mode and the log file is overwritten.

Go back to Table of Contents

Can I use NI SoftMotion for SolidWorks to tune my PID control loops or simulate an advanced closed loop control algorithm?

No. NI SoftMotion for SolidWorks is not the right tool for you if your goal is to simulate closed loop dynamics that include the motor electromechanical equations (voltage/current, back-emf, torque constant), the current loop tuning, the percent overshoot/undershoot of the position and velocity loops due to the PID tuning, or to validate advanced control algorithms like LQR or H-infinity control. For those types of applications you can use a tool like MSC.Adams, MapleSim or the NI Control Design and Simulation Module. With LabVIEW 2009, the module now includes simulation examples for servo motors, induction motors and other electrical machinery such as a full wind turbine.

The NI SoftMotion for SolidWorks tool sends position trajectories points from LabVIEW to SolidWorks and the mechanical simulation in SolidWorks calculates all of the forces and torques necessary for the motion assembly to traverse that trajectory. This is called indirect dynamics, since SolidWorks Motion is simulating an ideal motion trajectory. This "ideal trajectory" type of simulation is useful for validating the motion control profiles and logic, checking for collision, analyzing the force and velocity requirements for sizing/selecting motors and linear actuators, calculating force/torque loads for stress analysis, calculating machine cycle time/throughput performance, visualizing the realistic operation of the machine under the control software, determining if mechanical parts (like motor couplings) are strong enough, determining if the mechanism is stiff enough and won't vibrate, etc., etc. For stress/strain and factor of safety analysis, you can determine the amount of force/torque loading you expect the mechanical system to encounter when running under the control of the motion control system using the NI SoftMotion for SolidWorks tools. Because the force/torque calculations are based on the actual motion profiles (straight-line, arc, contour) with the velocity, acceleration, and jerk limits of the motion control system, the results should be much more accurate than a "back of the envelope" calculation and are also easier to get since no math calculations are required.

Learn more about using these tools to analyze your machine design and avoid common pitfalls.

Go back to Table of Contents

Can I run real-time simulations? Why are the simulations slower than real life

No. Motion simulations run in “virtual time” where LabVIEW and SolidWorks communicate in a point-by-point fashion on a simulated time interval. This virtual time period is defined by the LabVIEW scan period, which is typically 5 milliseconds.

However, it normally takes longer than 5 milliseconds for SolidWorks to calculate the simulation results for that time interval. The amount of time it takes to calculate one simulation time step varies depending on the complexity of the model, the LabVIEW scan engine scan period, and the SolidWorks simulation accuracy requirements. Internally, the SolidWorks simulation is constantly making adjustments to guarantee that the simulation results satisfy the accuracy requirements. This is why the simulation speed may vary depending on a number of different factors.

Once the simulation is finished and you have set the scan engine to configuration mode, you can playback the simulation in SolidWorks at faster rates. Use the Playback Speed control in the SolidWorks Motion Manager Toolbar to adjust the speed.

Go back to Table of Contents

How can I calculate the peak and RMS torque and velocity in LabVIEW for motor and actuator sizing?

Yes. For an example, open the project named “Cell Phone Test Machine Advanced.lvproj” and then run the example “LabVIEW Motion Control - 2D Straight Line Move with Performance Monitoring.vi”. This is included in the “..\Exercise 2 (SolidWorks)\Advanced” subfolder of this SolidWorks hands on tutorial.

This example calculates the peak and RMS values for torque and velocity for a single motion axis. The results are stored in an array, where each element in the array corresponds to a move operation.

Go back to Table of Contents

What is a motion axis and how can I use one?

An axis provides a reference to a motion resource that you can control from LabVIEW. An NI SoftMotion axis can be associated with simulated hardware or with actual hardware. Use the Axis Manager dialog box to associate your hardware with an NI SoftMotion axis. 

You can create the following axis types based on the hardware you associate with your NI SoftMotion axis:

  • NI 951x axis (Scan Interface Mode)
  • Simulated axis
  • SolidWorks axis
  • Unbound axis

Go back to Table of Contents

What is a coordinate space and when should I use one?

A coordinate is a logical grouping of axes that you use as an input to NI SoftMotion function blocks that can use coordinate resources and precisely move multiple axes together. Coordinates allow you to command a move using multiple axes and guarantee that the axes both start and stop at the same time. (Is this right for a straight line move with different position set points?)

This is in contrast to starting individual axes that are not part of a coordinate at the same time, where the axes start the move using software synchronization but do not stop synchronized. Use the Configure Coordinate Space dialog box to organize axes into coordinates.

Go back to Table of Contents

What is a table and when should I use one?

Use the Configure Table dialog box to add a table for contouring or camming moves. Table resources contain position information for Contour or Camming operations.

Contour Table

Contour tables are provided as a tab-delimited text file where each line provides a new set of axis positions. Using the Check Status and Update Points contour move methods, you can update the contour buffer created from the original table data during execution of the contour move.

Camming Table

Camming tables provide slave positions used to determine the camming profile used in electronic camming operations. Using the specified master cycle the camming table is divided into equal segments. These segments define a set of master/slave positions. Camming tables may also require a non-zero value for the Slave Stroke. This input is used to compensate for differences between the starting and ending position in the camming table.

Go back to Table of Contents