TwiceAsNice  2019-02-18
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Basda::MoConModule Class Reference

This is the implementation of the MoCon module commands. More...

#include <Module.h>

Inheritance diagram for Basda::MoConModule:
Inheritance graph
Collaboration diagram for Basda::MoConModule:
Collaboration graph

Classes

struct  MoConModuleEvent
 This is the implementation of the handler for the incoming events and function errors. More...
 

Public Member Functions

 MoConModule (std::string _name, Nice::JointPtr _config, MPIACoreProtocolPtr _protocol)
 Constructor. More...
 
 ~MoConModule ()
 Destructor. More...
 
void chat (const unsigned int _cardNo, const unsigned int _commandID, const unsigned int _moduleNo, const unsigned int _selectID, const std::string _parameter, const int _numberOfLines)
 This method send the command string to the electronic. More...
 
void dontParse (std::string &_ret)
 This method was requested by Lorenzo Busoni (lbuso.nosp@m.ni@a.nosp@m.rcetr.nosp@m.i.as.nosp@m.tro.i.nosp@m.t 02.03.2012) More...
 
void receiveDataRaw (const unsigned int _cardNo, const unsigned int _commandID, const unsigned int _moduleNo, std::string &_ret, const unsigned int _numberOfLines)
 This method was requested by Lorenzo Busoni (lbuso.nosp@m.ni@a.nosp@m.rcetr.nosp@m.i.as.nosp@m.tro.i.nosp@m.t 02.03.2012) More...
 
void setBasicSettings (const SelectBasicSettings::Constant _selectID, const double _parameter)
 
With this method a value of the basic configuration can be changed. More...
 
void setBasicSettings ()
 This method sets all basic configuration with the values stored in the property tree. More...
 
void getBasicSettings (bool _compareParameter=false)
 This method returns the basic configuration of the motor. More...
 
void validateBasicSettings ()
 
void setMotorSettings (const SelectMotorSettings::Constant _selectID, const double _parameter)
 
With this method a value of the motor configuration can be changed. More...
 
void setMotorSettings ()
 This method sets all motor configurations with the values stored in the property tree. More...
 
void getMotorSettings (bool _compareParameter=false)
 This method returns the motor configuration. More...
 
int getMotorType ()
 Returns the motor type. More...
 
void setStepperSettings (const SelectStepperSettings::Constant _selectID, const int _parameter)
 
With this method a value of the stepper settings can be changed. More...
 
void setStepperSettings ()
 This method sets all stepper settings with the values stored in the property tree. More...
 
void getStepperSettings (bool _compareParameter=false)
 This method returns the stepper settings of the motor. More...
 
void setServoLoopSettings (const SelectServoLoopSettings::Constant _selectID, const unsigned int _parameter)
 
This method set the servo settings. More...
 
void setServoLoopSettings ()
 This method sets all servo settings with the values stored in the property tree. More...
 
void getServoLoopSettings (bool _compareParameter=false)
 This method returns the servo settings of the motor. More...
 
void setEncoderSettings (const SelectSetEncodeSettings::Constant _selectID, const int _parameter)
 
With this method a value of the incremental encoder settings can be changed. More...
 
void setEncoderSettings ()
 This method sets all incremental encoder settings with the values stored in the property tree. More...
 
void getEncoderSettings (bool _compareParameter=false)
 This method returns the incremental encoder settings. More...
 
void setAmplifierSettings (const SelectAmplifierSettings::Constant _selectID, const int _parameter1, const int _parameter2=-1, const int _parameter3=-1)
 
With this method a value of the amplifier settings can be changed. More...
 
void setAmplifierSettings ()
 This method sets all amplifier settings with the values stored in the property tree. More...
 
void getAmplifierCardInfo ()
 This method returns the amplifier configuration of the motor. More...
 
void getAmplifierInfo ()
 This method returns information of the amplifier. More...
 
void getMotorControllerVersion ()
 This method returns the firmware version of the motor controller. More...
 
std::string getMotorControllerErrorNr ()
 This methods returns the motor controller error number. More...
 
void initializeMotor ()
 This method try to initialized the motor If not all motor settings are available and valid a exception will be thrown. More...
 
void stop ()
 This method stops the motor with a deceleration. More...
 
void abort ()
 Abort the moving of the motor immediately without deceleration. More...
 
double moveToPositiveLimit (bool _travelRangeCheck=true)
 The motor moves to the positive software limit switch. More...
 
double moveToNegativeLimit (bool _travelRangeCheck=true)
 The motor moves to the negative software limit switch. More...
 
double moveOutOfLimit ()
 The motor moves out of the limit switch. More...
 
void moveAbsolute (int _absolutePosition)
 The motor moves to the absolute position. More...
 
void moveRelative (int _relativePosition)
 The motor moves to the relative position. More...
 
void moveToHome ()
 The motor is looking for the reference position. More...
 
void moveCorrection ()
 The lost steps can be corrected with this methods. More...
 
bool isMoving ()
 Checks if the motor is still in motion. More...
 
bool isAtHome ()
 
bool isMotionComplete ()
 Checks if the motor has finished the motion. More...
 
void setMotionComplete (bool _complete)
 Set the MOTOR_COMPLETE flag. More...
 
int isAtLimit ()
 Checks if the motor is in limit. More...
 
unsigned int getActivityStatus ()
 This method returns the current activity status. More...
 
unsigned int getSignalStatus ()
 This method returns the current signal status. More...
 
int getMEncPosition ()
 This method returns the current absolute position. More...
 
int getAEncPosition ()
 This method returns the current position of the absolute encoder. More...
 
int getIEncPosition ()
 This method returns the current position of the incremental encoder. More...
 
int getVelocity ()
 This method returns the current velocity. More...
 
int getIEncVelocity ()
 This method returns the current velocity of the incremental encoder. More...
 
int getStartHomeDistance ()
 This method returns the distance between the start point and the reference point. More...
 
void loadMotorSettings ()
 This method read the motor settings from the EEPROM. More...
 
void saveMotorSettings ()
 This method save the motor settings in the EEPROM. More...
 
void waitForEvent ()
 This method wait till an event was received. More...
 
Nice::I64 getReferenceTime ()
 This method synchronize the MoCon time with the PC time. More...
 
Nice::I64 getCurrentTime ()
 This method stores the current PC time and Mocon cycles in the properties. More...
 
void setExternalProfileBufferSize (const unsigned int _bufferSize, bool _extended=true)
 This method set the external buffer size. More...
 
void setExternalProfileData (const unsigned int _index, const unsigned int _timeBase, const int _velocity, const int _position, const int _acceleration=0, const int _jerk=0)
 This method set the external profile data. More...
 
void setExternalProfileStart (const ValueStartMode::Constant _startMode, const Nice::Date _startTime=Nice::Date::microSeconds(-1))
 This method starts the external profile from the beginning or from the last position. More...
 
void setExternalProfileStop ()
 This method stops the external profile. More...
 
int getExternalProfileInfo ()
 This method returns the actual index of the external profile. More...
 
Nice::Time initExternalProfile (int _frequency, unsigned int _maxSamplesPerSegment, unsigned int _minSamplesPerSegment, unsigned int _faultTolerance)
 
void clearExternalProfileBuffer ()
 This method freed the allocated memory of the external profile. More...
 
void calculateTransition (const Nice::Date &_date, const Nice::NPoint &_positionSequence)
 This method calculates the transition from one trajectory to another if a trajectory already exist. More...
 
void calculateTransition (const Nice::Date &_date, const Nice::NPoint &_positionSequence, const Nice::Time &_transitionLength)
 
unsigned int fitTrajectory ()
 This method convert the given trajectory to a motor controller profile. More...
 
void validateExternalProfile ()
 
unsigned int bufferExternalProfile ()
 
Nice::Date uploadExternalProfile ()
 This uploads the external profile data. More...
 
void uploadExternalProfile (const Nice::SeqSeqInt &_segments)
 
bool isExternalProfileDone ()
 
void setProfilePosition (double _position)
 Change the absolute position of the motors. More...
 
void setCollision (bool _collisionNegative, bool _collisionPositive)
 This method enables the flag to indicate whether the CoCon detected a collision. More...
 
 MoConModule (std::string _name, Nice::JointPtr _config, MPIACoreProtocolPtr _protocol)
 Constructor. More...
 
 ~MoConModule ()
 Destructor. More...
 
void chat (const unsigned int _cardNo, const unsigned int _commandID, const unsigned int _moduleNo, const unsigned int _selectID, const std::string _parameter, const int _numberOfLines)
 This method send the command string to the electronic. More...
 
void dontParse (std::string &_ret)
 This method was requested by Lorenzo Busoni (lbuso.nosp@m.ni@a.nosp@m.rcetr.nosp@m.i.as.nosp@m.tro.i.nosp@m.t 02.03.2012) More...
 
void receiveDataRaw (const unsigned int _cardNo, const unsigned int _commandID, const unsigned int _moduleNo, std::string &_ret, const unsigned int _numberOfLines)
 This method was requested by Lorenzo Busoni (lbuso.nosp@m.ni@a.nosp@m.rcetr.nosp@m.i.as.nosp@m.tro.i.nosp@m.t 02.03.2012) More...
 
void setBasicSettings (const SelectBasicSettings::Constant _selectID, const double _parameter)
 
With this method a value of the basic configuration can be changed. More...
 
void setBasicSettings ()
 This method sets all basic configuration with the values stored in the property tree. More...
 
void getBasicSettings (bool _compareParameter=false)
 This method returns the basic configuration of the motor. More...
 
void validateBasicSettings ()
 
void setMotorSettings (const SelectMotorSettings::Constant _selectID, const double _parameter)
 
With this method a value of the motor configuration can be changed. More...
 
void setMotorSettings ()
 This method sets all motor configurations with the values stored in the property tree. More...
 
void getMotorSettings (bool _compareParameter=false)
 This method returns the motor configuration. More...
 
int getMotorType ()
 Returns the motor type. More...
 
void setStepperSettings (const SelectStepperSettings::Constant _selectID, const int _parameter)
 
With this method a value of the stepper settings can be changed. More...
 
void setStepperSettings ()
 This method sets all stepper settings with the values stored in the property tree. More...
 
void getStepperSettings (bool _compareParameter=false)
 This method returns the stepper settings of the motor. More...
 
void setServoLoopSettings (const SelectServoLoopSettings::Constant _selectID, const unsigned int _parameter)
 
This method set the servo settings. More...
 
void setServoLoopSettings ()
 This method sets all servo settings with the values stored in the property tree. More...
 
void getServoLoopSettings (bool _compareParameter=false)
 This method returns the servo settings of the motor. More...
 
void setEncoderSettings (const SelectSetEncodeSettings::Constant _selectID, const int _parameter)
 
With this method a value of the incremental encoder settings can be changed. More...
 
void setEncoderSettings ()
 This method sets all incremental encoder settings with the values stored in the property tree. More...
 
void getEncoderSettings (bool _compareParameter=false)
 This method returns the incremental encoder settings. More...
 
