You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/section-7/feedforward-control.md
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Feedforward isn't limited to controlling velocity, you can determine the voltage
22
22
We will first learn about the most common feedforward model used for motors, then show how the model can be used to control motor velocity and acceleration. Afterwards, we will cover more complicated mechanisms such as the arm subsystem.
23
23
24
24
## The Permanent-Magnet DC Motor Feedforward Equation
25
-
[Click here to read about the equation](https://docs.wpilib.org/en/stable/docs/software/advanced-controls/introduction/introduction-to-feedforward.html). Don't read past the "Variants of the Feedforward Equation".
25
+
[Click here to read about the equation](https://docs.wpilib.org/en/stable/docs/software/advanced-controls/introduction/introduction-to-feedforward.html).
26
26
27
27
For those that only want a quick summary. Here is the equation:
The code excerpt is only meant to show how feedforward works. This is not how we actually implement feedforward, but should give you a better idea of the inner workings of feedforward.
52
52
53
+
In addition, feedforward can also be used for elevators and arms. There is one additional constant \\(k_{g}\\) which is used to counteract the force of gravity.
54
+
53
55
## Tuning and System Idenfication
54
56
Similar to PID, you can tune values by manually guessing and checking.
55
57
@@ -132,6 +134,9 @@ Note that [SysIdRoutineLog](https://github.wpilib.org/allwpilib/docs/release/jav
132
134
133
135
You may also notice that the only values that the logger logs are of instances that must be of `MutableMeasure<(insert measure)>`. This records the values along with its units. You can't just log a value.
134
136
137
+
!!! note
138
+
Notice that you can write anything in the `driveMotor()` and `logMotor()` methods. You are not limited to only powering a single motor but can power an entire elevator, arm, etc. SysID also analyzes elevators and arms which calculate the \\(k_{g}\\) constant.
139
+
135
140
After you set up the testing parameters and mechanism to test, the SysIdRoutine provides functions that return a command to run the test.
136
141
137
142
```java
@@ -150,10 +155,25 @@ Typically it is recommended to bind these commands to controller buttons or an a
Now you are ready to enable and run the tests! Typically the longer you run them, the more data you get which will lead to more accurate calculations. However, keep in mind not to run too long for safety purposes. After all four tests have been run, use the [DataLogTool](https://docs.wpilib.org/en/stable/docs/software/telemetry/datalog-download.html) to get the files.
156
164
165
+
Afterwards, put them into the SysID tool which can be opened by `Ctrl + Shift + P` and typing `Start Tool`. Here are the following articles for analyzing the data and determining the constants:
0 commit comments