public class MotorDiagnostic
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
CommandDbnc_loops
Minimum number of loops above the command threshold to ensure the motor should be rotating
|
double |
CommandThresh
Minimum command to ensure the motor should be rotating
|
int |
MaxCurrentDbnc_loops
Minimum time above current threshold before declaring the motor "over-current"
|
double |
MaxCurrentThresh_A
Maximum current the motor should draw in steady-state
|
double |
MinCurrentThresh_A
Minimum current the motor should draw in steady-state
|
boolean |
motorOverCurrent
OverCurrent diagnostic indicates we are commanding the motor to turn, but there is too much
current being drawn.
|
boolean |
motorSpeedLost
SpeedLost diagnostic indicates rotation is commanded, current draw is above minimum and below
maximum, but no speed is seen at the sensor.
|
boolean |
motorStalled
Stalled diagnostic indicates motor should be turning, is not, and is drawing too much
current.
|
int |
SpeedDbnc_loops
Minimum number of loops above the speed threshold to declare the motor "rotating"
|
double |
SpeedThresh_RPM
Minimum speed to declare the motor "rotating"
|
Constructor and Description |
---|
MotorDiagnostic()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
eval(double motorSpeed_RPM,
double currentDraw_A,
double motorCommand)
Call once per periodic loop to determine motor state
|
public boolean motorStalled
public boolean motorOverCurrent
public boolean motorSpeedLost
public double SpeedThresh_RPM
public int SpeedDbnc_loops
public double CommandThresh
public int CommandDbnc_loops
public double MaxCurrentThresh_A
public int MaxCurrentDbnc_loops
public double MinCurrentThresh_A
public void eval(double motorSpeed_RPM, double currentDraw_A, double motorCommand)
motorSpeed_RPM
- The motor's speed in RPM as measured by the encoderscurrentDraw_A
- The motor's present current draw (estimated or measured)motorCommand
- The present motor command (from the joystick or otherise, whatever is
sent to the controller)