void setAmplifierSettings (const SelectAmplifierSettings::Constant _selectID, const int _parameter1, const int _parameter2=-1, const int _parameter3=-1)
 
With this method a value of the amplifier settings can be changed. More...
 
void setAmplifierSettings ()
 This method sets all amplifier settings with the values stored in the property tree. More...
 
void getAmplifierCardInfo ()
 This method returns the amplifier configuration of the motor. More...
 
void getAmplifierInfo ()
 This method returns information of the amplifier. More...
 
void getMotorControllerVersion ()
 This method returns the firmware version of the motor controller. More...
 
std::string getMotorControllerErrorNr ()
 This methods returns the motor controller error number. More...
 
void initializeMotor ()
 This method try to initialized the motor If not all motor settings are available and valid a exception will be thrown. More...
 
void stop ()
 This method stops the motor with a deceleration. More...
 
void abort ()
 Abort the moving of the motor immediately without deceleration. More...
 
double moveToPositiveLimit (bool _travelRangeCheck=true)
 The motor moves to the positive software limit switch. More...
 
double moveToNegativeLimit (bool _travelRangeCheck=true)
 The motor moves to the negative software limit switch. More...
 
double moveOutOfLimit ()
 The motor moves out of the limit switch. More...
 
void moveAbsolute (int _absolutePosition)
 The motor moves to the absolute position. More...
 
void moveRelative (int _relativePosition)
 The motor moves to the relative position. More...
 
void moveToHome ()
 The motor is looking for the reference position. More...
 
void moveCorrection ()
 The lost steps can be corrected with this methods. More...
 
bool isMoving ()
 Checks if the motor is still in motion. More...
 
bool isAtHome ()
 
bool isMotionComplete ()
 Checks if the motor has finished the motion. More...
 
void setMotionComplete (bool _complete)
 Set the MOTOR_COMPLETE flag. More...
 
int isAtLimit ()
 Checks if the motor is in limit. More...
 
unsigned int getActivityStatus ()
 This method returns the current activity status. More...
 
unsigned int getSignalStatus ()
 This method returns the current signal status. More...
 
int getMEncPosition ()
 This method returns the current absolute position. More...
 
int getAEncPosition ()
 This method returns the current position of the absolute encoder. More...
 
int getIEncPosition ()
 This method returns the current position of the incremental encoder. More...
 
int getVelocity ()
 This method returns the current velocity. More...
 
int getIEncVelocity ()
 This method returns the current velocity of the incremental encoder. More...
 
int getStartHomeDistance ()
 This method returns the distance between the start point and the reference point. More...
 
void loadMotorSettings ()
 This method read the motor settings from the EEPROM. More...
 
void saveMotorSettings ()
 This method save the motor settings in the EEPROM. More...
 
void waitForEvent ()
 This method wait till an event was received. More...
 
Nice::I64 getReferenceTime ()
 This method synchronize the MoCon time with the PC time. More...
 
Nice::I64 getCurrentTime ()
 This method stores the current PC time and Mocon cycles in the properties. More...
 
void setExternalProfileBufferSize (const unsigned int _bufferSize, bool _extended=true)
 This method set the external buffer size. More...
 
void setExternalProfileData (const unsigned int _index, const unsigned int _timeBase, const int _velocity, const int _position, const int _acceleration=0, const int _jerk=0)
 This method set the external profile data. More...
 
void setExternalProfileStart (const ValueStartMode::Constant _startMode, const Nice::Date _startTime=Nice::Date::microSeconds(-1))
 This method starts the external profile from the beginning or from the last position. More...
 
void setExternalProfileStop ()
 This method stops the external profile. More...
 
int getExternalProfileInfo ()
 This method returns the actual index of the external profile. More...
 
Nice::Time initExternalProfile (int _frequency, unsigned int _maxSamplesPerSegment, unsigned int _minSamplesPerSegment, unsigned int _faultTolerance)
 
void clearExternalProfileBuffer ()
 This method freed the allocated memory of the external profile. More...
 
void calculateTransition (const Nice::Date &_date, const Nice::NPoint &_positionSequence)
 This method calculates the transition from one trajectory to another if a trajectory already exist. More...
 
void calculateTransition (const Nice::Date &_date, const Nice::NPoint &_positionSequence, const Nice::Time &_transitionLength)
 
unsigned int fitTrajectory ()
 This method convert the given trajectory to a motor controller profile. More...
 
void validateExternalProfile ()
 
unsigned int bufferExternalProfile ()
 
Nice::Date uploadExternalProfile ()
 This uploads the external profile data. More...
 
void uploadExternalProfile (const Nice::SeqSeqInt &_segments)
 
bool isExternalProfileDone ()
 
void setProfilePosition (double _position)
 Change the absolute position of the motors. More...
 
void setCollision (bool _collisionNegative, bool _collisionPositive)
 This method enables the flag to indicate whether the CoCon detected a collision. More...
 
- Public Member Functions inherited from Basda::MPIACoreModule
 MPIACoreModule (std::string _name, Nice::JointPtr _config, Basda::MPIACoreProtocolPtr _protocol)
 Constructor. More...
 
 ~MPIACoreModule ()
 Destructor. More...
 
void open ()
 
void close ()
 
bool configParameterUploadRequired ()
 
 MPIACoreModule (std::string _name, Nice::JointPtr _config, Basda::MPIACoreProtocolPtr _protocol)
 Constructor. More...
 
 ~MPIACoreModule ()
 Destructor. More...
 
void open ()
 
void close ()
 
bool configParameterUploadRequired ()
 

Private Types

typedef IceUtil::Handle< MoConModuleEventMoConModuleEventPtr
 
typedef IceUtil::Handle< MoConModuleEventMoConModuleEventPtr
 

Private Member Functions

void addInternalProperties ()
 This method add some internal properties like status properties. More...
 
void checkTravelRange ()
 
void travelRangeChanged (const Nice::Point &_a)
 
void addInternalProperties ()
 This method add some internal properties like status properties. More...
 
void checkTravelRange ()
 
void travelRangeChanged (const Nice::Point &_a)
 

Private Attributes

bool m_extendedProfileParamter
 member for the extended external profile mode More...
 
unsigned int m_bufferSize
 
unsigned int m_externalProfileIndexCycle
 
Nice::Time m_timeResolution
 
int m_frequency
 
Basda::MoConModuleProfile m_profile
 member for the extended external profile mode More...
 
Nice::NPoint m_positionSequence
 
Nice::NPoint m_positionSequenceBackup
 
Nice::Date m_startDate
 
Nice::Point m_travelRange
 
Nice::Time m_blockSize
 
int m_currentPosition
 
Nice::Date m_currentPcDate
 
Nice::I64 m_currentMoConClocks
 
double m_cycleTime
 
unsigned int m_microsteps
 
bool m_collisionPositive
 
bool m_collisionNegative
 
Nice::U16 m_basicResolution
 
Nice::U32 m_basicAcceleration
 
double m_accelerationPerCycle
 The basic acceleration is set during the external profile initialization, to keep the acceleration constant over the whole trajectory. More...
 
std::vector< Basda::MoConModuleProfile::Segmentm_externalProfileBuffer
 
unsigned int m_externalProfileBufferSize
 
Nice::Monitor m_monitor
 

Additional Inherited Members

- Protected Member Functions inherited from Basda::MPIACore
 MPIACore (std::string _name, Nice::JointPtr _config, const MPIACoreProtocolPtr _protocol)
 
 ~MPIACore ()
 
template<typename Type >
Type checkAttribute (const std::string &_node, const std::string &_attributeName, const Type &_default)
 
template<typename RT >
std::vector< RT > getVector (const std::string &_str)
 This is a generic method to convert a data string to a vector. More...
 
std::string name ()
 
 MPIACore (std::string _name, Nice::JointPtr _config, const MPIACoreProtocolPtr _protocol)
 
 ~MPIACore ()
 
template<typename Type >
Type checkAttribute (const std::string &_node, const std::string &_attributeName, const Type &_default)
 
template<typename RT >
std::vector< RT > getVector (const std::string &_str)
 This is a generic method to convert a data string to a vector. More...
 
std::string name ()
 
- Static Protected Member Functions inherited from Basda::MPIACore
template<typename RT >
static RT getValue (const std::string &_str)
 This is a generic method to convert a data string to a number. More...
 
template<typename RT >
static RT getValue (const std::string &_str)
 This is a generic method to convert a data string to a number. More...
 
- Protected Attributes inherited from Basda::MPIACore
std::string m_name
 
std::string m_address
 member of the connection address More...
 
unsigned int m_cardNo
 member of the card number More...
 
unsigned int m_moduleNo
 member of the module number More...
 
HandlerPtr m_handler
 
MPIACoreProtocolPtr m_protocol
 member of the protocol to communicate with the MPIA in-house electronic. More...
 
Nice::JointPtr m_config
 member of the root of the configuration tree More...
 
bool m_warning
 

Detailed Description

This is the implementation of the MoCon module commands.

The MPIA electronic rack can keep up to 8 motor controller cards, which can control up to 8 motors each. This class extends the MPIACoreModule class with the functionality of the motor controller module.

Author
Frank Kittmann
Version
09.06.30
Date
2009.06.30

Member Typedef Documentation

◆ MoConModuleEventPtr [1/2]

◆ MoConModuleEventPtr [2/2]

Constructor & Destructor Documentation

◆ MoConModule() [1/2]

Basda::MoConModule::MoConModule ( std::string  _name,
Nice::JointPtr  _config,
MPIACoreProtocolPtr  _protocol 
)

Constructor.

◆ ~MoConModule() [1/2]

Basda::MoConModule::~MoConModule ( )
inline

Destructor.

◆ MoConModule() [2/2]

Basda::MoConModule::MoConModule ( std::string  _name,
Nice::JointPtr  _config,
MPIACoreProtocolPtr  _protocol 
)

Constructor.

◆ ~MoConModule() [2/2]

Basda::MoConModule::~MoConModule ( )
inline

Destructor.

Member Function Documentation

◆ abort() [1/2]

void Basda::MoConModule::abort ( void  )

Abort the moving of the motor immediately without deceleration.

Note
Abrupt stop of a fast running motor can leads to losing steps. The motor could be damaged too.

◆ abort() [2/2]

void Basda::MoConModule::abort ( )

Abort the moving of the motor immediately without deceleration.

Note
Abrupt stop of a fast running motor can leads to losing steps. The motor could be damaged too.

◆ addInternalProperties() [1/2]

void Basda::MoConModule::addInternalProperties ( )
private

This method add some internal properties like status properties.

◆ addInternalProperties() [2/2]

void Basda::MoConModule::addInternalProperties ( )
private

This method add some internal properties like status properties.

◆ bufferExternalProfile() [1/2]

unsigned int Basda::MoConModule::bufferExternalProfile ( )

◆ bufferExternalProfile() [2/2]

unsigned int Basda::MoConModule::bufferExternalProfile ( )

◆ calculateTransition() [1/4]

void Basda::MoConModule::calculateTransition ( const Nice::Date _date,
const Nice::NPoint _positionSequence 
)

This method calculates the transition from one trajectory to another if a trajectory already exist.

