How to optimize the maneuverability of the swerve chassis?

So, i am the programmer as well as the driver of 6940. During my drive, I found our robot extremely hard to control when setting the swerve base at a high velocity and I can hardly aim at the Node and the Double Substation.So I have to lower the speed limit of our robot. However, I noticed that some robot can drive both fast and accurately. I was wondering if there’s anything I can do in my program to optimize the maneuverability of our swerve chassis.

2 Likes

This is the code of our robot. The ManualControl Command and the SwerveBase Subsystem is the main code of our swerve control.

1 Like

There are a few different things you can do.

One of the first things we did is take velocity control off the translation stick and put it on a trigger of our gamepad. This mean that we weren’t trying to control both angle of translation and velocity off of the same stick. We called this the gas pedal approach.

Another thing we did was slow down our rotation stick. We only rotate at 1/3 the input rate.

We also squared the stick inputs. This meant that small movements close were slower but you could speed it up if you pushed the stick farther,

The final thing we did was add SlewRateLimiters which slowed how fast we could accelerate.

Even with all these restrictions on acceleration our MK4i L2 is fast it is just more controllable.

1 Like

whoops i meant to reply to op.

Did you mean to reply to the OP or me? We started on baseFalcon, The drive command I linked is far more controllable than what is on baseFalcon, basefalcon has no slew limits, keeps velocity and translation angle on the same control, doesn’t limit rotation speed on the stick, nor even square inputs for better control. Base Falcon control isn’t a good driver experience it is a starting point that lets you move a swerve drive.

1 Like

I’d highly recommend you look at YAGSL or

base falcon to see how they are handling input .

1 Like

I agree, even in YAGSL’s example I cube the inputs and avoid SlewRateLimiters on purpose (they’re very confusing for new programmers) however I could easily show how to use the SwerveDrive.setMaximumSpeed function and have been debating on whether or not to use the desaturateSpeeds function that limits angular velocity but have voted against it because “it’s just another configuration option that may never be used” instead i created the SwerveController.setMaximumAngularVelocity which limits your angular velocity when using the SwerveController to generate ChassisSpeeds (which is useful bc SwerveController makes it easy to control orientation for swerve drives.

I haven’t spent a lot of time with YAGSL yet but SwerveController looks nice. It still has velocity and translation angle on the same axis making fine direction control at low speeds difficult and doesn’t seem to have exponential control on the sticks but it does seem to hit the other marks of limiting rotation, and slew rate limits control.

Another thing we added was a slow button, for fine approaches, it is in our controller the left bumper and reduces speed by 1/3 it is good for substation approach and endgame balancing.

2 Likes

OK,thanks.I’ll try it later.

our team has fine control where we press a button to slow us down

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.