Search…
Configuration Parameters
Below is a list of all the configurable parameters within the SPARK MAX. Parameters can be set through the CAN or USB interfaces. The parameters are saved in a different region of memory from the device firmware and persist through a firmware update.
Name
ID
Type
Default
Description
kCanID
0
uint
0
CAN ID This parameter persists through a normal firmware update.
kInputMode
1
Input Mode
0
Input mode, this parameter is read only and the input mode is detected by the firmware automatically. 0 - PWM 1 - CAN 2 - USB
kMotorType
2
Motor Type
BRUSHLESS
Motor type: 0 - Brushed 1 - Brushless This parameter persists through a normal firmware update.
Reserved
3
-
Reserved
kSensorType
4
Sensor Type
HALL_EFFECT
Sensor type: 0 - No Sensor 1 - Hall Sensor 2 - Encoder This parameter persists through a normal firmware update.
kCtrlType
5
Ctrl Type
CTRL_DUTY_CYCLE
Control Type, this is a read only parameter of the currently active control type. The control type is changed by calling the correct API. 0 - Duty Cycle 1 - Velocity 2 - Voltage 3 - Position
kIdleMode
6
Idle Mode
IDLE_COAST
State of the half bridge when the motor controller commands zero output or is disabled. 0 - Coast 1 - Brake This parameter persists through a normal firmware update.
kInputDeadband
7
float32
%0.05
Percent of the input which results in zero output for PWM mode. This parameter persists through a normal firmware update.
Reserved
8
-
-
Reserved
Reserved
9
-
-
Reserved
kPolePairs
10
uint
7
Number of pole pairs for the brushless motor. This is the number of poles/2 and can be determined by either counting the number of magnets or counting the number of windings and dividing by 3. This is an important term for speed regulation to properly calculate the speed.
kCurrentChop
11
float32
115/Amps
If the half bridge detects this current limit, it will disable the motor driver for a fixed amount of time set by kCurrentChopCycles. This is a low sophistication 'current control'. Set to 0 to disable. The max value is 125.
kCurrentChopCycles
12
uint
0
Number of PWM Cycles for the h-bridge to be off in the case that the current limit is set. Min = 1, multiples of PWM period (50μs). During this time the current will be recirculating through the low side MOSFETs, so instead of 'freewheeling' the diodes, the bridge will be in brake mode during this time.
kP_0
13
float32
0
Proportional gain constant for gain slot 0.
kI_0
14
float32
0
Integral gain constant for gain slot 0.
kD_0
15
float32
0
Derivative gain constant for gain slot 0.
kF_0
16
float32
0
Feed Forward gain constant for gain slot 0.
kIZone_0
17
float32
0
Integrator zone constant for gain slot 0. The PIDF loop integrator will only accumulate while the setpoint is within IZone of the target.
kDFilter_0
18
float32
0
PIDF derivative filter constant for gain slot 0.
Export as PDF
Copy link