Open dylantknguyen opened 4 years ago
Mikes Pseudocode:
self.dashboard.putNumber('DB/Kp', 0)
self.dashboard.putNumber('DB/Ki', 0)
self.dashboard.putNumber('DB/Kd', 0)
class encorderPid
init(encoder)
self.encdoer = encorder
getSourceType()
return kRate; #1
setSourceType()
pass
pidGet()
return self.encorder * mult;
class motorOutput
init(m1, m2)
self.m1 = m1
self.m2 = m2
pidWrite(output)
m1.set(output)
m2.set(output)
# shooter
self.topMotorEncoderPid = encoderPid(self.topEncoder)
self.topMotorOutput = motorOutput(top1, top2)
self.topPIDController = PID(p,i,d,f,topMotorEncoderPid, topMotorOutput)
from Dylan
This was implemented bfb1bbc. However, it still needs to be tuned.
In 9ffa21a, you can input an RPM and get that RPM out but it's not a true PID. However, it works.
Implemented a real PID in fdb33b0
The PID has been tuned in 318267e with kF (feed-forward). This PID is far from perfect but is a good starting point.
Please implement a PID loop for the shooter. Use the following resources for assistance.
https://robotpy.readthedocs.io/projects/wpilib/en/latest/wpilib/PIDController.html https://frc-pdr.readthedocs.io/en/latest/control/using_WPILIB's_pid_controller.html