Table of Contents

Class CustomBrushlessMotorConfigs

Namespace
CTRE.Phoenix6.Configs
Assembly
Phoenix6.Hardware.dll

Configs related to using a custom brushless motor that is not formally supported by Talon FXS.

Configs are only used when Motor Arrangement is set to Custom Brushless Motor. Note this feature will only work device is not FRC-Locked.

Users are responsible for ensuring that these configs are accurate to the motor. CTR Electronics is not responsible for damage caused by an incorrect custom motor configuration.
public class CustomBrushlessMotorConfigs : IParentConfiguration, ISerializable, ICloneable
Inheritance
CustomBrushlessMotorConfigs
Implements
Inherited Members

Fields

HallCCWSelect

Optional configuration to correct clockwise versus counter-clockwise rotor spin.

Depending on the mechanical design of the motor, rotor may spin clockwise during positive output when Inverted is set to counterclockwise. This configuration can be toggled so that the rest of the API is canonically true.
  • Default ValueFalse
public bool HallCCWSelect

Field Value

bool

HallDirection

Determines expected Hall direction for rotor velocity signage.

If RotorVelocity is signed opposite of applied voltage, flip this configuration.
  • Default ValueFalse
public bool HallDirection

Field Value

bool

HallDuringAB

Expected Hall Value when motor controller applies A+ and B-.

Hall Values are little endian [CBA]. For example, if halls report: HA=0, HB=0, HC=1, then the Hall Value is 4.
  • Minimum Value0
  • Maximum Value6
  • Default Value0
  • Units
public int HallDuringAB

Field Value

int

HallDuringAC

Expected Hall Value when motor controller applies A+ and C-.

Hall Values are little endian [CBA]. For example, if halls report: HA=0, HB=0, HC=1, then the Hall Value is 4.
  • Minimum Value0
  • Maximum Value6
  • Default Value0
  • Units
public int HallDuringAC

Field Value

int

MotorKv

Kv constant of the connected custom brushless motor. This can usually be determined by consulting the motor manufacturer data sheet.

  • Minimum Value0
  • Maximum Value2047
  • Default Value500
  • UnitsRPM/V
public double MotorKv

Field Value

double

PolePairCount

Number of pole pairs in the connected custom brushless motor (number of poles divided by 2). This can usually be determined by consulting the motor manufacturer data sheet.

For example, if motor has ten poles, then specify five pole pairs.
  • Minimum Value1
  • Maximum Value8
  • Default Value1
  • Units
public int PolePairCount

Field Value

int

Methods

Clone()

Creates a copy of this config group.

public CustomBrushlessMotorConfigs Clone()

Returns

CustomBrushlessMotorConfigs

Deserialize(string)

Deserialize string and put values into this object

public StatusCode Deserialize(string to_deserialize)

Parameters

to_deserialize string

String to deserialize

Returns

StatusCode

OK if deserialization is OK

Serialize()

Serialize this object into a string

public string Serialize()

Returns

string

This object's data serialized into a string

ToString()

Provides the string representation of this object

public override string ToString()

Returns

string

WithHallCCWSelect(bool)

Modifies this configuration's HallCCWSelect parameter and returns itself for method-chaining and easier to use config API.

Optional configuration to correct clockwise versus counter-clockwise rotor spin.

Depending on the mechanical design of the motor, rotor may spin clockwise during positive output when Inverted is set to counterclockwise. This configuration can be toggled so that the rest of the API is canonically true.
  • Default ValueFalse
public CustomBrushlessMotorConfigs WithHallCCWSelect(bool newHallCCWSelect)

Parameters

newHallCCWSelect bool

Parameter to modify

Returns

CustomBrushlessMotorConfigs

Itself

WithHallDirection(bool)

Modifies this configuration's HallDirection parameter and returns itself for method-chaining and easier to use config API.

Determines expected Hall direction for rotor velocity signage.

If RotorVelocity is signed opposite of applied voltage, flip this configuration.
  • Default ValueFalse
public CustomBrushlessMotorConfigs WithHallDirection(bool newHallDirection)

Parameters

newHallDirection bool

Parameter to modify

Returns

CustomBrushlessMotorConfigs

Itself

WithHallDuringAB(int)

Modifies this configuration's HallDuringAB parameter and returns itself for method-chaining and easier to use config API.

Expected Hall Value when motor controller applies A+ and B-.

Hall Values are little endian [CBA]. For example, if halls report: HA=0, HB=0, HC=1, then the Hall Value is 4.
  • Minimum Value0
  • Maximum Value6
  • Default Value0
  • Units
public CustomBrushlessMotorConfigs WithHallDuringAB(int newHallDuringAB)

Parameters

newHallDuringAB int

Parameter to modify

Returns

CustomBrushlessMotorConfigs

Itself

WithHallDuringAC(int)

Modifies this configuration's HallDuringAC parameter and returns itself for method-chaining and easier to use config API.

Expected Hall Value when motor controller applies A+ and C-.

Hall Values are little endian [CBA]. For example, if halls report: HA=0, HB=0, HC=1, then the Hall Value is 4.
  • Minimum Value0
  • Maximum Value6
  • Default Value0
  • Units
public CustomBrushlessMotorConfigs WithHallDuringAC(int newHallDuringAC)

Parameters

newHallDuringAC int

Parameter to modify

Returns

CustomBrushlessMotorConfigs

Itself

WithMotorKv(double)

Modifies this configuration's MotorKv parameter and returns itself for method-chaining and easier to use config API.

Kv constant of the connected custom brushless motor. This can usually be determined by consulting the motor manufacturer data sheet.
  • Minimum Value0
  • Maximum Value2047
  • Default Value500
  • UnitsRPM/V
public CustomBrushlessMotorConfigs WithMotorKv(double newMotorKv)

Parameters

newMotorKv double

Parameter to modify

Returns

CustomBrushlessMotorConfigs

Itself

WithPolePairCount(int)

Modifies this configuration's PolePairCount parameter and returns itself for method-chaining and easier to use config API.

Number of pole pairs in the connected custom brushless motor (number of poles divided by 2). This can usually be determined by consulting the motor manufacturer data sheet.

For example, if motor has ten poles, then specify five pole pairs.
  • Minimum Value1
  • Maximum Value8
  • Default Value1
  • Units
public CustomBrushlessMotorConfigs WithPolePairCount(int newPolePairCount)

Parameters

newPolePairCount int

Parameter to modify

Returns

CustomBrushlessMotorConfigs

Itself