TitanDrive: A field-oriented controller...for differential drives

Hi, after the big growth in swerve drives last year, I wanted to see if you could get a field-oriented control using a differential drive. This lead me to develop TitanDrive, which I think gives a comparable level of maneuverability to a differential drive robot.

The core function of TitanDrive is that the robot rotates as rapidly as controllable, to point in the direction desired, and at an angle specified (I found 60 degrees works well), it stops spinning and starts moving curving in that direction. This results in very rapid control, and while moving at high speed, can do a 180 spin in around 0.5s. Overall, this system results in much easier control for the driver at high speeds. Additionally, many of the benefits from swerve-based field-oriented control are maintained, like the simplicity needed to go to a specific position or maneuver around an object quickly.

TitanDrive uses 3 other buttons in addition to the joystick:

  • A button for zeroing the heading
  • A button that stops the robot from moving, so it will only spin to face the desired heading
  • A button that flips the direction the robot is following (based on the “mode” TitanDrive has been set to)

The 4 modes that I’ve created for TitanDrive are:

  • HoldForward (my favorite): hold the flip button to force the robot to move forwards, otherwise it uses whichever direction is closest
  • HoldFlip: hold the flip button to force the robot to start following in the opposite direction to what it currently is, otherwise it used whichever direction is closest
  • Toggle: press the flip button to change the follow direction
  • Manual: hold the flip button to follow backwards, otherwise it will follow forwards

I wasn’t really sure which one I or other people would like better, so I made a few. If anyone has another other ideas for different modes, I’d love to hear them!

The main caveat that I’ve noticed is that very fine control is diminished because of how aggressive the controller is, so for games like Deep Space, where being 2" off is undesired, this may end up being harder to control than like arcade drive. Additionally, it has a steep learning curve and took be a bit to get the hang off (I’m still learning).

Code:
This is my implementation of the control sequence inside our base drivetrain
This is my implementation of the controller here
And this is a sample of it being instantiated in RobotContainer

Here’s a quick video of my using it, I’m still working on my control, but the quick turning is very satisfying.

I would love to here any suggestions or changes anyone else makes, and also thoughts from any drivers who are trying it out!

11 Likes

This looks really cool! Have you tried driving it around on a larger field to see what the experience is like?

I have not been able to yet, but I will, and I’m going to get someone to play defense too

1 Like

Field-oriented differential drive is a fun challenge; your approach here is similar to the one 449 did a few years ago. We found it to be surprisingly usable, but not as good as relative controls for an experienced driver.

It teaches you an awful lot about controls, though! Thanks for sharing this, and I hope teams take inspiration from it.

6 Likes

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