Parameters
_date- the external profile start date
_positionSequence- supporting points of the spline in steps
_transitionLength- the time how long the transition should take

◆ calculateTransition() [2/4]

void Basda::MoConModule::calculateTransition ( const Nice::Date _date,
const Nice::NPoint _positionSequence 
)

This method calculates the transition from one trajectory to another if a trajectory already exist.

Parameters
_date- the external profile start date
_positionSequence- supporting points of the spline in steps
_transitionLength- the time how long the transition should take

◆ calculateTransition() [3/4]

void Basda::MoConModule::calculateTransition ( const Nice::Date _date,
const Nice::NPoint _positionSequence,
const Nice::Time _transitionLength 
)

◆ calculateTransition() [4/4]

void Basda::MoConModule::calculateTransition ( const Nice::Date _date,
const Nice::NPoint _positionSequence,
const Nice::Time _transitionLength 
)

◆ chat() [1/2]

void Basda::MoConModule::chat ( const unsigned int  _cardNo,
const unsigned int  _commandID,
const unsigned int  _moduleNo,
const unsigned int  _selectID,
const std::string  _parameter,
const int  _numberOfLines 
)

This method send the command string to the electronic.

This method is set to public due to requests from Lorenzo Busoni. BUT THE USER OF THIS METHOD TAKE OVER THE RESPONSIBILITY OF THE CORRECT ERROR HANDLING. THE DRIVER DOES NOT HAVE THE CONTROL OVER THAT DEVICE ANY MORE.

Parameters
_commandIDthe command ID
_selectIDthe sub command ID
_cardNothe ID of the MPIA electronic card
_moduleNothe ID of the device module
_parameterthe parameter as string
_numberOfLinesthe number of lines that might be read

Hi Martin,

that's exactly what I was thinking: The use case is (real example from our experience): we discover at the telescope that we need to continuously monitor a given property (PropA) of the MoCon (obviously because of a malfunctioning in the hardware!). Without this monitor, we will be stuck. You can add the required functionality in the Mocca adding the function getPropA: this requires 4 hours and the day is lost. The day after you are stuck because you discover that you miss PropB, and the day is lost again. As an alternative, one can add the 2 lines below in the code (with a comment: "1 10 0 = getPropA") and this requires 5 minutes. The day after one can add a similar line with 1 11 0. When you're back in Europe you implement getPropA and getPropB in Mocca and you cleanup the code removing the receiveResponseForComment

Generally speaking I think it is a safe idea to have a generic interface to access EVERY possible functionality of a device, because soon or later you'll need it. In the case of the Mocon it is quite easy, a good compromise between living dangerously and wasting too much time in the effort of a complete implementation of all the MoCon commands.

Lorenzo Busoni

◆ chat() [2/2]

void Basda::MoConModule::chat ( const unsigned int  _cardNo,
const unsigned int  _commandID,
const unsigned int  _moduleNo,
const unsigned int  _selectID,
const std::string  _parameter,
const int  _numberOfLines 
)

This method send the command string to the electronic.

This method is set to public due to requests from Lorenzo Busoni. BUT THE USER OF THIS METHOD TAKE OVER THE RESPONSIBILITY OF THE CORRECT ERROR HANDLING. THE DRIVER DOES NOT HAVE THE CONTROL OVER THAT DEVICE ANY MORE.

Parameters
_commandIDthe command ID
_selectIDthe sub command ID
_cardNothe ID of the MPIA electronic card
_moduleNothe ID of the device module
_parameterthe parameter as string
_numberOfLinesthe number of lines that might be read

Hi Martin,

that's exactly what I was thinking: The use case is (real example from our experience): we discover at the telescope that we need to continuously monitor a given property (PropA) of the MoCon (obviously because of a malfunctioning in the hardware!). Without this monitor, we will be stuck. You can add the required functionality in the Mocca adding the function getPropA: this requires 4 hours and the day is lost. The day after you are stuck because you discover that you miss PropB, and the day is lost again. As an alternative, one can add the 2 lines below in the code (with a comment: "1 10 0 = getPropA") and this requires 5 minutes. The day after one can add a similar line with 1 11 0. When you're back in Europe you implement getPropA and getPropB in Mocca and you cleanup the code removing the receiveResponseForComment

Generally speaking I think it is a safe idea to have a generic interface to access EVERY possible functionality of a device, because soon or later you'll need it. In the case of the Mocon it is quite easy, a good compromise between living dangerously and wasting too much time in the effort of a complete implementation of all the MoCon commands.

Lorenzo Busoni

◆ checkTravelRange() [1/2]

void Basda::MoConModule::checkTravelRange ( )
private

◆ checkTravelRange() [2/2]

void Basda::MoConModule::checkTravelRange ( )
private

◆ clearExternalProfileBuffer() [1/2]

void Basda::MoConModule::clearExternalProfileBuffer ( )

This method freed the allocated memory of the external profile.

◆ clearExternalProfileBuffer() [2/2]

void Basda::MoConModule::clearExternalProfileBuffer ( )

This method freed the allocated memory of the external profile.

◆ dontParse() [1/2]

void Basda::MoConModule::dontParse ( std::string &  _ret)

This method was requested by Lorenzo Busoni (lbuso.nosp@m.ni@a.nosp@m.rcetr.nosp@m.i.as.nosp@m.tro.i.nosp@m.t 02.03.2012)

It supports a direct communication with the MoCon. BUT THE USER OF THIS METHOD TAKE OVER THE RESPONSIBILITY OF THE CORRECT ERROR HANDLING. THE DRIVER DOES NOT HAVE THE CONTROL OVER THAT DEVICE ANY MORE.

Parameters
_retthe allocated memory for the command response
See also
chat

◆ dontParse() [2/2]

void Basda::MoConModule::dontParse ( std::string &  _ret)

This method was requested by Lorenzo Busoni (lbuso.nosp@m.ni@a.nosp@m.rcetr.nosp@m.i.as.nosp@m.tro.i.nosp@m.t 02.03.2012)

It supports a direct communication with the MoCon. BUT THE USER OF THIS METHOD TAKE OVER THE RESPONSIBILITY OF THE CORRECT ERROR HANDLING. THE DRIVER DOES NOT HAVE THE CONTROL OVER THAT DEVICE ANY MORE.

Parameters
_retthe allocated memory for the command response
See also
chat

◆ fitTrajectory() [1/2]

unsigned int Basda::MoConModule::fitTrajectory ( )

This method convert the given trajectory to a motor controller profile.

The external profile can be setup with a spline which has some supporting points (in PC time and steps). This spline will be converted to motor controller time and microsteps steps.

Returns
the number of generated segments

The final external profile coordinates will be calculated as followed:

$ point.xp = (double) lrint(i * m_timeResolution.toMicroSecondsDouble() / m_cycleTime) $

$ point.yp = _positionSequence.at(i) * m_microsteps; $

where i is the index of the position sequence the other variables are self-explained, i hope :)

◆ fitTrajectory() [2/2]

unsigned int Basda::MoConModule::fitTrajectory ( )

This method convert the given trajectory to a motor controller profile.

The external profile can be setup with a spline which has some supporting points (in PC time and steps). This spline will be converted to motor controller time and microsteps steps.

Returns
the number of generated segments

The final external profile coordinates will be calculated as followed:

$ point.xp = (double) lrint(i * m_timeResolution.toMicroSecondsDouble() / m_cycleTime) $

$ point.yp = _positionSequence.at(i) * m_microsteps; $

where i is the index of the position sequence the other variables are self-explained, i hope :)

◆ getActivityStatus() [1/2]

unsigned int Basda::MoConModule::getActivityStatus ( )

This method returns the current activity status.

It returns the 16 bit activity register:

  • bit 0: phasing initialized
  • bit 1: at maximal velocity
  • bit 2: tracking
  • bit 3: current profile mode
  • bit 4: -
  • bit 5: -
  • bit 6: -
  • bit 7: axis settled
  • bit 8: motor on/off
  • bit 9: position capture
  • bit 10: in motion
  • bit 11: in positive limit
  • bit 12: in negative limit
  • bit 13: limit profile segment
  • bit 14: -
  • bit 15: -
Returns
a 16 bit value

◆ getActivityStatus() [2/2]

unsigned int Basda::MoConModule::getActivityStatus ( )

This method returns the current activity status.

It returns the 16 bit activity register:

  • bit 0: phasing initialized
  • bit 1: at maximal velocity
  • bit 2: tracking
  • bit 3: current profile mode
  • bit 4: -
  • bit 5: -
  • bit 6: -
  • bit 7: axis settled
  • bit 8: motor on/off
  • bit 9: position capture
  • bit 10: in motion
  • bit 11: in positive limit
  • bit 12: in negative limit
  • bit 13: limit profile segment
  • bit 14: -
  • bit 15: -
Returns
a 16 bit value

◆ getAEncPosition() [1/2]

int Basda::MoConModule::getAEncPosition ( )

This method returns the current position of the absolute encoder.

Returns
the absolute encoder position in steps/counts

◆ getAEncPosition() [2/2]

int Basda::MoConModule::getAEncPosition ( )

This method returns the current position of the absolute encoder.

Returns
the absolute encoder position in steps/counts

◆ getAmplifierCardInfo() [1/2]

void Basda::MoConModule::getAmplifierCardInfo ( )

This method returns the amplifier configuration of the motor.

The amplifier settings will be stored in the properties:

  • VAR.AMPLIFIER.CARD.CLASSIFICATION
  • VAR.AMPLIFIER.CARD.IDENTIFICATION
  • VAR.AMPLIFIER.CARD.NAME
  • VAR.AMPLIFIER.CARD.VERSION
  • VAR.AMPLIFIER.CARD.MANUFACTURE_DATE
  • VAR.AMPLIFIER.CARD.SERIAL_NUMBER
  • VAR.AMPLIFIER.CARD.OFFSET
Exceptions
Basda::MoCon::AADException

◆ getAmplifierCardInfo() [2/2]

void Basda::MoConModule::getAmplifierCardInfo ( )

This method returns the amplifier configuration of the motor.

The amplifier settings will be stored in the properties:

  • VAR.AMPLIFIER.CARD.CLASSIFICATION
  • VAR.AMPLIFIER.CARD.IDENTIFICATION
  • VAR.AMPLIFIER.CARD.NAME
  • VAR.AMPLIFIER.CARD.VERSION
  • VAR.AMPLIFIER.CARD.MANUFACTURE_DATE
  • VAR.AMPLIFIER.CARD.SERIAL_NUMBER
  • VAR.AMPLIFIER.CARD.OFFSET
Exceptions
Basda::MoCon::AADException

◆ getAmplifierInfo() [1/2]

void Basda::MoConModule::getAmplifierInfo ( )

This method returns information of the amplifier.

