Breadcrumbs

Industrial Physics

Library Download
Library Instructions

Only S3-A Flyways and M3 series XBots are currently supported in iPhysics

Loading PMC Configuration into iPhysics

  1. Unzip the iPhysics library for Planar Motor Inc.

  2. Install the motion plug-in:

    1. Go to Motion Control tab and click on Add plugin object

    2. The Technology plugins window will appear

    3. Right-click in the left column and select Add plugin…

    4. Browse to iPhysicstoPMC.dll and upload it

    5. Rebuild image-20240923-165056.png the simulation

image-20240923-164657.png
  1. Save the file PMCConfig.xml in the same location as the unzipped “lib” folder and the script ImportConfig.js

image-20240923-172007.png

PMCConfig.xml is obtained through the Planar Motor Tool:

  1. Go to Configuration and click on Open Configurator

  2. Once desired configuration in selected, click on Save To PC

image-20240923-182320.png

Do not rename the file. Regenerate/replace the configuration file each time the layout is changed or a different PMC is used.

  1. Run ImportConfig under the Extensions tab in iPhysics

image-20240923-183752.png

If ImportConfig is not already available:

  1. Click on Load script

  2. Browse and select ImportConfig.js

image-20240923-184022.png
  1. If the extension did not appear after the above step, close and restart iPhysics

Running the extension in Step 4 will create a new iPhysics document. If an already opened iPhysics simulation needs to be used, please refer to Importing Configuration in an Already Opened Simulation.



Modifying User Origin in iPhysics

There are 2 options to change the user origin in iPhysics.

Automatically through the ImportConfig extension

This will create a new document and current changes will not be transferred, unless Importing Configuration in an Already Opened Simulation is executed first.

  1. Open the Configurator in the Planar Motor Tool

  2. Save the layout to PC (replace the previous PMCConfig.xml file)

  3. Run ImportConfig in iPhysics from the Extensions tab

Manually in the properties window in iPhysics

The current document will continue to be used.

  1. Open the Model structure window

  2. Select Main

  3. Open the Properties window

  4. Navigate to the Trafo tab

  5. Make sure the View is System w.r.t. Parent

  6. Select the scope to be Move Components

  7. Enter the same values (in meters and degrees) as in the Configurator

image-20240923-185601.png



Modifying the Extension

Importing Configuration in an Already Opened Simulation

Running the extensions will create a new document every time they are run. To be able to load the PMC configuration in an already opened iPhysics simulation,

  1. Open the file ImportConfig.js

  2. Comment the following lines:

image-20240923-190226.png
image-20240923-190513.png
  1. The configuration will load in the top-most level of the model tree (its parent is the world trafo). To modify that, change the parent path:

image-20240923-190543.png
  1. Save the file

If there is already an instance of the configuration which was loaded in the simulation beforehand, delete if first, and then run the extension again.



Troubleshooting

Go through the steps in order until one of them solves the issue. If none of them worked, restart iPhysics and run ImportConfig again.

XBots are not synchronized with PMT or physical system
  1. Make sure that the simulation is actually running

  2. Verify that the IP Address in the script of Main matches that of the PMC

    1. Open the script by double-clicking on from the Model structure

      image-20240923-192625.png
    2. Check the IP Address, change its value if needed and click on Compile

      image-20240923-192727.png
    3. Close the script, rebuild image-20240923-165056.png the simulation and click play image-20240923-192502.png

The status of the connection between iPhysics and PMC can be known by looking at the isConnected property of Main. An active connection is indicated by 1.

image-20240923-192407.png

Verify that when rebuilding image-20240923-165056.png , isConnected changes to 0, and clicking play image-20240923-192502.png brings it back to 1. Repeat this around 3 times. If its value stays 0 throughout, restart iPhysics and run ImportConfig again.

  1. Unload and reload the motion plug-in

    1. Rebuild image-20240923-165056.png the simulation. DO NOT skip this step.

    2. Go to Add plugin object from the Motion Control tab. Click on iphysicstopmc and unload it

      image-20240923-193632.png
    3. Right-click in the left column of the Technology plugins window and select Reload plugins

    4. Rebuild image-20240923-165056.png the simulation. This will reattach the plug-in to the components

Nothing happens when running the extension
  1. Make sure the config file obtained from the Configurator of the Planar Motor Tool is in the same location as the ImportConfig.js file

  2. Make sure the config file is named “PMCConfig”