frc5687 / frc5687/2018-switchbot
Add position-dependant feedforward to Arm PID
- Dominant language
- Java
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
PID works much better with a "feedforward" factor. This is essentially a way of telling the algorithm how much power we _think_ it should need to achieve the desired goal. In previous subsystms we used a "hold speed" to tell the subsystem how much power it needed to stay in one place. The problem with the arm is that the holdspeed will vary by angle, so we can't use a constant. So we'll use an array!
- [ ] Create an array of doubles large enough to have an entry per degree of arc from the arm's MIN_ANGLE to MAX_ANGLE
- [ ] Populate that array using one of two methods:
- Empirical: With the pincers holding a cube, move the arm through a set of angles and record the power needed to hold it at each angle, then interpolate between those angles and hard-code the results in the array
- Theoretical: Use the method above to determine the power needed at -90 and +90, then work out a formula to compute the power at intermediate angles. I'd suggest reaching out to Amory or Moxhay for help with the formula.
- [ ] Update Arm.drive to set the pidcontroller feedforward (using setF) based on the angle of the arm (getAngle) and the array of feedforward constants
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.