Claw Auto-Align

Hi everyone,
I was working on our claw bot and one of the main issues that we ran into is the claw getting misaligned. Now, the driver has to constantly move the claws back and forth against the arm to get them aligned. We have IME’s on the motors, but we are unsure of how to get them to help aligning. We also tried to put potentiometers because that would make it much easier, but they restrict the movement of the claw. Any help appreciated.

Hello! Our team is suffering from similar problems. My current solution is to use a P loop (PI if P doesn’t work) with the target being the other claw whenever the claws are not actively used by the driver. This is untested and uncoded however and I would be interested to hear other solutions…

My claw has a potentiometer on each side of the claw and I have all of the positions for the claw preset so I only have to press one button to move it to a specific position. I also have buttons to open and close the two arms incase the positions that are programmed are not ideal.

6030J was using that methodology (controls on the joystick directly manipulate 1 side and the other follows through a P loop). It worked fairly well (except for unrelated issues with the IMEs).

In my opinion, though, the best solution is to simply mechanically link the 2 sides of the claw (probably with gears).

This works but it would be better to have more options, and sometimes the sensors can get off-set and mess everything up. I would suggest just a mechanical link with two gears between the two sides of the claws.

Use idler gears.

the two side of the claw are over 15 inches apart from each other making this not very feasable

This sounds like a very good option and I am already working on a way to implement this.

Same here. The distance between the claws is very large. Also, sometimes if the claw gets misaligned, it can be easier to get stars in the corners, and then have them realign using sensors afterwards. It also provides a little more flexibility in driving when you end up hitting a claw against the wall or another robot.

Ok so this may sound stupid, but how about including chain and sprockets to make it work? IF it wouldn’t get in the way.

my claw folds up.

Use PID or some form of it. No real need to mechanically link it together. It will certainly help but code should be able to solve the issue. I cite 97917 (the original claw+tray hybrid) on that one.

Here’s some pseudo-code (p loop because I’m lazy):

float kp = 0.5;
int error;
void clawControl(){
     error = SensorValue[leftClaw] - SensorValue[rightClaw];
     motor[leftClaw] = motor[rightClaw] = error*kp;

task userControl{
          if(button1 == 1){
               motor[leftClaw] = motor[rightClaw] = 127;
          else if(button2 == 1){
               motor[leftClaw] = motor[rightClaw] = -127;

Our team is not doing a claw-bot however, I have seen objects fall out of claws due to insufficient power holding the claws shut-- especially with fast arms. Since a P controller decreases power as the claw reaches its target position, wouldn’t that cause stars (or maybe cubes) to fall out of the claw due to insufficient power.

I’m not too familiar with PI loops, but could a tuned integral compensate for the power loss near the target value?

I literally used 10 motor power to hold the claw shut. Seriously. And the claw was a rushed build not even that fine-tuned (rebuilding it now). Moral of the story, a P controller should be just fine even if it is using minimal power to hold the claw shut.

The PiD controller would work so that as soon as the claw arms move away it applies motor power in, so technically there’s no way to lose stars.

This exactly.

We got a claw auto-align working thanks to all of your wonderful suggestions. Thank you soooooooooooooooooooooooooooo much!

The one issue we are running into now is that we have to have the claws set up at the exact same position when we turn the robot on so the encoders know what values mean they are the same. How can we fix this? If you need a better explanation, just tell me because i am pretty sure that I did a horrible job explaining.

You could have bumper buttons that zero each side out.

We also have a wide claw, but our quick solution was to chain the sides together. It works really well and it has never broken on us.

My suggestion is to use potentiometers. They have a limited range of motion but for a claw that shouldn’t matter. Potentiometers can not be erased so when resetting you don’t have to worry about that problem.

As I mentioned in the original post, we have already tried potentiometers on the claw. Our claw moves backwards and forwards a lot and the range of a potentiometer was not enough. (To be honest though, I hate IME’s anyway and if there was any way possible, I would switch to a pot).:slight_smile: