Torque control with setJointMotorControl2 and invariance to time step size

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
sogartar
Posts: 3
Joined: Tue Jun 22, 2021 11:26 pm

Torque control with setJointMotorControl2 and invariance to time step size

Post by sogartar »

I am using setJointMotorControl2 and it's TORQUE_CONTROL mode to control a wheel. It uses a continuous joint with some damping.
I was surprised to find out that the time step size has a significant effect on the outcome of the simulation.
I let the wheel, that is just a cylinder, to just rotate without touching anything. Each time step I set the torque with setJointMotorControl2. I let the wheel reach terminal velocity and measure the joint velocity with getJointState.
At 100 FPS the terminal velocity is 50.
At 500 FPS the terminal velocity is 37.
At 800 FPS the terminal velocity is 28.
At 1000 FPS the terminal velocity is 0 (the wheel stops spinning completely).

My understanding is that supplying a constant torque all the time should result in a simulation that is invariant to time step size aside from numerical errors. How is torque control with setJointMotorControl2 supposed to work?
Post Reply