Quote:
Originally Posted by Ether
Couple of follow-up questions if I may:
1) Perhaps you've posted this somewhere already, and if so my apologies: could you share a bit more detail about your PID? e.g. did you use feedforward, or integrate the PID output, or tune I like P. How closely were you able to hold speed. stuff like that.
|
We integrated the PID output. Within the PID, we only used the proportional and derivative terms.
We were able to hold our speed within +/- 50 to 200 rpm; depending on the set speed. We tuned the PID to be the most steady at the bottom of the key shot.
I would say our biggest issue while tuning the PID was handling the split second/recovery when the ball entered and went through the shooter. We noticed huge shooter speed recovery variations with a few balls (We called them the "pumpkin balls"

); thus missing the shot. At one point we tried adding additional logic to "power thru" any quick decreases in shooter speed. That didn't end up working well so we just continued to tune the PID to match the majority of balls.
Here is the function that we wrote in place of the PIDWrite provided by WPIlib. Thus still allowing us to use the WPIlib PIDController.
Code:
void PIDWrite(float output) {
//Used in place of WPIlib PIDWrite for cannon control
//m_cannonUpToSpeed is used to allow/deny the feeder to feed balls
if((m_cannonSetPoint - 5) <= m_CannonEncode->GetRate() && (m_cannonSetPoint + 5) >= m_CannonEncode->GetRate())
{
m_cannonUpToSpeed = 1;
}
//500 is our "hail mary" setpoint
else if(m_cannonSetPoint == 500)
{
m_cannonUpToSpeed = 1;
}
else
{
m_cannonUpToSpeed = 0;
}
m_CannonDemandedVoltage += output;
if(m_CannonDemandedVoltage > 1) m_CannonDemandedVoltage = 1;
if(m_CannonDemandedVoltage < 0) m_CannonDemandedVoltage = 0;
m_Cannon1->Set(-m_CannonDemandedVoltage);
m_Cannon2->Set(-m_CannonDemandedVoltage);
}