Typedefs | |
| typedef enum _uc_mode_type | UNICODER_MODE |
| typedef enum _uc_encoder_type | ENCODER_TYPE |
Enumerations | |
| enum | _uc_mode_type { MD_I2C = 0x01, MD_RS232 = 0x02, MD_ASCII_HEX = 0x04, MD_SHORT_RET = 0x08, MD_INVERT_SERVO = 0x10, MD_FILTER_PERIOD = 0x20 } |
| Unicoder Mode Values. More... | |
| enum | _uc_encoder_type { ET_DEFAULT, ET_QUADRATURE, ET_STEPDIR, ET_COMMUTATION } |
| Encoder Types. More... | |
Functions | |
| NDICMDC_API BOOL | NdiCmd_UCSetConstant (int handle, int addr, BYTE const_value) |
| Set Constant. | |
| NDICMDC_API BOOL | NdiCmd_UCGetConstant (int handle, int addr, BYTE *const_value) |
| Get. | |
| NDICMDC_API BOOL | NdiCmd_SetMode (int handle, BYTE mode) |
| Set Mode. | |
| NDICMDC_API BOOL | NdiCmd_GetMode (int handle, BYTE *mode) |
| Get Mode. | |
| NDICMDC_API BOOL | NdiCmd_GetEncoderMode (int handle, ENCODER_TYPE *enc_type, int *num_bits, BOOL *wide_index, BOOL *ccw) |
| Get Encoder Mode. | |
| NDICMDC_API BOOL | NdiCmd_SetEncoderMode (int handle, ENCODER_TYPE enc_type, int num_bits, BOOL wide_index, BOOL ccw) |
| Set Encoder Mode. | |
| NDICMDC_API BOOL | NdiCmd_GetZeroPosition (int handle, int *angle) |
| Get Zero Position. | |
| NDICMDC_API BOOL | NdiCmd_SetZeroPosition (int handle, int angle) |
| Set Zero Position. | |
| NDICMDC_API BOOL | NdiCmd_GetPeriod (int handle, int *period) |
| Get Period. | |
| NDICMDC_API BOOL | NdiCmd_GetTime (int handle, int *the_time) |
| Get Time. | |
| NDICMDC_API BOOL | NdiCmd_SetTime (int handle, int the_time) |
| Set Time. | |
| NDICMDC_API BOOL | NdiCmd_GetServo (int handle, int *speed) |
| Get Servo. | |
| NDICMDC_API BOOL | NdiCmd_SetServo (int handle, int speed) |
| Set Servo. | |
| NDICMDC_API BOOL | NdiCmd_UCCoast (int handle) |
| Unicoder Coast. | |
| NDICMDC_API BOOL | NdiCmd_SetCenterPosition (int handle, int center_pos) |
| Set Servo Center Position. | |
| NDICMDC_API BOOL | NdiCmd_GetCenterPosition (int handle, int *center_pos) |
| Get Servo Center Position. | |
| NDICMDC_API BOOL | NdiCmd_UCStoreParameters (int handle) |
| Unicoder Store Parameters. | |
| enum _uc_encoder_type |
Encoder Types.
These values are passed to NdiCmd_SetEncoderMode().
| enum _uc_mode_type |
Unicoder Mode Values.
These values can be bitwise ORed together to form a mode BYTE.
| NDICMDC_API BOOL NdiCmd_GetCenterPosition | ( | int | handle, | |
| int * | center_pos | |||
| ) |
Get Servo Center Position.
This function retrieves the pulsewidth of the servo output pulse's center or zero position. It is 3067 by default, which corresponds to 1.5ms.
| handle | an integer WheelCommander handle | |
| center_pos | a pointer to an integer specifying pulsewidth in multiples of 489ns |
| NDICMDC_API BOOL NdiCmd_GetEncoderMode | ( | int | handle, | |
| ENCODER_TYPE * | enc_type, | |||
| int * | num_bits, | |||
| BOOL * | wide_index, | |||
| BOOL * | ccw | |||
| ) |
Get Encoder Mode.
This function queries the Unicoder for its current operating mode. This includes the nature of its incremental output signals, the number of bits of resolution, the size of the index pulse, and the direction of rotation.
| handle | an integer Unicoder handle | |
| enc_type | a member of the ENCODER_TYPE enumeration | |
| num_bits | an integer representing the resolution | |
| wide_index | a BOOL indicating that the index pulse is 3 wide rather than 1 | |
| ccw | a BOOL indicating that the angle increases in a counter-clockwise direction when true |
| NDICMDC_API BOOL NdiCmd_GetMode | ( | int | handle, | |
| BYTE * | mode | |||
| ) |
Get Mode.
This function retrieves the current operating mode of the Unicoder encoder.
| handle | an integer Unicoder handle | |
| mode | a BYTE containing an ORing of UNICODER_MODE values, containing the mode returned |
| NDICMDC_API BOOL NdiCmd_GetPeriod | ( | int | handle, | |
| int * | period | |||
| ) |
Get Period.
This function returns the elapsed time between the previous two transitions of the encoder's incremental signals. The unit of time is the Unicoder's own internal timebase, nominally in multiples of 489ns (+/- 2%).
| handle | an integer Unicoder handle | |
| period | an integer indicating the elapsed time between encoder transitions |
| NDICMDC_API BOOL NdiCmd_GetServo | ( | int | handle, | |
| int * | speed | |||
| ) |
Get Servo.
This function returns the current pulsewidth deviation, or 0x8000 if RC servo pulses are currently turned off.
| handle | an integer WheelCommander handle | |
| speed | an integer specifying pulsewidth delta from 1.5ms |
| NDICMDC_API BOOL NdiCmd_GetTime | ( | int | handle, | |
| int * | the_time | |||
| ) |
Get Time.
This function returns the current system time, in multiples of 489ns. This is useful to calibrate velocity and other time-dependent measurements, using the main robot controller's more accurate crystal-controlled clock. The clock inside the Unicoder encoder is accurate to +/- 2%, so velocity and period measurements are likewise limited in accuracy.
| handle | an integer Unicoder handle | |
| the_time | an integer indicating the system time in multiples of 489ns. |
| NDICMDC_API BOOL NdiCmd_GetZeroPosition | ( | int | handle, | |
| int * | angle | |||
| ) |
Get Zero Position.
This function queries the Unicoder for the angle relative to the factory default at which the index pulse and user angle origin begin.
| handle | an integer Unicoder handle | |
| angle | an integer representing the number of encoder positions from 0 to 1023 (0 is the default) |
| NDICMDC_API BOOL NdiCmd_SetCenterPosition | ( | int | handle, | |
| int | center_pos | |||
| ) |
Set Servo Center Position.
This function sets the pulsewidth of the servo output pulse's center or zero position. It is 3067 by default, which corresponds to 1.5ms.
| handle | an integer WheelCommander handle | |
| center_pos | an integer specifying pulsewidth in multiples of 489ns |
| NDICMDC_API BOOL NdiCmd_SetEncoderMode | ( | int | handle, | |
| ENCODER_TYPE | enc_type, | |||
| int | num_bits, | |||
| BOOL | wide_index, | |||
| BOOL | ccw | |||
| ) |
Set Encoder Mode.
This function allows you to change the Unicoder's current operating mode. This includes the nature of its incremental output signals, the number of bits of resolution, the size of the index pulse, and the direction of rotation.
| handle | an integer Unicoder handle | |
| enc_type | a member of the ENCODER_TYPE enumeration | |
| num_bits | an integer representing the resolution | |
| wide_index | a BOOL indicating that the index pulse is 3 wide rather than 1 | |
| ccw | a BOOL indicating that the angle increases in a counter-clockwise direction when true |
| NDICMDC_API BOOL NdiCmd_SetMode | ( | int | handle, | |
| BYTE | mode | |||
| ) |
Set Mode.
This function allows you to change the current operating mode.
| handle | an integer Unicoder handle | |
| mode | a BYTE containing an ORing of UNICODER_MODE values, containing the mode to be set |
| NDICMDC_API BOOL NdiCmd_SetServo | ( | int | handle, | |
| int | speed | |||
| ) |
Set Servo.
This function enables production of an RC servo control pulse on TP2, with the specified deviation in multiples of 489ns from the center pulsewidth of 1.5ms. In this mode, the encoder should be set to sign/magnitude mode, as the ChB/DIR line is shared with TP2 through a 1K resistor, and is sampled only on edges of the servo control pulse. Useful values are in the range of +/- 2048, corresponding to +/- 1ms.
| handle | an integer WheelCommander handle | |
| speed | an integer specifying pulsewidth delta from 1.5ms |
| NDICMDC_API BOOL NdiCmd_SetTime | ( | int | handle, | |
| int | the_time | |||
| ) |
Set Time.
This function allows you to change the current system time, in multiples of 489ns.
| handle | an integer Unicoder handle | |
| the_time | an integer indicating the system time in multiples of 489ns. |
| NDICMDC_API BOOL NdiCmd_SetZeroPosition | ( | int | handle, | |
| int | angle | |||
| ) |
Set Zero Position.
This function allows you to change the angle of the Unicoder's index pulse and the amount to shift the user-accessible angle by.
| handle | an integer Unicoder handle | |
| angle | an integer representing the number of encoder positions from 0 to 1023 (0 is the default) |
| NDICMDC_API BOOL NdiCmd_UCCoast | ( | int | handle | ) |
Unicoder Coast.
This function stops any current motion, and sets the servo into low power mode. It is now safe to use modes other than sign/magnitude.
| handle | an integer WheelCommander handle |
| NDICMDC_API BOOL NdiCmd_UCGetConstant | ( | int | handle, | |
| int | addr, | |||
| BYTE * | const_value | |||
| ) |
Get.
This function retrieves a byte from the flash constants area.
| handle | an integer Unicoder handle | |
| addr | an integer address in the flash | |
| const_value | a pointer to a BYTE, containing the value read |
| NDICMDC_API BOOL NdiCmd_UCSetConstant | ( | int | handle, | |
| int | addr, | |||
| BYTE | const_value | |||
| ) |
Set Constant.
This function lets you directly access the constants stored in Flash in the Unicoder. This is for advanced users only. The functions NdiCmd_GetMode(), NdiCmd_GetI2CAddr(), and so forth, are easier to use.
| handle | an integer Unicoder handle | |
| addr | an integer indicating the address in the flash constants area | |
| const_value | a BYTE indicating the value to write to addr |
| NDICMDC_API BOOL NdiCmd_UCStoreParameters | ( | int | handle | ) |
Unicoder Store Parameters.
This function writes any user-modifiable constants to flash.
| handle | an integer WheelCommander handle |
1.5.5