Robotran’s Frequently Asked Questions

Section 1: General features:

1. Does Robotran provide a solution for inverse kinematics?
2. Does Robotran provide a solution for forward kinematics?
3. Is there a way to see the 3D shape of my robot during building the project?
4. What are the data structures, mbs_data, mbs_info and MBS_user?
5. When I write the rotation matrix I get the minus of the result of a sensor in Robotran. Why is that?
6. Is it possible to linearize the model about a desired position?
7. Which file can be used to include actuator dynamics such as motor dynamics? 
8. What does different new templates means?
9. During generation of a new project, what does full symbolic option means?
10. How to model impacts on a multibody system?
11. How Can I define user variables or parameters?
12. How can I rename project? Can I easily rename it by windows interface?
13. How can I find out sensor IDs?
14. How do I log extra user variables in Robotran?

Section 2: How to … in Simulink?

15. How can I get an independent C code from Robotran?
16. How to make an S-Function in Simulink?
17. How can I visualize the trajectories of my system?
18. How can I compile the S-Functions under Linux?
19. How could one add joint viscous damping into the simulation model?
20. How Can I add arbitrary Input- Output to my Simulink blocks?

Section 3: Operating system

21. Can Robotran be installed on Linux or Mac?
22. Can robotran run on 32 bit or 64 bit machines?

Section 4: Troubleshooting

23. Is there a test program that I can use to verify that Robotran is installed correctly?
24. Why the inverse dynamics gives an error missing file mbs_invdyn_io.m?
25. My Contact model is Correct in C code (user_ExtForces file) however it is giving incorrect result. Why?
26. When I am compiling the C projects this gives an error for user_WheelForces. How can I sort out this problem?
27. Why the mbs_get_joint_id() gives an error?

 

 

 

 

 Section 1: General features

1. Does Robotran provide a solution for inverse kinematics?
    Robotran provides explicit direct kinematics (mbs_exe_solvekin). Nevertheless, the explicit form of inverse kinematics is rapidly too complex in multibody systems. Consequently, a better solution to formalize inverse kinematics is using a numerical method based on the explicit formulation of the direct kinematics.
2. Does Robotran provide a solution for forward kinematics?
    Yes, this is done via sensors which compute the symbolic expression for the position and orientation of the robot as well as Jacobian information.
3. Is there a way to see the 3D shape of my robot during building the project?
    Yes, you can click on the 3D edit button in MBSysPad GUI to view the current state of your robot and you can also use Toni’s Gui to move the joints.
4. What are the data structures, mbs_data, mbs_info and MBS_user?
    These are structures used by the Robotran code to pass data among the modules which are explained in detail on the Robotran website.
5. When I write the rotation matrix I get the minus of the result of a sensor in Robotran. Why is that?
    You should check the convention that you are using to write your rotation matrix. It is important that you note that the rotation matrix in Robotran represents the previous body O in terms of the next body S, such that X_s=R*X_o;
6. Is it possible to linearize the model about a desired position?
    yes, one can use the modal analysis provided in Robotran as: [mbs_modal,mbs_data] = mbs_exe_modal(mbs_data,opt.modal);
If the model is unstable, like an inverted pendulum, inverse dynamics can be used to find the torque for the desired position to keep the pendulum, and then the modal analysis can be performed.
7. Which file can be used to include actuator dynamics such as motor dynamics?
    The file ..\usrfctR\user_Derivates.m contains the actuator dynamics (for instance: motor dynamics) as well as any other user defined dynamics.
8. What does different new templates means?
    Concerning templates, it is a feature that we use for specifying which are the files added in a project workspace when it is created. The "standard template" is the most generic one, the two others are designed for education purposes.
9. During generation of a new project, what does full symbolic option means?
    If you check the box, the symbolic generator will put a symbol for all parameters of your model, even if they are zero. If you do not check the box the parameter with zero value are not considered in the symbolic equations, leading to less terms in the equations and thus better performances in terms of computational time. The chapter "Generating the equations with MBsysTran" of the course syllabus will cover those aspects in more details and give more.
Section 2: How to … in Matlab?
10. How to model impacts on a multibody system?
    Concerning the impacts, the user of Robotran can implement any force model that he wants (so in analytical form too), via the user functions : for instance, you can read and fill in the Matlab file "user_ExtForces.m" in the "userfctR" directory of the project that you created.
11. How Can I define user variables or parameters?
    The easiest way is to use a user_model. In MBsysPad, you can define "user models" that can contain various kinds of parameters (scalar, vector, and look up table). This can also be used as variable.
12. How can I rename project? Can I easily rename it by windows interface?
    It is not advised to use windows to rename a project. You should use mbs_copy_project function in Matlab, which changes the name of all the old files to the new files. Using this function is recommended to avoid loading the old project with Matlab which apparently has the name changed, but internally has the old name.
13. How can I find out sensor IDs?
    One can use mbs_get_S_sensor_id function in matlab. All utility functions are in Robotran\MBsysLab\mbs_matlab\mbs_utilities folder. There are plenty of function for finding ID numbers of link, sensor, joints and link.
