How to keep joints running in max torque

Typically: "How do I... ", "How can I... " questions
Post Reply
narutom
Posts: 5
Joined: 07 Jan 2019, 04:24

How to keep joints running in max torque

Post by narutom » 13 Nov 2019, 08:17

hello
I am doing the simulation of the snake robot.
When gravity is -9.8, the joint can't hold on to the shape of the robot. So, I plan to keep joints running in max torque.
The part of my program is as follows.

Code: Select all

    A0=[0 0 -9.8];
    [~]=vrep.simxSetArrayParameter(clientID,0,A0,vrep.simx_opmode_oneshot_wait);
    target_torque=100.*ones(1,jointnum);
    for c=1:jointnum
        [forceCode(c)]=vrep.simxSetJointForce(clientID,joint(c),target_torque(c),vrep.simx_opmode_oneshot_wait);
    end
    
    for i=1:10
        for c=1:jointnum
        [returnCode(c)]=vrep.simxSetJointTargetPosition(clientID,joint(c),target_joint(i,c),vrep.simx_opmode_oneshot_wait);
        end
        vrep.simxSynchronousTrigger(clientID);
    end
    
    for c=1:jointnum
        [~,force(c)]=vrep.simxGetJointForce(clientID,joint(c),vrep.simx_opmode_oneshot_wait);
    end
At first, I set the torque as 100. In the end, I use vrep.simxGetJointForce to get the joint force. But the joint work as follows. The specified max. force/torque will be applied as long as the max. velocity is not reached. Once the max. velocity is reached, the applied force/torque drops to zero and the max. velocity is kept. So, the force is very low.
But I want to hold on to the shape of the robot. what should I do?
Thanks.

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

Re: How to keep joints running in max torque

Post by coppelia » 14 Nov 2019, 09:33

Hello,

you need to tell us in which mode the joints are (motor enabled, controller disabled?)
If you impose a force to a joint that has its controller disabled, then it will accelerate applying the full specified force, until the max. velocity has been reached. This can happen fast or slow, depending on the load on the joint.

Cheers

Post Reply