Claw hold

Would there be any problems if after we clamp down on a clump of stars or a cube with our claw, I continue to press the button? Like keep the motors running? Would this break them as they’re not able to go any further? I want a way to hold stars and cubes tightly without the claw loosening up and they falling out…

You will probably stall your motors. Write some code that holds the claws together at like 15 power and you should be good.

You could use a potentiometer and program the motors so they do not go farther than they need to be.

If you do this, make sure that the potentiometer is always checking values and adjusting, so that the stars don’t fall out.

@roboticblackbelt Exactly, we’re using 1 or possibley 2 potentiometers and making sure the values in the code are close or equal to each other. The only problems that may happen is if you test the program to make sure they are aligned. ALWAYS check ahead of time. I made the wrong move testing mine at home.

If you mechanically link the two sides of the claws together via gearing, you can reduce your number of pots to 1 and avoid the code needed to synch two separate motors on the two sides of your claw.

Also, have a look at this thread:
https://vexforum.com/t/stall-in-claw/38000/1

True, but if they have one of the wide claws, all those gears will just add friction. For most scenarios I agree.

For anyone wondering: https://www.youtube.com/watch?v=QVbeu1PoRX4&feature=youtu.be

Oh, I see. Nice machine!

We are actually using their intake. Does that change things?

I think the comments about keeping a motor hold value of 15-20 will still hold true for this kind of design. It’s just that this design needs either two pots or two encoders or, as the video shows, two integrated motor encoders.

We’re using integrated encoders. What would we use them for apart from autonomous? Would they help us hold stars without the claws loosening ?

Unless you have some kind of mechanical way to keep the claws in synch, you will need an electronic method to keep them aligned, otherwise they might end up looking like windshield wipers.

What do you mean by electronic method? If you mean gearing them together when you say mechanical method, then no, we haven’t done that.

Each of the two motors will have no way of knowing where it is supposed to be pointing its half of the claw, so they can easily get out of synch so they don’t close properly. If the encoders detect that the two parts of the claw are out of synch, then your code in your Cortex can send a signal to the motor to correct the misalignment. But that is going to take some significant coding on your part.

Can’t you just use in IF statement so that if one encoder reads more ticks than another, the other speeds up? Wouldn’t that work?

That method would work, but it wouldn’t be very precise. The best way to accomplish that would be to use a PID loop that compares the two encoders instead of just an “if” loop.

A full PID? I’ve been trying to get that but I’m not that advanced yet. Any ideas on how to go about that? Or would just gearing the claws together work?

There are several tutorials on YouTube that explain PID very well. I’d suggest watching through one or two of them to get the general idea of what the code for a base PID loop should be.

The basic gist of PID is that the loop determines the “error” between a target value and the value of whichever sensor you happen to be using, then outputs power values tot the motors based on that “error” value. In order to use PID to compare the two sides of your claw, you would need a few statements in PID code that set whichever side is ahead of the other as the target value, or “master”, and set the side that’s behind as the current value, or “slave”, and then compute the error accordingly. This method is used in drive straightening as well, so it might be useful later on too.

I’m not too sure about gearing the two sides of the claw together. My engineering skills aren’t too hot but I think you might end up introducing a lot of unnecessary friction into the claw if you add a bunch of gears to sync them.