Claw Stalling

Has anyone had issues with their motorized claw stalling? Our ratio is 1:5 for torque and it works in the beginning, but after we grab a couple objects, the claw just stalls off and on? Is there any easy way to fix this Would it just help to run the motors at a lower speed in the code instead of full speed?

PID. Plenty of material already here, a quick google search will get you a pretty good answer.

How would you do PID for a claw?

Here is ours. clawangleleft and clawangleright are the potentiometers on each side of the claw. The code is such that the further away a claw arm is from its desired position, the more power it sends to the motor.


int clawset = 0
if(VexRT[Btn5U] == 1)
{
clawset = (clawset + 2)
}
if(VexRT[Btn5D] ==1)
{
clawset = (clawset - 2)
}
if((VexRT[Btn5U] == 0) && (VexRT[Btn5D] == 0)
{
}
while(true)
{
motor[clawArmReft] = ((0.3)*((clawset) - (sensorValue[clawangleleft])));
motor[clawArmRight] = ((0.3)*((clawset) - (sensorValue[clawangleright])));
}

Is that’s a task? Or is that a function?

You could just have that in your normal driver control loop, or you could use it as a function.

But because the reading of the controller is only ran once because it is outside of a while loop how will u constantly control ur claw ?

We have it inside our driver control while loop.