#include <motor_driver_interface.h>
Public Member Functions | |
virtual int | activate_limits (int action)=0 |
Activates/Deactivates the driver Limits. If the limits aren't activated the driver will NOT respect the Maximum or Minimum positions. | |
virtual int | calibrate (int limit)=0 |
starts the calibration sequence of the drive | |
virtual int | disable_driver ()=0 |
Disables the driver. | |
virtual int | enable_driver ()=0 |
Enables the driver. | |
virtual int | get_config (driverConf_t *dc)=0 |
Function that gets the current driver configuration as is stored in the flash memory of the driver and writes it in a driverConf_t type format. | |
virtual int | get_cur_lim ()=0 |
get the continous current limit (CCL) in mA. | |
virtual int | get_instant_current (int *current)=0 |
asks for the instant velocity from sensor data of the driver. | |
virtual int | get_instant_pos (long int *positon)=0 |
asks for the instant position from sensor data of the driver. | |
virtual int | get_instant_vel (long int *velocity)=0 |
asks for the instant velocity from sensor data of the driver. | |
virtual long int | get_max_acc ()=0 |
returns the maximum acceleration allowed by the driver. To set this value see | |
virtual long int | get_max_dec ()=0 |
returns the maximum decceleration allowed by the driver. To set this value see | |
virtual long int | get_max_pos ()=0 |
returns the maximum position allowed by the driver. To set this value see | |
virtual long int | get_max_vel ()=0 |
Returns the maximum speed allowed by the driver which is set with setDriverMaxVel() function. | |
virtual long int | get_min_pos ()=0 |
This function reads from the driver min position from its flash memory. | |
virtual int | get_peak_cur_lim ()=0 |
get the Peak Current Limit (PCL) in mA. | |
virtual int | get_sensor (driverSensor_t *sensor)=0 |
asks for sensor data of the driver | |
virtual int | get_status (driverStatus_t *drvStatus)=0 |
Asks to the driver its current status. | |
virtual int | init (int baudrate, char *dev, char *sem)=0 |
high level functions | |
MotorDriverInterface () | |
Constructor. | |
virtual int | move_abs_pos (long int pos)=0 |
Sends to the driver the order to move to an absolute position in pulses. | |
virtual int | move_rel_pos (long int pos)=0 |
Sends to the driver the order to move to a relative position in pulses. | |
virtual int | move_vel (long int vel)=0 |
Sends to the driver the order to move at a determined speed (in rpm) | |
virtual int | save_to_flash ()=0 |
Save current configuartion params to FLASH memory of the drive, so the nest time the drive is turned on it loads thas configuration. WARNING!!! It should not be used more than 10,000 times because the FLASH memory could get damaged!!! | |
virtual int | set_baudrate (int baud)=0 |
tells to the driver at which baudrate we want to operate | |
virtual int | set_config (driverConf_t dc)=0 |
Function that configures the driver from a driverConf_t type. | |
virtual int | set_cur_lim (int cl)=0 |
loads continous current limit | |
virtual int | set_home_position (long int home)=0 |
Sets the current positon as the given value. NOTE: Use only during the calibration phase. This function sends to the driver the Home command. The home commands tells to the driver which is the current position. For example If we send home = 0 we are telling to the driver that the current position is 0 position (and it should used as a reference). | |
virtual int | set_max_acc (long int maxAcc)=0 |
sets the maximum acceleration allowed by the driver in revolutions/s^2 | |
virtual int | set_max_dec (long int maxDec)=0 |
sets the maximum deceleration allowed by the driver in revolutions/s^2 | |
virtual int | set_max_pos (long int maxPos)=0 |
Sets the maximum absolute position in pulses. | |
virtual int | set_max_vel (long int maxVel)=0 |
Sets the maximum speed allowed by the driver in rpm. | |
virtual int | set_min_pos (long int minPos)=0 |
Sets the minimum absolute position in pulses. | |
virtual int | set_peak_cur_lim (int pcl)=0 |
loads peak current limit | |
virtual | ~MotorDriverInterface () |
Abstract destructor. |
Definition at line 29 of file motor_driver_interface.h.
MotorDriverInterface::MotorDriverInterface | ( | ) | [inline] |
Constructor.
Definition at line 34 of file motor_driver_interface.h.
virtual MotorDriverInterface::~MotorDriverInterface | ( | ) | [inline, virtual] |
Abstract destructor.
Definition at line 41 of file motor_driver_interface.h.
virtual int MotorDriverInterface::activate_limits | ( | int | action | ) | [pure virtual] |
Activates/Deactivates the driver Limits. If the limits aren't activated the driver will NOT respect the Maximum or Minimum positions.
action | it only has two allowed values: ACTIVATE to activate de driver or DEACTIVATE to disable de driver |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::calibrate | ( | int | limit | ) | [pure virtual] |
starts the calibration sequence of the drive
limit | sensor position in pulses measured from the desired 0 position |
currentLimit | max current the motor is not allowed to exceed (in mA) This limit is directly related to torque of the motor. |
calibrationSpeed | The speed of the motor during the calibration |
timeOut | maximum time (in milli seconds) to perform the calibration. If this time is exceeded the function will return an error. |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::disable_driver | ( | ) | [pure virtual] |
Disables the driver.
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::enable_driver | ( | ) | [pure virtual] |
Enables the driver.
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::get_config | ( | driverConf_t * | dc | ) | [pure virtual] |
Function that gets the current driver configuration as is stored in the flash memory of the driver and writes it in a driverConf_t type format.
dc | is the driverConf_t type where the driver configuration is stored |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::get_cur_lim | ( | ) | [pure virtual] |
get the continous current limit (CCL) in mA.
WARNING: Untested Function
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::get_instant_current | ( | int * | current | ) | [pure virtual] |
asks for the instant velocity from sensor data of the driver.
current | is where the instant current data from the driver will be stored. The units from the driver are [rpm] |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::get_instant_pos | ( | long int * | positon | ) | [pure virtual] |
asks for the instant position from sensor data of the driver.
position | is a pointer pointing to where the position sensor data from the driver will be stored. The units from the driver are in [pulses] |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::get_instant_vel | ( | long int * | velocity | ) | [pure virtual] |
asks for the instant velocity from sensor data of the driver.
velocity | is where the velocity sensor data from the driver will be stored. The units from the driver are [rpm] |
Implemented in Mcdc3006s.
virtual long int MotorDriverInterface::get_max_acc | ( | ) | [pure virtual] |
returns the maximum acceleration allowed by the driver. To set this value see
Implemented in Mcdc3006s.
virtual long int MotorDriverInterface::get_max_dec | ( | ) | [pure virtual] |
returns the maximum decceleration allowed by the driver. To set this value see
Implemented in Mcdc3006s.
virtual long int MotorDriverInterface::get_max_pos | ( | ) | [pure virtual] |
returns the maximum position allowed by the driver. To set this value see
Implemented in Mcdc3006s.
virtual long int MotorDriverInterface::get_max_vel | ( | ) | [pure virtual] |
Returns the maximum speed allowed by the driver which is set with setDriverMaxVel() function.
Implemented in Mcdc3006s.
virtual long int MotorDriverInterface::get_min_pos | ( | ) | [pure virtual] |
This function reads from the driver min position from its flash memory.
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::get_peak_cur_lim | ( | ) | [pure virtual] |
get the Peak Current Limit (PCL) in mA.
WARNING: Untested Function
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::get_sensor | ( | driverSensor_t * | sensor | ) | [pure virtual] |
asks for sensor data of the driver
sensor | is the sensor structure where we want to store the sensor data from the driver. |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::get_status | ( | driverStatus_t * | drvStatus | ) | [pure virtual] |
Asks to the driver its current status.
drvStatus | is a structure where the current driver status is stored. Each of the parameters of the drvStatus are set to 1 if true or 0 if false |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::init | ( | int | baudrate, |
char * | dev, | ||
char * | sem | ||
) | [pure virtual] |
high level functions
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::move_abs_pos | ( | long int | pos | ) | [pure virtual] |
Sends to the driver the order to move to an absolute position in pulses.
p | absolute position in pulses |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::move_rel_pos | ( | long int | pos | ) | [pure virtual] |
Sends to the driver the order to move to a relative position in pulses.
p | relative position in pulses |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::move_vel | ( | long int | vel | ) | [pure virtual] |
Sends to the driver the order to move at a determined speed (in rpm)
v | velocity in rpm (revolutions per minute) |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::save_to_flash | ( | ) | [pure virtual] |
Save current configuartion params to FLASH memory of the drive, so the nest time the drive is turned on it loads thas configuration. WARNING!!! It should not be used more than 10,000 times because the FLASH memory could get damaged!!!
The EEPSAV command always responds with the character string “EEPROM writing done” after successful saving of the current settings in the data Flash memory, or with “Flash defect”, if the save has failed.
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::set_baudrate | ( | int | baud | ) | [pure virtual] |
tells to the driver at which baudrate we want to operate
baud | is the baudrate of the communication. |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::set_config | ( | driverConf_t | dc | ) | [pure virtual] |
Function that configures the driver from a driverConf_t type.
dc | is where dc configuration is read in order to write it into the driver |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::set_cur_lim | ( | int | cl | ) | [pure virtual] |
loads continous current limit
cl | current limit in mA Range = [0 - 12000mA] |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::set_home_position | ( | long int | home | ) | [pure virtual] |
Sets the current positon as the given value. NOTE: Use only during the calibration phase. This function sends to the driver the Home command. The home commands tells to the driver which is the current position. For example If we send home = 0 we are telling to the driver that the current position is 0 position (and it should used as a reference).
home | is the given position in pulses. This parameter specifies which is the current position. |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::set_max_acc | ( | long int | maxAcc | ) | [pure virtual] |
sets the maximum acceleration allowed by the driver in revolutions/s^2
maxAcc | maximum acceleration in revolutions/s^2 |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::set_max_dec | ( | long int | maxDec | ) | [pure virtual] |
sets the maximum deceleration allowed by the driver in revolutions/s^2
maxDec | maximum deceleration in r/sec² |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::set_max_pos | ( | long int | maxPos | ) | [pure virtual] |
Sets the maximum absolute position in pulses.
maxPos | in pulses |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::set_max_vel | ( | long int | maxVel | ) | [pure virtual] |
Sets the maximum speed allowed by the driver in rpm.
maxVel | in r.p.m. |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::set_min_pos | ( | long int | minPos | ) | [pure virtual] |
Sets the minimum absolute position in pulses.
minPos | is the minimum absolute position in pulses |
Implemented in Mcdc3006s.
virtual int MotorDriverInterface::set_peak_cur_lim | ( | int | pcl | ) | [pure virtual] |
loads peak current limit
pcl | current limit in mA Range = [0 - 12000mA] |
Implemented in Mcdc3006s.