User:George neb/sandbox/Swerve Drive

Swerve Drive
Swerve drive is a drivetrain that is specifically designed so that the robot can spin while traveling along any path across the terrain. It is a drive-train that enables the robot to move in any direction and can also rotate the chassis while moving all at the same time.

Pros
Maneuverability - Unlike other drive trains, in which the chassis must be rotated before the robot can move in the desired direction, swerve drive enables mobility in any direction without having to rotate the chassis. The robot can move in the desired direction and rotate its chassis at the same time, because every wheel can be independently driven and steered.

Minimal steering friction - Very low static friction during the swerve steering.

Customizability - In swerve drive software program can control the direction and the speed independently, that gives you the ability to modify driving modes that best suit your goals.

Cons
Cost - Swerve Drive tends to be more expensive than other simpler driver trains like west coast.

Difficult to execute - Executing a swerve drive is more difficult to build and to program.

Uses a large number of motors - You need to use 2 motors per wheel(one motor will be used to drive the wheel and second one will be used to steer the wheel) which means for a 4 wheel swerve drive you need 8 motors. That could be a problem if you are planning on competing in the FRC Robotics Competition because the competition generally only allows you to have a single PDU(Power Distribution Unit) which can only support 16 motors in total. So if you use swerve drive you will already use eight out of the sixteen total motors that you can use. So before you commit to swerve drive, think how many motors will you need to use in your robot and decide if you can afford to give eight motors to swerve drive.

How does it work?
General overview: Every wheel on swerve drive has two motors attached to it: one motor is controlling the speed and torque at which the motor drives and the other motor is responsible for changing the direction that the wheel is facing. Every wheel can independently change both the speed and direction; this is what allows the robot to move in any direction. You can program the swerve to move relative to the driver, which means that if you want the swerve to go left the robot will go relative to your left.

Math behind moving relative to driver: If you want to add this feature to your swerve drive you would have to add a gyroscope to the robot. A gyroscope is used to determine the direction in which the robot is facing, and knowing where the robot is facing is crucial in the calculations. To move relative to the driver you have to steer each wheel at an angle θ where θ = (angle where the driver wants to go) - (angle where the robot is facing that you can get from a gyroscope).

Rotate Chassis: Rotation of the chassis in place is done by setting all of the wheels tangent to the circle that they describe and turn the chassis like a turret. The chassis is represented by a circle of radius h about a chassis Center-Point. There is an angular bearing of travel relative to the nominal chassis orientation of