Create and Import the Robot Model¶
The basic procedures for creating and importing a robot model are shown below:
This section describes how to create a robot model and import it in Mech-Viz V1.6.0. A FANUC M-900iB/400L robot will be used as an example.
Obtain the CAD File and Specifications of the Robot¶
Before creating the robot model, please obtain the CAD file and the datasheet which contains DH parameters and motion ranges of each joint of the robot. You can download the relevant documentation on the official website of the robot. The figure below shows the CAD file and descriptions of FANUC M-900iB/400L.
Hint
Some robot websites will provide models in X_T format. Comparing to STEP files, X_T files perform better and takes less time in reconstruction. Therefore, it is recommended to use models in X_T format.
Write the [robot]_algo.json File¶
[robot]_algo.json Template File¶
The template file of [robot]_algo.json is stored in resource/robot/algo_example.json
in the installation directory of Mech-Viz. You can create a new [robot]_algo.json file based on the template.
Hint
Please refer to Description of [robot]_algo.json file for descriptions of parameters in [robot]_algo.json.
Obtain the Configuration of the Robot (algo_type)¶
Different robots have different configurations. In Mech-Viz, different robot configurations are described by different frames of reference and DH parameter definitions. Please refer to Robot Configurations for examples of different robot configurations.
Unlike UR collaborative robot, FANUC M-900iB/400L is a common 6-axis split-ball type wrist industrial robot, which belongs to the SphericalWrist_SixAxis configuration.
Obtain the DH Parameters (dh, dhPassive)¶
Please refer to Robot Configurations and find the corresponding configuration file of the robot. Then you can confirm the dh value in [robot]_algo.json according to the DH parameters in the specifications of the robot.
The dh parameters of FANUC M-900iB/400L are a=0.940, b=0.410, c=1.120, d=0.250, e=2.180, f=0.300.
In the above figure, the configuration diagram of SphericalWrist_SixAxis robot is on the left, and the specifications of FANUC M-900iB/400L is on the right.
Obtain the Motion Ranges of Each Joint (minlimits, maxlimits)¶
Usually, the motion ranges of joints are specified in the documentation of the robot. However, you need to open the robot simulation software RoboGuide of FANUC robots and then search for the motion ranges in this case.
Obtain Other Parameters¶
For common robot brands, you can refer to the parameters of other created robot models. If there is not any available parameters to reference, please contact the site engineers for other parameters.
Attention
Please use English punctuation marks in the JSON parameter file.
The mastering_joints, axis_flip, base_z_offset attributes should correspond to those specified in the robot simulation software.
The axis_flip attribute is coupled with minlimits and maxlimits. Sometimes it is necessary to switch the value of the upper and lower limits and reverse the positive and negative signs of the values at the same time.
J6 in the mastering_joints attribute can be neglected easily. This attribute affects Euler angles and need to be checked and saved carefully.
Write the [robot]_profile.json Parameter File¶
[robot]_profile.json template file is stored in resource/robot/profile_example.json
in the installation directory of Mech-Viz. You can create a new [robot]_profile.json file based on the template.
Hint
Please refer to Description of [robot]_profile.json file for descriptions of parameters in [robot]_profile.json.
This file is not mandatory.
Use Solidworks to Construct a STL Model of the Entire Robot¶
Once all the DH parameters are obtained, you can start to create reference frames for each axis on the robot model.
Import the CAD Model in SolidWorks¶
Open the CAD model of the robot in SolidWorks, as shown below.
In the above figure, the CAD robot model is on the left and an assembly reference diagram is on the right.
Hint
It is recommended to download an entire robot model that has been assembled completely.
If you can download only the parts, you will need to assemble them yourself and check each joint according to the DH parameters.
You may remove the details of the model and keep only the structure that may affect collision detection to reduce the time to import the model.
Create Reference Frames¶
Please refer to Robot Configurations and create reference frames of each axis. As for FANUC M-900iB/400L, the configuration is SphericalWrist_SixAxis, and the robot pose should be as shown in the figure below: J1 axis is aligned with the base, J2 axis stays vertically upward, J3 axis and J4 axis stays horizontally forward, and J5 axis stays forward rather than downward. Once the pose is determined, all parts should be fixed.
Export STL Models of Robot Joints¶
It is recommended to hide other parts on the assembly when exporting the joint model in turn.
Save the exported file in STL format, set the output to binary and the unit to meter.
The entire robot model of FANUC M-900iB/400L in STL format is shown below.
Now you have completed creating a robot model.
Import the Model File in Mech-Viz¶
The robot library of Mech-Viz is stored in resource/robot
in the installation directory. Robot models of the same brand are stored in the same folder which is named after the brand name, and all the files of the robot model are stored in the folder which is named after the model name.
As for FANUC M900iB/400L, the model files are stored in resource/robot/fanuc_m900ib_400l
. The descriptions of each file are as follows.
STL
: the robot model filefanuc_m900ib_400l_algo.json
: robot kinematic parameter filefanuc_m900ib_400l_preview.png
: image of the robotfanuc_m900ib_400l_profile.json
: parameter description file of the robot
Attention
Use lower case letters to name the folders.
The robot model file supports STL, DAE, and OBJ format. Different formats of model files are stored in a folder which is named after the format name respectively.
STL model can be used for both display and collision detection.
DAE model can only be used for display.
OBJ model can only be used for collision detection.
A complete robot model set should include at least one model used for display and one for collision detection.
Copy and paste all files into the corresponding directory and the robot model will be imported successfully. Then you can select the newly imported robot from the robot library in Mech-Viz.