The drive subsystem provides the means to move the robot around and field and change the direction it is facing. In the drive the motor drives the wheel through a combination of gears, belts and pulleys or chains and sprockets. This reduces the speed of the wheel compared to the motor while increasing torque. The overall ratio of motor speed to wheel speed is the “gear ratio”, shown as G in the figure below. Each rotation of the wheel translates to π * D movement of the chassis, where D is the wheel diameter.
There are three basic types of drives in FRC:
See “WPI Drive Classes” under References for more details about the types of drives.
FRC Team 151 currently uses differential drive, so here are more details on that approach and how software can be used to control it.
WPILib provides three different ways to map OI joystick inputs to wheel speeds to provide forward/backward movement and turning with a differential drive.
In the software the DifferentialDrive is an object used within the drive subsystem. Motors are separate objects which are used in the Differential Drive.
The DifferentialDrive class also provides a Sendable interface that can be used to easily publish and display drive speeds on a dashboard using a built-in widget.
References:
WPILib Drive Classes:
https://docs.wpilib.org/en/stable/docs/software/hardware-apis/motors/wpi-drive-classes.html
WPILib Drive Modes:
https://docs.wpilib.org/en/stable/docs/software/hardware-apis/motors/wpi-drive-classes.html#drive-modes
WPILib DIfferentialDrive Class:
https://github.wpilib.org/allwpilib/docs/release/java/edu/wpi/first/wpilibj/drive/DifferentialDrive.html