Public Member Functions | Private Attributes
Mcdc3006s Class Reference

#include <mcdc3006s.h>

Inheritance diagram for Mcdc3006s:
Inheritance graph
[legend]

List of all members.

Public Member Functions

int activateLimits (int action)
 Activates/Deactivates the driver Limits. If the limits aren't activated the driver will NOT respect the Maximum or Minimum positions.
int calibrateDriver (long int limit, int current_limit, int calibration_speed, int time_out)
 starts the calibration sequence of the drive
int disableDriver ()
 Disables the driver.
int enableDriver ()
 Enables the driver.
int getDriverConf (driverConf_t *dc)
 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.
int getDriverCurLim ()
 get the continous current limit (CCL) in mA.
int getDriverInstantCurrent (int *current)
 asks for the instant velocity from sensor data of the driver.
int getDriverInstantPos (long int *positon)
 asks for the instant position from sensor data of the driver.
int getDriverInstantVel (long int *velocity)
 asks for the instant velocity from sensor data of the driver.
long int getDriverMaxAcc ()
 returns the maximum acceleration allowed by the driver. To set this value see
long int getDriverMaxDec ()
 returns the maximum decceleration allowed by the driver. To set this value see
long int getDriverMaxPos ()
 returns the maximum position allowed by the driver. To set this value see
long int getDriverMaxVel ()
 Returns the maximum speed allowed by the driver which is set with setDriverMaxVel() function.
long int getDriverMinPos ()
 This function reads from the driver min position from its flash memory.
int getDriverPCurLim ()
 get the Peak Current Limit (PCL) in mA.
int getDriverSensor (driverSensor_t *sensor)
 asks for sensor data of the driver
int getDriverStatus (driverStatus_t *drvStatus)
 Asks to the driver its current status.
int init (int baudrate, char *dev, char *sem)
 high level functions
 Mcdc3006s ()
 Empty constructor.
int moveDriverAbsPos (long int pos)
 Sends to the driver the order to move to an absolute position in pulses.
int moveDriverRelPos (long int pos)
 Sends to the driver the order to move to a relative position in pulses.
int moveDriverVel (long int vel)
 Sends to the driver the order to move at a determined speed (in rpm)
int saveToFlash ()
 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!!!
int setDriverBaud (int baud)
 tells to the driver at which baudrate we want to operate
int setDriverConf (driverConf_t dc)
 Function that configures the driver from a driverConf_t type.
int setDriverCurLim (int cl)
 loads continous current limit
int setDriverHomePosition (long int home)
 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).
int setDriverMaxAcc (long int maxAcc)
 sets the maximum acceleration allowed by the driver in revolutions/s^2
int setDriverMaxDec (long int maxDec)
 sets the maximum deceleration allowed by the driver in revolutions/s^2
int setDriverMaxPos (long int maxPos)
 Sets the maximum absolute position in pulses.
int setDriverMaxVel (long int maxVel)
 Sets the maximum speed allowed by the driver in rpm.
int setDriverMinPos (long int minPos)
 Sets the minimum absolute position in pulses.
int setDriverPCurLim (int pcl)
 loads peak current limit
 ~Mcdc3006s ()
 Destructor.

Private Attributes

Rs232 _comm

Detailed Description

Definition at line 34 of file mcdc3006s.h.


Constructor & Destructor Documentation

Empty constructor.

Definition at line 30 of file mcdc3006s.cpp.

Destructor.

Definition at line 36 of file mcdc3006s.cpp.


Member Function Documentation

