Closed MikasaSucasa closed 2 years ago
Here is an example of another team using the integrated PID for falcons... https://github.com/frc1444/robot2020/blob/master/wpi/src/main/java/com/first1444/frc/robot2020/MotorBallShooter.java
Along with the PID implementation, we will need to add a liveWindow to our shuffleboard so that we can observe how well our control strategy is working. Here is the tutorial from frist: https://docs.wpilib.org/en/stable/docs/software/dashboards/shuffleboard/getting-started/shuffleboard-graphs.html
Another great example of a shooter class which uses talonFX controllers and PID https://github.com/Team254/FRC-2020-Public/blob/master/src/main/java/com/team254/frc2020/subsystems/Shooter.java
Here is the Cubic Regression Polynomial formula from our curve-fitted values: y = 3119.8 + 19.002x - 0.1949171x^2 + 0.000954319*x^3
y is RPM x is distance in inches
EDIT: Updated after adjusting PID coefficients. y = 0.0047x3 - 1.2642x2 + 121.27x - 127.68
Can curve fit in Excel -- https://www.got-it.ai/solutions/excel-chat/excel-tutorial/curve-fitting/curve-fitting-in-excel
I committed the spreadsheet with the datapoints and curve fit to the base folder of the 2022 robot code. DistanceVelocityPolynomial.xlsx
https://github.com/FRC-Sonic-Squirrels/Flywheel-Tuner/blob/main/src/main/java/frc/robot/Robot.java for future reference. Handles all the things we'd want to do.
3rd order polynomial after Tuesday's practice: y = 0.0078x^3 - 2.3105x^2 + 236.44x - 4384.4
Make an RPM error based PIDF Controller for our launcher class. This is needed for more consistent shooting.