On the issue of the rotation angle of the rotating pair

Typically: "How do I... ", "How can I... " questions
Post Reply
Lnferior
Posts: 23
Joined: 20 Jul 2022, 17:49

On the issue of the rotation angle of the rotating pair

Post by Lnferior »

I added a cylinder and a rectangular block to the environment, and connected them through a rotation pair. The rectangular block rotates around the center of the cylinder, and the rotation pair is set to speed control mode. By multiplying speed and time in the Lua non threaded script, a certain angle of rotation is achieved. I found that when the rotation speed is small, the rotation angle is relatively accurate, but when the speed is set high, there is a significant deviation in the rotation position, Why is this and how should we solve it?
Cheers

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: On the issue of the rotation angle of the rotating pair

Post by coppelia »

Hello,

if you use dynamics, then the associated physics engine will compute relevant values. Additionally, a physics engine usually has difficulties with large angular velocities. You can try several things to improve the accuracy:
  • use a different physics engine
  • reduce the dynamics time step (Dynamics dt in the simulation settings dialog)
  • adjust the mass and/or inertia of the body that is rotating
  • write your own speed controller, but my guess is that you won't do better than the physics engines
  • etc.
Cheers

Lnferior
Posts: 23
Joined: 20 Jul 2022, 17:49

Re: On the issue of the rotation angle of the rotating pair

Post by Lnferior »

Thanks

Post Reply