The amplifier settings will be stored in the properties:

  • VAR.AMPLIFIER.MODULE.CLASSIFICATION
  • VAR.AMPLIFIER.MODULE.IDENTIFICATION
  • VAR.AMPLIFIER.MODULE.NAME
  • VAR.AMPLIFIER.MODULE.MOTOR_POWER_SUPPLY
  • VAR.AMPLIFIER.MODULE.FUSE
  • VAR.AMPLIFIER.MODULE.THERMAL_FLAG
  • VAR.AMPLIFIER.MODULE.SHORT_CURRENT_FLAG
  • VAR.AMPLIFIER.MODULE.PWMA
  • VAR.AMPLIFIER.MODULE.PWMB
  • VAR.AMPLIFIER.MODULE.PWMC
  • VAR.AMPLIFIER.MODULE.SIGN_DIR_INVERSE
  • VAR.AMPLIFIER.MODULE.BREAK_POWEROFF_INVERSE
  • VAR.AMPLIFIER.MODULE.AUTO_POWEROFF_INVERSE
Exceptions
Basda::MoCon::AADException

◆ getAmplifierInfo() [2/2]

void Basda::MoConModule::getAmplifierInfo ( )

This method returns information of the amplifier.

The amplifier settings will be stored in the properties:

  • VAR.AMPLIFIER.MODULE.CLASSIFICATION
  • VAR.AMPLIFIER.MODULE.IDENTIFICATION
  • VAR.AMPLIFIER.MODULE.NAME
  • VAR.AMPLIFIER.MODULE.MOTOR_POWER_SUPPLY
  • VAR.AMPLIFIER.MODULE.FUSE
  • VAR.AMPLIFIER.MODULE.THERMAL_FLAG
  • VAR.AMPLIFIER.MODULE.SHORT_CURRENT_FLAG
  • VAR.AMPLIFIER.MODULE.PWMA
  • VAR.AMPLIFIER.MODULE.PWMB
  • VAR.AMPLIFIER.MODULE.PWMC
  • VAR.AMPLIFIER.MODULE.SIGN_DIR_INVERSE
  • VAR.AMPLIFIER.MODULE.BREAK_POWEROFF_INVERSE
  • VAR.AMPLIFIER.MODULE.AUTO_POWEROFF_INVERSE
Exceptions
Basda::MoCon::AADException

◆ getBasicSettings() [1/2]

void Basda::MoConModule::getBasicSettings ( bool  _compareParameter = false)

This method returns the basic configuration of the motor.

The basic settings will be stored in the properties:

  • CFG.DATASHEET.BASIC.PROFILE
  • CFG.DATASHEET.BASIC.RESOLUTION
  • CFG.DATASHEET.BASIC.VELOCITY.STRAIGHT
  • CFG.DATASHEET.BASIC.VELOCITY.START
  • CFG.DATASHEET.BASIC.VELOCITY.ACCELERATION
  • CFG.DATASHEET.BASIC.VELOCITY.DECELERATION
  • CFG.DATASHEET.BASIC.JERK
Exceptions
Basda::MoCon::MotorNotInitializedException

◆ getBasicSettings() [2/2]

void Basda::MoConModule::getBasicSettings ( bool  _compareParameter = false)

This method returns the basic configuration of the motor.

The basic settings will be stored in the properties:

  • CFG.DATASHEET.BASIC.PROFILE
  • CFG.DATASHEET.BASIC.RESOLUTION
  • CFG.DATASHEET.BASIC.VELOCITY.STRAIGHT
  • CFG.DATASHEET.BASIC.VELOCITY.START
  • CFG.DATASHEET.BASIC.VELOCITY.ACCELERATION
  • CFG.DATASHEET.BASIC.VELOCITY.DECELERATION
  • CFG.DATASHEET.BASIC.JERK
Exceptions
Basda::MoCon::MotorNotInitializedException

◆ getCurrentTime() [1/2]

Nice::I64 Basda::MoConModule::getCurrentTime ( )

This method stores the current PC time and Mocon cycles in the properties.

This method ask the MoCon for the current MoCon cycle and stores the PC time and the MoCon cycle it in the properties:

  • VAR.TIME.CURRENT.MOCON
  • VAR.TIME.CURRENT.SERVER

These properties keep the current time and will be updated every time when the synchroniseTime() or getCurrentTime() method is called.

See also
getReferenceTime()

◆ getCurrentTime() [2/2]

Nice::I64 Basda::MoConModule::getCurrentTime ( )

This method stores the current PC time and Mocon cycles in the properties.

This method ask the MoCon for the current MoCon cycle and stores the PC time and the MoCon cycle it in the properties:

  • VAR.TIME.CURRENT.MOCON
  • VAR.TIME.CURRENT.SERVER

These properties keep the current time and will be updated every time when the synchroniseTime() or getCurrentTime() method is called.

See also
getReferenceTime()

◆ getEncoderSettings() [1/2]

void Basda::MoConModule::getEncoderSettings ( bool  _compareParameter = false)

This method returns the incremental encoder settings.

The incremental encoder settings will be stored in the properties:

  • CFG.DATASHEET.ENCODER.COUNTS
  • CFG.DATASHEET.ENCODER.STEPS
  • CFG.DATASHEET.ENCODER.ERROR_LIMIT
Exceptions
Basda::MoCon::MotorNotInitializedException

◆ getEncoderSettings() [2/2]

void Basda::MoConModule::getEncoderSettings ( bool  _compareParameter = false)

This method returns the incremental encoder settings.

The incremental encoder settings will be stored in the properties:

  • CFG.DATASHEET.ENCODER.COUNTS
  • CFG.DATASHEET.ENCODER.STEPS
  • CFG.DATASHEET.ENCODER.ERROR_LIMIT
Exceptions
Basda::MoCon::MotorNotInitializedException

◆ getExternalProfileInfo() [1/2]

int Basda::MoConModule::getExternalProfileInfo ( )

This method returns the actual index of the external profile.

◆ getExternalProfileInfo() [2/2]

int Basda::MoConModule::getExternalProfileInfo ( )

This method returns the actual index of the external profile.

◆ getIEncPosition() [1/2]

int Basda::MoConModule::getIEncPosition ( )

This method returns the current position of the incremental encoder.

Returns
the incremental encoder position in steps/counts
Exceptions
Basda::MoCon::IEncNotInitializedException

◆ getIEncPosition() [2/2]

int Basda::MoConModule::getIEncPosition ( )

This method returns the current position of the incremental encoder.

Returns
the incremental encoder position in steps/counts
Exceptions
Basda::MoCon::IEncNotInitializedException

◆ getIEncVelocity() [1/2]

int Basda::MoConModule::getIEncVelocity ( )

This method returns the current velocity of the incremental encoder.

Returns
the current velocity of the incremental encoder
Exceptions
Basda::MoCon::IEncNotInitializedException

◆ getIEncVelocity() [2/2]

int Basda::MoConModule::getIEncVelocity ( )

This method returns the current velocity of the incremental encoder.

Returns
the current velocity of the incremental encoder
Exceptions
Basda::MoCon::IEncNotInitializedException

◆ getMEncPosition() [1/2]

int Basda::MoConModule::getMEncPosition ( )

This method returns the current absolute position.

The current position will be stored in the property

  • VAR.POSITION

The motor controller position will be converted based on the unit stored in the VAR.UNIT property.

Returns
the absolute position in steps/counts

◆ getMEncPosition() [2/2]

int Basda::MoConModule::getMEncPosition ( )

This method returns the current absolute position.

The current position will be stored in the property

  • VAR.POSITION

The motor controller position will be converted based on the unit stored in the VAR.UNIT property.

Returns
the absolute position in steps/counts

◆ getMotorControllerErrorNr() [1/2]

std::string Basda::MoConModule::getMotorControllerErrorNr ( )

This methods returns the motor controller error number.

In some cases the motor controller returns a Basda::MoCon::CheckSumException. This method read the error code from the MoCon and stores it in the property

  • VAR.MC.ERROR
Exceptions
Basda::MoCon::CheckSumException
See also
Basda::MoCon::CheckSumException

◆ getMotorControllerErrorNr() [2/2]

std::string Basda::MoConModule::getMotorControllerErrorNr ( )

This methods returns the motor controller error number.

In some cases the motor controller returns a Basda::MoCon::CheckSumException. This method read the error code from the MoCon and stores it in the property

  • VAR.MC.ERROR
Exceptions
Basda::MoCon::CheckSumException
See also
Basda::MoCon::CheckSumException

◆ getMotorControllerVersion() [1/2]

void Basda::MoConModule::getMotorControllerVersion ( )

This method returns the firmware version of the motor controller.

The firmware settings will be stored in the properties:

  • VAR.MC.TYPE
  • VAR.MC.CONTROLLED_AXIS
  • VAR.MC.VERSION

◆ getMotorControllerVersion() [2/2]

void Basda::MoConModule::getMotorControllerVersion ( )

This method returns the firmware version of the motor controller.

The firmware settings will be stored in the properties:

  • VAR.MC.TYPE
  • VAR.MC.CONTROLLED_AXIS
  • VAR.MC.VERSION

◆ getMotorSettings() [1/2]

void Basda::MoConModule::getMotorSettings ( bool  _compareParameter = false)

This method returns the motor configuration.

The motor settings will be stored in the properties:

  • CFG.DATASHEET.MOTOR.REFERENCE.SWITCH
  • CFG.DATASHEET.MOTOR.REFERENCE.SENSE
  • CFG.DATASHEET.MOTOR.VELOCITY.HOME
  • CFG.DATASHEET.MOTOR.VELOCITY.DOCKING
  • CFG.DATASHEET.MOTOR.DOCKING_DISTANCE
Exceptions
Basda::MoCon::MotorNotInitializedException

◆ getMotorSettings() [2/2]

void Basda::MoConModule::getMotorSettings ( bool  _compareParameter = false)

This method returns the motor configuration.

The motor settings will be stored in the properties:

  • CFG.DATASHEET.MOTOR.REFERENCE.SWITCH
  • CFG.DATASHEET.MOTOR.REFERENCE.SENSE
  • CFG.DATASHEET.MOTOR.VELOCITY.HOME
  • CFG.DATASHEET.MOTOR.VELOCITY.DOCKING
  • CFG.DATASHEET.MOTOR.DOCKING_DISTANCE
Exceptions
Basda::MoCon::MotorNotInitializedException

◆ getMotorType() [1/2]

int Basda::MoConModule::getMotorType ( )

Returns the motor type.

Returns
0 - servo (Basda::MotorType::SERVO) 1 - stepper (Basda::MotorType::STEPPER)

◆ getMotorType() [2/2]

int Basda::MoConModule::getMotorType ( )

Returns the motor type.

Returns
0 - servo (Basda::MotorType::SERVO) 1 - stepper (Basda::MotorType::STEPPER)

◆ getReferenceTime() [1/2]

Nice::I64 Basda::MoConModule::getReferenceTime ( )

This method synchronize the MoCon time with the PC time.

This method ask the MoCon for the current MoCon cycle and stores the PC time and the MoCon cycle it in the properties:

  • VAR.TIME.REFERENCE.MOCON
  • VAR.TIME.REFERENCE.SERVER
  • VAR.TIME.CURRENT.MOCON
  • VAR.TIME.CURRENT.SERVER

