C/C++ API Reference
Driver.Driver()
Driver::Driver(uint32_t node_id, Interface *interface)
Description
Construct a new Driver object.
Parameters
| Datatype | Variable | Description |
|---|
uint32_t | node_id | CAN Node ID of the driver |
Interface * | interface | Initialised CAN Interface object for the interface to which the driver is connected |
Driver.clearDriverErrors()
ret_status_t Driver::clearDriverErrors()
Description
Clear driver errors.
Returns
| Datatype | Description |
|---|
ret_status_t | Return Status |
ret_status_t Driver::configureMotorEncoder(uint8_t encoder_type, int32_t resolution_param=4096, bool use_index=true)
Description
Configure motor side encoder. Set it to onboard absolute, external incremental or external absolute. Output side and motor side encoders can't be set to same.
encoder_type value | Encoder Type | Description |
|---|
| 0 | TYPE_NONE | Using no encoder |
| 1 | TYPE_ONBOARD_ENCODER | Using onboard absolute encoder (Tested) |
| 2 | TYPE_INCREMENTAL | Using External incremental Encoder (Tested) |
| 3 | TYPE_SPI_ABS_AMS | Using AS5047P absolute encoder from AMS (Tested) |
| 4 | TYPE_SPI_ABS_MAXXX | Using MAXXX series absolute encoders from Monolith Power Systems (Tested with MA732, MA702, MA600) |
| 5 | TYPE_SPI_ABS_MUXXX | Using MU series absolute encoders from iC-Haus (Tested with MU150, MU200) |
| 6 | TYPE_SPI_ABS_CUI | Using AMT 203 absolute encoder from CUI (Tested) |
| 7 | TYPE_SPI_ABS_AEAT | Using AEAT absolute encoders from Broadcomm (To be tested) |
| 8 | TYPE_SPI_ABS_RLS | Using RLS absolute encoders from Renishaw (To be tested) |
Parameters
| Datatype | Variable | Description |
|---|
uint8_t | encoder_type | type of encoder used |
int32_t | resolution_param | CPR value of the encoder in case of an incremental encoder or resolution value in 2^bits in case of absolute encoder (this parameter is ignored in the case of using onboard absolute encoder) resolution_param is set to 4096 by default. |
bool | use_index | flag to set whether to use the index pin for incremental encoder or not. Valid only when an incremental encoder is used. use_index is set to true by default. |
Returns
| Datatype | Description |
|---|
ret_status_t | Return Status |
ret_status_t Driver::configureOutputEncoder(uint8_t encoder_type, int32_t resolution_param=4096, bool use_index=true)
Description
Configure Output side encoder. Set it to onboard absolute, external incremental or external absolute. Output side and motor side encoders can't be set to same.
encoder_type value | Encoder Type | Description |
|---|
| 0 | TYPE_NONE | Using no encoder |
| 1 | TYPE_ONBOARD_ENCODER | Using onboard absolute encoder (Tested) |
| 2 | TYPE_INCREMENTAL | Using External incremental Encoder (Tested) |
| 3 | TYPE_SPI_ABS_AMS | Using AS5047P absolute encoder from AMS (Tested) |
| 4 | TYPE_SPI_ABS_MAXXX | Using MAXXX series absolute encoders from Monolith Power Systems (Tested with MA732, MA702, MA600) |
| 5 | TYPE_SPI_ABS_MUXXX | Using MU series absolute encoders from iC-Haus (Tested with MU150, MU200) |
| 6 | TYPE_SPI_ABS_CUI | Using AMT 203 absolute encoder from CUI (Tested) |
| 7 | TYPE_SPI_ABS_AEAT | Using AEAT absolute encoders from Broadcomm (To be tested) |
| 8 | TYPE_SPI_ABS_RLS | Using RLS absolute encoders from Renishaw (To be tested) |
Parameters
| Datatype | Variable | Description |
|---|
uint8_t | encoder_type | type of encoder used |
int32_t | resolution_param | CPR value of the encoder in case of an incremental encoder or resolution value in 2^bits in case of absolute encoder (this parameter is ignored in the case of using onboard absolute encoder) resolution_param is set to 4096 by default. |
bool | use_index | flag to set whether to use the index pin for incremental encoder or not. Valid only when an incremental encoder is used. use_index is set to true by default. |
Returns
| Datatype | Description |
|---|
ret_status_t | Return Status |
Driver.disableBrakeResistor()
ret_status_t Driver::disableBrakeResistor()
Description
Disable brake resistor and configure it.
Returns
| Datatype | Description |
|---|
ret_status_t | Return Status |
Driver.disableMotorThermalLimit()
ret_status_t Driver::disableMotorThermalLimit()
Description
Disable Motor based Thermal limit.
Returns
| Datatype | Description |
|---|
ret_status_t | Return Status |
Driver.disableOutputEncoder()
ret_status_t Driver::disableOutputEncoder()
Description
Disable Output Encoder.
Returns
| Datatype | Description |
|---|
ret_status_t | Return Status |
Driver.emergencyStop()
ret_status_t Driver::emergencyStop()
Description
Function to issue an emergency stop to the device which halts the driver and sets the error flag; Since the error flag is set the driver doesn't respond to any other commands, until the driver is rebooted.
Returns
| Datatype | Description |
|---|
ret_status_t | Return Status |
Driver.enableBrakeResistor()
ret_status_t Driver::enableBrakeResistor(float brake_resistance_value)
Description
Enable brake resistor and configure it.
Parameters
| Datatype | Variable | Description |
|---|
float | brake_resistance_value | brake resistance value |
Returns
| Datatype | Description |
|---|
ret_status_t | Return Status |
Driver.enableMotorThermalLimit()
ret_status_t Driver::enableMotorThermalLimit(uint16_t upper_limit)
Description
Enable Motor based Thermal limit. A thermistor is used to measure motor temperature and start limiting the motor current once the temperature starts to approach the upper limit. The current limiting starts when the difference between the current temperature & the upper limit reaches 20 degrees celsius. The acutators will shut themselves off in case the temperature reaches the upper limit.
Parameters
| Datatype | Variable | Description |
|---|
uint16_t | upper_limit | Shutdown temperature at which the driver will stop. |
Returns
| Datatype | Description |
|---|
ret_status_t | Return Status |
Driver.enterDFUMode()
ret_status_t Driver::enterDFUMode()
Description
Enter in DFU Mode.
Returns
| Datatype | Description |
|---|
ret_status_t | ret_status_t |
Driver.eraseConfigurations()
ret_status_t Driver::eraseConfigurations()
Description
Erase Configuration of the driver.
Returns
| Datatype | Description |
|---|
ret_status_t | Return Status |
Driver.flash()
ret_status_t Driver::flash(std::string firmware_path, bool is_in_dfu_mode=false)
Description
Function to flash a firmware onto the device.
Parameters
| Datatype | Variable | Description |
|---|
std::string | firmware_path | path to firmware file |
bool | is_in_dfu_mode | flag to set if the driver is already in dfu mode |
Returns
| Datatype | Description |
|---|
ret_status_t | ret_status_t |
Driver.getBrakeCurrent()
ret_status_t Driver::getBrakeCurrent(float *brake_current)
Description
Function to get the brake current of the driver.
Parameters