User Tools

Site Tools


training:software:drive_subsystems

Drive Subsystems

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:

  • Differential Drive - All of the driven wheels on a side are rotated in the same direction. This is similar to the way a tank or skid steer loader work. Moving wheels on both sides in the same direction causes forward or backward movement and moving wheels in opposite directions causes the robot to turn. If there is no forward/backward movement, the robot can spin in place. There is no way to move sideways.
  • Swerve Drive - The robot has four wheel assemblies on the corners which can be both driven and rotated. This allows movement in any direction as well as rotation independent of the direction of movement.
  • Mercanum Drive - The wheels have angled rollers and pairs of wheels on each side can be driven independent, so the robot can move sideways. One disadvantage is that the robot will roll when on an incline or bumped on the side.

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.

  • Tank Drive - The left joystick controls left wheel speed and the right joystick controls the right wheel speed. Pushing one joystick further results in turning while moving. Pushing joysticks in equal and opposite amounts results in turning in place.
  • Arcade Drive - The left joystick forward/back controls speed and the right joystick left/right controls the rate of turning. Pushing the right joystick with the left joystick centered results in turning in place
  • Curvature Drive - This is similar to Arcade drive except the right joystick controls turning radius instead of rate. This mode is more like a car. If there is no forward/backward speed, there is no movement. To allow turning in place, the mode provides a means to temporarily enable that movement, which is normally triggered from a button on the OI controller.

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

Discussion

Enter your comment:
C M W U᠎ G
 
training/software/drive_subsystems.txt · Last modified: by Brian Utterback

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki