Recent Updates

  • Updated on: Jan 20, 2023

    Using test mode

    It is important to verify the operation of the robot before using it for a match, demonstration or other task. So often wires can be pulled lose, circuit breakers are left out, or other issues that might cause the robot to not operate as expected. There are a number of strategies for testing your robot code. You might have a checklist where each subsystem is manually verified using the operator controls. You can also test the autonomous operation this way when the robot is off the ground can the operation can be observed.

    Test mode is designed to enable programmers to have a place to put code to verify that all systems on the robot are functioning. In each of the robot program templates there is a place to add test code to the robot. If you use the IterativeRobot template, or use command-based programming you can easily see the operation of all the motors and sensors through the LiveWindow.

  • Once you have some commands created, you can set one of them to be the default command for a subsystem. Default commands run automatically when nothing else is running that requires that subsystem. A good example is having a drive train subsystem with a default command that reads joysticks. That way, whenever the robot program isn't running other commands to operate the drive train under program control, it will operate with joysticks.

    Manual RobotBuilder
  • Updated on: Jan 20, 2023

    Operating a compressor for pneumatics

    The Compressor class is designed to operate any FRC supplied compressor on the robot. A Compressor object is constructed with 2 input/output ports:

    • The Digital Relay output port connected to the Spike relay that controls the power to the compressor. (A digital output or Solenoid module port alone doesn’t supply enough current to operate the compressor.)

    • The Digital input port connected to the pressure switch that monitors the accumulator pressure.

    The Compressor class will automatically create a task that runs in the background and twice a second turns the compressor on or off based on the pressure switch value. If the system pressure is above the high set point of the switch, the compressor turns off. If the pressure is below the low set point, the compressor turns on.

  • Updated on: Jan 20, 2023

    Composite controllers - RobotDrive

    The RobotDrive class is designed to simplify the operation of the drive motors based on a model of the drive train configuration. The program describes the layout of the motors. Then the class can generate all the speed values to operate the motors for different configurations. For cases that fit the model, it provides a significant simplification to standard driving code. For more complex cases that aren’t directly supported by the RobotDrive class it may be subclassed to add additional features or not used at all.

  • The WPI Robotics library has extensive support for motor control. There are a number of classes that represent different types of speed controllers and servos. The WPI Robotics Library currently supports two classes of speed controllers, PWM based motor controllers (Jaguars, Victors and Talons) and CAN based motor controllers (Jaguar). WPILIb also contains a composite class called RobotDrive which allows you to control multiple motors with a single object. This article will cover the details of PWM motor controllers, CAN controllers and RobotDrive will be covered in separate articles.

  • Updated on: Jan 20, 2023

    Analog triggers

    An analog trigger is a way to convert an analog signal into a digital signal using resources built into the FPGA. The resulting digital signal can then be used directly or fed into other digital components of the FPGA such as the counter or encoder modules. The analog trigger module works by comparing analog signals to a voltage range set by the code. The specific return types and meanings depend on the analog trigger mode in use.

  • Updated on: Jan 20, 2023

    Analog inputs

    The NI 9201 Analog to Digital module has a number of features not available on simpler controllers. It will automatically sample the analog channels in a round robin fashion, providing a combined sample rate of 500 ks/s (500,000 samples / second). These channels can be optionally oversampled and averaged to provide the value that is used by the program. There are raw integer and floating point voltage outputs available in addition to the averaged values. The diagram below outlines this process.

  • Ultrasonic sensors are a common way to find the distance from a robot to the nearest surface

  • A compass uses the earth’s magnetic field to determine the heading of the robot.

  • Updated on: Jan 20, 2023

    Gyros to control robot driving direction

    Gyros typically in the FIRST kit of parts are provided by Analog Devices, and are actually angular rate sensors. The output voltage is proportional to the rate of rotation of the axis perpendicular to the top package surface of the gyro chip. The value is expressed in mV/°/second (degrees/second or rotation expressed as a voltage). By integrating (summing) the rate output over time, the system can derive the relative heading of the robot.

    Another important specification for the gyro is its full-scale range. Gyros with high full-scale ranges can measure fast rotation without “pinning” the output. The scale is much larger so faster rotation rates can be read, but there is less resolution due to a much larger range of values spread over the same number of bits of digital to analog input. In selecting a gyro, you would ideally pick the one that had a full-scale range that matched the fastest rate of rotation your robot would experience. This would yield the highest accuracy possible, provided the robot never exceeded that range.