So our team has been trying to make to put in our driver’s code a way to keep the power of the claw just enough to hold the claw at its current potentiometer position
-if the claw starts moving higher then the value the power will decrease, which brings it back toward the value
-if the claw starts moving lower then the value the power increases, which brings it back toward the value
We kind of got it working but it keeps overshooting the value… is there any way to fix this?
If you don’t want to do PID, try lowering the speed of the claw to something more manageable. So if you’re currently setting to 127 if you’re off target, then do something slower like 100 and go from there.
Furthermore, you might get better results if you divide the output of
by 10. The potentiometer is precise, and you can afford to chop off the last digit
Finally, try adding a deadband, so you stop your claw if you’re within a few units of your goal.
The only part of that code that is specific to robotc is that motor[port1] = power would be motor(1, power). If you need examples of how to do things in PROS, see the tutorials on the pros website. You can also look at the code for the Open Source Starstruck Robot. Looking at these resources should let you come back with a more specific question if you still need help.