-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* move sysid to advanced controls * remove images and add redirects * remove unneeded pages and rename analysis page * refer to the application as "SysId" * remove json converter docs * routine creation page * add binding instructions to creation page * running routine page * revse accleration r^2 range * move feedforward gains to analysis page * Loading data text * select the right analysis type * add loading images * add sysid image to software page * correct sysid image path * correct unit scaling image path * add redirects and lint * change robot-characterization redirects * kill project configuration redirects * no redirect errors * grammar * elaborate on loggers, kA * undo redirects edits * whitespace * Add multi-routine warning * remove drivetrain references and correcct spelling * remove drivetrain from introduction * new images * remove trailing whitespace
- Loading branch information
1 parent
90bb17f
commit d3a96bf
Showing
87 changed files
with
188 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+312 KB
source/docs/controls-overviews/images/control-system-software/sysid.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 21 additions & 1 deletion
22
...tem-identification/analyzing-feedback.rst → ...system-identification/analyzing-gains.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
source/docs/software/advanced-controls/system-identification/creating-routine.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
Creating an Identification Routine | ||
================================== | ||
|
||
Types of Tests | ||
-------------- | ||
|
||
A standard motor identification routine consists of two types of tests: | ||
|
||
- **Quasistatic:** In this test, the mechanism is gradually sped-up such that the voltage corresponding to acceleration is negligible (hence, "as if static"). | ||
- **Dynamic:** In this test, a constant 'step voltage' is given to the mechanism, so that the behavior while accelerating can be determined. | ||
|
||
Each test type is run both forwards and backwards, for four tests in total. The tests can be run in any order, but running a "backwards" test directly after a "forwards" test is generally advisable (as it will more or less reset the mechanism to its original position). ``SysIdRoutine`` provides command factories that may be used to run the tests, for example as part of an autonomous routine. Previous versions of SysId used a project generator to create and deploy robot code to run these tests, but it proved to be very fragile and difficult to maintain. The user code-based workflow enables teams to use mechanism code they already know works, including soft and hard limits. | ||
|
||
User Code Setup | ||
--------------- | ||
|
||
.. note:: Some familiarity with your language's units library is recommended and knowing how to use Consumers is required. Ths page assumes you are using the Commands framework. | ||
|
||
To assist in creating SysId-compatible identification routines, WPILib provides the ``SysIdRoutine`` class. Users should create a ``SysIdRoutine`` object, which take both a ``Config`` object describing the test settings and a ``Mechanism`` object describing how the routine will control the relevant motors and log the measurements needed to perform the fit. | ||
|
||
Routine Config | ||
^^^^^^^^^^^^^^ | ||
|
||
The ``Config`` object takes in a a voltage ramp rate for use in Quasistatic tests, a steady state step voltage for use in Dynamic tests, a time to use as the maximum test duration for safety reasons, and a callback method that accepts the current test state (such as "dynamic-forward") for use by a 3rd party logging solution. The constructor may be left blank to default the ramp rate to 1 volt per second and the step voltage to 7 volts. | ||
|
||
.. note:: Not all 3rd party loggers will interact with SysIdRoutine directly. CTRE users who do not wish to use SysIdRoutine directly for logging should use the `SignalLogger <https://pro.docs.ctr-electronics.com/en/latest/docs/api-reference/api-usage/signal-logging.html>`__ API and use Tuner X to convert to wpilog. REV users may use Team 6328's `Unofficial REV-Compatible Logger (URCL) <https://github.com/Mechanical-Advantage/AdvantageScope/blob/main/docs/REV-LOGGING.md>`__. In both cases the log callback should be set to ``null``. Once the log file is in hand, it may be used with SysId just like any other. | ||
|
||
The timeout and state callback are optional and defaulted to 10 seconds and null (which will log the data to a normal WPILog file) respectively. | ||
|
||
Declaring the Mechanism | ||
^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
The ``Mechanism`` object takes a voltage consumer, a log consumer, the subsystem being characterized, and the name of the mechanism (to record in the log). The drive callback takes in the routine-generated voltage command and passes it to the relevant motors. The log callback reads the motor voltage, position, and velocity for each relevant motor and adds it to the running log. The subsystem is required so that it may be added to the requirements of the routine commands. The name is optional and will be defaulted to the string returned by getName(). | ||
|
||
The callbacks can either be created in-place via Lambda expressions or can be their own standalone functions and be passed in via method references. Best practice is to create the routine and callbacks inside the subsystem, to prevent leakage. | ||
|
||
.. tab-set-code:: | ||
|
||
.. code-block:: java | ||
// Creates a SysIdRoutine | ||
SysIdRoutine routine = new SysIdRoutine( | ||
new SysIdRoutine.Config(), | ||
new SysIdRoutine.Mechanism(this::voltageDrive, this::logMotors, this) | ||
); | ||
Mechanism Callbacks | ||
^^^^^^^^^^^^^^^^^^^ | ||
|
||
The ``Mechanism`` callbacks are essentially just plumbing between the routine and your motors and sensors. | ||
|
||
The ``drive`` callback exists so that you can pass the requested voltage directly to your motor controller(s). | ||
|
||
The ``log`` callback reads sensors so that the routine can log the voltage, position, and velocity at each timestep. | ||
|
||
See the SysIdRoutine (`Java <https://github.com/wpilibsuite/allwpilib/tree/main/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/sysid>`__, `C++ <https://github.com/wpilibsuite/allwpilib/tree/main/wpilibcExamples/src/main/cpp/examples/SysId>`__) example project for example callbacks. | ||
|
||
Test Factories | ||
^^^^^^^^^^^^^^^^^ | ||
|
||
To be able to run the tests, SysIdRoutine exposes test "factories", or functions that each return a command that will execute a given test. | ||
|
||
.. tab-set-code:: | ||
|
||
.. code-block:: java | ||
public Command sysIdQuasistatic(SysIdRoutine.Direction direction) { | ||
return m_sysIdRoutine.quasistatic(direction); | ||
} | ||
public Command sysIdDynamic(SysIdRoutine.Direction direction) { | ||
return m_sysIdRoutine.dynamic(direction); | ||
} | ||
Either bind the factory methods to either controller buttons or an create an autonomous routine with them. It is recommended to bind them to buttons that the user must hold down for the duration of the test so that the user can stop the routine quickly if it exceeds safe limits. |
Binary file added
BIN
+294 KB
...s/software/advanced-controls/system-identification/images/accel-vs-vel-plot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+41.4 KB
...software/advanced-controls/system-identification/images/controller-settings.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added
BIN
+227 KB
...cs/software/advanced-controls/system-identification/images/entries-selected.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+294 KB
...s/software/advanced-controls/system-identification/images/feedback-analysis.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+294 KB
...oftware/advanced-controls/system-identification/images/feedforward-analysis.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+294 KB
.../software/advanced-controls/system-identification/images/feedforward-values.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added
BIN
+200 KB
source/docs/software/advanced-controls/system-identification/images/log-loaded.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+77.8 KB
source/docs/software/advanced-controls/system-identification/images/looptype.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added
BIN
+294 KB
...are/advanced-controls/system-identification/images/motionthreshold-selector.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+294 KB
...software/advanced-controls/system-identification/images/optimality-criteria.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+294 KB
source/docs/software/advanced-controls/system-identification/images/plot-view.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added
BIN
+27.7 KB
...docs/software/advanced-controls/system-identification/images/regular-slider.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added
BIN
+228 KB
.../docs/software/advanced-controls/system-identification/images/scaling-units.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+140 KB
...software/advanced-controls/system-identification/images/selecting-data-file.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+228 KB
...docs/software/advanced-controls/system-identification/images/state-selected.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+77.8 KB
...oftware/advanced-controls/system-identification/images/test-duration-slider.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+294 KB
...s/software/advanced-controls/system-identification/images/time-domain-plots.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added
BIN
+284 KB
...ocs/software/advanced-controls/system-identification/images/viewing-metrics.png
Oops, something went wrong.
Binary file added
BIN
+294 KB
...oftware/advanced-controls/system-identification/images/window-size-selector.png
Oops, something went wrong.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.