Thrifty Nova
  • Software Resources
    • Getting Started
    • Configure Controller Settings
      • Factory Default
      • Motor Type - Minion Setting
      • Inverting the Motor
      • Brake Mode
      • Maximum Output
      • Ramp Up/Ramp Down
      • Current Limiting
      • Soft Limits
      • Hard Limits
      • Setting Encoder Position
      • Follower Mode
    • Configure Onboard PID
    • Configure CAN Frequency
    • IO Signal Management
    • Set Output
    • Logging
    • Get Feedback
    • Unit Conversions
    • Subsystem Examples
      • Simple Elevator Example
      • Swerve Module Example
      • Simple Arm Example
  • Electrical Resources
    • Wiring the Thrifty Nova
    • LED Color Codes
    • Brushless Hall Sensor Connector
    • USB Communications
    • 10 Pin Data Connector
      • Intro to Sensors
      • Sensor Hat
      • Motor Runner Board
    • Hard Reset
  • Mechanical
    • Mounting Options
  • Software Releases
    • Software Releases
  • Thrifty Config
    • Thrifty Config Demo Video
Powered by GitBook
On this page
  • Usage Examples
  • API Details for setEncoderPosition

Was this helpful?

Export as PDF
  1. Software Resources
  2. Configure Controller Settings

Setting Encoder Position

PreviousHard LimitsNextFollower Mode

Last updated 6 months ago

Was this helpful?

You can reset the encoder on the Thrifty Nova to be at some specific value. The current position of the encoder will real as the set value, and all the other readings will be adjusted accordingly. The position needs to be passed in encoder units, so it can be wise to use .

Encoder Types

The Thrifty Nova supports three types of encoders, each with different capabilities:

Encoder Type
Resolution
Position
Velocity
Notes

INTERNAL

42 counts/rev

✓

✓

Built into NEO motors

QUAD

4096 counts/rev

✓

✓

External quadrature encoder

ABS

4096 counts/rev

✓

X

External absolute encoder

Setting Up Encoders

First, tell the motor which encoder type you're using:

javaCopy// Select which encoder to use for feedback
motor.useEncoderType(EncoderType.INTERNAL);  // Built-in NEO encoder
motor.useEncoderType(EncoderType.QUAD);      // External quadrature encoder
motor.useEncoderType(EncoderType.ABS);       // External absolute encoder

Usage Examples

The following example sets the encoder to be currently at the zero position.

myEncoder.setEncoderPosition(0);

And this example sets the current position to read as 21 encoder units.

myEncoder.setEncoderPosition(21);

API Details for setEncoderPosition

Sets the encoder position.

setEncoderPosition(double position)

Parameters:

  • position The position to set the encoder to.

conversions