TwiceAsNice
2019-02-18
|
This is the implementation of the MoCon module commands. More...
#include <Module.h>
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 02.03.2012) ni@a rcetr i.as tro.i tMore... | |
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 02.03.2012) ni@a rcetr i.as tro.i tMore... | |
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 02.03.2012) ni@a rcetr i.as tro.i tMore... | |
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 02.03.2012) ni@a rcetr i.as tro.i tMore... | |
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... | |
![]() | |
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< MoConModuleEvent > | MoConModuleEventPtr |
typedef IceUtil::Handle< MoConModuleEvent > | MoConModuleEventPtr |
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::Segment > | m_externalProfileBuffer |
unsigned int | m_externalProfileBufferSize |
Nice::Monitor | m_monitor |
Additional Inherited Members | |
![]() | |
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 () |
![]() | |
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... | |
![]() | |
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 |
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.
|
private |
|
private |
Basda::MoConModule::MoConModule | ( | std::string | _name, |
Nice::JointPtr | _config, | ||
MPIACoreProtocolPtr | _protocol | ||
) |
Constructor.
|
inline |
Destructor.
Basda::MoConModule::MoConModule | ( | std::string | _name, |
Nice::JointPtr | _config, | ||
MPIACoreProtocolPtr | _protocol | ||
) |
Constructor.
|
inline |
Destructor.
void Basda::MoConModule::abort | ( | void | ) |
Abort the moving of the motor immediately without deceleration.
void Basda::MoConModule::abort | ( | ) |
Abort the moving of the motor immediately without deceleration.
|
private |
This method add some internal properties like status properties.
|
private |
This method add some internal properties like status properties.
unsigned int Basda::MoConModule::bufferExternalProfile | ( | ) |
unsigned int Basda::MoConModule::bufferExternalProfile | ( | ) |
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.
_date | - the external profile start date |
_positionSequence | - supporting points of the spline in steps |
_transitionLength | - the time how long the transition should take |
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.
_date | - the external profile start date |
_positionSequence | - supporting points of the spline in steps |
_transitionLength | - the time how long the transition should take |
void Basda::MoConModule::calculateTransition | ( | const Nice::Date & | _date, |
const Nice::NPoint & | _positionSequence, | ||
const Nice::Time & | _transitionLength | ||
) |
void Basda::MoConModule::calculateTransition | ( | const Nice::Date & | _date, |
const Nice::NPoint & | _positionSequence, | ||
const Nice::Time & | _transitionLength | ||
) |
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.
_commandID | the command ID |
_selectID | the sub command ID |
_cardNo | the ID of the MPIA electronic card |
_moduleNo | the ID of the device module |
_parameter | the parameter as string |
_numberOfLines | the 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
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.
_commandID | the command ID |
_selectID | the sub command ID |
_cardNo | the ID of the MPIA electronic card |
_moduleNo | the ID of the device module |
_parameter | the parameter as string |
_numberOfLines | the 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
|
private |
|
private |
void Basda::MoConModule::clearExternalProfileBuffer | ( | ) |
This method freed the allocated memory of the external profile.
void Basda::MoConModule::clearExternalProfileBuffer | ( | ) |
This method freed the allocated memory of the external profile.
void Basda::MoConModule::dontParse | ( | std::string & | _ret | ) |
This method was requested by Lorenzo Busoni (lbuso 02.03.2012) ni@a rcetr i.as tro.i t
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.
_ret | the allocated memory for the command response |
void Basda::MoConModule::dontParse | ( | std::string & | _ret | ) |
This method was requested by Lorenzo Busoni (lbuso 02.03.2012) ni@a rcetr i.as tro.i t
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.
_ret | the allocated memory for the command response |
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.
The final external profile coordinates will be calculated as followed:
where i is the index of the position sequence the other variables are self-explained, i hope :)
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.
The final external profile coordinates will be calculated as followed:
where i is the index of the position sequence the other variables are self-explained, i hope :)
unsigned int Basda::MoConModule::getActivityStatus | ( | ) |
This method returns the current activity status.
It returns the 16 bit activity register:
unsigned int Basda::MoConModule::getActivityStatus | ( | ) |
This method returns the current activity status.
It returns the 16 bit activity register:
int Basda::MoConModule::getAEncPosition | ( | ) |
This method returns the current position of the absolute encoder.
int Basda::MoConModule::getAEncPosition | ( | ) |
This method returns the current position of the absolute encoder.
void Basda::MoConModule::getAmplifierCardInfo | ( | ) |
This method returns the amplifier configuration of the motor.
The amplifier settings will be stored in the properties:
Basda::MoCon::AADException |
void Basda::MoConModule::getAmplifierCardInfo | ( | ) |
This method returns the amplifier configuration of the motor.
The amplifier settings will be stored in the properties:
Basda::MoCon::AADException |
void Basda::MoConModule::getAmplifierInfo | ( | ) |
This method returns information of the amplifier.
The amplifier settings will be stored in the properties:
Basda::MoCon::AADException |
void Basda::MoConModule::getAmplifierInfo | ( | ) |
This method returns information of the amplifier.
The amplifier settings will be stored in the properties:
Basda::MoCon::AADException |
This method returns the basic configuration of the motor.
The basic settings will be stored in the properties:
Basda::MoCon::MotorNotInitializedException |
This method returns the basic configuration of the motor.
The basic settings will be stored in the properties:
Basda::MoCon::MotorNotInitializedException |
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:
These properties keep the current time and will be updated every time when the synchroniseTime() or getCurrentTime() method is called.
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:
These properties keep the current time and will be updated every time when the synchroniseTime() or getCurrentTime() method is called.
This method returns the incremental encoder settings.
The incremental encoder settings will be stored in the properties:
Basda::MoCon::MotorNotInitializedException |
This method returns the incremental encoder settings.
The incremental encoder settings will be stored in the properties:
Basda::MoCon::MotorNotInitializedException |
int Basda::MoConModule::getExternalProfileInfo | ( | ) |
This method returns the actual index of the external profile.
int Basda::MoConModule::getExternalProfileInfo | ( | ) |
This method returns the actual index of the external profile.
int Basda::MoConModule::getIEncPosition | ( | ) |
This method returns the current position of the incremental encoder.
Basda::MoCon::IEncNotInitializedException |
int Basda::MoConModule::getIEncPosition | ( | ) |
This method returns the current position of the incremental encoder.
Basda::MoCon::IEncNotInitializedException |
int Basda::MoConModule::getIEncVelocity | ( | ) |
This method returns the current velocity of the incremental encoder.
Basda::MoCon::IEncNotInitializedException |
int Basda::MoConModule::getIEncVelocity | ( | ) |
This method returns the current velocity of the incremental encoder.
Basda::MoCon::IEncNotInitializedException |
int Basda::MoConModule::getMEncPosition | ( | ) |
This method returns the current absolute position.
The current position will be stored in the property
The motor controller position will be converted based on the unit stored in the VAR.UNIT property.
int Basda::MoConModule::getMEncPosition | ( | ) |
This method returns the current absolute position.
The current position will be stored in the property
The motor controller position will be converted based on the unit stored in the VAR.UNIT property.
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
Basda::MoCon::CheckSumException |
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
Basda::MoCon::CheckSumException |
void Basda::MoConModule::getMotorControllerVersion | ( | ) |
This method returns the firmware version of the motor controller.
The firmware settings will be stored in the properties:
void Basda::MoConModule::getMotorControllerVersion | ( | ) |
This method returns the firmware version of the motor controller.
The firmware settings will be stored in the properties:
This method returns the motor configuration.
The motor settings will be stored in the properties:
Basda::MoCon::MotorNotInitializedException |
This method returns the motor configuration.
The motor settings will be stored in the properties:
Basda::MoCon::MotorNotInitializedException |
int Basda::MoConModule::getMotorType | ( | ) |
Returns the motor type.
int Basda::MoConModule::getMotorType | ( | ) |
Returns the motor type.
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:
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.
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:
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.
This method returns the servo settings of the motor.
The servo settings will be stored in the properties:
Basda::MoCon::CmdForServoException |
This method returns the servo settings of the motor.
The servo settings will be stored in the properties:
Basda::MoCon::CmdForServoException |
unsigned int Basda::MoConModule::getSignalStatus | ( | ) |
This method returns the current signal status.
It returns the 16 bit signal register:
unsigned int Basda::MoConModule::getSignalStatus | ( | ) |
This method returns the current signal status.
It returns the 16 bit signal register:
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.
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.
This method returns the stepper settings of the motor.
The stepper settings will be stored in the properties:
Basda::MoCon::CmdForStepperException |
This method returns the stepper settings of the motor.
The stepper settings will be stored in the properties:
Basda::MoCon::CmdForStepperException |
int Basda::MoConModule::getVelocity | ( | ) |
This method returns the current velocity.
The current velocity will be stored in the property
int Basda::MoConModule::getVelocity | ( | ) |
This method returns the current velocity.
The current velocity will be stored in the property
Nice::Time Basda::MoConModule::initExternalProfile | ( | int | _frequency, |
unsigned int | _maxSamplesPerSegment, | ||
unsigned int | _minSamplesPerSegment, | ||
unsigned int | _faultTolerance | ||
) |
Nice::Time Basda::MoConModule::initExternalProfile | ( | int | _frequency, |
unsigned int | _maxSamplesPerSegment, | ||
unsigned int | _minSamplesPerSegment, | ||
unsigned int | _faultTolerance | ||
) |
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.
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.
bool Basda::MoConModule::isAtHome | ( | ) |
bool Basda::MoConModule::isAtHome | ( | ) |
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:
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:
bool Basda::MoConModule::isExternalProfileDone | ( | ) |
bool Basda::MoConModule::isExternalProfileDone | ( | ) |
bool Basda::MoConModule::isMotionComplete | ( | ) |
Checks if the motor has finished the motion.
The following property will indicate the motion completeness
bool Basda::MoConModule::isMotionComplete | ( | ) |
Checks if the motor has finished the motion.
The following property will indicate the motion completeness
bool Basda::MoConModule::isMoving | ( | ) |
Checks if the motor is still in motion.
The following property will indicate the motion
bool Basda::MoConModule::isMoving | ( | ) |
Checks if the motor is still in motion.
The following property will indicate the motion
void Basda::MoConModule::loadMotorSettings | ( | ) |
This method read the motor settings from the EEPROM.
void Basda::MoConModule::loadMotorSettings | ( | ) |
This method read the motor settings from the EEPROM.
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
The unit of the travel range property is steps/counts and hard-coded.
_absolutePosition | |
_unit | the unit in which the absolute position value is given |
Basda::MoCon::MotorInMotionException | |
Basda::MoCon::MotorNotInitializedException | |
Basda::MoCon::MotorInPosLimitException | |
Basda::MoCon::MotorInNegLimitException |
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
The unit of the travel range property is steps/counts and hard-coded.
_absolutePosition | |
_unit | the unit in which the absolute position value is given |
Basda::MoCon::MotorInMotionException | |
Basda::MoCon::MotorNotInitializedException | |
Basda::MoCon::MotorInPosLimitException | |
Basda::MoCon::MotorInNegLimitException |
void Basda::MoConModule::moveCorrection | ( | ) |
The lost steps can be corrected with this methods.
The position register will be not changed!
void Basda::MoConModule::moveCorrection | ( | ) |
The lost steps can be corrected with this methods.
The position register will be not changed!
double Basda::MoConModule::moveOutOfLimit | ( | ) |
The motor moves out of the limit switch.
double Basda::MoConModule::moveOutOfLimit | ( | ) |
The motor moves out of the limit switch.
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
The unit of the travel range property is steps/counts and hard-coded.
_relativePosition | in steps |
_unit | the unit in which the absolute position value is given |
Basda::MoCon::MotorInMotionException | |
Basda::MoCon::MotorNotInitializedException | |
Basda::MoCon::MotorInPosLimitException | |
Basda::MoCon::MotorInNegLimitException |
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
The unit of the travel range property is steps/counts and hard-coded.
_relativePosition | in steps |
_unit | the unit in which the absolute position value is given |
Basda::MoCon::MotorInMotionException | |
Basda::MoCon::MotorNotInitializedException | |
Basda::MoCon::MotorInPosLimitException | |
Basda::MoCon::MotorInNegLimitException |
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.
Basda::MoCon::MotorInMotionException | |
Basda::MoCon::MotorNotInitializedException | |
Basda::MoCon::MotorSettingsIncompleteException |
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.
Basda::MoCon::MotorInMotionException | |
Basda::MoCon::MotorNotInitializedException | |
Basda::MoCon::MotorSettingsIncompleteException |
The motor moves to the negative software limit switch.
_travelRangeCheck | is 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 |
The motor moves to the negative software limit switch.
_travelRangeCheck | is 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 |
The motor moves to the positive software limit switch.
_travelRangeCheck | is 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 |
The motor moves to the positive software limit switch.
_travelRangeCheck | is 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 |
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 02.03.2012) ni@a rcetr i.as tro.i t
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.
_commandID | the command ID which is defined in the CommandIDs.h |
_cardNo | the card number |
_moduleNo | the module number |
_ret | the allocated space for the returned data |
_numberOfLines | This parameter limitates how many data should be read from the Ethernet buffer. All data are read if the value is -1. |
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 02.03.2012) ni@a rcetr i.as tro.i t
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.
_commandID | the command ID which is defined in the CommandIDs.h |
_cardNo | the card number |
_moduleNo | the module number |
_ret | the allocated space for the returned data |
_numberOfLines | This parameter limitates how many data should be read from the Ethernet buffer. All data are read if the value is -1. |
void Basda::MoConModule::saveMotorSettings | ( | ) |
This method save the motor settings in the EEPROM.
void Basda::MoConModule::saveMotorSettings | ( | ) |
This method save the motor settings in the EEPROM.
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 |
_selectID | is the ID to define the type of the _parameter |
_parameter1 | the configuration value |
_parameter2 | the configuration value only for the Microsteps and adaption option |
_parameter3 | the configuration value only for the Microsteps and adaption option |
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 |
_selectID | is the ID to define the type of the _parameter |
_parameter1 | the configuration value |
_parameter2 | the configuration value only for the Microsteps and adaption option |
_parameter3 | the configuration value only for the Microsteps and adaption option |
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.
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.
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) |
_selectID | is the ID to define the type of the _parameter |
_parameter | the configuration value |
Basda::MoCon::CmdForStepperException | |
Basda::MoCon::RevolutionNotDefinedException | |
Basda::MoCon::MotorInMotionException |
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) |
_selectID | is the ID to define the type of the _parameter |
_parameter | the configuration value |
Basda::MoCon::CmdForStepperException | |
Basda::MoCon::RevolutionNotDefinedException | |
Basda::MoCon::MotorInMotionException |
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.
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.
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 |
_selectID | is the ID to define the type of the _parameter |
_parameter | the configuration value |
Basda::MoCon::MotorInMotionException |
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 |
_selectID | is the ID to define the type of the _parameter |
_parameter | the configuration value |
Basda::MoCon::MotorInMotionException |
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.
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.
void Basda::MoConModule::setExternalProfileBufferSize | ( | const unsigned int | _bufferSize, |
bool | _extended = true |
||
) |
This method set the external buffer size.
_bufferSize | the buffer size 1..4294967295 |
_extended | enables 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) |
void Basda::MoConModule::setExternalProfileBufferSize | ( | const unsigned int | _bufferSize, |
bool | _extended = true |
||
) |
This method set the external buffer size.
_bufferSize | the buffer size 1..4294967295 |
_extended | enables 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) |
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.
_index | the data value index 0..4294967295 |
_timeBase | 0..4294967295 |
_velocity | -2147483647..2147483647 |
_position | -2147483647..2147483647 |
_acceleration | optional, has to be defined if the extended mode is enabled |
_jerk | optional, has to be defined if the extended mode is enabled |
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.
_index | the data value index 0..4294967295 |
_timeBase | 0..4294967295 |
_velocity | -2147483647..2147483647 |
_position | -2147483647..2147483647 |
_acceleration | optional, has to be defined if the extended mode is enabled |
_jerk | optional, has to be defined if the extended mode is enabled |
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.
_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)) |
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.
_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)) |
void Basda::MoConModule::setExternalProfileStop | ( | ) |
This method stops the external profile.
void Basda::MoConModule::setExternalProfileStop | ( | ) |
This method stops the external profile.
void Basda::MoConModule::setMotionComplete | ( | bool | _complete | ) |
Set the MOTOR_COMPLETE flag.
The following property is used
void Basda::MoConModule::setMotionComplete | ( | bool | _complete | ) |
Set the MOTOR_COMPLETE flag.
The following property is used
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 |
_selectID | is the ID to define the type of the _parameter |
_parameter | the configuration value |
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 |
_selectID | is the ID to define the type of the _parameter |
_parameter | the configuration value |
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.
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.
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.
_position | the new absolute position in steps |
Basda::MoCon::OutOfRangeException |
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.
_position | the new absolute position in steps |
Basda::MoCon::OutOfRangeException |
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: %) |
_selectID | is the ID to define the type of the _parameter |
_parameter | the configuration value |
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: %) |
_selectID | is the ID to define the type of the _parameter |
_parameter | the configuration value |
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.
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.
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.
_selectID | is the ID to define the type of the _parameter |
_parameter | the configuration value |
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.
_selectID | is the ID to define the type of the _parameter |
_parameter | the configuration value |
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.
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.
void Basda::MoConModule::stop | ( | ) |
This method stops the motor with a deceleration.
void Basda::MoConModule::stop | ( | ) |
This method stops the motor with a deceleration.
|
private |
|
private |
Nice::Date Basda::MoConModule::uploadExternalProfile | ( | ) |
This uploads the external profile data.
Nice::Date Basda::MoConModule::uploadExternalProfile | ( | ) |
This uploads the external profile data.
void Basda::MoConModule::uploadExternalProfile | ( | const Nice::SeqSeqInt & | _segments | ) |
void Basda::MoConModule::uploadExternalProfile | ( | const Nice::SeqSeqInt & | _segments | ) |
void Basda::MoConModule::validateBasicSettings | ( | ) |
void Basda::MoConModule::validateBasicSettings | ( | ) |
void Basda::MoConModule::validateExternalProfile | ( | ) |
void Basda::MoConModule::validateExternalProfile | ( | ) |
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.
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.
|
private |
The basic acceleration is set during the external profile initialization, to keep the acceleration constant over the whole trajectory.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
member for the extended external profile mode
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
member for the extended external profile mode
|
private |
|
private |
|
private |