Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export default defineConfig({
label: '4788 Documentation',
autogenerate: { directory: '4788' },
},
{
label: 'Controls',
autogenerate: { directory: 'controls' },
},
{
label: 'External Docs',
items: [
Expand Down
18 changes: 18 additions & 0 deletions src/content/docs/controls/gains.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Gains
---

Some notes on common gain types for FRC mechanisms:

- We can find KV for a mechanism from max speed / max output
- We can find KA for a mechanism from max output \* mass \* radius / stall torque
- You can find PD gains for a system from KV and KA using LQR as done [here](https://github.com/CurtinFRC/2025-Reefscape/blob/97b38f60e3f359b29868ac4a912493ae2ca4138e/src/main/java/org/curtinfrc/frc2025/util/FeedbackAnalysis.java)
- KS is the amount of voltage before the amount required to make a mechanism move
- KS and KG can be found for an elevator or arm using KG = (output up + output down) / 2 and KS = (output up - output down) / 2 where output up and down are the voltage needed to move the mechanism up or down. Note also for arms this will require some use of trig if the arm cannot start flat
- note all of these ignore mechanism gear ratios

Some more notes on tuning can be found in these articles

- https://docs.wpilib.org/en/stable/docs/software/advanced-controls/introduction/tutorial-intro.html
- https://docs.wpilib.org/en/stable/docs/software/advanced-controls/introduction/common-control-issues.html#common-control-loop-tuning-issues
- https://v6.docs.ctr-electronics.com/en/stable/docs/api-reference/device-specific/talonfx/closed-loop-requests.html