The VAR.TIME.REFERENCE properties keep the reference time, which will be updated only when this method is called. The VAR.TIME.CURRENT.MOCON properties keep the current time and will be updated every time when the synchroniseTime() or getCurrentTime() method is called.

See also
getCurrentTime()

◆ getReferenceTime() [2/2]

Nice::I64 Basda::MoConModule::getReferenceTime ( )

This method synchronize the MoCon time with the PC time.

This method ask the MoCon for the current MoCon cycle and stores the PC time and the MoCon cycle it in the properties:

  • VAR.TIME.REFERENCE.MOCON
  • VAR.TIME.REFERENCE.SERVER
  • VAR.TIME.CURRENT.MOCON
  • VAR.TIME.CURRENT.SERVER

The VAR.TIME.REFERENCE properties keep the reference time, which will be updated only when this method is called. The VAR.TIME.CURRENT.MOCON properties keep the current time and will be updated every time when the synchroniseTime() or getCurrentTime() method is called.

See also
getCurrentTime()

◆ getServoLoopSettings() [1/2]

void Basda::MoConModule::getServoLoopSettings ( bool  _compareParameter = false)

This method returns the servo settings of the motor.

The servo settings will be stored in the properties:

  • CFG.DATASHEET.SERVOLOOP.KP
  • CFG.DATASHEET.SERVOLOOP.KI
  • CFG.DATASHEET.SERVOLOOP.KD
  • CFG.DATASHEET.SERVOLOOP.KAFF
  • CFG.DATASHEET.SERVOLOOP.KVFF
  • CFG.DATASHEET.SERVOLOOP.KOUT
  • CFG.DATASHEET.SERVOLOOP.ILIM
  • CFG.DATASHEET.SERVOLOOP.BIAS
  • CFG.DATASHEET.SERVOLOOP.LIMIT
Exceptions
Basda::MoCon::CmdForServoException

◆ getServoLoopSettings() [2/2]

void Basda::MoConModule::getServoLoopSettings ( bool  _compareParameter = false)

This method returns the servo settings of the motor.

The servo settings will be stored in the properties:

  • CFG.DATASHEET.SERVOLOOP.KP
  • CFG.DATASHEET.SERVOLOOP.KI
  • CFG.DATASHEET.SERVOLOOP.KD
  • CFG.DATASHEET.SERVOLOOP.KAFF
  • CFG.DATASHEET.SERVOLOOP.KVFF
  • CFG.DATASHEET.SERVOLOOP.KOUT
  • CFG.DATASHEET.SERVOLOOP.ILIM
  • CFG.DATASHEET.SERVOLOOP.BIAS
  • CFG.DATASHEET.SERVOLOOP.LIMIT
Exceptions
Basda::MoCon::CmdForServoException

◆ getSignalStatus() [1/2]

unsigned int Basda::MoConModule::getSignalStatus ( )

This method returns the current signal status.

It returns the 16 bit signal register:

  • bit 0: encoder A
  • bit 1: encoder B
  • bit 2: encoder index
  • bit 3: home switch
  • bit 4: positive limit
  • bit 5: negative limit
  • bit 6: axis In
  • bit 7: hall A
  • bit 8: hall B
  • bit 9: hall C
  • bit 10: axis out
  • bit 11: -
  • bit 12: -
  • bit 13: -
  • bit 14: -
  • bit 15: -
Returns
a 16 bit value

◆ getSignalStatus() [2/2]

unsigned int Basda::MoConModule::getSignalStatus ( )

This method returns the current signal status.

It returns the 16 bit signal register:

  • bit 0: encoder A
  • bit 1: encoder B
  • bit 2: encoder index
  • bit 3: home switch
  • bit 4: positive limit
  • bit 5: negative limit
  • bit 6: axis In
  • bit 7: hall A
  • bit 8: hall B
  • bit 9: hall C
  • bit 10: axis out
  • bit 11: -
  • bit 12: -
  • bit 13: -
  • bit 14: -
  • bit 15: -
Returns
a 16 bit value

◆ getStartHomeDistance() [1/2]

int Basda::MoConModule::getStartHomeDistance ( )

This method returns the distance between the start point and the reference point.

The software position counter of the motor controller is zero after the motor controller is switched on. The moveToHome() method have to be called first in order to align the software position counter with the hardware position counter of the motor controller.

Returns
the start point - reference point distance

◆ getStartHomeDistance() [2/2]

int Basda::MoConModule::getStartHomeDistance ( )

This method returns the distance between the start point and the reference point.

The software position counter of the motor controller is zero after the motor controller is switched on. The moveToHome() method have to be called first in order to align the software position counter with the hardware position counter of the motor controller.

Returns
the start point - reference point distance

◆ getStepperSettings() [1/2]

void Basda::MoConModule::getStepperSettings ( bool  _compareParameter = false)

This method returns the stepper settings of the motor.

The stepper settings will be stored in the properties:

  • CFG.DATASHEET.STEPPER.MICROSTEPS.VALUE
  • CFG.DATASHEET.STEPPER.MICROSTEPS.ADAPTION
  • CFG.DATASHEET.STEPPER.AUTO_POWER_OFF
Exceptions
Basda::MoCon::CmdForStepperException

◆ getStepperSettings() [2/2]

void Basda::MoConModule::getStepperSettings ( bool  _compareParameter = false)

This method returns the stepper settings of the motor.

The stepper settings will be stored in the properties:

  • CFG.DATASHEET.STEPPER.MICROSTEPS.VALUE
  • CFG.DATASHEET.STEPPER.MICROSTEPS.ADAPTION
  • CFG.DATASHEET.STEPPER.AUTO_POWER_OFF
Exceptions
Basda::MoCon::CmdForStepperException

◆ getVelocity() [1/2]

int Basda::MoConModule::getVelocity ( )

This method returns the current velocity.

The current velocity will be stored in the property

  • VAR.VELOCITY
Returns
the current velocity in rev/min

◆ getVelocity() [2/2]

int Basda::MoConModule::getVelocity ( )

This method returns the current velocity.

The current velocity will be stored in the property

  • VAR.VELOCITY
Returns
the current velocity in rev/min

◆ initExternalProfile() [1/2]

Nice::Time Basda::MoConModule::initExternalProfile ( int  _frequency,
unsigned int  _maxSamplesPerSegment,
unsigned int  _minSamplesPerSegment,
unsigned int  _faultTolerance 
)

◆ initExternalProfile() [2/2]

Nice::Time Basda::MoConModule::initExternalProfile ( int  _frequency,
unsigned int  _maxSamplesPerSegment,
unsigned int  _minSamplesPerSegment,
unsigned int  _faultTolerance 
)

◆ initializeMotor() [1/2]

void Basda::MoConModule::initializeMotor ( )

This method try to initialized the motor If not all motor settings are available and valid a exception will be thrown.

Exceptions
Basda::MoCon::MotorInMotionException
Basda::MoCon::ParamMissingException
Basda::MoCon::NoAmpplifierException
Basda::MoCon::MicrostepResolutionException
Basda::MoCon::CheckSumException

◆ initializeMotor() [2/2]

void Basda::MoConModule::initializeMotor ( )

This method try to initialized the motor If not all motor settings are available and valid a exception will be thrown.

Exceptions
Basda::MoCon::MotorInMotionException
Basda::MoCon::ParamMissingException
Basda::MoCon::NoAmpplifierException
Basda::MoCon::MicrostepResolutionException
Basda::MoCon::CheckSumException

◆ isAtHome() [1/2]

bool Basda::MoConModule::isAtHome ( )

◆ isAtHome() [2/2]

bool Basda::MoConModule::isAtHome ( )

◆ isAtLimit() [1/2]

int Basda::MoConModule::isAtLimit ( )

Checks if the motor is in limit.

This method checks the motor controller limit switches and set the corresponding properties. If the motor is not in the hardware limit, this method checks if the current position (stored in the VAR.POSITION property) is in the valid range. If the current position out of the valid range, the limit properties indicate that the motor is in the software limits.

The status will be stored in the properties:

  • VAR.LIMIT
Exceptions
Basda::MoCon::LimitSwitchException
Basda::MoCon::MotorNotInitializedException
See also
IN_VALID_RANGE, SOFTWARE_LIMIT, HARDWARE_LIMIT

◆ isAtLimit() [2/2]

int Basda::MoConModule::isAtLimit ( )

Checks if the motor is in limit.

This method checks the motor controller limit switches and set the corresponding properties. If the motor is not in the hardware limit, this method checks if the current position (stored in the VAR.POSITION property) is in the valid range. If the current position out of the valid range, the limit properties indicate that the motor is in the software limits.

The status will be stored in the properties:

  • VAR.LIMIT
Exceptions
Basda::MoCon::LimitSwitchException
Basda::MoCon::MotorNotInitializedException
See also
IN_VALID_RANGE, SOFTWARE_LIMIT, HARDWARE_LIMIT

◆ isExternalProfileDone() [1/2]

bool Basda::MoConModule::isExternalProfileDone ( )

◆ isExternalProfileDone() [2/2]

bool Basda::MoConModule::isExternalProfileDone ( )

◆ isMotionComplete() [1/2]

bool Basda::MoConModule::isMotionComplete ( )

Checks if the motor has finished the motion.

The following property will indicate the motion completeness

  • VAR.MOTION_COMPLETE
Todo:
this method doesn't update this property active. It just readout its property. An active readout of the motion complete event should be implemented.

◆ isMotionComplete() [2/2]

bool Basda::MoConModule::isMotionComplete ( )

Checks if the motor has finished the motion.

The following property will indicate the motion completeness

  • VAR.MOTION_COMPLETE
Todo:
this method doesn't update this property active. It just readout its property. An active readout of the motion complete event should be implemented.

◆ isMoving() [1/2]

bool Basda::MoConModule::isMoving ( )

Checks if the motor is still in motion.

The following property will indicate the motion

  • VAR.MOVING

◆ isMoving() [2/2]

bool Basda::MoConModule::isMoving ( )

Checks if the motor is still in motion.

The following property will indicate the motion

  • VAR.MOVING

◆ loadMotorSettings() [1/2]

void Basda::MoConModule::loadMotorSettings ( )

◆ loadMotorSettings() [2/2]

void Basda::MoConModule::loadMotorSettings ( )

◆ moveAbsolute() [1/2]

void Basda::MoConModule::moveAbsolute ( int  _absolutePosition)

The motor moves to the absolute position.

The given absolute position will be checked if it is in the valid travel range, before the command will be send to the motor controller. Is the target position still in the valid travel range the absolute position will be send to the motor controller. In case the target position is out of the valid range, the position will be adjusted to the maximum / minimum position. The travel range can be set in the configuration file via the property

  • CFG.DATASHEET.TRAVELRANGE.

The unit of the travel range property is steps/counts and hard-coded.

Parameters
_absolutePosition
_unitthe unit in which the absolute position value is given
Exceptions
Basda::MoCon::MotorInMotionException
Basda::MoCon::MotorNotInitializedException
Basda::MoCon::MotorInPosLimitException
Basda::MoCon::MotorInNegLimitException
See also
Unit, Basda::MoConModuleMoveAbsThread
Todo:
remove the hardcoded travel range unit!

