LogoLogo
  • Welcome!
  • Mission Statement
  • Contributing Guidelines
    • Embed CADs in Wiki Articles
  • VEX Worlds Livestream Archive
    • VEX U
    • V5RC High School
    • V5RC Middle School
    • VIQRC Middle School
    • VIQRC Elementary School
    • JROTC
  • ⚙️Hardware
    • Design Fundamentals
      • Gear Ratios
      • Internal Forces (Stress)
      • Torque
      • RPM
      • Center of Mass
    • Introduction to VEX Parts
      • Structure
        • C-Channels and Angles
        • Fasteners
        • Retainers
        • Gussets and Brackets
        • Bearings
        • Plate Metal and Flat Bars
      • Motion
        • High Strength Components
        • Gears and Sprockets
        • Traction Wheels
        • Mecanum Wheels
        • Omnidirectional Wheels
        • Flex Wheels
    • Robot Decorations
      • Part Dyeing
      • Metal Coloring
      • License Plate Holders
    • Lifts
      • Double Reverse Four Bar (DR4B or RD4B)
      • Four Bar
      • Scissor Lift
      • Six Bar
      • Other Lifts
      • Best Practices
    • Shooting Mechanisms
      • Catapult
      • Flywheel
      • Linear Puncher
    • Drivetrains
      • Tank Drive
      • Mecanum Drive
      • Holonomic Drive
      • Designing a Drivetrain
      • Best Practices
    • Pivots & Joints
    • Pneumatics
      • Best Practices - Pneumatics
    • Intakes
    • Flip Out Mechanisms
    • Defensive Mechanisms
    • Misc. Building Techniques
    • VexU
      • Common Manufacturing Techniques
        • 3D Printing
        • Laser Cutting
      • Custom Manufactured Parts Library
      • Commercial Off The Shelf Parts Library
  • 👑Team Administration
    • New Team Resources
      • Creating The Team
      • Gaining Interest for Robotics Teams
      • Attending Competitions
        • Elimination Bracket
    • Team Dynamics
      • Organization Structure and Longevity
      • Member Allocation and Management
      • How *Not* To Run a Team
    • Team Finances
      • One-Year Team Financial Breakdown
      • Funding Your Teams
    • Hosting Competitions
      • Live Streaming
      • Tournament Manager
        • Competition Electronics
        • Creating a Tournament
        • Tools
          • Field Set Control
          • Connecting Mobile Devices
          • Connecting Raspberry Pis
        • Match Control
          • Inputting Match Scores
          • Inputting Skills Scores
          • Inputting Scores on TM Mobile
        • Displays
        • Alliance Selection
      • Additional Event Partner Resources
    • VexU Organization Management
      • Getting Started in VexU
      • Team / Personnel Management
      • Volunteering At Local Events
  • 📚The Judging Process
    • The Engineering Design Process
      • Test and Refine
    • The Engineering Notebook
      • Segments of the Notebook
      • BLRS2 '23-'24 Engineering Notebook
      • Integrating Inventor Models into Documentation
      • Engineering Notebook Rubric Breakdown
    • The Interview
      • Interview Rubric Breakdown
    • Using Notion for an Engineering Notebook
      • How to Setup a Notebook
      • How to Create Entries
      • How to Export a Notebook
      • Purdue SIGBots Notion Template
        • Game Analysis
        • Identify The Problem
        • Brainstorm Solution
        • Select Best Approach & Plan
        • Build Log
        • Programming Log
        • Testing Solution
        • Tournament Recap
        • Innovative Feature
  • 🖥️VEX CAD
    • CAD Programs
      • Inventor
      • Fusion 360
      • Solidworks
      • OnShape
      • Protobot
    • Making a Chassis
      • Inventor Chassis: The Basics
        • Installation
        • User Interface Overview
        • Dark Mode
        • Assemblies
        • Placing Parts
        • Navigating CAD
        • Changing Visual Style
        • Grounding
        • Connecting Two C-Channels
        • Modifying Existing Constraints
        • Toggling Visibility on Existing Parts
        • Completing Half of the Chassis
          • Inner Drive Channel
          • Bearing Flats
          • Motors
          • Wheels
          • Sprockets
          • Spacers, Washers and Standoffs
          • Spacers Cont.
        • Creating Mid-Plane
        • Mirroring
      • Inventor Chassis: Best Practices
        • File Structure
        • Subassemblies
        • Wheel Subassembly
        • Origin Planes
        • Cross Brace
        • Drive Channels
        • Simple Motor iMates
        • Replacing Simple Electronics
        • Completing Half of the Drive
          • Bearing Flats (Best Practice)
          • Wheels
          • Powered Gear
          • Spacer Boxing
          • Spacers, Washers and Standoffs (Best Practice)
        • Model Browser Folders
        • Mirroring (Best Practice)
        • Model Browser Folder (Right)
        • Main Assembly
      • Fusion 360 Chassis
      • Solidworks Chassis, Chain, and Custom Plastic
    • Remembering The Best
      • 62A Skyrise
      • 400X Nothing But Net
      • 2587Z Nothing But Net
      • 365X Starstruck
      • 62A In The Zone
      • 202Z In The Zone
      • 5225A In The Zone
      • 169A Turning Point
      • 929U Turning Point
      • 7K Tower Takeover
      • 5225A Tower Takeover
      • 62A Change Up
    • Scuff Controller
  • 💻Software
    • Odometry
    • Path Planning
    • Robotics Basics
      • Arcade Drive
      • Tank Drive
      • Joystick Deadzones
      • Curvature (Cheesy) Drive
      • Subsystem Toggling
    • Organizing Code
      • Code Style
      • Code Styling Guide
      • Writing Good Comments
      • Version Control
    • Control Algorithms
      • Bang Bang
      • PID Controller
      • Basic Pure Pursuit
      • Flywheel Velocity Control
      • Kalman Filter
      • Take Back Half (TBH) Controller
      • RAMSETE Controller
    • Competition Specific
      • Operator Control
      • Autonomous Control
    • C++ Basics for VEX Robotics
      • Basic Control Flow
      • Enumerations
      • Namespaces (::)
      • Multiple Files (C/C++)
    • VEX Programming Software
      • PROS
        • OkapiLib
      • vexide
      • Robot Mesh Studio (RMS)
      • EasyC
      • RobotC
      • VEXcode
      • Midnight C
    • General
      • Stall Detection
      • Register Programming
      • Sensors and Odometry in Autonomous
      • Embedded Programming Tips
      • Debugging
      • Bit Shift
      • Bit Mask
      • Autoformatting
      • Finite State Machine
      • Data Logging
    • Object Recognition
      • Red Green Buoy
      • AMS
      • OpenCV
      • OpenNI
    • 🤖AI in VRC: Pac-Man Pete
  • ⚡VEX Electronics
    • V5 ESD Protection Board
    • VEX Electronics
      • VEX V5 Brain
        • V5 Electronics Observations and Issues
      • VEX Controller
      • VEXnet and V5 Robot Radio
      • VEX Battery
      • VEX Motors
    • VEX Sensors
      • 3-Pin / ADI Sensors
        • Encoder
        • Potentiometer
        • Limit Switch
        • Bumper Switch
        • Accelerometer
        • Gyroscope
        • Ultrasonic
        • Line Tracker
        • LED Indicator
      • Smart Port Sensors
        • GPS Sensor
        • Rotation Sensor
        • Vision Sensor
        • Optical Sensor
        • Distance Sensor
        • Inertial Sensor (IMU)
        • 3-Wire Expander
    • V5 Brain Wiring Guide
    • Legacy
      • VEX Cortex
      • Power Expander
      • VEX Motor Controller
      • VEX Cortex Wiring Guide
  • General Electronics
    • General Topics
      • External Boards
        • ASUS Tinker Board S
        • Arduino
        • Beagleboard
        • Leaflabs Maple
        • LattePanda
        • Meadow F7 Micro
        • Netduino
        • ODROID-XU4
        • Pandaboard
        • Raspberry Pi
      • Analog-Digital Converter (ADC)
      • Bit-Bang
      • GPIO
      • I2C
      • Jitter
      • Line Noise
      • List of Tools
      • Output Drive
      • Power Consumption
      • Radius Array
      • Resettable Fuse (PTC)
      • SPI
      • Slew Rate
      • Stalling
      • USART
      • UART
      • 5 Volt Tolerant
      • DC Motor Basics
