public class PWMController extends PWM implements ControllerModule, ActuatorModule, SpeedController, MotorSafety
PWM.PeriodMultiplier, PWM.PWMChannelInterface.InterfaceType| Modifier and Type | Field and Description |
|---|---|
private boolean |
m_inverted |
protected MotorSafetyHelper |
m_safetyHelper |
m_description, m_disabled, m_table, m_table_listener, PWM_DEFAULT_CENTER, PWM_DEFAULT_PERIOD, PWM_DEFAULT_STEPS_DOWN, PWM_DISABLED_WIDTH, SYSTEM_CLOCK_TICKS_PER_MICROSECm_ifaceType, MAX_ANALOG_IN_CHANNELS, MAX_ANALOG_OUT_CHANNELS, MAX_DIGITAL_CHANNELS, MAX_PWM_CHANNELS, MAX_RELAY_CHANNELSSAFETY_TIMEOUT_DEFAULT, SAFETY_TIMEOUT_LOOSE, SAFETY_TIMEOUT_STRICT| Constructor and Description |
|---|
PWMController(PWM.PWMChannel channel)
Instantiates a new PWM motor controller.
|
PWMController(PWM.PWMChannel channel,
java.lang.String desc)
Instantiates a new PWM motor controller.
|
PWMController(PWM.PWMChannel channel,
java.lang.String desc,
PDP.PowerChannel pwChannel)
Instantiates a new PWM motor controller.
|
PWMController(PWM.PWMChannel channel,
java.lang.String desc,
PDP.PowerChannel pwChannel,
double boundsPosMax,
double boundsPosMin,
double boundsCenter,
double boundsNegMax,
double boundsNegMin,
PWM.PeriodMultiplier multi)
Instantiates a new PWM motor controller.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDescription()
Gets the description.
|
MotorSafetyHelper |
getSafetyHelper()
Return the MotorSafetyHelper object for this MotorSafety Object
|
double |
getSpeed()
Gets the speed.
|
void |
makeSafe()
Make this actuator safe.
|
void |
setInverted(boolean inverted)
Set the inverted state of the speed controller.
|
void |
setSpeed(double speed)
Sets the speed.
|
void |
stopMotor()
Stop/Disable the motor.
|
disableModule, eliminateDeadband, enableModule, free, get, getCenterPWM, getChannel, getChannelName, getChannelNumber, getModuleEnabled, getPosition, getRaw, getSmartDashboardType, getTable, initTable, set, setBounds, setPeriodMultiplier, setPosition, setRaw, setZeroLatch, startLiveWindowMode, stopLiveWindowMode, updateTableallocateMXPPin, checkAnalogInputChannel, checkAnalogOutputChannel, checkDigitalChannel, checkPWMChannel, checkRelayChannel, freeMXPPin, getInterfaceTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdisableModule, enableModule, getModuleEnabledpidWrite, setfeed, getSafetyExpiration, isAlive, isSafetyEnabled, setSafetyEnabled, setSafetyExpirationbindValue, bindValueprotected final MotorSafetyHelper m_safetyHelper
private boolean m_inverted
public PWMController(PWM.PWMChannel channel)
channel - the pwm channel this controller operates onpublic PWMController(PWM.PWMChannel channel, java.lang.String desc)
channel - the pwm channel this controller operates ondesc - the description of this motor controllerpublic PWMController(PWM.PWMChannel channel, java.lang.String desc, PDP.PowerChannel pwChannel)
channel - the pwm channel this controller operates ondesc - the description of this motor controllerpwChannel - The PDP(Power Distribution Panel) Channelpublic PWMController(PWM.PWMChannel channel, java.lang.String desc, PDP.PowerChannel pwChannel, double boundsPosMax, double boundsPosMin, double boundsCenter, double boundsNegMax, double boundsNegMin, PWM.PeriodMultiplier multi)
channel - the pwm channel this controller operates ondesc - the description of this motor controllerpwChannel - The PDP(Power Distribution Panel) ChannelboundsPosMax - The maximum PWM pulse in msboundsPosMin - The maximum of the pulse deadband in msboundsCenter - The center/zero/off pulse width in msboundsNegMax - the mimium of the pulse deadband in msboundsNegMin - The minimum PWM pulse in msmulti - The PeriodMultiplier enumpublic final MotorSafetyHelper getSafetyHelper()
getSafetyHelper in interface MotorSafetypublic final double getSpeed()
getSpeed in interface SpeedSourcegetSpeed in interface SpeedControllergetSpeed in class PWMpublic final void setSpeed(double speed)
public final void setInverted(boolean inverted)
setInverted in interface SpeedControllerinverted - true to invert the values sent to the motor.public final void stopMotor()
stopMotor in interface SpeedControllerstopMotor in interface MotorSafetypublic final java.lang.String getDescription()
getDescription in interface MotorSafetypublic void makeSafe()
makeSafe in interface ActuatorModule