Configuration
Understand compatibility current fields and coast behavior, check configuration results, and save supported settings.
Java 0.33.0 / firmware 2.6.6: zero duty coasts; brake is unsupported. Stator and supply current-limit settings are inactive compatibility fields and do not limit amperes. Supply current is observational; stator current is unavailable. The speed-based duty governor can reduce applied output.
Compatibility current fields
CurrentLimitsConfigs limits = new CurrentLimitsConfigs()
.withStatorCurrentLimit(30)
.withSupplyCurrentLimit(20);
StatusCode result = motor.getConfigurator().apply(limits);
if (!result.isOK()) {
System.err.println(result.describe());
}| Field | Unit | Accepted team range |
|---|---|---|
| StatorCurrentLimit | A | 0.001–70 |
| SupplyCurrentLimit | A | 0.001–45 |
Unset fields are left alone. Do not set unsupported fields merely because a class contains them. In particular, the configurable lower supply-current limit and lower-time fields are refused by this library.
Team settings from Java
Use Java 0.33.0 with firmware 2.6.6. Current settings below are inactive compatibility fields; older firmware implemented different behavior. setSetting(name, value) uses the units in this table and checks the controller's supported range and write readback. getSetting(name) returns the confirmed value, or NaN if it cannot read it. Factory calibration and gate-driver settings stay locked.
| Setting name | Units | Accepted range | After restart |
|---|---|---|---|
| climit / supply | A | 0.001 to 70 / 0.001 to 45 | Save |
| uvlo / uvhi | V | 6 to 20 / 6 to 24; choose low below high | Save |
| twarn / ttrip | °C | 40 to 80; warning must not exceed trip | Save |
| foldstart / folden | °C / 0 or 1 | 40 to 80 / off or on | Save |
| dutymax | Duty fraction | 0.001 to 1 | Save |
| idle_brake | 0 or 1 | Coast only; brake unavailable | Resets |
| vel_kp | Duty per rad/s | 0.00005 to 0.01 | Save |
| vel_ki | Duty per accumulated rad | 0.0002 to 0.05 | Save |
| vel_d_gain | Duty per rad/s² | 0 to 0.001 | Save |
| pos_kp | 1/s | 0 to 500; zero prevents position entry | Save |
| pos_i_gain | 1/s² | 0 to 500; step 0.001 | Save |
| pos_d_gain | Dimensionless | 0 to 10; step 0.00001 | Save |
| vel_slew | rad/s² | 200 to 60000 | Save |
| pos_amax | rad/s² | 1 to 20000 | Resets |
| pos_vmax | rad/s | 1 to 800 | Resets |
| pos_prof | 0 or 1 | Position profile off / on | Resets |
Save means call saveConfigurationConfirmed() after applying and checking settings. Firmware 2.6.6 remains coast-only regardless of a saved neutral setting. Apply configuration while stopped, outside periodic motion code: acknowledged requests can wait for a reply. A multi-field apply is sequential; if a later write fails, earlier accepted writes may already be in effect.
// Example thermal setup; choose settings for the mechanism.
StatusCode result = motor.getConfigurator().setSetting("ttrip", 75);
if (!result.isOK()) {
System.err.println(result.describe());
} else {
double tripC = motor.getConfigurator().getSetting("ttrip");
System.out.println("Trip temperature: " + tripC);
StatusCode saved = motor.saveConfigurationConfirmed();
if (!saved.isOK()) System.err.println(saved.describe());
}setDeviceName(name) accepts 1 to 8 printable ASCII characters without commas and confirms readback; save afterward to retain it. getDeviceName() returns null if unavailable. Set a unique CAN ID in SWYFT Link before constructing the Java motor object with that ID.
What survives a restart?
| Setting | Persistence / action |
|---|---|
| Current limits | Apply the limits and check the result. After saving and restarting, check the values reported by the motor rather than assuming they were restored. |
| Velocity gains | Apply Slot0Configs and check the result; confirmed Save retains the gain fields. |
| Coast / Brake neutral mode | Resets when the motor restarts. Set it again at startup; Save does not keep this setting. |
| Mechanism ratio and wrap | Stored in your robot program, not on the motor. Set it again when the program starts. |
| Software limits | The public configurator refuses them. Implement mechanism travel limits and homing in your robot code. |
// Call after intentionally configuring a stopped controller.
// Do not write flash from a periodic control loop.
StatusCode saved = motor.saveConfigurationConfirmed();
if (!saved.isOK()) System.err.println(saved.describe());Choose neutral behavior
Neutral behavior determines what happens when the controller applies no driving output. Coast lets the shaft turn freely. Product firmware 2.6.6 supports only coast. Selecting BRAKE throws before transmission.
StatusCode result = motor.setNeutralMode(SwyftCyclone.NeutralMode.COAST);
if (!result.isOK()) System.err.println(result.describe());Handling a configuration failure
Range errors, unsupported fields and setting changes attempted while the motor is enabled are different problems. Print StatusCode.describe(), stop the motor when requested, and retry only the intended setting. Read back or inspect the live result before relying on it.