Swerve Joystick Control Strategy

What does your team do to the joystick inputs before passing them to the robot?

  • Square (or Cube) the inputs?
  • Deadband?
  • Cap the output?
  • Multiply by a scalar?
  • Slew Rate Limiter?
  • Set a minimum output?
  • Do you have a different strategy for rotation vs translation?
  • What output: %, V, Speed, Amperage, Torque?
1 Like

I can really only speak to the input rates, for turning we have our input raised to the 3/2. …yes I know. We tried changing it from linear to squared and I felt it was a bit of a drastic difference, so we kind of split the middle. For translation, it’s just linear.

1 Like

For our swerve: Thrustmaster Joysticks, read linearly
We have an internal deadband function for Xbox Controllers when zero centering is bad
Usually multiply by scalar to output units (could be m/s or V or %)
We cap driver speed and ramp it up with comfort
No minimum output usually
Swerve wheels have independent acceleration limiters on both the drive and turn

For output control:

  • Swerve Drive, speed via motor controller PID
  • Swerve Turn, voltage request (from a software PID) converted to a % (we started with the 2021 WpiLib template which was software PID, but commanding a brushless speed controller, so we divide by battery voltage, which is probably all wrong)
  • Our arm, we started with software PID, then made it software profiled pid, then added f term for gravity compensation, then switched to hardware pid with motion magic
    • Software PID got it running, profiled pid smoothed it out for wear, f term compensated for gravity much better, and then the hardware pid runs at 1ms and fixed most of our gear stripping issues
  • Intake was voltage control
1 Like

Well seeing as how I mentor an all girls school that is quite the assumption.

I am not asking for our driver. I asking because:

  1. I want to understand what strategies are most popular.
  2. I want to understand what strategies a library should support
  3. I want to understand if anyone has any fancy new ideas to try (like on discord I heard about a one sided slew rate limiter which seems like an interesting idea to try).

This post about polar joystick filters would be nice.

3 Likes

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