Hello,
I want to apply torques to joints of the UR5 robot to follow a desired path, I checked "motor enabled" and unchecked "Position control enabled". and I Set a very high target velocity.
I did this for the joint number 1 of the robot but the robot rotates very fast then stop on the ground. I want to know where my mistake was? and what should i do?
thank you for helping
Torque Control
Re: Torque Control
Hello,
have a look at the demo scene scenes/motorControllerExamples.ttt (only available from CoppeliaSim V4.1.0): it illustrates the various control modes available.
If you want to control a joint in force/torque mode, and have the joint follow a specific trajectory, then you should put your control code inside of a joint callback function. Such a joint callback function is also illustrated in the example scene mentioned above. Why such a joint callback function is needed is because with a regular script call, you would act on the joint force/torque once each simulation step. But by default, the physics engine will perform 10 sub-step in the same time. So the joint callback function is called 10 times per simulation step. Of course, you also have the possibility to adjust the simulation step size (e.g. from 50ms to 5ms) in order to have the physics engine perform one calculation step within a simulation step.
Cheers
have a look at the demo scene scenes/motorControllerExamples.ttt (only available from CoppeliaSim V4.1.0): it illustrates the various control modes available.
If you want to control a joint in force/torque mode, and have the joint follow a specific trajectory, then you should put your control code inside of a joint callback function. Such a joint callback function is also illustrated in the example scene mentioned above. Why such a joint callback function is needed is because with a regular script call, you would act on the joint force/torque once each simulation step. But by default, the physics engine will perform 10 sub-step in the same time. So the joint callback function is called 10 times per simulation step. Of course, you also have the possibility to adjust the simulation step size (e.g. from 50ms to 5ms) in order to have the physics engine perform one calculation step within a simulation step.
Cheers
Re: Torque Control
Hi,
Thank you for replying, I made Computed torque controller code in python, and the joint callback function is written in Lua?
Is there another way that i can transfer the values of torque that i calculated in python to vrep?
Thank you for replying, I made Computed torque controller code in python, and the joint callback function is written in Lua?
Is there another way that i can transfer the values of torque that i calculated in python to vrep?
Re: Torque Control
you can also do this directly from Python. In CoppeliaSim V4.1.0 or above, have a look at the demo scene scenes/pControllerViaRemoteApi.ttt
The important points are:
The important points are:
- CoppeliaSim needs to run in synchronous mode
- The simulation time step has to be the same as the dynamics time step (in this scene 5ms), if dynamics is involved, otherwise you will miss control loops
- programming/b0remoteApiBindings/python/pController.py
- programming/remoteApiBindings/python/python/pController.py