2023 Official 1721 Robot Manual

Introduction

Outreach Tag

Warning

Make sure this manual’s revision hash and the robot hash match!

Heck

Accident Counter

This is the official Robot Manual for Tidal Force FRC Team 1721’s 2023 robot, Rotom Toaster. For the FRC Game Charged Up!

This manual contains technical diagrams, prototyping processes and in depth technical descriptions of all robot functions, from software to hardware and the messy bits in-between.

If you’re really that interested to know all the details, you’ll find them here!

Critical Design Review

Introduction

Outreach Tag

Design review process

Bumpers

Outreach Tag

The Drivetrain

Introduction

Outreach Tag

The Drivetrain Under Construction

The drivetrain during construction

The tank drivetrain is tried and tested, even by us! During Prototyping we experimented with our kitbot drivetrain and used it as a solid base to train new members with.

The drivetrain is a 3x3 tank drive base, with all wheels powered, and the first two being omnidirectional.

The drivetrain’s top speed is estimated to be 45kts. Although it has not yet been in wide enough area to confirm.

Prototyping

Outreach Tag

Kitbot

The kitbot/prototype drivetrain.

In the pre season we prototyped using our kitbot and counterweights.

Software

Software Tag

The drive base uses simple two wheel steering kinematics and an odometry with encoders, gyro and accelerometers to detect robot position.

Config Files

drivetrain:
  max_velocity: 1.5               # Updated Never by Nobody
  encoderConversionFactor: 21.43  # Updated 1/27 by Joe

  # All pose coordinates are in meters.
  leftMotor:
    Motor1Port: 2                # Updated 1/12 by Keegan
    Motor2Port: 1                # Updated 1/12 by Keegan 
    EncoderPorts: [2, 1]         # Updated 2/12 by Keegan
    EncoderReversed: False       # Updated Never by Nobody
    Inverted: False              # Updated Never by Nobody

  rightMotor:
    Motor1Port: 3                # Updated 1/8 by Keegan
    Motor2Port: 4                # Updated 1/8 by Keegan
    EncoderPorts: [3, 4]         # Updated Never by Nobody
    EncoderReversed: True        # Updated Never by Nobody
    Inverted: True               # Updated Never by Nobody

  navX: # NavX ids
    can_id: 0                    # Updated 1/13 by Keegan
    yaw: 0                       # Updated 1/13 by Keegan
    pitch: 0                     # Updated 1/13 by Keegan
    roll: 0                      # Updated 1/13 by Keegan
drive:
  # Diff lock
  kStabilizationP: 0.011
  kStabilizationI: 0.0001
  kStabilizationD: 0

  # TurnToAngle
  kTurnP: 0.007
  kTurnI: 0.006
  kTurnD: 0.001

  kMaxTurnRateDegPerS: 100
  kMaxTurnAccelerationDegPerSSquared: 300

  kTurnToleranceDeg: 5
  kTurnRateToleranceDegPerS: 10 # degrees per second

The Arm

Introduction

Outreach Tag

The arm Under Construction

The arm during construction

The arm is a 3 stage nested tube stock assembly powered by springs. Its a design we’ve become familiar with. It is powered by a pair of Rev NEO motors. One for its angle, and another for its extension.

Top Down

The angle is determined by a lead screw and lifting arm assembly so as to avoid excessive motor load and precise location tuning.

Lead screw

A close up of the lead screw

Software

Software Tag

The arm is driven using the embedded PID loops on both its motors. Limit switches limit its maximum extents to protect the robot from damage.

Config Files

arm:
  elevatorMotor: # Drives the spool to move the lift in and out
    MotorPort: 5                 # Updated 1/22 by Keegan
    Inverted: False              # Updated 1/22 by Keegan
    LimitSwitch: 0               # Updated 2/15 by Keegan
    ConversionFactor: 1          # Updated 1/18 by Joe
    Start: 0                     # Updated 3/18 by Keegan

  ladderMotor: # Drives the lead screw to run the lift up and down
    MotorPort: 6             # Updated 1/22 by Keegan
    Inverted: False          # Updated 1/22 by Keegan
arm:
  elevator:
    kp: 0.075
    ki: 0
    kd: 0.1
    ff: 0

  ladder:
    kp: 0.1
    ki: 0
    kd: 0.1
    ff: 0

Operating and Controls

Controller Map

Driveteam Tag

# This file defines the input
# and control scheme of the robot.
# this is orginized into control modes

main mode:
  driver: # using a stick controller
    controller_port: 0 # What usb port the driver controller is on

    # Axis
    ForwardAxis: 1
    SteerAxis: 2

    # Buttons
    HalfSpeedButton: 1
    DiffLock: 2
    Turn90: 3
    TurnAnti90: 4
    StartConfig: 5
    Slow: 10
    Crawl: 3

  operator: # using an "x-box" controller
    controller_port: 1

    # Hold Buttons
    Unclamp: 6
    Clamp: 5
    FindZero: 8
    hold: 3

    # Presets/Modes
    LowGoal: 1
    HighGoal: 4
    ManualMode: 7
