Public Member Functions
MotorDriverInterface Class Reference

#include <motor_driver_interface.h>

Inheritance diagram for MotorDriverInterface:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual int activateLimits (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 calibrateDriver (long int limit, int current_limit, int calibration_speed, int time_out)=0
 starts the calibration sequence of the drive
virtual int disableDriver ()=0
 Disables the driver.
virtual int enableDriver ()=0
 Enables the driver.
virtual int getDriverConf (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 getDriverCurLim ()=0
 get the continous current limit (CCL) in mA.
virtual int getDriverInstantCurrent (int *current)=0
 asks for the instant velocity from sensor data of the driver.
virtual int getDriverInstantPos (long int *positon)=0
 asks for the instant position from sensor data of the driver.
virtual int getDriverInstantVel (long int *velocity)=0
 asks for the instant velocity from sensor data of the driver.
virtual long int getDriverMaxAcc ()=0
 returns the maximum acceleration allowed by the driver. To set this value see
virtual long int getDriverMaxDec ()=0
 returns the maximum decceleration allowed by the driver. To set this value see
virtual long int getDriverMaxPos ()=0
 returns the maximum position allowed by the driver. To set this value see
virtual long int getDriverMaxVel ()=0
 Returns the maximum speed allowed by the driver which is set with setDriverMaxVel() function.
virtual long int getDriverMinPos ()=0
 This function reads from the driver min position from its flash memory.
virtual int getDriverPCurLim ()=0
 get the Peak Current Limit (PCL) in mA.
virtual int getDriverSensor (driverSensor_t *sensor)=0
 asks for sensor data of the driver
virtual int getDriverStatus (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 moveDriverAbsPos (long int pos)=0
 Sends to the driver the order to move to an absolute position in pulses.
virtual int moveDriverRelPos (long int pos)=0
 Sends to the driver the order to move to a relative position in pulses.
virtual int moveDriverVel (long int vel)=0
 Sends to the driver the order to move at a determined speed (in rpm)
virtual int saveToFlash ()=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 setDriverBaud (int baud)=0
 tells to the driver at which baudrate we want to operate
virtual int setDriverConf (driverConf_t dc)=0
 Function that configures the driver from a driverConf_t type.
virtual int setDriverCurLim (int cl)=0
 loads continous current limit
virtual int setDriverHomePosition (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 setDriverMaxAcc (long int maxAcc)=0
 sets the maximum acceleration allowed by the driver in revolutions/s^2
virtual int setDriverMaxDec (long int maxDec)=0
 sets the maximum deceleration allowed by the driver in revolutions/s^2
virtual int setDriverMaxPos (long int maxPos)=0
 Sets the maximum absolute position in pulses.
virtual int setDriverMaxVel (long int maxVel)=0
 Sets the maximum speed allowed by the driver in rpm.
virtual int setDriverMinPos (long int minPos)=0
 Sets the minimum absolute position in pulses.
virtual int setDriverPCurLim (int pcl)=0
 loads peak current limit
virtual ~MotorDriverInterface ()
 Abstract destructor.

Detailed Description

Definition at line 29 of file motor_driver_interface.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

virtual int MotorDriverInterface::activateLimits ( 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.

Parameters:
actionit only has two allowed values: ACTIVATE to activate de driver or DEACTIVATE to disºable de driver
Returns:
ERR_NOERR if everything works correctly
ERR_WRI in case of error when writing in the driver descriptor file
ERR_OUTOFRANGE if action is not in allowed values set

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::calibrateDriver ( long int  limit,
int  current_limit,
int  calibration_speed,
int  time_out 
) [pure virtual]

starts the calibration sequence of the drive

Parameters:
limitsensor position in pulses measured from the desired 0 position
currentLimitmax current the motor is not allowed to exceed (in mA) This limit is directly related to torque of the motor.
calibrationSpeedThe speed of the motor during the calibration
timeOutmaximum time (in milli seconds) to perform the calibration. If this time is exceeded the function will return an error.
Returns:
ERR_NOERR If the calibration is done successfully
ERR_CURLIM if the current limit is reached during the calibration. I.E. an obstacle is blocking the motor.
ERR_TIMEOUT if the calibration process lasts more than the timeOut value
ERR_NOHOME if it is not possible to establish the home position

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::disableDriver ( ) [pure virtual]

Disables the driver.

Returns:
ERR_NOERR if everything works correctly
ERR_WRI in case of error when writing in the driver descriptor file

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::enableDriver ( ) [pure virtual]

Enables the driver.

Returns:
ERR_NOERR if everything works correctly
ERR_WRI in case of error when writing in the driver descriptor file

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::getDriverConf ( 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.

Parameters:
dcis the driverConf_t type where the driver configuration is stored
Returns:
ERR_NOERR if there are no problems
ERR_COM if it is not possible to read (any parameter) information from the driver. When this happens at least one of the parameters of the driverConf_t structure could be incomplete.

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::getDriverCurLim ( ) [pure virtual]

get the continous current limit (CCL) in mA.

Returns:
returns the value of the continous current limit (CCL) in mA.
ERR_COM if could not communicate with the driver (either write or read)

WARNING: Untested Function

Todo:
change the way I save the parameter. It has to be saved by parameter by reference. Return only must return Error control

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::getDriverInstantCurrent ( int *  current) [pure virtual]

asks for the instant velocity from sensor data of the driver.

Parameters:
currentis where the instant current data from the driver will be stored. The units from the driver are [rpm]
Returns:
ERR_NOERR if no error (operation is succesful)
ERR_COM if there is an error communicating whit the driver.

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::getDriverInstantPos ( long int *  positon) [pure virtual]

asks for the instant position from sensor data of the driver.

Parameters:
positionis a pointer pointing to where the position sensor data from the driver will be stored. The units from the driver are in [pulses]
Returns:
ERR_NOERR if no error (operation is succesful)
ERR_COM if there is an error communicating whit the driver.

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::getDriverInstantVel ( long int *  velocity) [pure virtual]

asks for the instant velocity from sensor data of the driver.

Parameters:
velocityis where the velocity sensor data from the driver will be stored. The units from the driver are [rpm]
Returns:
ERR_NOERR if no error (operation is succesful)
ERR_COM if there is an error communicating whit the driver.

Implemented in Mcdc3006s.

virtual long int MotorDriverInterface::getDriverMaxAcc ( ) [pure virtual]

returns the maximum acceleration allowed by the driver. To set this value see

See also:
SetDriverMaxAcc
Returns:
maxAcc Returns the maximum acceleration revolutions/sec²
ERR_COM if could not communicate with the driver (either write or read)
Todo:
change the way I save the parameter. It has to be saved by parameter by reference. Return only must return Error control

Implemented in Mcdc3006s.

virtual long int MotorDriverInterface::getDriverMaxDec ( ) [pure virtual]

returns the maximum decceleration allowed by the driver. To set this value see

See also:
SetDriverMaxDec
Returns:
maxDec Returns the maximum decceleration revolutions/sec²
ERR_COM if could not communicate with the driver (either write or read)
Todo:
change the way I save the parameter. It has to be saved by parameter by reference. Return only must return Error control

Implemented in Mcdc3006s.

virtual long int MotorDriverInterface::getDriverMaxPos ( ) [pure virtual]

returns the maximum position allowed by the driver. To set this value see

See also:
SetDriverMaxPos
Returns:
ERR_NOERR if there aren't any problems
ERR_COM if could not communicate with the driver (either write or read)
Todo:
change the way I save the parameter. It has to be saved by parameter by reference. Return only must return Error control

Implemented in Mcdc3006s.

virtual long int MotorDriverInterface::getDriverMaxVel ( ) [pure virtual]

Returns the maximum speed allowed by the driver which is set with setDriverMaxVel() function.

Returns:
maxVel configurated in the drive in r.p.m.
ERR_COM if could not communicate with the driver (either write or read)
Todo:
change the way I save the parameter. It has to be saved by parameter by reference. Return only must return Error control

Implemented in Mcdc3006s.

virtual long int MotorDriverInterface::getDriverMinPos ( ) [pure virtual]

This function reads from the driver min position from its flash memory.

Returns:
returns the value of the min position in pulses
ERR_COM if could not communicate with the driver (either write or read) Warning, it is possible to recevie a min pos which the same as ERR_COM. If this happens the function will wrongly understand that an error has occured *
Todo:
change the way I save the parameter. It has to be saved by parameter by reference. Return only must return Error control

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::getDriverPCurLim ( ) [pure virtual]

get the Peak Current Limit (PCL) in mA.

Returns:
returns the value of the peak current limit (PCL) in mA.
ERR_COM if could not communicate with the driver (either write or read)

WARNING: Untested Function

Todo:
change the way I save the parameter. It has to be saved by parameter by reference. Return only must return Error control

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::getDriverSensor ( driverSensor_t sensor) [pure virtual]

asks for sensor data of the driver

Parameters:
sensoris the sensor structure where we want to store the sensor data from the driver.
Returns:
ERR_NOERR if no error (operation is succesful)
ERR_COM if there is an error communicating whit the driver. In this case some (of all) of the sensor parameters could not be up to date.

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::getDriverStatus ( driverStatus_t drvStatus) [pure virtual]

Asks to the driver its current status.

Parameters:
drvStatusis 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
Returns:
ERR_NOERR if the status could be returned
ERR_COM if it is not possible to check the driver status

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::init ( int  baudrate,
char *  dev,
char *  sem 
) [pure virtual]

high level functions

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::moveDriverAbsPos ( long int  pos) [pure virtual]

Sends to the driver the order to move to an absolute position in pulses.

Parameters:
pabsolute position in pulses
Returns:
ERR_NOERR if no error sending the command to the driver
ERR_WRI if it isn't possible to communicate with the driver

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::moveDriverRelPos ( long int  pos) [pure virtual]

Sends to the driver the order to move to a relative position in pulses.

Parameters:
prelative position in pulses
Returns:
ERR_NOERR if no error sending the command to the driver
ERR_WRI if it isn't possible to communicate with the driver

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::moveDriverVel ( long int  vel) [pure virtual]

Sends to the driver the order to move at a determined speed (in rpm)

Parameters:
vvelocity in rpm (revolutions per minute)
Returns:
ERR_NOERR if no error sending the command to the driver
ERR_WRI if it isn't possible to communicate with the driver

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::saveToFlash ( ) [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!!!

Returns:
ERR_COM if an error communicating with driver occurs
ERR_NOERR if the save is done correctly

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::setDriverBaud ( int  baud) [pure virtual]

tells to the driver at which baudrate we want to operate

Parameters:
baudis the baudrate of the communication.
Returns:
ERR_NOERR if the configuration is succesful
ERR_OUTOFRANGE if the parameter baud is not in the expected values
ERR_WRI if it is not possible to write to the driver the configuration

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::setDriverConf ( driverConf_t  dc) [pure virtual]

Function that configures the driver from a driverConf_t type.

Parameters:
dcis where dc configuration is read in order to write it into the driver
Returns:
ERR_NOERR if success
ERR_CONF if any error occurs

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::setDriverCurLim ( int  cl) [pure virtual]

loads continous current limit

Parameters:
clcurrent limit in mA Range = [0 - 12000mA]
Returns:
ERR_NOERR if everything goes correct
ERR_WRI if could not write to the driver

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::setDriverHomePosition ( 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).

Parameters:
homeis the given position in pulses. This parameter specifies which is the current position.
Returns:
ERR_NOERR if everything works correctly
ERR_WRI in case of error when writing in the driver descriptor file

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::setDriverMaxAcc ( long int  maxAcc) [pure virtual]

sets the maximum acceleration allowed by the driver in revolutions/s^2

Parameters:
maxAccmaximum acceleration in revolutions/s^2
Returns:
ERR_NOERR if everything goes correct
ERR_WRI if could not write to the driver

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::setDriverMaxDec ( long int  maxDec) [pure virtual]

sets the maximum deceleration allowed by the driver in revolutions/s^2

Parameters:
maxDecmaximum deceleration in r/sec²
Returns:
ERR_NOERR if everything goes correct
ERR_WRI if could not write to the driver

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::setDriverMaxPos ( long int  maxPos) [pure virtual]

Sets the maximum absolute position in pulses.

Parameters:
maxPosin pulses
Returns:
ERR_NOERR if everything has gone correctly
ERR_OUTOFRANGE if maxPos is below or equal 0 (maxPos must be higher than 0).
ERR_WRI if could not write to the driver
ERR_POSLIMIT if it is not possible to activate the limits

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::setDriverMaxVel ( long int  maxVel) [pure virtual]

Sets the maximum speed allowed by the driver in rpm.

Parameters:
maxVelin r.p.m.
Returns:
ERR_NOERR if everything goes correct
ERR_WRI if could not write to the driver

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::setDriverMinPos ( long int  minPos) [pure virtual]

Sets the minimum absolute position in pulses.

Parameters:
minPosis the minimum absolute position in pulses
Returns:
ERR_NOERR if everything has gone correctly
ERR_OUTOFRANGE if minPos is higher or equal than 0 (minPos must be lower than 0).
ERR_WRI if could not write to the driver
ERR_POSLIMIT if it is not possible to activate the limits

Implemented in Mcdc3006s.

virtual int MotorDriverInterface::setDriverPCurLim ( int  pcl) [pure virtual]

loads peak current limit

Parameters:
pclcurrent limit in mA Range = [0 - 12000mA]
Returns:
ERR_NOERR if everything goes correct
ERR_WRI if could not write to the driver

Implemented in Mcdc3006s.


The documentation for this class was generated from the following file:


motor_drivers
Author(s): Raul Perula-Martinez
autogenerated on Thu Apr 2 2015 03:07:04