◆ moveAbsolute() [2/2]

void Basda::MoConModule::moveAbsolute ( int  _absolutePosition)

The motor moves to the absolute position.

The given absolute position will be checked if it is in the valid travel range, before the command will be send to the motor controller. Is the target position still in the valid travel range the absolute position will be send to the motor controller. In case the target position is out of the valid range, the position will be adjusted to the maximum / minimum position. The travel range can be set in the configuration file via the property

  • CFG.DATASHEET.TRAVELRANGE.

The unit of the travel range property is steps/counts and hard-coded.

Parameters
_absolutePosition
_unitthe unit in which the absolute position value is given
Exceptions
Basda::MoCon::MotorInMotionException
Basda::MoCon::MotorNotInitializedException
Basda::MoCon::MotorInPosLimitException
Basda::MoCon::MotorInNegLimitException
See also
Unit, Basda::MoConModuleMoveAbsThread
Todo:
remove the hardcoded travel range unit!

◆ moveCorrection() [1/2]

void Basda::MoConModule::moveCorrection ( )

◆ moveCorrection() [2/2]

void Basda::MoConModule::moveCorrection ( )

◆ moveOutOfLimit() [1/2]

double Basda::MoConModule::moveOutOfLimit ( )

The motor moves out of the limit switch.

Returns
the docking distance (return value is required to calculate the completion value)

◆ moveOutOfLimit() [2/2]

double Basda::MoConModule::moveOutOfLimit ( )

The motor moves out of the limit switch.

Returns
the docking distance (return value is required to calculate the completion value)

◆ moveRelative() [1/2]

void Basda::MoConModule::moveRelative ( int  _relativePosition)

The motor moves to the relative position.

The given relative position will be converted to a absolute position value first to check if it is in the valid travel range. Is the target position still in the valid travel range the relative position will be send to the motor controller. In case the target position is out of the valid range, the position will be adjusted to the maximum valid relative position. The travel range can be set in the configuration file via the property

  • CFG.DATASHEET.TRAVELRANGE.

The unit of the travel range property is steps/counts and hard-coded.

Parameters
_relativePositionin steps
_unitthe unit in which the absolute position value is given
Exceptions
Basda::MoCon::MotorInMotionException
Basda::MoCon::MotorNotInitializedException
Basda::MoCon::MotorInPosLimitException
Basda::MoCon::MotorInNegLimitException
See also
Unit, Basda::MoConModuleMoveRelThread

◆ moveRelative() [2/2]

void Basda::MoConModule::moveRelative ( int  _relativePosition)

The motor moves to the relative position.

The given relative position will be converted to a absolute position value first to check if it is in the valid travel range. Is the target position still in the valid travel range the relative position will be send to the motor controller. In case the target position is out of the valid range, the position will be adjusted to the maximum valid relative position. The travel range can be set in the configuration file via the property

  • CFG.DATASHEET.TRAVELRANGE.

The unit of the travel range property is steps/counts and hard-coded.

Parameters
_relativePositionin steps
_unitthe unit in which the absolute position value is given
Exceptions
Basda::MoCon::MotorInMotionException
Basda::MoCon::MotorNotInitializedException
Basda::MoCon::MotorInPosLimitException
Basda::MoCon::MotorInNegLimitException
See also
Unit, Basda::MoConModuleMoveRelThread

◆ moveToHome() [1/2]

void Basda::MoConModule::moveToHome ( )

The motor is looking for the reference position.

The motor controller reset the step counter to zero if the home position is found.

Exceptions
Basda::MoCon::MotorInMotionException
Basda::MoCon::MotorNotInitializedException
Basda::MoCon::MotorSettingsIncompleteException
See also
Basda::MoConModuleMoveHomeThread

◆ moveToHome() [2/2]

void Basda::MoConModule::moveToHome ( )

The motor is looking for the reference position.

The motor controller reset the step counter to zero if the home position is found.

Exceptions
Basda::MoCon::MotorInMotionException
Basda::MoCon::MotorNotInitializedException
Basda::MoCon::MotorSettingsIncompleteException
See also
Basda::MoConModuleMoveHomeThread

◆ moveToNegativeLimit() [1/2]

double Basda::MoConModule::moveToNegativeLimit ( bool  _travelRangeCheck = true)

The motor moves to the negative software limit switch.

Parameters
_travelRangeCheckis true if the travel range might be checked before the movement. In that case the motor will move maximal to the software limit. If false the motor will move relative INT_MAX steps
Returns
the minimal absolute position within the travel range (return value is required to calculate the completion value)

◆ moveToNegativeLimit() [2/2]

double Basda::MoConModule::moveToNegativeLimit ( bool  _travelRangeCheck = true)

The motor moves to the negative software limit switch.

Parameters
_travelRangeCheckis true if the travel range might be checked before the movement. In that case the motor will move maximal to the software limit. If false the motor will move relative INT_MAX steps
Returns
the minimal absolute position within the travel range (return value is required to calculate the completion value)

◆ moveToPositiveLimit() [1/2]

double Basda::MoConModule::moveToPositiveLimit ( bool  _travelRangeCheck = true)

The motor moves to the positive software limit switch.

Parameters
_travelRangeCheckis true if the travel range might be checked before the movement. In that case the motor will move maximal to the software limit. If false the motor will move relative INT_MAX steps
Returns
the maximal absolute position within the travel range (return value is required to calculate the completion value)

◆ moveToPositiveLimit() [2/2]

double Basda::MoConModule::moveToPositiveLimit ( bool  _travelRangeCheck = true)

The motor moves to the positive software limit switch.

Parameters
_travelRangeCheckis true if the travel range might be checked before the movement. In that case the motor will move maximal to the software limit. If false the motor will move relative INT_MAX steps
Returns
the maximal absolute position within the travel range (return value is required to calculate the completion value)

◆ receiveDataRaw() [1/2]

void Basda::MoConModule::receiveDataRaw ( const unsigned int  _cardNo,
const unsigned int  _commandID,
const unsigned int  _moduleNo,
std::string &  _ret,
const unsigned int  _numberOfLines 
)

This method was requested by Lorenzo Busoni (lbuso.nosp@m.ni@a.nosp@m.rcetr.nosp@m.i.as.nosp@m.tro.i.nosp@m.t 02.03.2012)

It supports a direct communication with the MoCon without to parse the response. BUT THE USER OF THIS METHOD TAKE OVER THE RESPONSIBILITY OF THE CORRECT ERROR HANDLING. THE DRIVER DOES NOT HAVE THE CONTROL OVER THAT DEVICE ANY MORE.

Parameters
_commandIDthe command ID which is defined in the CommandIDs.h
_cardNothe card number
_moduleNothe module number
_retthe allocated space for the returned data
_numberOfLinesThis parameter limitates how many data should be read from the Ethernet buffer. All data are read if the value is -1.
Returns
the return parameter is stored in _ret parameter.
See also
chat

◆ receiveDataRaw() [2/2]

void Basda::MoConModule::receiveDataRaw ( const unsigned int  _cardNo,
const unsigned int  _commandID,
const unsigned int  _moduleNo,
std::string &  _ret,
const unsigned int  _numberOfLines 
)

This method was requested by Lorenzo Busoni (lbuso.nosp@m.ni@a.nosp@m.rcetr.nosp@m.i.as.nosp@m.tro.i.nosp@m.t 02.03.2012)

It supports a direct communication with the MoCon without to parse the response. BUT THE USER OF THIS METHOD TAKE OVER THE RESPONSIBILITY OF THE CORRECT ERROR HANDLING. THE DRIVER DOES NOT HAVE THE CONTROL OVER THAT DEVICE ANY MORE.

Parameters
_commandIDthe command ID which is defined in the CommandIDs.h
_cardNothe card number
_moduleNothe module number
_retthe allocated space for the returned data
_numberOfLinesThis parameter limitates how many data should be read from the Ethernet buffer. All data are read if the value is -1.
Returns
the return parameter is stored in _ret parameter.
See also
chat

◆ saveMotorSettings() [1/2]

void Basda::MoConModule::saveMotorSettings ( )

◆ saveMotorSettings() [2/2]

void Basda::MoConModule::saveMotorSettings ( )

◆ setAmplifierSettings() [1/4]

void Basda::MoConModule::setAmplifierSettings ( const SelectAmplifierSettings::Constant  _selectID,
const int  _parameter1,
const int  _parameter2 = -1,
const int  _parameter3 = -1 
)


With this method a value of the amplifier settings can be changed.

The amplifier settings are:

SelectID Parameter 1 Parameter 2 Parameter 3
Sense control signal bit 0: PWMa/Pulse (0=not inverse, 1=inverse)
bit 1: PWMb (0=not inverse, 1=inverse)
bit 2: PWMc/AtRest (0=not inverse, 1=inverse)
bit 3: Sign/Dir (0=not inverse, 1=inverse)
bit 4: power off (0=not inverse, 1=inverse)
bit 5: auto power off (0=not inverse, 1=inverse)
- -
Bit mask for microsteps 0x0..0xFF - -
Microsteps and allocation 16 different position: 1..16 microstep value: 1..1024 bit value: 0x0..0xFF
Parameters
_selectIDis the ID to define the type of the _parameter
_parameter1the configuration value
_parameter2the configuration value only for the Microsteps and adaption option
_parameter3the configuration value only for the Microsteps and adaption option
Exceptions
Basda::MoCon::CmdForStepperException
Basda::MoCon::MotorInMotionException
See also
MPIA/MoCon/CommandIDs.h - SelectAmplifierSettings

◆ setAmplifierSettings() [2/4]

void Basda::MoConModule::setAmplifierSettings ( const SelectAmplifierSettings::Constant  _selectID,
const int  _parameter1,
const int  _parameter2 = -1,
const int  _parameter3 = -1 
)


With this method a value of the amplifier settings can be changed.

The amplifier settings are:

SelectID Parameter 1 Parameter 2 Parameter 3
Sense control signal bit 0: PWMa/Pulse (0=not inverse, 1=inverse)
bit 1: PWMb (0=not inverse, 1=inverse)
bit 2: PWMc/AtRest (0=not inverse, 1=inverse)
bit 3: Sign/Dir (0=not inverse, 1=inverse)
bit 4: power off (0=not inverse, 1=inverse)
bit 5: auto power off (0=not inverse, 1=inverse)
- -
Bit mask for microsteps 0x0..0xFF - -
Microsteps and allocation 16 different position: 1..16 microstep value: 1..1024 bit value: 0x0..0xFF
Parameters
_selectIDis the ID to define the type of the _parameter
_parameter1the configuration value
_parameter2the configuration value only for the Microsteps and adaption option
_parameter3the configuration value only for the Microsteps and adaption option
Exceptions
Basda::MoCon::CmdForStepperException
Basda::MoCon::MotorInMotionException
See also
MPIA/MoCon/CommandIDs.h - SelectAmplifierSettings

◆ setAmplifierSettings() [3/4]

void Basda::MoConModule::setAmplifierSettings ( )

This method sets all amplifier settings with the values stored in the property tree.