Alternative text

This needs to be filled out!

Alternative text

This needs to be filled out!

Robot Wiring

Wiring Prototype

Wiring Prototype

Full Electrical Schematic

Outreach Tag Pitcrew Tag

Schematic here!

Robot Network Architecture

The robot contains several networked computers, all talking over high speed tcp/ip. The layout of the network may be of importance during service and debugging.

Network layout

Software Tag Pitcrew Tag

Robot Network Hosts

Hostname

mDNS

IP

roborio

I forget

10.17.21.2

nuc

10.17.21.11

limelight

TBD

TBD

aivision

TBD

TBD

driverstation

DHCP

Developing

Configuration Files

Pitcrew Tag Software Tag

This is literally the robot hardware configuration written in yaml.

These are provided as reference for use by pit crew.

Use this to confirm/reconfigure motor controller addresses or examine if pose x/y cords match actual.

# This file defines the robot's
# physical dimensions. Things like
# Motor placement, max and min extensions
# of arms, and similar should go here.

drivetrain:
  max_velocity: 1.5               # Updated Never by Nobody
  encoderConversionFactor: 21.43  # Updated 1/27 by Joe

  # All pose coordinates are in meters.
  leftMotor:
    Motor1Port: 2                # Updated 1/12 by Keegan
    Motor2Port: 1                # Updated 1/12 by Keegan 
    EncoderPorts: [2, 1]         # Updated 2/12 by Keegan
    EncoderReversed: False       # Updated Never by Nobody
    Inverted: False              # Updated Never by Nobody

  rightMotor:
    Motor1Port: 3                # Updated 1/8 by Keegan
    Motor2Port: 4                # Updated 1/8 by Keegan
    EncoderPorts: [3, 4]         # Updated Never by Nobody
    EncoderReversed: True        # Updated Never by Nobody
    Inverted: True               # Updated Never by Nobody

  navX: # NavX ids
    can_id: 0                    # Updated 1/13 by Keegan
    yaw: 0                       # Updated 1/13 by Keegan
    pitch: 0                     # Updated 1/13 by Keegan
    roll: 0                      # Updated 1/13 by Keegan

arm:
  elevatorMotor: # Drives the spool to move the lift in and out
    MotorPort: 5                 # Updated 1/22 by Keegan
    Inverted: False              # Updated 1/22 by Keegan
    LimitSwitch: 0               # Updated 2/15 by Keegan
    ConversionFactor: 1          # Updated 1/18 by Joe
    Start: 0                     # Updated 3/18 by Keegan

  ladderMotor: # Drives the lead screw to run the lift up and down
    MotorPort: 6             # Updated 1/22 by Keegan
    Inverted: False          # Updated 1/22 by Keegan
    ConversionFactor: 1      # Updated 1/18 by Joe
    Start: 55                # Updated 3/18 by Keegan



claw:
  MotorPort: 7             # Updated 1/22 by Keegan
  Inverted: False          # Updated 1/22 by Keegan
  EncoderPorts: 7          # Updated 2/11 by Keegan
  EncoderReversed: False   # Updated 1/22 by Keegan
Figure of a programmer

A programmer in his natural habitat

Modifying these docs

Software Tag

Requirements for building the docs

You’ll need to install several packages to build these docs

# Ubuntu/Debian users
sudo apt install texlive-latex-recommended texlive-latex-extra texlive-pictures pandoc rename latexmk

# Arch/Manjaro users
pacman -S texlive-pictures pandoc latexmk

Making the docs

Under the Docs directory in 1721-ChargedUp, setup a pipenv using the provided files and invoke the make latexpdf command to build the docs.

pipenv install # May take a while
pipenv shell
make latexpdf # Builds the manual

Find the generated .pdf under docs/_build/latex/ it is recommended that you also have a restructured text interpreter such as reStructuredText. Documentation for sphinx can be found here

Using Github

Software Tag

We use Github as our main version control and automation system, paired with github actions and our own jenkins build server in the build space.

Making Pull requests

While you will mostly interact with github through git you should know how to make pull requests.

First go to the current repo 1721 ChargedUp.

pull request

You first under the pull requests tab create a new pull request, select the branch you want to make the pull request for.

Once approved by someone with proper clearance (Keegan or Joe) you may merge it, please squash and merge to not have billions of commits in main.

Creating Issues

This will go over creating github issues, github issues are one way we communicate what needs to be done.

On the issues tab there will be a button saying New issue, click that and enter the information about the issue.

