Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced Swerve Improvements #24

Open
1 of 3 tasks
ErikCald opened this issue Nov 23, 2023 · 7 comments
Open
1 of 3 tasks

Advanced Swerve Improvements #24

ErikCald opened this issue Nov 23, 2023 · 7 comments

Comments

@ErikCald
Copy link
Collaborator

ErikCald commented Nov 23, 2023

There are some advanced swerve improvements that I have been researching for awhile now. The first list will be very important because they are related to prevent carpet damage:

desiredState.speedMetersPerSecond *= desiredState.angle.minus(getAngle()).getCos();
  • The TeleopSwerve command needs to have acceleration limiters (SlewRateLimiter) that have sensible units . It is very important that the unit of the limiter is done in m/s/s which just means you need to do the limit after multiplying the joystick value by the desired max speed.

Some less critical ideas and improvements:

  • Account for the coupling ratio. This accounts for an inaccuracy due to the design of the co-axle swerve module design. Anytime the steering rotates, the drive motor moves a little bit which is untracked by the encoder. The coupling ratio accounts for this movement. Most important when passing to odometry but can also be used to adjust the speed of a module when setting a velocity.
@ErikCald
Copy link
Collaborator Author

ErikCald commented Dec 3, 2023

@ErikCald
Copy link
Collaborator Author

Fix singleton class issue. Only use SwerveSubsystem.getInstance() to get the subsytem

@ErikCald
Copy link
Collaborator Author

ErikCald commented Dec 20, 2023

This equation was added into the ChassisSpeed object to account for skew:

Example for using the ChassisSpeed to account for skew: https://github.com/wpilibsuite/allwpilib/blob/6a2d3c30a6df21b841d3bce11c4e3d48f0282189/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervebot/Drivetrain.java#L62

@ErikCald
Copy link
Collaborator Author

@ErikCald ErikCald mentioned this issue Dec 20, 2023
7 tasks
@ErikCald
Copy link
Collaborator Author

@ErikCald
Copy link
Collaborator Author

Run setCANTimeout(500) after factory defaults but before doing any settings. Then run setCANTimeout(0) after all settings are completed but before burn flash. Example here: https://github.com/Mechanical-Advantage/RobotCode2023/blob/9884d13b2220b76d430e82248fd837adbc4a10bc/src/main/java/org/littletonrobotics/frc2023/subsystems/gripper/GripperIOSparkMax.java#L45

@ErikCald
Copy link
Collaborator Author

ErikCald commented Jan 8, 2024

Super stretch goal for way later, prob after comp. Setup the swerve code ecosystem to transfer EASILY to students in future years who aren't as proficient in code. My ideas right now are to just add all the different gear ratios of SDS modules into the config, add code to handle inverted SDS modules, and put comments explaining certain necessary changes per year, stuff like the Translation2d for each module, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant