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
  • Examples
  • API Details
  • Set Soft Limits
  • Enable Soft Limits

Was this helpful?

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

Soft Limits

Soft limits are positions on the motor's encoder that the motor will not pass. This allows you to constrain motion between two points, helpful in many mechanisms where overrotation or overextension are dangerous.

Examples

First you must set the soft limits, the following constrains the motor between -18 and 24 encoder ticks.

motor.setSoftLimits(-18, 24); 

This example constrains the motor between 3 and 9 encoder ticks.

motor.setSoftLimits(3, 9); 

Then one must physically enable the soft limits to take effect.

motor.enableSoftLimits(true); 

You can also turn off soft limts, but still leave the limits configured on the motor controller.

motor.enableSoftLimits(false); 

API Details

Set Soft Limits

Sets the soft limits that the motor will not cross if soft limits are enabled.

setSoftLimits(double revLimit, double fwdLimit)

Parameters:

  • revLimit The reverse position the motor will not go past.

  • fwdLimit The forward position the motor will not go past.

Enable Soft Limits

Enable / disable soft limits.

enableSoftLimits(boolean enable)

Parameters:

  • enable If soft limits should be enabled.

Soft limits tell your motor controller how many revolutions your motor can safely turn before it needs to stop. Unlike hard limit switches that physically cut power at the end of travel, soft limits use the motor's built-in encoder to count rotations. You set these in your controller to match your mechanism's actual range of motion - for example, if your arm can only rotate 3.5 times before it hits its mechanical stop, you'd set your soft limit to something like 3.4 rotations. This prevents your mechanism from binding up or damaging itself by trying to push past its mechanical limits. Since these are programmed into the controller itself using encoder counts, they're always enforced - you can't override them, and they'll work consistently every time.

PreviousCurrent LimitingNextHard Limits

Last updated 7 months ago

Was this helpful?