In terms of robotic drive systems, a holonomic drive is one that can move translationally and rotationally, regardless of the state of one another. In contrast, in non-holonomic drives such as a tank, if you were facing north and wanted to travel west, you'd first have to orient the front of the tank westward by rotating it. In a holonomic drive, you can travel in any direction while keeping the front of your robot facing north but can also rotate to change its heading without needing to translate. The X drive is one implementation of a holonomic drive system that requires 4 omni wheels with others such as the H drive that requires 5.
The X drive is made possible by the use of omni wheels built on a square chassis, each inclined at 45° with respect to the compass headings of the robot (N, E, S, W). When driving along the compass headings, the motion is distributed evenly between the larger wheel hub itself and the smaller rollers located around the circumference of the omni wheel. When driving at 45° headings (NW, NE, SE, SW), two of the omni wheels remain stationary while their rollers roll, and the other two omni wheels roll on their hubs. When rotating on the spot, the omni wheels all travel in the same circular direction.
The program written for this X drive allows the user to control translational movements with the left joystick and rotational movements with the right joystick. To compute the resultant velocity vector of the robot given an input from the user, the program adds the inputs from all three joystick axes, taking into account whether the scalar position of the joystick should be negated so that the wheels spin in the same direction. Please see the collapsed section below for the source code.
While trying to record footage for this project, I found myself a hand short to hold the phone since the remote control required both hands. I devised a simple phone holder that attaches to the two connector pin holes in the controller so I could record while controlling the robot.
Top-down view of top side
Top-down view of bottom side (bottom-down view?)
Phone holder used to record the robot while I was controlling it
#include "iq_cpp.h"
using namespace vex;
const float DEADBAND = 5.0; //to prevent motor drift
void joystickControl();
int main() {
joystickControl();
}
void joystickControl() {
while (true) {
if (fabs(static_cast<float>(Controller.AxisA.position()))
+ fabs(static_cast<float>(Controller.AxisC.position()))
+ fabs(static_cast<float>(Controller.AxisB.position())) > DEADBAND) {
frontLeftMotor.setVelocity((Controller.AxisB.position() + Controller.AxisA.position() + Controller.AxisC.position()), percent);
rearLeftMotor.setVelocity(-(Controller.AxisB.position() - Controller.AxisA.position() - Controller.AxisC.position()), percent);
frontRightMotor.setVelocity(-(Controller.AxisB.position() - Controller.AxisA.position() + Controller.AxisC.position()), percent);
rearRightMotor.setVelocity((Controller.AxisB.position() + Controller.AxisA.position() - Controller.AxisC.position()), percent);
} else {
frontLeftMotor.setVelocity(0, percent);
frontRightMotor.setVelocity(0, percent);
rearLeftMotor.setVelocity(0, percent);
rearRightMotor.setVelocity(0, percent);
}
frontLeftMotor.spin(forward);
frontRightMotor.spin(forward);
rearLeftMotor.spin(forward);
rearRightMotor.spin(forward);
wait(20, msec);
}
}