### Controlling velocity with MATLAB

Posted:

**03 Jan 2020, 21:40**Hello. I have a 6-DOF robot and I have a set of angular velocities and positions values taken at 10ms intervals of the actual robot joints. I want the robot model in the simulation to follow those values using MATLAB as the control method.

I was able to manipulate the joint positions using the following MATLAB code in a
Where "

I want to be able to manipulate the joint velocities as well but the following function does not work:
Where "

One forum topic said to use child scripts in Coppeliasim and call them using MATLAB. I did that but I also could not control the velocities. I want to also ask if it is even possible to control the velocity. The joints are set to Force/Torque mode with the control loop enabled.

I was able to manipulate the joint positions using the following MATLAB code in a

*for*loop:Code: Select all

`[returnCode]=vrep.simxSetJointTargetPosition(clientID,art_0,(A(i,1))*pi/180,vrep.simx_opmode_oneshot);`

**A**" represents a matrix with joint positions.I want to be able to manipulate the joint velocities as well but the following function does not work:

Code: Select all

`[returnCode]=vrep.simxSetJointTargetVelocity(clientID,art_0,B(i,1),vrep.simx_opmode_oneshot);`

**B**" represents a matrix with joint velocities.One forum topic said to use child scripts in Coppeliasim and call them using MATLAB. I did that but I also could not control the velocities. I want to also ask if it is even possible to control the velocity. The joints are set to Force/Torque mode with the control loop enabled.