# Learning and Designing Swerve Modules?

I am looking into learning more about building, designing, and anything I can on swerve modules.

I have some time now and have become more interested in possibly designing and building one. I have 0 clues on where to start, what is needed, and how to do all the math for it.

Swerve has always gone over my head, so how do I swerve?

2 Likes

1640 has a swerve wiki thatâs pretty good that covers the iteration of their modules, with some reference photos of 1717 as well. CD Media also has photos of swerves galore. If I was to try and outline from zero to âas good as I can explain itâ though, hereâs the answer:

Intro

The concept of swerve as you know it is what used to be referred to as âunicorn swerveâ. Capable of simultaneous translation (moving in the X/Y plane that is a floor) and rotation (relative to everything else.) itâs called a holonomic drivetrain. There are other holonomic drivetrains such as X, killough, or mecanum, but all of them (generally) lack the traction to accelerate compared to traditional tank drives.

The core requirement of modern swerve is being able to absolutely command the angle of your wheelpod (a wheel and gear setup or wheel, motor, reduction, etc. and a slipring) This is typically accomplished with the use of encoders (but lose absolute heading in the event of a power outage) or potentiometers (usually have limited rotations). Otherwise, you have no way to accomplish the math of producing a given wheel direction for a given input vector. For this reason, controls integration is essential. You may not strictly need a sensor on your propulsion motor, but you definitely need one on your steering motor.

The math for swerve is built-in to WPILib and has examples if youâre curious, though it lacks the vendor-specific implementations (for using sensored brushless motors, but the concepts apply still)

A Side Note On Control

Some teams drive their swerve in whatâs called âfield oriented driveâ, where the desired vector on the stick is absolute to the field, not to the robot. If I push the joystick of a robot to 9-o-clock on a non-field oriented robot and itâs already at 9-o-clock, itâs likely to head to 6-oclock. But if the robot is field oriented, and you know what angle the field starts at, you can command the robot to head towards the top left of the field.

As to designing and building one, there are a few ongoing metas observable through the SDS and WCP swerves available for sale. In the past, some teams have tried slipring swerve, where the motor controller is inside the wheelpod assembly. This allows for infinite rotation (same as coaxial), but effectively caps how small your wheelpod can be. Looking at WCP and SDS swerves, as well as a plethora of historical swerves, theyâre majority coaxial, where two concentric axles rotate and transfer the translational power to the wheel.

The same concepts that apply to intake design also apply to swerve, in the theory that to get the same surface speed on the roller (wheel), a smaller wheel requires a smaller reduction. For this reason, it often makes sense to run swerve with smaller wheels, to avoid needing a massive reduction.