The amplifier settings are stored in the sub tree CFG.DATASHEET.AMPLIFIER of the motor and can be configured via the configuration files.

◆ setAmplifierSettings() [4/4]

void Basda::MoConModule::setAmplifierSettings ( )

This method sets all amplifier settings with the values stored in the property tree.

The amplifier settings are stored in the sub tree CFG.DATASHEET.AMPLIFIER of the motor and can be configured via the configuration files.

◆ setBasicSettings() [1/4]

void Basda::MoConModule::setBasicSettings ( const SelectBasicSettings::Constant  _selectID,
const double  _parameter 
)


With this method a value of the basic configuration can be changed.

The basic setting consist of

SelectID Parameter
Profile 0=trapeze, 2=s-curve
Steps/Counts per revolution 1..8192
Velocity 0.0115..81916250.0 (unit: revolution per minute)
Start velocity 0.0115..81916250.0 (unit: revolution per minute)
Acceleration 1717..2147483647 (unit: revolution per minute^2)
Deceleration 1717..2147483647 (unit: revolution per minute^2)
Jerk 3930..2147483647 (unit: revolution per minute^3)
Parameters
_selectIDis the ID to define the type of the _parameter
_parameterthe configuration value
Exceptions
Basda::MoCon::CmdForStepperException
Basda::MoCon::RevolutionNotDefinedException
Basda::MoCon::MotorInMotionException
See also
MPIA/MoCon/CommandIDs.h - SelectBasicSettings

◆ setBasicSettings() [2/4]

void Basda::MoConModule::setBasicSettings ( const SelectBasicSettings::Constant  _selectID,
const double  _parameter 
)


With this method a value of the basic configuration can be changed.

The basic setting consist of

SelectID Parameter
Profile 0=trapeze, 2=s-curve
Steps/Counts per revolution 1..8192
Velocity 0.0115..81916250.0 (unit: revolution per minute)
Start velocity 0.0115..81916250.0 (unit: revolution per minute)
Acceleration 1717..2147483647 (unit: revolution per minute^2)
Deceleration 1717..2147483647 (unit: revolution per minute^2)
Jerk 3930..2147483647 (unit: revolution per minute^3)
Parameters
_selectIDis the ID to define the type of the _parameter
_parameterthe configuration value
Exceptions
Basda::MoCon::CmdForStepperException
Basda::MoCon::RevolutionNotDefinedException
Basda::MoCon::MotorInMotionException
See also
MPIA/MoCon/CommandIDs.h - SelectBasicSettings

◆ setBasicSettings() [3/4]

void Basda::MoConModule::setBasicSettings ( )

This method sets all basic configuration with the values stored in the property tree.

The basic configuration values are stored in the sub tree CFG.DATASHEET.BASIC of the motor and can be configured via the configuration files.

◆ setBasicSettings() [4/4]

void Basda::MoConModule::setBasicSettings ( )

This method sets all basic configuration with the values stored in the property tree.

The basic configuration values are stored in the sub tree CFG.DATASHEET.BASIC of the motor and can be configured via the configuration files.

◆ setCollision() [1/2]

void Basda::MoConModule::setCollision ( bool  _collisionNegative,
bool  _collisionPositive 
)

This method enables the flag to indicate whether the CoCon detected a collision.

In that case the limit switch exception 'broken cable' will be ignored.

Parameters
_collisionif true a collision was detected by the CoCon

◆ setCollision() [2/2]

void Basda::MoConModule::setCollision ( bool  _collisionNegative,
bool  _collisionPositive 
)

This method enables the flag to indicate whether the CoCon detected a collision.

In that case the limit switch exception 'broken cable' will be ignored.

Parameters
_collisionif true a collision was detected by the CoCon

◆ setEncoderSettings() [1/4]

void Basda::MoConModule::setEncoderSettings ( const SelectSetEncodeSettings::Constant  _selectID,
const int  _parameter 
)


With this method a value of the incremental encoder settings can be changed.

The incremental encoder settings are:

SelectID Parameter
incremental counts per revolution -32767..32767 (unit: counts/rev)
steps per revolution -32767..32767 (unit: steps/rev)
error limit 0..2147483647
Parameters
_selectIDis the ID to define the type of the _parameter
_parameterthe configuration value
Exceptions
Basda::MoCon::MotorInMotionException
See also
MPIA/MoCon/CommandIDs.h - SelectSetEncodeSettings

◆ setEncoderSettings() [2/4]

void Basda::MoConModule::setEncoderSettings ( const SelectSetEncodeSettings::Constant  _selectID,
const int  _parameter 
)


With this method a value of the incremental encoder settings can be changed.

The incremental encoder settings are:

SelectID Parameter
incremental counts per revolution -32767..32767 (unit: counts/rev)
steps per revolution -32767..32767 (unit: steps/rev)
error limit 0..2147483647
Parameters
_selectIDis the ID to define the type of the _parameter
_parameterthe configuration value
Exceptions
Basda::MoCon::MotorInMotionException
See also
MPIA/MoCon/CommandIDs.h - SelectSetEncodeSettings

◆ setEncoderSettings() [3/4]

void Basda::MoConModule::setEncoderSettings ( )

This method sets all incremental encoder settings with the values stored in the property tree.

The incremental encoder settings are stored in the sub tree CFG.DATASHEET.ENCODER of the motor and can be configured via the configuration files.

◆ setEncoderSettings() [4/4]

void Basda::MoConModule::setEncoderSettings ( )

This method sets all incremental encoder settings with the values stored in the property tree.

The incremental encoder settings are stored in the sub tree CFG.DATASHEET.ENCODER of the motor and can be configured via the configuration files.

◆ setExternalProfileBufferSize() [1/2]

void Basda::MoConModule::setExternalProfileBufferSize ( const unsigned int  _bufferSize,
bool  _extended = true 
)

This method set the external buffer size.

Parameters
_bufferSizethe buffer size 1..4294967295
_extendedenables the extended mode that allows to program the external profile with < index >, < time >, < velocity >, < position >, < acceleration >, < jerk >, otherwise the external profile needs only the parameter < index >, < time >, < velocity >, < position > (disable = 0, enable = 1)
See also
::Basda::MoConModuleEvent::parseTraceData

◆ setExternalProfileBufferSize() [2/2]

void Basda::MoConModule::setExternalProfileBufferSize ( const unsigned int  _bufferSize,
bool  _extended = true 
)

This method set the external buffer size.

Parameters
_bufferSizethe buffer size 1..4294967295
_extendedenables the extended mode that allows to program the external profile with < index >, < time >, < velocity >, < position >, < acceleration >, < jerk >, otherwise the external profile needs only the parameter < index >, < time >, < velocity >, < position > (disable = 0, enable = 1)
See also
::Basda::MoConModuleEvent::parseTraceData

◆ setExternalProfileData() [1/2]

void Basda::MoConModule::setExternalProfileData ( const unsigned int  _index,
const unsigned int  _timeBase,
const int  _velocity,
const int  _position,
const int  _acceleration = 0,
const int  _jerk = 0 
)

This method set the external profile data.

Parameters
_indexthe data value index 0..4294967295
_timeBase0..4294967295
_velocity-2147483647..2147483647
_position-2147483647..2147483647
_accelerationoptional, has to be defined if the extended mode is enabled
_jerkoptional, has to be defined if the extended mode is enabled
See also
::Basda::MoConModuleEvent::parseTraceData

◆ setExternalProfileData() [2/2]

void Basda::MoConModule::setExternalProfileData ( const unsigned int  _index,
const unsigned int  _timeBase,
const int  _velocity,
const int  _position,
const int  _acceleration = 0,
const int  _jerk = 0 
)

This method set the external profile data.

Parameters
_indexthe data value index 0..4294967295
_timeBase0..4294967295
_velocity-2147483647..2147483647
_position-2147483647..2147483647
_accelerationoptional, has to be defined if the extended mode is enabled
_jerkoptional, has to be defined if the extended mode is enabled
See also
::Basda::MoConModuleEvent::parseTraceData

◆ setExternalProfileStart() [1/2]

void Basda::MoConModule::setExternalProfileStart ( const ValueStartMode::Constant  _startMode,
const Nice::Date  _startTime = Nice::Date::microSeconds(-1) 
)

This method starts the external profile from the beginning or from the last position.

Parameters
_startMode- define whether the profile should start from the beginning or from the current position
_starTime- the start time in cycle clocks (-1 is chosen to start the profile immediately; start time 0 (zero means to start at cycle zero))
See also
MPIA/MoCon/CommandIDs.h - ValueStartMode

◆ setExternalProfileStart() [2/2]

void Basda::MoConModule::setExternalProfileStart ( const ValueStartMode::Constant  _startMode,
const Nice::Date  _startTime = Nice::Date::microSeconds(-1) 
)

This method starts the external profile from the beginning or from the last position.

Parameters
_startMode- define whether the profile should start from the beginning or from the current position
_starTime- the start time in cycle clocks (-1 is chosen to start the profile immediately; start time 0 (zero means to start at cycle zero))
See also
MPIA/MoCon/CommandIDs.h - ValueStartMode

◆ setExternalProfileStop() [1/2]

void Basda::MoConModule::setExternalProfileStop ( )

This method stops the external profile.

◆ setExternalProfileStop() [2/2]

void Basda::MoConModule::setExternalProfileStop ( )

This method stops the external profile.

◆ setMotionComplete() [1/2]

void Basda::MoConModule::setMotionComplete ( bool  _complete)

Set the MOTOR_COMPLETE flag.

The following property is used

  • VAR.MOTION_COMPLETE

◆ setMotionComplete() [2/2]

void Basda::MoConModule::setMotionComplete ( bool  _complete)

Set the MOTOR_COMPLETE flag.

The following property is used

  • VAR.MOTION_COMPLETE

◆ setMotorSettings() [1/4]

void Basda::MoConModule::setMotorSettings ( const SelectMotorSettings::Constant  _selectID,
const double  _parameter 
)


With this method a value of the motor configuration can be changed.

SelectID Parameter
Reference switch 0: disable (default)
1: positive limit switch
2: negative limit switch
3: separate switch
4: level switch
Reference sense 0: reference switch is high active (default)
1: reference switch is low active
Home velocity 0.0115..81916250.0 (unit: revolution per minute)
Docking velocity 0.0115..81916250.0 (unit: revolution per minute)
Docking distance to reference switch 1..1000000000
Parameters
_selectIDis the ID to define the type of the _parameter
_parameterthe configuration value
Exceptions
Basda::MoCon::RevolutionNotDefinedException
Basda::MoCon::MotorInMotionException
See also
MPIA/MoCon/CommandIDs.h - SelectMotorSettings

◆ setMotorSettings() [2/4]

void Basda::MoConModule::setMotorSettings ( const SelectMotorSettings::Constant  _selectID,
const double  _parameter 
)


With this method a value of the motor configuration can be changed.