14. How do I log extra user variables in Robotran?
    The variable can be stored at each step time in MBS_user and then logged in userfctR\user_DirDyn_io.m file.

Section 2: How to … in Simulink?

15. How can I get an independent C code from Robotran?
    During the generation interface you’ll need to write Matlab, C in the languages field of the code generation interface, and then you’ll have both the C code and the Matlab code of your model in symbolic form.
16. How to make an S-Function in Simulink?
    The steps to follow are the followings:
- In MBsysPad, create a user model and add parameters with initial values of your variables if needed.
- In Matlab, call the mbs_sf_create_project again (take care to first backup your files because some are overwritten). This will update the UserModelStruct.c and UserModelStruct.h files so that variables are added to the user_model substructure
- In your C code, you can access and modify the variable using MBSdata->user_model->nameOfUserModel.nameOfParameter
This is explained in detail in the document “MBS-Simulink_ProjectCreation_EN”.
17. How can I visualize the trajectories of my system?
    There is an animation feature which is accessible from MBSysPad GUI, where it can show your robot in the home configuration and you can browse for the animation file in the animation folder of your project and play the results. If the animation didn’t work for some reason you must make sure that the first column is time, and the rest of the columns are joint angles.
18. How can I compile the S-Functions under Linux?
    This can be added later in a help file.
19. How could one add joint viscous damping into the simulation model?
    It could be incorporated as an additional term in the torque calculations in user_JointForces.m. Also static friction can be added as a simple dead-zone in this file.
20. How Can I add arbitrary Input- Output to my Simulink blocks?
    For moment the only way is to add user variables is to modify *.mbs file. For adding custom input ports to the simulink blocks, you have to use the user_IO functionalities. Presently, you have to edit the *.mbs file with a text editor to add the user_IO. You have to add a
<user_variables> tag as follows:
<user_variables>
<user_variable>
<varname>myInput1</varname>
<type>in</type>
<size>1</size>
</user_variable>
<user_variable>
<varname>myInput2</varname>
<type>in</type>
<size>4</size>
</user_variable>
</user_variables>
You can add this code before the <x3D> tag. Each inner <user_variable> tag (without s) defines one additional port on the block. The <varname> tag defines the name of the input. The <type> tag defines whether it is an input or an output port. The <size> tag defines the size of the signal that will be connected to the port. Then, if you reload the file in matlab with mbs_load, you can check the presence of user_variables in the mbs_info structure. If you call the mbs_sf_create_project, the C code will be adapted to add access to the user_IO in the Visual Project. You can access the input value by using the following code:
MBSdata->user_IO->myInput1 if it is a scalar input port (size=1)
MBSdata->user_IO->myInput2[i] if it is a vector input port (size>1)

Section 3: Operating system

21. Can Robotran be installed on Linux or Mac?
    Yes, you’ll need to follow the web interface and choose a folder which has write permission.
22. Can robotran run on 32 bit or 64 bit machines?
    Yes, the only difference will be compiling C code which will be specific to the machine which compiled the code.

Section 4: Troubleshooting

23. Is there a test program that I can use to verify that Robotran is installed correctly?
    There are several examples available for download from the website where you can test your installation.
24. Why the inverse dynamics gives an error missing file mbs_invdyn_io.m?
    You should use the standard template to have the mbs_invdyn_io.m generated in your project folder. The simple template doesn’t have this file.
25. My Contact model is Correct in C code (user_ExtForces file) however it is giving incorrect result. Why?
    The user_ExtForces function must return Swr which is a 9 element vector: Swr[1], Swr[2], Swr[3] are the 3 components of the external force in the inertial frame Swr[4], Swr[5], Swr[6] are the 3 components of the external torque in the inertial frame Swr[7], Swr[8], Swr[9] are the 3 components of the position vector of the force application point, with respect to the body reference point in the body-fixed frame. So, the user must give the correct value of components 7 to 9. In Matlab, this is done automatically with the two "pre-written" following
lines: idpt = mbs_data.xfidpt(ixF); dxF = mbs_data.dpt(:,idpt); For the C version, the equivalent code is not written in the template. So, at the end of the user_ExtForces function, you have to replace the lines
SWr[7]=dxF[1];
SWr[8]=dxF[2];
SWr[9]=dxF[3];
by the following lines:
idpt = MBSdata->xfidpt[ixF];
SWr[7] = MBSdata->dpt[1][idpt];
SWr[8] = MBSdata->dpt[2][idpt];
SWr[9] = MBSdata->dpt[3][idpt];
The dxF vector is used when the application point position is moving during the simulation. It is typically the case for wheel-ground contact in vehicle dynamics.If the application point is fixed during the simulation, it would be possible to save simulation time by defining the value of Swr[7],Swr[8], Swr[9] only once at the beginning of the simulation (for instance in the user_initialization file).
26. When I am compiling the C projects this gives an error for user_WheelForces. How can I sort out this problem?
    If you don’t have wheel in your structure simply remove it from visual studio project, but this is changed in the new version of Robotran.

©2017 Robotran