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
  • Percent Output Control
  • Position Control
  • Velocity Control

Was this helpful?

Export as PDF
  1. Software Resources

Set Output

The Thrifty Nova provides various ways to set the output of the motor, percent, positional, and velocity control. The following examples highlight various applications of these three control modes.

Percent Output Control

Simplest control mode - directly sets motor power:

javaCopymotor.setPercent(1.0);    // 100% forward
motor.setPercent(0.75);   // 75% forward
motor.setPercent(0);      // Off
motor.setPercent(-0.25);  // 25% reverse
motor.setPercent(-1.0);   // 100% reverse

Position Control

Moves to specific encoder positions using PID control:

javaCopy// Requires configured PID!
motor.setPosition(90);    // Go to position 90
motor.setPosition(-45);   // Go to position -45
motor.setPosition(0);     // Return to zero position

Velocity Control

Maintains specific speeds using PID control:

javaCopy// Requires configured PID!
motor.setVelocity(100);   // 100 units/second forward
motor.setVelocity(-50);   // 50 units/second reverse
motor.setVelocity(0);     // Stop with active control

Control Flow Summary

  1. Configure encoder type with useEncoderType()

  2. (Optional) Set initial position with setEncoderPosition()

  3. Use control methods:

    • setPercent() for direct power control

    • setPosition() for position control (requires PID)

    • setVelocity() for velocity control (requires PID)

  4. Read feedback with:

    • getPosition() for current position

    • getVelocity() for current speed

Important Notes

  • Position and velocity units are always in encoder-native units

  • Use the Conversion class to convert between encoder units and real-world units

  • Position/velocity control require properly configured PID

  • setPosition() sets a target for closed-loop control

  • getPosition() reads the actual measured position

  • Current readings are always in amps

  • All encoder readings are relative to the last setEncoderPosition() call

PreviousIO Signal ManagementNextLogging

Last updated 6 months ago

Was this helpful?