SelectID Parameter
Reference switch 0: disable (default)
1: positive limit switch
2: negative limit switch
3: separate switch
4: level switch
Reference sense 0: reference switch is high active (default)
1: reference switch is low active
Home velocity 0.0115..81916250.0 (unit: revolution per minute)
Docking velocity 0.0115..81916250.0 (unit: revolution per minute)
Docking distance to reference switch 1..1000000000
Parameters
_selectIDis the ID to define the type of the _parameter
_parameterthe configuration value
Exceptions
Basda::MoCon::RevolutionNotDefinedException
Basda::MoCon::MotorInMotionException
See also
MPIA/MoCon/CommandIDs.h - SelectMotorSettings

◆ setMotorSettings() [3/4]

void Basda::MoConModule::setMotorSettings ( )

This method sets all motor configurations with the values stored in the property tree.

The motor configuration values are stored in the sub tree CFG.DATASHEET.MOTOR of the motor and can be configured via the configuration files.

◆ setMotorSettings() [4/4]

void Basda::MoConModule::setMotorSettings ( )

This method sets all motor configurations with the values stored in the property tree.

The motor configuration values are stored in the sub tree CFG.DATASHEET.MOTOR of the motor and can be configured via the configuration files.

◆ setProfilePosition() [1/2]

void Basda::MoConModule::setProfilePosition ( double  _position)

Change the absolute position of the motors.

The motor will not move, but the current absolute position will be set to the given position value. The new position value can only be inside the travel range.

Parameters
_positionthe new absolute position in steps
Exceptions
Basda::MoCon::OutOfRangeException

◆ setProfilePosition() [2/2]

void Basda::MoConModule::setProfilePosition ( double  _position)

Change the absolute position of the motors.

The motor will not move, but the current absolute position will be set to the given position value. The new position value can only be inside the travel range.

Parameters
_positionthe new absolute position in steps
Exceptions
Basda::MoCon::OutOfRangeException

◆ setServoLoopSettings() [1/4]

void Basda::MoConModule::setServoLoopSettings ( const SelectServoLoopSettings::Constant  _selectID,
const unsigned int  _parameter 
)


This method set the servo settings.

The servo settings can be set only for servo motors. The servo settings are:

SelectID Parameter
KP 0..32767
KI 0..32767
KD 0..32767
KAFF 0..32767
KVFF 0..32767
KOUT 0..100 (unit: %)
ILIM 0..2147483647
BIAS -100..100 (unit: %)
LIMIT 0..100 (unit: %)
Parameters
_selectIDis the ID to define the type of the _parameter
_parameterthe configuration value
Exceptions
Basda::MoCon::CmdForServoException
Basda::MoCon::MotorInMotionException
See also
MPIA/MoCon/CommandIDs.h - SelectServoLoopSettings

◆ setServoLoopSettings() [2/4]

void Basda::MoConModule::setServoLoopSettings ( const SelectServoLoopSettings::Constant  _selectID,
const unsigned int  _parameter 
)


This method set the servo settings.

The servo settings can be set only for servo motors. The servo settings are:

SelectID Parameter
KP 0..32767
KI 0..32767
KD 0..32767
KAFF 0..32767
KVFF 0..32767
KOUT 0..100 (unit: %)
ILIM 0..2147483647
BIAS -100..100 (unit: %)
LIMIT 0..100 (unit: %)
Parameters
_selectIDis the ID to define the type of the _parameter
_parameterthe configuration value
Exceptions
Basda::MoCon::CmdForServoException
Basda::MoCon::MotorInMotionException
See also
MPIA/MoCon/CommandIDs.h - SelectServoLoopSettings

◆ setServoLoopSettings() [3/4]

void Basda::MoConModule::setServoLoopSettings ( )

This method sets all servo settings with the values stored in the property tree.

The servo settings are stored in the sub tree CFG.DATASHEET.SERVOLOOP of the motor and can be configured via the configuration files.

◆ setServoLoopSettings() [4/4]

void Basda::MoConModule::setServoLoopSettings ( )

This method sets all servo settings with the values stored in the property tree.

The servo settings are stored in the sub tree CFG.DATASHEET.SERVOLOOP of the motor and can be configured via the configuration files.

◆ setStepperSettings() [1/4]

void Basda::MoConModule::setStepperSettings ( const SelectStepperSettings::Constant  _selectID,
const int  _parameter 
)


With this method a value of the stepper settings can be changed.

The stepper settings can be set only for stepper motors. The stepper settings are:

SelectID Parameter
Micro steps 1..x (maximum depending on the amplifier)
Micro steps adaption 0: disable, 1: enable
Auto power off / break 0: disable, 1: enable

Each step of a stepper motor is divided in microsteps. In the default mode is the micro step adaption enabled and the motor position will be adjusted to a full step. To move the motor in micro steps the micro step adaption has to be disabled. But note: The position value has to multiply with the micro steps in order to reach the same position as without micro steps. The auto power off parameter allows that the power will be switched off automatically in order to reduce the waste heat.

Parameters
_selectIDis the ID to define the type of the _parameter
_parameterthe configuration value
Exceptions
Basda::MoCon::CmdForStepperException
Basda::MoCon::MotorInMotionExceptionERVO
See also
MPIA/MoCon/CommandIDs.h - SelectStepperSettings

◆ setStepperSettings() [2/4]

void Basda::MoConModule::setStepperSettings ( const SelectStepperSettings::Constant  _selectID,
const int  _parameter 
)


With this method a value of the stepper settings can be changed.

The stepper settings can be set only for stepper motors. The stepper settings are:

SelectID Parameter
Micro steps 1..x (maximum depending on the amplifier)
Micro steps adaption 0: disable, 1: enable
Auto power off / break 0: disable, 1: enable

Each step of a stepper motor is divided in microsteps. In the default mode is the micro step adaption enabled and the motor position will be adjusted to a full step. To move the motor in micro steps the micro step adaption has to be disabled. But note: The position value has to multiply with the micro steps in order to reach the same position as without micro steps. The auto power off parameter allows that the power will be switched off automatically in order to reduce the waste heat.

Parameters
_selectIDis the ID to define the type of the _parameter
_parameterthe configuration value
Exceptions
Basda::MoCon::CmdForStepperException
Basda::MoCon::MotorInMotionExceptionERVO
See also
MPIA/MoCon/CommandIDs.h - SelectStepperSettings

◆ setStepperSettings() [3/4]

void Basda::MoConModule::setStepperSettings ( )

This method sets all stepper settings with the values stored in the property tree.

The stepper settings are stored in the sub tree CFG.DATASHEET.STEPPER of the motor and can be configured via the configuration files.

◆ setStepperSettings() [4/4]

void Basda::MoConModule::setStepperSettings ( )

This method sets all stepper settings with the values stored in the property tree.

The stepper settings are stored in the sub tree CFG.DATASHEET.STEPPER of the motor and can be configured via the configuration files.

◆ stop() [1/2]

void Basda::MoConModule::stop ( )

This method stops the motor with a deceleration.

◆ stop() [2/2]

void Basda::MoConModule::stop ( )

This method stops the motor with a deceleration.

◆ travelRangeChanged() [1/2]

void Basda::MoConModule::travelRangeChanged ( const Nice::Point _a)
private

◆ travelRangeChanged() [2/2]

void Basda::MoConModule::travelRangeChanged ( const Nice::Point _a)
private

◆ uploadExternalProfile() [1/4]

Nice::Date Basda::MoConModule::uploadExternalProfile ( )

This uploads the external profile data.

◆ uploadExternalProfile() [2/4]

Nice::Date Basda::MoConModule::uploadExternalProfile ( )

This uploads the external profile data.

◆ uploadExternalProfile() [3/4]

void Basda::MoConModule::uploadExternalProfile ( const Nice::SeqSeqInt _segments)

◆ uploadExternalProfile() [4/4]

void Basda::MoConModule::uploadExternalProfile ( const Nice::SeqSeqInt _segments)

◆ validateBasicSettings() [1/2]

void Basda::MoConModule::validateBasicSettings ( )

◆ validateBasicSettings() [2/2]

void Basda::MoConModule::validateBasicSettings ( )

◆ validateExternalProfile() [1/2]

void Basda::MoConModule::validateExternalProfile ( )

◆ validateExternalProfile() [2/2]

void Basda::MoConModule::validateExternalProfile ( )

◆ waitForEvent() [1/2]

void Basda::MoConModule::waitForEvent ( )

This method wait till an event was received.

The timeout parameter is defined in the property CFG.CONNECTION.EVENT_TIMEOUT and defines how long the method should wait for an incoming event.

◆ waitForEvent() [2/2]

void Basda::MoConModule::waitForEvent ( )

This method wait till an event was received.

The timeout parameter is defined in the property CFG.CONNECTION.EVENT_TIMEOUT and defines how long the method should wait for an incoming event.

Member Data Documentation

◆ m_accelerationPerCycle

double Basda::MoConModule::m_accelerationPerCycle
private

The basic acceleration is set during the external profile initialization, to keep the acceleration constant over the whole trajectory.

◆ m_basicAcceleration

Nice::U32 Basda::MoConModule::m_basicAcceleration
private

◆ m_basicResolution

Nice::U16 Basda::MoConModule::m_basicResolution
private

◆ m_blockSize

Nice::Time Basda::MoConModule::m_blockSize
private

◆ m_bufferSize

unsigned int Basda::MoConModule::m_bufferSize
private

◆ m_collisionNegative

bool Basda::MoConModule::m_collisionNegative
private

◆ m_collisionPositive

bool Basda::MoConModule::m_collisionPositive
private

◆ m_currentMoConClocks

Nice::I64 Basda::MoConModule::m_currentMoConClocks
private

◆ m_currentPcDate

Nice::Date Basda::MoConModule::m_currentPcDate
private

◆ m_currentPosition

int Basda::MoConModule::m_currentPosition
private

◆ m_cycleTime

double Basda::MoConModule::m_cycleTime
private

◆ m_extendedProfileParamter

bool Basda::MoConModule::m_extendedProfileParamter
private

member for the extended external profile mode

◆ m_externalProfileBuffer

std::vector< Basda::MoConModuleProfile::Segment > Basda::MoConModule::m_externalProfileBuffer
private

◆ m_externalProfileBufferSize

unsigned int Basda::MoConModule::m_externalProfileBufferSize
private

◆ m_externalProfileIndexCycle

unsigned int Basda::MoConModule::m_externalProfileIndexCycle
private

◆ m_frequency

int Basda::MoConModule::m_frequency
private

◆ m_microsteps

unsigned int Basda::MoConModule::m_microsteps
private

◆ m_monitor

Nice::Monitor Basda::MoConModule::m_monitor
private

◆ m_positionSequence

Nice::NPoint Basda::MoConModule::m_positionSequence
private

◆ m_positionSequenceBackup

Nice::NPoint Basda::MoConModule::m_positionSequenceBackup
private

◆ m_profile

Basda::MoConModuleProfile Basda::MoConModule::m_profile
private

member for the extended external profile mode

◆ m_startDate

Nice::Date Basda::MoConModule::m_startDate
private

◆ m_timeResolution

Nice::Time Basda::MoConModule::m_timeResolution
private

◆ m_travelRange

Nice::Point Basda::MoConModule::m_travelRange
private

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