Custom velocity loop

Typically: "How do I... ", "How can I... " questions
Post Reply
zhekas
Posts: 1
Joined: 03 Oct 2014, 21:39

Custom velocity loop

Post by zhekas »

Hello.
I am aware of joint custom control callback script, but it looks that it is aimed to position control mainly. I would like to implement a custom velocity control loop (and some more advanced stuff, but later). The output of velocity loop should be force/torque, but the callback is returning velocity and maximum allowed torque, which is not suitable for velocity control loop. Is there a way of implementing such a loop with existing API?
Thank you.

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

Re: Custom velocity loop

Post by coppelia »

Hello,

I am not sure I understood you completely. If you want to control the velocity, what else do you need to specify than the desired velocity, and the motor torque/force?
At least, the phyiscs engines do not take any other input that these. But here you have several options:
  • you can set a very large force/torque, and simply provide the desired velocity
  • you can set a very large velocity, and simply modulate the force/torque
Because this is how a physics engine motor is working: it will accelerate to the specified velocity, with the specified force/torque. If that force/torque is large, the velocity is reaches almost instantaneously. Otherwise, it will take some time.

Cheers

Post Reply