6933 Offseason Swerve Appreciation

Our tiny Vermont team Archytas (6933) has graduated to swerve drive in the offseason! Woo hoo!

I wanted to extend appreciation to all of the developers and manufacturers who have worked on the parts and software tools to make swerve so accessible. A team can now order parts, download software, and have a running swerve robot without having to develop any new infrastructure from scratch. The built-in modules in the WPI library do most of the heavy lifting.

As the coding mentor, every time the team brought up swerve, I would say, “Offseason. You don’t want to try to figure out a whole new drive system during a season.” So this year, they finally did it. I’m really proud of our team and the members who showed up to the shop and did the assembly, wiring, coding and testing to get this thing running. If you’re doing swerve for the first time, copious bench testing is recommended, as well as clean wiring. The swerve modules have a lot of exposed gears, and we chewed up a loose encoder wire early on (“What’s wrong with the software?” we thought. Oops.)

Boy, am I impressed. The speed/angle mixing model in the library just plain works, meaning we can focus on abstract functionality. We started out testing the limits of manual driving. Then we used the Limelight targeting a steamworks ball and trying stuff like target positioning and target rotation lock. This thing can allow a driver to do donuts and figure-8s all while staying pointed directly at a target. It’s like playing Dark Souls but without dodge rolling.

I’ll attach a couple of videos. (Shout out to former team 885 for the recycled bumper.) The first video is some manual driving with the speed/acceleration cranked up. We did discover that it’s possible to crank up the acceleration so high that full stick chews up the carpet! The limits are there for a reason. Duly noted. Burning rubber is not fast.

The second video (you can see some evidence of carpet abuse) is a deliberately very slow autonomous “puppy bot” mode with a twist. We tried out the Limelight’s April tag mode that supports the 3D orientation and we told the bot to not only establish a specific distance from the box, but to also re-orient itself so that it faces the box head-on. The Limelight is even more great stuff just handed to teams on a silver platter.

We’ll be doing more tests to boost speed and accuracy, and working on a bunch of autonomous awareness features to do things like remember where it last saw a tag when it goes out of the field of view. We’re going to try to squeeze as much performance as we can out of a Limelight and coding tricks before we think about Mechanical-Advantage-style multi-camera field-positioning infrastructure. One step at a time!

We had a bunch of alumni drivers on Christmas break from college come by the shop and try the swerve drive. Big hit.

Control note: After doing some high-speed driving, it occurred to us that using the right stick for rotation could be under-utilizing the tools we have. It has two axes, right? And usually, when you turn the robot, isn’t it so that you’re facing a specific direction? (Towards the human player station, towards a target, aligned with a ramp, etc.) Fussing with scooching left and right by manually steering seems slow. So we changed the right joystick to a “point that way” control. Hit east, the robot faces east. Hit northwest, the robot faces northwest (We’ll probably optionally quantize that to a fixed number of even divisions of the compass points. Experiments continue. The stick goes back to ordinary turning when using camera-centric driving instead of field-centric. Works a treat.)

The alumni drivers tried some cycles between human player and target from last year and concurred that the point-north/drive, point-south/drive cycle was far faster when using turn-to-angle control instead of fussing with manual turning. I’m sure it’s going to take a bunch of additional tuning, and the algorithm isn’t built into the library, but it’s surprisingly simple. Math.atan2(x,y) gets you the target angle from the joystick axes, then you can rotate towards the gyro angle. Easy peasy.

Exciting stuff. Looking forward to kickoff!

12 Likes

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