SLHS-Robotics / SLHS-Offseason-2024

BSD 3-Clause Clear License
0 stars 0 forks source link

Create basic arm control #4

Open sevenbitscience opened 6 months ago

sevenbitscience commented 6 months ago

Make some basic controls for the arm to control all the motors and servos on the arm directly.

0novo commented 6 months ago

control suggestions:

obviously it would be nice to test this control scheme when we get to that part also doesn't take into account the robot's movement on the ground (i.e. thru wheels) :P

sevenbitscience commented 6 months ago

Those controls could be on the second gamepad, and the drive controls can be on the first gamepad

sevenbitscience commented 6 months ago

Basics of Tele-Op control

Control will happen within the while (opModeIsActive()) loop

Moving stuff

Servos move when you call the setPosition, and motors move when you call the setPower

Both of those functions take a double (decimal number) as input

Getting input

FTC SDK provides two variable for input from the gamepads

gamepad1 and gamepad2

You get input from the user from variables inside of those things

We can get:

You get one of these values by calling something like this

gamepad1.a

If you keep track of how the inputs are changing over time, you can do edge detection

Control

You can use logic stuff to control how you move the stuff based on what input you are getting

You probably want to make sure that when you're pressing nothing, the stuff is not moving

sevenbitscience commented 5 months ago

When we tested the basic code, the arm had some trouble moving. One problem is that it seems like it may be too heavy overall at this point. The motor that drives the whole arm up and down was struggling to get it to move. The motor was not tightly held in its bracket, causing it to rotate. The shaft on the other side of that chain was also severely bent. The motor may also need a more advantageous gear reduction, although I am unsure that we have any other than the 40:1 and 20:1

sevenbitscience commented 5 months ago

We tested the repaired arm and made some findings. The lower section of the arm lets the whole arm sag, as it is too much weight, and it backdrives the motor. We brainstormed some solutions to this problem.

After testing, two of the shafts were bent. Build is going to replace them.