Making and Adding Labels and Milestones

Labels and Milestones are a nice way to categorize issues and pull requests, they both can created and added the same way.

To create a Label or Milestone on the main page of issues or pull requests there are buttons, saying Labels and Milestones.

labes example

After pressing input a name and a description, github uses a hex system for colors to help select a color use this.

Robot Simulator

Software Tag

Requirements

Under the rio directory setup a pipenv using the provided files and invoke the make sim command to run the simulator.

pipenv install # May take a while
pipenv shell
make sim # Alternatively run: python3 robot.py sim

This will start the robot simulator. See Using the Simulator for more info.

Using the Simulator

Alternative text

To be able to “operate” the robot while any mode will work it is recommended that under robot state, Teleoperated is enabled.

Under the Joysticks there will be Joysticks 1-5 all grayed out, to select one go to System Joysticks and drag on over.

When starting up the program there will be no input method selected under System Joysticks there may be Joysticks, Xbox controllers, or Keyboards 0-3.

Joysticks and Xbox controllers work as if piloting an actual robot, to find layouts for controls see Controller Map.

Keyboard 0 is the WASD keys to move and E and R to rotate the controller buttons 1 through 4 can be access by Z,X,C,V in that order.

Keyboards 1-3 are differing controller schemes that are useless for the purposes of testing due to lack of movement.

Keyboard inputs require you to have the active window be the simulator while, Joysticks and xbox controllers don’t.

Dashboard

Software Tag Driveteam Tag

Dashboard Requirements

Under the dashboard directory setup a pipenv using the provided files and invoke the make run command to start the Dashboard’s local host.

pipenv install # May take a while
pipenv shell
make run # makes a locally hosted website dashboard

This will start the website dashboard. See Using the Dashboard for more info.

Using the Dashboard

Activating the dashboard doesn’t automatically start. To start the Dashboard within your terminal it will print

cd www && python -m pynetworktables2js
16:32:28:683 INFO    : dashboard           : Connecting to NetworkTables at Ip address
16:32:28:683 INFO    : nt                  : NetworkTables initialized in client mode
16:32:28:683 INFO    : dashboard           : NetworkTables Initialized
16:32:28:684 INFO    : dashboard           : Listening on http://localhost:5800/
16:32:28:978 INFO    : tornado.access      : 101 GET /networktables/ws (Ip address) 0.89ms
16:32:28:978 INFO    : net2js              : NetworkTables websocket opened

Within this you will see one called local host, you will need to copy that link and put it in a web browser. It is recommend that you use this in incognito due to network cache causing issues with not updating.

Dashboard image

This will auto connect to the simulation if one is running, if you start one after remember to refresh the page.

For this station to active things such as the swerve drive wheels, the simulation must be set to Teleoperated see Using the Simulator.

Robot code

Software Tag

Deploying code

First remember to have the FRC Driver Station open first otherwise this won’t work properly.

To deploy robot code first go to the rio setup a pipenv and invoke the make deploy, always run the Robot Simulator on code before deploying!

pipenv install # this may take some time
pipenv shell
make deploy # this run python3 robot.py deploy

First time running it will ask for a team number (1721). After the first time it will know the team number deploy the code.

FRC Driver Station

Alternative text

Q driver Station

The FRC Driver Station is made for windows, but there is a linux version Q Driver Station.

This will assume your using the windows version but they both mostly the same.

Most of this won’t be in your control during competitions, but this will go over it all.

The base mode is Teleoperated but you can also set it to Autonomous, practice, and test.

Autonomous will simulate code that would be run in Autonomous. Practice will simulate competition timings, for testing use Teleoperated or in sim, see Robot Simulator. Test, tests the code a better way to test is Robot Simulator.

You can enable the robot after a joystick is detected, make sure to plug one in, it has robot code, and has communications with the robot.

Also see Dashboard for how to use the dashboard.

The Event Checklist

Introduction

Outreach Tag Pitcrew Tag

This is the checklist for events, this should be gone through with every event attended.

It is best to run through the night before to give for things to be found and secured in the trailer.

preferable this list should be checked at least twice in order to nto have any missing pieces.

Checklist

Pitcrew Tag

Checklist

Item

Use

Checkbox

Drive Laptop

To deploy and run the robots code.

Controllers

To control the robot.

The Robot

It is our only way of participating.

Tool Chest

To store the tools used in basic repairs.

Chargers

Specifically the Laptop and Battery Chargers.

Batteries

To power the robot.

Battery Beak

Needed for checking batteries

Bill Of Materials

Outreach Tag

Bill Of Materials

Qty

Unit Cost

Total Cost

Electronics

RoboRio 2

1

$485.00

$485.00

navX2

1

$107.00

$107.00

Drivetrain

Arm

$592.00