Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Sometimes you might need to reset your Thrifty Nova motor controller back to its original settings. The factory reset feature lets you do this with just one line of code!
That's it! This command will reset almost all settings back to their factory defaults.
When you perform a factory reset, these settings will return to their default values:
Motor inversion (returns to false
)
Brake mode (returns to false
)
Maximum output (returns to 100%)
Ramp rates (returns to 0.1 seconds)
Current limits (returns to 40 amps)
PID values (returns to 0)
Soft limits
Temperature throttling
Some settings will stay the same even after a factory reset:
CAN ID
Device name
Serial number
Here's a complete example showing how you might use factory reset in your robot code:
Factory reset is useful when:
You're setting up a new motor controller
You want to start fresh with default settings
You're troubleshooting motor issues
You're not sure what settings might have been changed before
💡 Tip: It's a good practice to call factoryReset()
during your robot's initialization if you want to ensure you're starting with known default values.
⚠️ Important: Remember that after doing a factory reset, you'll need to reconfigure any special settings your robot needs. Don't just reset and forget!
There are many options to configuring on the Thrifty Nova. These can be configured in the constructor using a variety of configuration setters. These setters can be chained together to make for a very clean configuration style. The following is an example of this configuration strategy.
After you are done setting your configurations you can check for any errors reported from the motor controllers. The motor controller will provide a list of errors encountered while configuring values. Errors are represented by a status enum. The following examples show how to access these error codes, check for certain error codes, and clear the error list.
In this example we get a list of all errors, then iterate through the errors and printing them out.
You can also check if a given error is present. Here we are checking if configuring brake mode has failed.
You can also clear this error list. It will repopulate if more errors are encountered
There are two types of behaviors that the motor can take when the user specifies that it should idle. These modes are called Brake Mode and Coast Mode.
Coast Mode is the most simple behavior, and the default mode. When the motor wants to idle, power is cut from the phases, letting the kinetic energy of the motor disipate through friction until the system comes to rest.
Brake Mode turns the motor into an electric generator, which converts the kinetic energy from the system into electric energy into the circuit. It accomplishes this by shorting the phases together anytime the motor is requested to be idle.
Set the brake mode status of the motor to be either in brake mode or not in brake mode.
Parameters:
inverted
If the motor should be in brake mode or not.
The user can constrain the maximum forward and reverse percent output of the motor.
If you wanted some motor to only be able to apply 25% power in both directions, I could use the following.
If you want some motor to have no constraint in going forward, but only 30% power in reverse, then you could use the second method overload.
You could also specify a limit of 50% power going forward, and not let the motor drive in reverse.
Set the maximum percent output.
Parameters
maxOutput
The maximum absolute output in both directions in range 0 to 1.
Parameters
maxFwd
The maximum forward output in range 0 to 1.
maxRev
The maximum reverse output in range 0 to 1.
Due to differences in motor phase wire colors, the Minion motor must run with a special config settable in Thrifty Config. This will allow teams to run either REV motors or CTRE motors without changing phase wires.
Thrifty Config has a dropdown allowing users to select between the default REV option (for Neo-type motors) and the CTRE (Minion) mode.
You can also change motor types after initialization:
⚠️ Important: Always verify your motor type matches your physical hardware before running your robot.
The user can specify the amount of time the motor should take to ramp up to full power and to ramp down to idle. The maximum amount of time is 10 seconds.
To set the motor to ramp up to 100% from idle over a period of 2s, use the following method.
To set the motor to ramp up to idle from 100% output over a period of 3.75s, use the following method.
Sets the time to ramp up in seconds from 0 to 10. For example, an input of 0.5 will ramp the motor from idle to 100% over the course of 0.5 seconds.
Parameters:
rampUp
The ramp up time.
Sets the time to ramp down in seconds from 0 to 10. For example, an input of 0.5 will ramp the motor from 100% to idle over the course of 0.5 seconds.
Parameters:
rampDown
The ramp up time.
Hard limits can be configured by connecting limit switches to the Thrifty Nova. Call the enableHardLimits
method to enable limit switch hard limits.
Enable the hard limits.
Disable the hard limits.
Enable / disable hard limits.
Parameters:
enable
If hard limits should be enabled.
Hard limits work through physical switches or sensors connected to your motor controller's 10-pin connector. When you hit the switch or trigger the Hall effect sensor at the end of your mechanism's travel, it immediately cuts power to the motor to prevent damage. Think of these as your last line of defense - they're your fail-safe that physically prevents the motor from pushing past its mechanical limits even if your code or soft limits somehow fail. You'll typically wire normally-closed limit switches or Hall effect sensors to these pins, so if a wire gets disconnected, the motor will safely stop instead of potentially running past its limits. These are especially important on mechanisms like elevators or arms where running past the end of travel could cause serious damage.
One configuration that can be easily changed is the direction the motor turns forward. This can be set using the following method, and by providing a boolean for weather or not the motor should be inverted.
Set the inversion status of the motor to be either inverted or not inverted.
Parameters:
inverted
If the motor be inverted or not.
The Thrifty Nova supports follower mode, allowing one motor controller to mirror the behavior of another. This is useful for mechanisms that need multiple synchronized motors, like a drive train or elevator.
To make a motor follow another:
Followers can be configured like any other motor. Here's a typical setup for a drive train:
The follower will mirror whatever control mode the leader is using (percent output, position, velocity)
Follower updates depend on the fault status frame rate - slower rates mean slower follower updates
A motor can only follow one leader at a time
If you call other control methods (like setPercent()
) on a follower, it will stop following
Like other configurations, you can check if setting up follower mode failed:
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.
First you must set the soft limits, the following constrains the motor between -18 and 24 encoder ticks.
This example constrains the motor between 3 and 9 encoder ticks.
Then one must physically enable the soft limits to take effect.
You can also turn off soft limts, but still leave the limits configured on the motor controller.
Sets the soft limits that the motor will not cross if soft limits are enabled.
Parameters:
revLimit
The reverse position the motor will not go past.
fwdLimit
The forward position the motor will not go past.
Enable / disable soft limits.
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.
The Thrifty Nova provides for the user to define a maximum current, where the motor will not draw any more power once a certain current threshold is crossed on either the stator or supply side.
Stator: Uses the total draw of phase a, b, and c from the motor side.
Supply: Uses the draw from the supply side
Think about current limits as protective boundaries - kind of like having both a speed limit and a weight limit on a bridge. Your motor controller needs two different types of these limits because of how brushless motors work.
When your motor is running slowly or just starting up, something interesting happens - the windings inside the motor (stator) can actually draw more current than what's coming from your battery. This gets especially important in pushing matches or when your motor is nearly stalled. Imagine your robot is in a head-to-head pushing match - your motors are working super hard but barely moving. In these near-stall conditions, they're pulling tons of current through their windings while hardly drawing anything from the battery. Without both limits in place, you could easily cook your motors without even realizing it. That's why we need both a supply current limit (protecting your battery) and a stator current limit (protecting the motor's insides). This dual protection becomes crucial when you're running at those really low speeds or in tough pushing situations.
For the Neo 550 - since it's one of the smaller motors in the family - you'll want to keep those current limits between 25-30 amps. Yes, your controller might be set to 40 amps by default, but that's too much for these little guys. The full-size Neo motors are different - they can handle brief bursts up to 60 amps, but you'll still want to keep them around 40 amps for normal match use to avoid burning them up.
To set a limit of 24 amps on stator side.
To set a limit of 60 amps on stator side.
To set a limit of 50 amps on supply side.
Set the max current the motor can draw in amps. Motor speed will be capped to satisfy the max current. Also set what current reading is used for limiting calculations, between:
Parameters:
currentType
The current reading used for limiting calculations.
maxCurrent
The max current.
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 conversions.
The Thrifty Nova supports three types of encoders, each with different capabilities:
INTERNAL
42 counts/rev
✓
✓
Built into NEO motors
QUAD
4096 counts/rev
✓
✓
External quadrature encoder
ABS
4096 counts/rev
✓
X
External absolute encoder
First, tell the motor which encoder type you're using:
The following example sets the encoder to be currently at the zero position.
And this example sets the current position to read as 21 encoder units.
setEncoderPosition
Sets the encoder position.
Parameters:
position The position to set the encoder to.