FRC1076 / 2019-Competition

Code for 2019 Competition
2 stars 1 forks source link

Create Climber command for endgame. (PID to prevent tipping on side or away from platform) #25

Closed mcolinj closed 5 years ago

mcolinj commented 5 years ago

Create Climber object that uses Lift and some addional Lift methods to climb more smartly. Pistons may not extend at the same rate due to uneven weight distribution, or variation in the performance of the valves and hoses, etc...

Climber can use PIDController with the gyro accelerometer to let us know if the robot is about to tip in an undesirable direction.

When that happens, we can retract the high side momentarily to allow the lower side to catch up.

For tipping side to side, we can set the PID to return a value in a -1 to 1 range (-1 is left too high, and 1 is right too high. Anything in between is less so.) And then just flip the solenoid on the high side long enough for the PID to return a corrected value. I think this seems like fun, and maybe a way that software could save the day. (I don't expect that mechanical will be able to balance the robot very well, as they have limited ability to move things around).

I guess tipping front to back is the same, I haven't thought how to do balancing in both directions, except as doing side-to-side and front-to-back separately. That is potentially problematic if/when they conflict, so maybe we need to think more about it. But that is what issues are for.

mcolinj commented 5 years ago

It turns out that for now, the right and left solenoids are ganged together, so we have no way to control side-to-side tilting. However, we may still need to provide software assist on the climb. We'll wait for some robot testing and see how it works before we dive in here.