torque control with pid

Typically: "How do I... ", "How can I... " questions
Post Reply
jetixmen
Posts: 14
Joined: 03 Oct 2023, 08:45

torque control with pid

Post by jetixmen »

Hi, i want to make a 2 dof manipulator with adjusting torques to drive my end effector to my desire point. İ couldn't see how can i use pid controller for this, in CoppeliaSim.
İ don't wanna make a custom controller setup like use position control mode when bla bla and switch to force mode when bla bla. I just wanna use it in Force mode all the time.
İ think there is KC control (and i am not sure it is working on adjusting torques) but i have no idea what it is.
Can someone help me?
Thank you in advance.

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

Re: torque control with pid

Post by coppelia »

İ don't wanna make a custom controller setup like use position control mode when bla bla and switch to force mode when bla bla. I just wanna use it in Force mode all the time.
Have a look at the demo scene scenes/motorControllerExamples-lua.ttt, the yellow joint. The joint needs to be in Dynamic mode, and the control mode needs to be Custom.

Then you need to have a child script with a sysCall_joint callback function somewhere in the hierarchy branch of that joint.

The simplest such function would be:

Code: Select all

function sysCall_joint(inData)
    return {velocity = targetVelocity, force = maxTorque}
end
In there you can modulate the force/torque as you want.

Cheers

jetixmen
Posts: 14
Joined: 03 Oct 2023, 08:45

Re: torque control with pid

Post by jetixmen »

Thank you but where did all the PİD controllers gone?
In old versions, we could enable the controller loop and adjust the pid coefficients. I can't find them know.

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

Re: torque control with pid

Post by coppelia »

Those values have now moved to the engine properties (via the engine properties button): each engine has its own set of PID values.

Cheers

jetixmen
Posts: 14
Joined: 03 Oct 2023, 08:45

Re: torque control with pid

Post by jetixmen »

Aao thank you

Post Reply