Powered by GitBook
LogoLogo

This work is licensed under a Attribution-ShareAlike 2.0 Generic License

On this page
  • Drives
  • Internal Encoders on the Drivetrain
  • Encoders on the powertrain, gyroscope for turns
  • 3 Unpowered Encoder Wheels
  • Lifts
  • Potentiometers
  • Encoder and Limit Switches

Was this helpful?

Edit on GitHub
Export as PDF
  1. Software
  2. General

Sensors and Odometry in Autonomous

You can't really have good software without sensors, and the quality of the readings from your sensors is often the determining factor in having competitive code.

PreviousRegister ProgrammingNextEmbedded Programming Tips

Last updated 4 years ago

Was this helpful?

It's important to ask for sensor placement on the robot to avoid being completely at the mercy of mechanics and electronics.

Drives

Drivetrain sensing is one of the most difficult problems in autonomous coding. Driving in auton is way easier when you know exactly where the robot is, but getting an accurate 2D state for the robot is a difficult problem for even professional robotics engineers. There are a couple of techniques for doing this within the realm of VEX.

Internal Encoders on the Drivetrain

Easiest and most common option. VEX V5 Motors contain internal encoders. By using the motors on the Drivetrain we can get encoder data from the robot. Simple enough, but full of issues.

Wheel slip is the biggest problem - even with proper slewing, the wheels tend to slip when the robot is told to start moving. This causes the encoders to return inaccurate values.

