koibots8230 / RumbleBot2024

MIT License
0 stars 0 forks source link

Question: PID control on RIO or onboard SparkMAX #5

Open eskiles opened 1 month ago

eskiles commented 1 month ago

@ConradSkelly @JakeStew81

AnglerFish primarily used PID loops controlled on the Rio, providing voltage outputs to the motor controller. This runs a 20ms loop. We saw a dramatic improvement in the drivetrain by moving the turn motor primary PID from the Rio to the SparkMAX. This runs a 1ms loop. RumbleBot, which is going to have high performance demands, may be a good time to start learning to run PID controls on the controllers while managing high-level targets on the Rio.

What are your thoughts?

Rev has a Closed Loop Velocity example in their github.

https://github.com/koibots8230/RumbleBot2024/blob/62df01fcafb80018675651ec7a72f0eea305d9dc/RumbleBot2024/src/main/java/frc/robot/subsystems/Shooter.java#L147

JakeStew81 commented 1 month ago

That was the plan, the only reason anglerfish didn't have em is because we realized after we'd tuned the wpilib ones and didn't have time to retune