Public Member Functions |
| | PWM (UINT32 channel) |
| | PWM (UINT8 moduleNumber, UINT32 channel) |
| virtual | ~PWM () |
| virtual void | SetRaw (UINT8 value) |
| virtual UINT8 | GetRaw () |
| void | SetPeriodMultiplier (PeriodMultiplier mult) |
| void | EnableDeadbandElimination (bool eliminateDeadband) |
| void | SetBounds (INT32 max, INT32 deadbandMax, INT32 center, INT32 deadbandMin, INT32 min) |
|
UINT32 | GetChannel () |
|
UINT32 | GetModuleNumber () |
| | SensorBase () |
| virtual | ~SensorBase () |
|
virtual Error & | GetError () |
| | Retrieve the current error. Get the current error information associated with this sensor.
|
|
virtual const Error & | GetError () const |
| virtual void | SetErrnoError (const char *contextMessage, const char *filename, const char *function, UINT32 lineNumber) const |
| | Set error information associated with a C library call that set an error to the "errno" global variable.
|
| virtual void | SetImaqError (int success, const char *contextMessage, const char *filename, const char *function, UINT32 lineNumber) const |
| | Set the current error information associated from the nivision Imaq API.
|
| virtual void | SetError (Error::Code code, const char *contextMessage, const char *filename, const char *function, UINT32 lineNumber) const |
| | Set the current error information associated with this sensor.
|
| virtual void | SetWPIError (const char *errorMessage, const char *contextMessage, const char *filename, const char *function, UINT32 lineNumber) const |
| | Set the current error information associated with this sensor.
|
|
virtual void | CloneError (ErrorBase *rhs) const |
|
virtual void | ClearError () const |
| | Clear the current error information associated with this sensor.
|
| virtual bool | StatusIsFatal () const |
| | Check if the current error code represents a fatal error.
|
Additional Inherited Members |
| static void | DeleteSingletons () |
|
static UINT32 | GetDefaultAnalogModule () |
|
static UINT32 | GetDefaultDigitalModule () |
|
static UINT32 | GetDefaultSolenoidModule () |
| static bool | CheckAnalogModule (UINT8 moduleNumber) |
| static bool | CheckDigitalModule (UINT8 moduleNumber) |
| static bool | CheckPWMModule (UINT8 moduleNumber) |
| static bool | CheckRelayModule (UINT8 moduleNumber) |
| static bool | CheckSolenoidModule (UINT8 moduleNumber) |
| static bool | CheckDigitalChannel (UINT32 channel) |
| static bool | CheckRelayChannel (UINT32 channel) |
| static bool | CheckPWMChannel (UINT32 channel) |
| static bool | CheckAnalogChannel (UINT32 channel) |
| static bool | CheckSolenoidChannel (UINT32 channel) |
|
static const UINT32 | kSystemClockTicksPerMicrosecond = 40 |
|
static const UINT32 | kDigitalChannels = 14 |
|
static const UINT32 | kAnalogChannels = 8 |
|
static const UINT32 | kAnalogModules = 2 |
|
static const UINT32 | kDigitalModules = 2 |
|
static const UINT32 | kSolenoidChannels = 8 |
|
static const UINT32 | kSolenoidModules = 2 |
|
static const UINT32 | kPwmChannels = 10 |
|
static const UINT32 | kRelayChannels = 8 |
|
static const UINT32 | kChassisSlots = 8 |
Class implements the PWM generation in the FPGA.
The values supplied as arguments for PWM outputs range from -1.0 to 1.0. They are mapped to the hardware dependent values, in this case 0-255 for the FPGA. Changes are immediately sent to the FPGA, and the update occurs at the next FPGA cycle. There is no delay.
As of revision 0.1.10 of the FPGA, the FPGA interprets the 0-255 values as follows:
- 255 = full "forward"
- 254 to 129 = linear scaling from "full forward" to "center"
- 128 = center value
- 127 to 2 = linear scaling from "center" to "full reverse"
- 1 = full "reverse"
- 0 = disabled (i.e. PWM output is held low)
Definition at line 32 of file PWM.h.
| const UINT32 PWM::kDefaultPwmPeriod = 774 |
|
staticprotected |
kDefaultPwmPeriod is "ticks" where each tick is 6.525us
- 20ms periods (50 Hz) are the "safest" setting in that this works for all devices
- 20ms periods seem to be desirable for Vex Motors
- 20ms periods are the specified period for HS-322HD servos, but work reliably down to 10.0 ms; starting at about 8.5ms, the servo sometimes hums and get hot; by 5.0ms the hum is nearly continuous
- 10ms periods work well for Victor 884
- 5ms periods allows higher update rates for Luminary Micro Jaguar speed controllers. Due to the shipping firmware on the Jaguar, we can't run the update period less than 5.05 ms.
kDefaultPwmPeriod is the 1x period (5.05 ms). In hardware, the period scaling is implemented as an output squelch to get longer periods for old devices.
Set to 5.05 ms period / 6.525us clock = 774
Definition at line 68 of file PWM.h.