Slop is another problem - the wheels, chain, and motors all have some wiggle room in them that means that the robot can usually move by an inch or so without any noticeable difference in the encoder readings.

Wheel scrub is another problem - when using omni wheels, the robot often doesn't turn perfectly on a point, which causes the turning readings to be off.

Encoders on the powertrain, gyroscope for turns

This is basically the same as above, but with a gyroscope sensor for turns instead of taking the difference in encoder readings. This improves turns quite a bit - you don't have to worry about wheel scrub with this. The VEX gyro tends to drift though, so the heading won't be accurate for any more than a couple of movements before it's off by quite a lot. This can be improved a lot with a nicer gyro, see .

In 2019 VEX released the SIGBots has acquired this sensor for use in robots. The sensor combines both a a 3-axis accelerometer as well as a 3-axis gyroscope. The combination of these two devices in one sensor allows for effective and accurate navigation, as well as controlling any change in the motion of a robot. The sensor is yet to be fully tested but the general consensus is that this new sensor drifts less and is more accurate.

3 Unpowered Encoder Wheels

This is probably ideal for VEX components. Used to great success by the , this allows the robot to track its forward/backward, side-to-side, and turning movement with just encoders. By having the encoders on dedicated, unpowered wheels, slip is nearly eliminated and the readings are much more accurate.

The only downside is that the assembly takes up a lot of space, and it may not handle going over bumps well. Other than that, it provides all of the required info about the robot's position and eliminates the issues seen in the above two examples.

Lifts

Potentiometers

Potentiometers are sensors that return absolute position and have a range of ~270 degrees, which in theory makes them perfect for lifts. However, in practicality, the tend to be very inconsistent and can suffer from issues like non-linearity (a movement of 20 degrees can return either 15 or 25 degrees depending on where in the pot's range you are) and generally breaking and failing to ever again return a value. Some teams have used 3rd party potentiometers (such as those found on electric guitars) to reduce friction and improve reliability.

One important thing to remember about VEX potentiometers is that they have a hard stop limit at 270 degrees, making them impossible to use on shafts that rotate past that limit.

Rotating a potentiometer past its hard limit will break the potentiometer.

Encoder and Limit Switches

The encoder/limit switch combo is a way of emulating the absolute position returned by a potentiometer, but without many of the drawbacks of potentiometers (bad reliability in particular). This setup is much more reliable, but does not have as much resolution as a potentiometer (360 ticks in a revolution compared to 4095 in 270 degrees) and is more bulky, which has traditionally been the reason for not using this setup.

Contributing Teams to this Article:

(Purdue SIGBots)

💻
BNS' worlds winning skills run in Starstruck
V5 Inertial Sensor
2018 World Skills and Champion 5225A
BLRS