CTRE_Phoenix  5.19.4
ctre::phoenix::motorcontrol::can::SlotConfiguration Struct Reference

#include <BaseMotorController.h>

Public Member Functions

std::string toString ()
 
std::string toString (std::string prependString)
 

Public Attributes

double kP
 
double kI
 
double kD
 
double kF
 
double integralZone
 
double allowableClosedloopError
 
double maxIntegralAccumulator
 
double closedLoopPeakOutput
 
int closedLoopPeriod
 

Detailed Description

Configurables available to a slot

Member Function Documentation

◆ toString() [1/2]

std::string ctre::phoenix::motorcontrol::can::SlotConfiguration::toString ( )
inline
Returns
String representation of configs

◆ toString() [2/2]

std::string ctre::phoenix::motorcontrol::can::SlotConfiguration::toString ( std::string  prependString)
inline
Parameters
prependStringString to prepend to configs
Returns
String representation of configs

Member Data Documentation

◆ allowableClosedloopError

double ctre::phoenix::motorcontrol::can::SlotConfiguration::allowableClosedloopError

Allowable closed loop error to neutral (in native units)

◆ closedLoopPeakOutput

double ctre::phoenix::motorcontrol::can::SlotConfiguration::closedLoopPeakOutput

Peak output from closed loop [0,1]

◆ closedLoopPeriod

int ctre::phoenix::motorcontrol::can::SlotConfiguration::closedLoopPeriod

Desired period of closed loop [1,64]ms

◆ integralZone

double ctre::phoenix::motorcontrol::can::SlotConfiguration::integralZone

Integral zone (in native units)

If the (absolute) closed-loop error is outside of this zone, integral accumulator is automatically cleared. This ensures than integral wind up events will stop after the sensor gets far enough from its target.

◆ kD

double ctre::phoenix::motorcontrol::can::SlotConfiguration::kD

D Gain

This is multiplied by derivative error (sensor units per PID loop, typically 1ms). Note the closed loop output interprets a final value of 1023 as full output. So use a gain of '250' to get full output if derr is 4096u (Mag Encoder 1 rotation) per 1000 loops (typ 1 sec)

◆ kF

double ctre::phoenix::motorcontrol::can::SlotConfiguration::kF

F Gain

See documentation for calculation details. If using velocity, motion magic, or motion profile, use (1023 * duty-cycle / sensor-velocity-sensor-units-per-100ms).

◆ kI

double ctre::phoenix::motorcontrol::can::SlotConfiguration::kI

I Gain

This is multiplied by accumulated closed loop error in sensor units every PID Loop. Note the closed loop output interprets a final value of 1023 as full output. So use a gain of '0.00025' to get full output if err is 4096u for 1000 loops (accumulater holds 4,096,000), [which is equivalent to one CTRE mag encoder rotation for 1000 milliseconds].

◆ kP

double ctre::phoenix::motorcontrol::can::SlotConfiguration::kP

P Gain

This is multiplied by closed loop error in sensor units. Note the closed loop output interprets a final value of 1023 as full output. So use a gain of '0.25' to get full output if err is 4096u (Mag Encoder 1 rotation)

◆ maxIntegralAccumulator

double ctre::phoenix::motorcontrol::can::SlotConfiguration::maxIntegralAccumulator

Max integral accumulator (in native units)


The documentation for this struct was generated from the following file: