AusTINCANsProgrammingTeam / 2022RobotCode

Other
6 stars 2 forks source link

Better shooter accuracy #224

Open azvanderpas opened 2 years ago

azvanderpas commented 2 years ago

Feedforward control: https://docs.wpilib.org/en/stable/docs/software/advanced-controls/controllers/feedforward.html#using-feedforward-to-control-mechanisms

Feedforward + PID control: https://docs.wpilib.org/en/stable/docs/software/advanced-controls/controllers/combining-feedforward-feedback.html

zbrotherton commented 2 years ago

So we should switch to WPIlib PID to use both in setVoltage? I thought sparkMax's setReference included the arbFF param as a way to get around using WPIlib PID if we wanted to use FF control, but I could be wrong

azvanderpas commented 2 years ago

Maybe you are right. Its odd that I don't see any examples of that being used anywhere though.

Either way we need to fix the shooter tuning since it appears we aren't staying stable, or at least we aren't checking that we are. Possibly the setReference doesn't do voltage compensation correctly since it's affected by our belt speed?

zbrotherton commented 2 years ago

It is really odd, I was looking for a long time for any sort of documentation or examples, and there was nothing. I'll work with keeping PID stable, though

caseyjbrotherton commented 2 years ago

Talks from whiteboard: