frc2399 / 2023-Season

Other
2 stars 2 forks source link

Is there a bunch of positional error in our intake location? #94

Closed wmarshall closed 1 year ago

wmarshall commented 1 year ago

While journeying through our constants file as part of #92 and #93, I was surprised to see that our ElevatorConstants.HEIGHT_TOLERANCE and ArmConstants.AngleTolerance were both seeming so high.

The lower bounds on these tolerances are our positional resolution for each subsystem, so I dug out some math:

  1. With the elevator, we should have a positional resolution of 0.006"
  2. With the arm, we should have a positional resolution of 0.114 degrees

Ultimately we're trying to control the location of the intake at the end of the arm in the middle of the elevator, so these tolerances compound and increase our potential total positional error.

To figure out how much our positional error might be, I did some more math. I found the distance from the arm axis to the farthest point on the intake in the CAD (27.019 inches) and did some calculations to figure out where that point would end up with:

  1. No Error
  2. Max allowable elevator height, max allowable arm angle
  3. Min allowed elevator height, min allowable arm angle
  4. Max allowable elevator height, min allowable arm angle
  5. Min allowed elevator height, max allowable arm angle

The numbers vary as the arm sweeps through its rotation because displacements horizontally and vertically cancel out to various degrees, but things are pretty gnarly when the arm is horizontal (setpoint = 0 radians = 0 degrees). I got a max of 1.36 inches total positional displacement - so the tip of the intake could be anywhere in a 2.72 inch diameter circle around where it is supposed to be.

Is there some other mechanism we're using to reduce total positional error? Should we tighten our error tolerance closer to our theoretical minimums to reduce how much error we allow?

edf42001 commented 1 year ago

Let's rename them to include the word "threshold" so it's more clear, update the comment and then this'll be good

alicelin27 commented 1 year ago

no smile no issue