int Mcdc3006s::activateLimits ( int  action) [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

Implements MotorDriverInterface.

Definition at line 172 of file mcdc3006s.cpp.

int Mcdc3006s::calibrateDriver ( long int  limit,
int  current_limit,
int  calibration_speed,
int  time_out 
) [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

Error control here

Implements MotorDriverInterface.

Definition at line 677 of file mcdc3006s.cpp.

int Mcdc3006s::disableDriver ( ) [virtual]

Disables the driver.

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

Implements MotorDriverInterface.

Definition at line 71 of file mcdc3006s.cpp.

int Mcdc3006s::enableDriver ( ) [virtual]

Enables the driver.

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

Implements MotorDriverInterface.

Definition at line 57 of file mcdc3006s.cpp.

int Mcdc3006s::getDriverConf ( driverConf_t dc) [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.

Implements MotorDriverInterface.

Definition at line 85 of file mcdc3006s.cpp.

int Mcdc3006s::getDriverCurLim ( ) [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

Implements MotorDriverInterface.

Definition at line 283 of file mcdc3006s.cpp.

int Mcdc3006s::getDriverInstantCurrent ( int *  current) [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.

Implements MotorDriverInterface.

Definition at line 427 of file mcdc3006s.cpp.

int Mcdc3006s::getDriverInstantPos ( long int *  positon) [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.

Implements MotorDriverInterface.

Definition at line 389 of file mcdc3006s.cpp.

int Mcdc3006s::getDriverInstantVel ( long int *  velocity) [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.

Implements MotorDriverInterface.

Definition at line 408 of file mcdc3006s.cpp.

long int Mcdc3006s::getDriverMaxAcc ( ) [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

Implements MotorDriverInterface.

Definition at line 247 of file mcdc3006s.cpp.

long int Mcdc3006s::getDriverMaxDec ( ) [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

Implements MotorDriverInterface.

Definition at line 265 of file mcdc3006s.cpp.

long int Mcdc3006s::getDriverMaxPos ( ) [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

Implements MotorDriverInterface.

Definition at line 192 of file mcdc3006s.cpp.

long int Mcdc3006s::getDriverMaxVel ( ) [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

Implements MotorDriverInterface.

Definition at line 229 of file mcdc3006s.cpp.

long int Mcdc3006s::getDriverMinPos ( ) [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

Implements MotorDriverInterface.

Definition at line 209 of file mcdc3006s.cpp.

int Mcdc3006s::getDriverPCurLim ( ) [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

Implements MotorDriverInterface.

Definition at line 300 of file mcdc3006s.cpp.

int Mcdc3006s::getDriverSensor ( driverSensor_t sensor) [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.

Implements MotorDriverInterface.

Definition at line 351 of file mcdc3006s.cpp.

int Mcdc3006s::getDriverStatus ( driverStatus_t drvStatus) [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

Implements MotorDriverInterface.

Definition at line 317 of file mcdc3006s.cpp.

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

high level functions

Implements MotorDriverInterface.

Definition at line 43 of file mcdc3006s.cpp.

int Mcdc3006s::moveDriverAbsPos ( long int  pos) [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

Implements MotorDriverInterface.

Definition at line 605 of file mcdc3006s.cpp.

int Mcdc3006s::moveDriverRelPos ( long int  pos) [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

Implements MotorDriverInterface.

Definition at line 626 of file mcdc3006s.cpp.

int Mcdc3006s::moveDriverVel ( long int  vel) [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

Implements MotorDriverInterface.

Definition at line 647 of file mcdc3006s.cpp.

int Mcdc3006s::saveToFlash ( ) [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.

Implements MotorDriverInterface.

Definition at line 156 of file mcdc3006s.cpp.

int Mcdc3006s::setDriverBaud ( int  baud) [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

Implements MotorDriverInterface.

Definition at line 577 of file mcdc3006s.cpp.

int Mcdc3006s::setDriverConf ( driverConf_t  dc) [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

Implements MotorDriverInterface.

Definition at line 128 of file mcdc3006s.cpp.

int Mcdc3006s::setDriverCurLim ( int  cl) [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

Implements MotorDriverInterface.

Definition at line 545 of file mcdc3006s.cpp.

int Mcdc3006s::setDriverHomePosition ( long int  home) [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

Implements MotorDriverInterface.

Definition at line 662 of file mcdc3006s.cpp.

int Mcdc3006s::setDriverMaxAcc ( long int  maxAcc) [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

Implements MotorDriverInterface.

Definition at line 513 of file mcdc3006s.cpp.

int Mcdc3006s::setDriverMaxDec ( long int  maxDec) [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

Implements MotorDriverInterface.

Definition at line 529 of file mcdc3006s.cpp.

int Mcdc3006s::setDriverMaxPos ( long int  maxPos) [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

Implements MotorDriverInterface.

Definition at line 446 of file mcdc3006s.cpp.

int Mcdc3006s::setDriverMaxVel ( long int  maxVel) [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

Implements MotorDriverInterface.

Definition at line 497 of file mcdc3006s.cpp.

int Mcdc3006s::setDriverMinPos ( long int  minPos) [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

Implements MotorDriverInterface.

Definition at line 471 of file mcdc3006s.cpp.

int Mcdc3006s::setDriverPCurLim ( int  pcl) [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

Implements MotorDriverInterface.

Definition at line 561 of file mcdc3006s.cpp.


Member Data Documentation

Rs232 Mcdc3006s::_comm [private]

Definition at line 368 of file mcdc3006s.h.


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


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