|
Copley Motion Library
|
Copley Controls amplifier object. More...
Public Member Functions | |
| const Error * | UpdateEvents (uint16 stat, uint32 events, uint16 inputs) |
| Update the amplifier's event map based on the status information received by a status PDO. More... | |
| void | PvtStatusUpdate (uint32 status) |
| This function is called by the PVT status PDO receiver function. More... | |
| virtual uint32 | GetNetworkRef (void) |
| Return a reference ID to the network that this node is attached to. More... | |
| virtual NodeState | GetState (void) |
| Returns the present state of this node. More... | |
| const Error * | GetStatusWord (uint16 &value) |
| Get the current value of the drive's status word. More... | |
| const Error * | SetControlWord (uint16 value) |
| Set the amplifier's control word. More... | |
| const Error * | GetControlWord (uint16 &value) |
| Returns the present value of the CANopen device profile control word. More... | |
Amplifier initialization | |
| Amp () | |
| Default constructor. More... | |
| Amp (Network &net, int16 nodeID) | |
| Construct and initialize an amplifier object using defaults for all amp settings. More... | |
| Amp (Network &net, int16 nodeID, AmpSettings &settings) | |
| Construct and initialize an amplifier object. More... | |
| virtual | ~Amp () |
| Amp object destructor. | |
| const Error * | Init (Network &net, int16 nodeID) |
| Initialize the amplifier object using all default settings. More... | |
| const Error * | Init (Network &net, int16 nodeID, AmpSettings &settings) |
| Initialize the amplifier object with custom amp settings. More... | |
| const Error * | ReInit (void) |
| Re-initialize an amplifier. More... | |
| const Error * | Reset (void) |
| Reset the amplifier object. More... | |
| const Error * | InitSubAxis (Amp &primary, int axis=2) |
| Initialize an Amp object for use with a secondary axis of a multi-axis EtherCAT amplifier. More... | |
Amplifier modes & status info | |
| const Error * | GetAmpName (char *name) |
| Get the amplifier name stored in the amplifiers flash. More... | |
| const Error * | SetAmpName (char *name) |
| Set the amplifier name stored in the amplifiers flash. More... | |
| const Error * | SetAmpMode (AMP_MODE mode) |
| Set the amplifier mode of operation. More... | |
| const Error * | GetAmpMode (AMP_MODE &mode) |
| Get the currently active amplifier mode of operation. More... | |
| const Error * | Disable (bool wait=true) |
| Disable the amplifier. More... | |
| const Error * | Enable (bool wait=true) |
| Enable the amplifier. More... | |
| bool | IsHardwareEnabled (void) |
| Return true if the amplifier's PWM outputs are currently enabled. More... | |
| bool | IsSoftwareEnabled (void) |
| Return true if the amplifier is being enabled by software. More... | |
| bool | IsReferenced (void) |
| Return true if the amplifier has been successfully referenced (homed). More... | |
| const Error * | CheckStateForMove (void) |
| Check the amplifier's state to make sure a move can be started. More... | |
| const Error * | ClearFaults (void) |
| Clear amplifier faults. More... | |
| const Error * | GetFaults (AMP_FAULT &value) |
| Get any active amplifier faults. More... | |
| const Error * | SetFaultMask (AMP_FAULT &value) |
| Set the amplifier's fault mask. More... | |
| const Error * | GetFaultMask (AMP_FAULT &value) |
| Get the current value of the amplifier's fault mask. More... | |
| const Error * | GetEventStatus (EVENT_STATUS &stat) |
| Get the amplifier's 'event status' register. More... | |
| const Error * | GetEventSticky (EVENT_STATUS &stat) |
| Get the amplifier's 'sticky' event status register. More... | |
| const Error * | GetEventLatch (EVENT_STATUS &stat) |
| Get the amplifier's latched event status register. More... | |
| const Error * | SetPwmMode (AMP_PWM_MODE mode) |
| Set the PWM output mode configuration for the amplifier. More... | |
| const Error * | GetPwmMode (AMP_PWM_MODE &mode) |
| Get the current PWM output mode configuration from the amplifier. More... | |
| const Error * | SetPhaseMode (AMP_PHASE_MODE mode) |
| Set the phasing mode configuration for the amplifier. More... | |
| const Error * | GetPhaseMode (AMP_PHASE_MODE &mode) |
| Get the current phasing mode configuration from the amplifier. More... | |
Motor & Amplifier state information | |
| const Error * | GetPositionActual (uunit &value) |
| Get the actual position used by the servo loop. More... | |
| const Error * | SetPositionActual (uunit value) |
| Set the actual position. More... | |
| const Error * | GetPositionMotor (uunit &value) |
| Get the actual motor position. More... | |
| const Error * | SetPositionMotor (uunit value) |
| Set the actual motor position. More... | |
| const Error * | GetPositionLoad (uunit &value) |
| Get the load encoder position. More... | |
| const Error * | SetPositionLoad (uunit value) |
| Set the load encoder position. More... | |
| const Error * | GetPositionCommand (uunit &value) |
| Get the instantaneous commanded position. More... | |
| const Error * | GetPositionError (uunit &value) |
| Get the position error. More... | |
| const Error * | GetVelocityActual (uunit &value) |
| Get the actual motor velocity. More... | |
| const Error * | GetVelocityLoad (uunit &value) |
| Get the load encoder velocity. More... | |
| const Error * | GetVelocityCommand (uunit &value) |
| Get the commanded velocity. More... | |
| const Error * | GetVelocityLimited (uunit &value) |
| Get the limited velocity. More... | |
| const Error * | GetCurrentActual (int16 &value) |
| Get the actual motor current. More... | |
| const Error * | GetCurrentCommand (int16 &value) |
| Get the commanded motor current. More... | |
| const Error * | GetCurrentLimited (int16 &value) |
| Get the limited motor current. More... | |
| const Error * | GetTrajectoryVel (uunit &value) |
| Get the instantaneous commanded velocity passed out of the trajectory generator. More... | |
| const Error * | GetTrajectoryAcc (uunit &value) |
| Get the instantaneous commanded acceleration passed out of the trajectory generator. More... | |
| const Error * | GetPhaseAngle (int16 &value) |
| Get the motor phase angle. More... | |
| const Error * | GetHallState (int16 &value) |
| Get the current digital hall sensor state. More... | |
| const Error * | GetRefVoltage (int16 &value) |
| Get the analog reference input voltage. More... | |
| const Error * | GetHighVoltage (int16 &value) |
| Get the high voltage bus voltage in units of 0.1 volts. More... | |
| const Error * | GetAmpTemp (int16 &value) |
| Get the current amplifier temperature (degrees C). More... | |
| const Error * | GetAnalogEncoder (int16 &sin, int16 &cos) |
| Get the raw voltage on the two analog encoder inputs (0.1 millivolt units). More... | |
| const Error * | GetMotorCurrent (int16 &u, int16 &v) |
| Get the actual current values read directly from the amplifier's current sensors. More... | |
Input & Output pin control | |
| const Error * | SetIoConfig (AmpIoCfg &cfg) |
| Configure the amplifier's programmable I/O pins using the values passed in the config structure. More... | |
| const Error * | GetIoConfig (AmpIoCfg &cfg) |
| Read the amplifier's programmable I/O pin configuration and return it in the passed config structure. More... | |
| const Error * | GetInputs (uint16 &value, bool viaSDO=false) |
| Get the present value of the general purpose input pins. More... | |
| const Error * | GetInputs32 (uint32 &value) |
| 32-bit version to Get the present value of the general purpose input pins. More... | |
| const Error * | WaitInputEvent (Event &e, Timeout timeout, uint32 &match) |
| Wait on the amplifier's general purpose input pins. More... | |
| const Error * | WaitInputHigh (uint32 inputs, Timeout timeout=-1) |
| Wait for any of the specified general purpose input pins to be set. More... | |
| const Error * | WaitInputLow (uint32 inputs, Timeout timeout=-1) |
| Wait for any of the specified general purpose input pins to be lowered. More... | |
| const Error * | SetIoPullup (uint16 value) |
| Set the current state of the input pin pull up/down resisters. More... | |
| const Error * | GetIoPullup (uint16 &value) |
| Get the current state of the input pin pull up/down resisters. More... | |
| const Error * | SetInputConfig (int8 pin, INPUT_PIN_CONFIG cfg, uint16 axis=0) |
| Set the input pin configuration for the specified input pin. More... | |
| const Error * | GetInputConfig (int8 pin, INPUT_PIN_CONFIG &cfg) |
| Get the input pin configuration for the specified input pin. More... | |
| const Error * | GetInputConfig (int8 pin, INPUT_PIN_CONFIG &cfg, uint16 &axis) |
| Get the input pin configuration for the specified input pin. More... | |
| const Error * | SetInputDebounce (int8 pin, int16 value) |
| Set the input pin debounce time for the specified input pin. More... | |
| const Error * | GetInputDebounce (int8 pin, int16 &value) |
| Get the input pin debounce time for the specified input pin. More... | |
| const Error * | SetOutputConfig (int8 pin, OUTPUT_PIN_CONFIG cfg, uint32 mask1=0, uint32 mask2=0, uint16 axis=0) |
| Set the output pin configuration for the specified pin. More... | |
| const Error * | GetOutputConfig (int8 pin, OUTPUT_PIN_CONFIG &cfg) |
| Get the output configuration for the specified pin. More... | |
| const Error * | GetOutputConfig (int8 pin, OUTPUT_PIN_CONFIG &cfg, uint16 &axis) |
| Get the output configuration for the specified pin. More... | |
| const Error * | GetOutputConfig (int8 pin, OUTPUT_PIN_CONFIG &cfg, uint32 &mask) |
| Get the output pin configuration for the specified pin. More... | |
| const Error * | GetOutputConfig (int8 pin, OUTPUT_PIN_CONFIG &cfg, uint32 &mask, uint16 &axis) |
| Get the output pin configuration for the specified pin. More... | |
| const Error * | GetOutputConfig (int8 pin, OUTPUT_PIN_CONFIG &cfg, uint32 &mask1, uint32 &mask2) |
| Get the output pin configuration for the specified pin. More... | |
| const Error * | GetOutputConfig (int8 pin, OUTPUT_PIN_CONFIG &cfg, uint32 &mask1, uint32 &mask2, uint16 &axis) |
| Get the output pin configuration for the specified pin. More... | |
| const Error * | SetOutputs (uint16 value) |
| Update the state of the manual output pins. More... | |
| const Error * | GetOutputs (uint16 &value) |
| Get the present value of the output pin control register. More... | |
| const Error * | SetIOOptions (int32 value) |
| Set the IO Options. More... | |
| const Error * | GetIOOPtions (int32 &value) |
| Get the IO Options. More... | |
| const Error * | SetIoPullup32 (int32 value) |
| 32 Bit version of SetIoPullup. More... | |
| const Error * | GetIoPullup32 (int32 &value) |
| 32 Bit version of GetIoPullup. More... | |
Position capture | |
| const Error * | SetPosCaptureCfg (POS_CAPTURE_CFG cfg) |
| Set the position capture configuration. More... | |
| const Error * | GetPosCaptureCfg (POS_CAPTURE_CFG &cfg) |
| Read the current configuration of the position capture mechanism. More... | |
| const Error * | GetPosCaptureStat (POS_CAPTURE_STAT &stat) |
| Read the current status of the position capture mechanism. More... | |
| const Error * | GetIndexCapture (int32 &value) |
| Get the most recently captured encoder index position. More... | |
| const Error * | GetHomeCapture (int32 &value) |
| Get the most recently captured home sensor position. More... | |
General parameter setup. | |
| const Error * | GetAmpConfig (AmpConfig &cfg) |
| Read the complete amplifier configuration from the amplifier and return it in the passed structure. More... | |
| const Error * | SetAmpConfig (AmpConfig &cfg) |
| Update an amplifier's configuration from the passed structure. More... | |
| const Error * | SaveAmpConfig (AmpConfig &cfg) |
| Upload the passed amplifier configuration to the amplifier's workign memory, and then copy that working memory to flash. More... | |
| const Error * | SaveAmpConfig (void) |
| Save all amplifier parameters to internal flash memory. More... | |
| const Error * | LoadFromFile (const char *name, int &line) |
| Load the specified amplifier data file. More... | |
| const Error * | GetCanNetworkConfig (CanNetworkConfig &cfg) |
| Get the current CANopen network configuration programmed into the amplifier. More... | |
| const Error * | SetCanNetworkConfig (CanNetworkConfig &cfg) |
| Set the CANopen node ID and bit rate configuration. More... | |
| const Error * | GetNetworkOptions (NetworkOptions &cfg) |
| Set the Network Options configuration. More... | |
| const Error * | SetNetworkOptions (NetworkOptions &cfg) |
| Set the Network Options configuration. More... | |
| const Error * | GetAmpInfo (AmpInfo &info) |
| Read the Amplifier information parameters from the drive. More... | |
| const Error * | GetMtrInfo (MtrInfo &info) |
| Read the motor information structure from the amplifier. More... | |
| const Error * | SetMtrInfo (MtrInfo &info) |
| Update the amplifier's motor information. More... | |
| const Error * | GetRegenConfig (RegenConfig &cfg) |
| Upload the current configuration parameters for the power regeneration resister connected to the amplifier. More... | |
| const Error * | SetRegenConfig (RegenConfig &cfg) |
| Download a new configuration structure for the power regeneration resister. More... | |
| const Error * | GetUstepConfig (UstepConfig &cfg) |
| Upload the current configuration parameters for the stepper. More... | |
| const Error * | SetUstepConfig (UstepConfig &cfg) |
| Download a new configuration structure for the microstepper. More... | |
| const Error * | GetAlgoPhaseInit (AlgoPhaseInit &cfg) |
| Upload the current configuration parameters for the algorithmic phase init. More... | |
| const Error * | SetAlgoPhaseInit (AlgoPhaseInit &cfg) |
| Download a new configuration structure for the algorithmic phase init. More... | |
| const Error * | GetCammingConfig (CammingConfig &cfg) |
| Upload the current configuration parameters for the camming. More... | |
| const Error * | SetCammingConfig (CammingConfig &cfg) |
| Download a new configuration structure for Camming. More... | |
| const Error * | GetGainScheduling (GainScheduling &cfg) |
| Upload the current configuration parameters for the GainS cheduling. More... | |
| const Error * | SetGainScheduling (GainScheduling &cfg) |
| Download a new configuration structure for Gain Scheduling. More... | |
| const Error * | GetDAConverterConfig (DAConfig &cfg) |
| Get the configuration for the D/A converter. More... | |
| const Error * | SetDAConverterConfig (DAConfig &cfg) |
| Set the D/A converter configuration. More... | |
Low level access to CANopen objects. | |
| const Error * | Download (int16 index, int16 sub, int32 size, byte *data) |
| Download data to an object in this Amps object dictionary. More... | |
| const Error * | Upload (int16 index, int16 sub, int32 &size, byte *data) |
| Upload data from an object in this Amps object dictionary. More... | |
| const Error * | Dnld32 (int16 index, int16 sub, uint32 data) |
| Download data to an object in this Amps object dictionary. More... | |
| const Error * | Dnld32 (int16 index, int16 sub, int32 data) |
| Download data to an object in this Amps object dictionary. More... | |
| const Error * | Upld32 (int16 index, int16 sub, uint32 &data) |
| Upload data from an object in this Amps object dictionary. More... | |
| const Error * | Upld32 (int16 index, int16 sub, int32 &data) |
| Upload data from an object in this Amps object dictionary. More... | |
| const Error * | Dnld16 (int16 index, int16 sub, uint16 data) |
| Download data to an object in this Amps object dictionary. More... | |
| const Error * | Dnld16 (int16 index, int16 sub, int16 data) |
| Download data to an object in this Amps object dictionary. More... | |
| const Error * | Upld16 (int16 index, int16 sub, uint16 &data) |
| Upload data from an object in this Amps object dictionary. More... | |
| const Error * | Upld16 (int16 index, int16 sub, int16 &data) |
| Upload data from an object in this Amps object dictionary. More... | |
| const Error * | Dnld8 (int16 index, int16 sub, uint8 data) |
| Download data to an object in this Amps object dictionary. More... | |
| const Error * | Dnld8 (int16 index, int16 sub, int8 data) |
| Download data to an object in this Amps object dictionary. More... | |
| const Error * | Upld8 (int16 index, int16 sub, uint8 &data) |
| Upload data from an object in this Amps object dictionary. More... | |
| const Error * | Upld8 (int16 index, int16 sub, int8 &data) |
| Upload data from an object in this Amps object dictionary. More... | |
| const Error * | DnldString (int16 index, int16 sub, char *data) |
| Download data to an object in this Amps object dictionary. More... | |
| const Error * | UpldString (int16 index, int16 sub, int32 &len, char *data) |
| Upload data from an object in this Amps object dictionary. More... | |
Control loop setup | |
| const Error * | GetPosLoopConfig (PosLoopConfig &cfg) |
| Get the configuration values of the amplifiers position loop. More... | |
| const Error * | SetPosLoopConfig (PosLoopConfig &cfg) |
| Update the amplifier's position loop configuration. More... | |
| const Error * | GetVelLoopConfig (VelLoopConfig &cfg) |
| Get the configuration values of the amplifiers velocity loop. More... | |
| const Error * | SetVelLoopConfig (VelLoopConfig &cfg) |
| Update the amplifier's velocity loop configuration. More... | |
| const Error * | GetCrntLoopConfig (CrntLoopConfig &cfg) |
| Get the configuration values of the amplifiers current loop. More... | |
| const Error * | SetCrntLoopConfig (CrntLoopConfig &cfg) |
| Update the amplifier's current loop configuration. More... | |
| const Error * | GetVloopOutputFilter (Filter &f) |
| Get the coefficients used in the velocity loop output filter. More... | |
| const Error * | SetVloopOutputFilter (Filter &f) |
| Set new coefficients for the velocity loop output filter. More... | |
| const Error * | GetVloopOutputFilter2 (Filter &f) |
| Get the coefficients used in the second velocity loop output filter. More... | |
| const Error * | SetVloopOutputFilter2 (Filter &f) |
| Set the coefficients used in the second velocity loop output filter. More... | |
| const Error * | GetVloopOutputFilter3 (Filter &f) |
| Get the coefficients used in the third velocity loop output filter. More... | |
| const Error * | SetVloopOutputFilter3 (Filter &f) |
| Set the coefficients used in the third velocity loop output filter. More... | |
| const Error * | GetVloopCommandFilter (Filter &f) |
| Get the coefficients used in the velocity loop command filter. More... | |
| const Error * | SetVloopCommandFilter (Filter &f) |
| Set new coefficients for the velocity loop command filter. More... | |
| const Error * | GetIloopCommandFilter (Filter &f) |
| Get the coefficients used in the current loop input filter. More... | |
| const Error * | SetIloopCommandFilter (Filter &f) |
| Set the coefficients used in the current loop input filter. More... | |
| const Error * | GetIloopCommandFilter2 (Filter &f) |
| Get the coefficients used in the second current loop input filter. More... | |
| const Error * | SetIloopCommandFilter2 (Filter &f) |
| Set the coefficients used in the second current loop input filter. More... | |
| const Error * | GetAnalogCommandFilter (Filter &f) |
| Get the coefficients used in the velocity loop command filter. More... | |
| const Error * | SetAnalogCommandFilter (Filter &f) |
| Set new coefficients for the analog reference input filter. More... | |
| const Error * | GetInputShapingFilter (InputShaper &f) |
| Get the coefficients used in the input shaping filter. More... | |
| const Error * | SetInputShapingFilter (InputShaper &f) |
| Set new coefficients for the input shaping filter. More... | |
Position and velocity windows | |
| const Error * | SetTrackingWindows (TrackingWindows &cfg) |
| Update the amplifier's tracking window configuration. More... | |
| const Error * | GetTrackingWindows (TrackingWindows &cfg) |
| Get the configuration values of the amplifiers position & velocity tracking windows. More... | |
| const Error * | SetPositionErrorWindow (uunit value) |
| Set the position error window. More... | |
| const Error * | GetPositionErrorWindow (uunit &value) |
| Get the position error window. More... | |
| const Error * | SetPositionWarnWindow (uunit value) |
| Set the position warning window. More... | |
| const Error * | GetPositionWarnWindow (uunit &value) |
| Get the position warning window. More... | |
| const Error * | SetSettlingWindow (uunit value) |
| Set the position settling window. More... | |
| const Error * | GetSettlingWindow (uunit &value) |
| Get the position window value. More... | |
| const Error * | SetSettlingTime (uint16 value) |
| Set the position window time value (milliseconds). More... | |
| const Error * | GetSettlingTime (uint16 &value) |
| Get the position window time value (milliseconds). More... | |
| const Error * | SetVelocityWarnWindow (uunit value) |
| Set the velocity warning window. More... | |
| const Error * | GetVelocityWarnWindow (uunit &value) |
| Get the velocity warning window. More... | |
| const Error * | SetVelocityWarnTime (uint16 value) |
| Set the velocity warning window time value (milliseconds). More... | |
| const Error * | GetVelocityWarnTime (uint16 &value) |
| Get the position window time value (milliseconds). More... | |
| const Error * | SetSoftLimits (SoftPosLimit &cfg) |
| Set software limit switch settings. More... | |
| const Error * | GetSoftLimits (SoftPosLimit &cfg) |
| Upload the current software limit switch settings from the amplifier. More... | |
Homing mode. | |
| const Error * | GoHome (void) |
| Execute a home move. More... | |
| const Error * | GoHome (HomeConfig &cfg) |
| Execute a home move. More... | |
| const Error * | SetHomeConfig (HomeConfig &cfg) |
| Configure the amplifier's homing related parameters. More... | |
| const Error * | GetHomeConfig (HomeConfig &cfg) |
| Load a structure with all parameters related to homing the amplifier. More... | |
| const Error * | SetHomeMethod (COPLEY_HOME_METHOD method, uint16 extended=0) |
| Set the method used for homing the drive. More... | |
| const Error * | GetHomeMethod (COPLEY_HOME_METHOD &method, uint16 *extended=0) |
| Get the selected homing method. More... | |
| const Error * | SetHomeOffset (uunit value) |
| Set the home offset value. More... | |
| const Error * | GetHomeOffset (uunit &value) |
| Get the home offset value. More... | |
| const Error * | SetHomeVelFast (uunit value) |
| Set the home velocity used to move to a home switch. More... | |
| const Error * | GetHomeVelFast (uunit &value) |
| Get the home velocity used to move to a home switch. More... | |
| const Error * | SetHomeVelSlow (uunit value) |
| Set the home velocity used to find a switch edge. More... | |
| const Error * | GetHomeVelSlow (uunit &value) |
| Get the home velocity used to find a switch edge. More... | |
| const Error * | SetHomeAccel (uunit value) |
| Set the home acceleration. More... | |
| const Error * | GetHomeAccel (uunit &value) |
| Get the home acceleration. More... | |
| const Error * | SetHomeCurrent (int16 value) |
| Set the home current. More... | |
| const Error * | GetHomeCurrent (int16 &value) |
| Get the home current. More... | |
| const Error * | SetHomeDelay (int16 value) |
| Set the home delay. More... | |
| const Error * | GetHomeDelay (int16 &value) |
| Get the home current. More... | |
| const Error * | GetHomeAdjustment (uunit &value) |
| Get the last home adjustment amount. More... | |
Quick stop support | |
| const Error * | QuickStop (void) |
| Perform a 'quick stop' on the axis. More... | |
| const Error * | HaltMove (void) |
| Halt the current move. More... | |
| const Error * | SetQuickStopDec (uunit value) |
| Set the quick stop deceleration value (i.e. More... | |
| const Error * | GetQuickStopDec (uunit &value) |
| Get the quick stop deceleration value. More... | |
| const Error * | SetHaltMode (HALT_MODE mode) |
| Set the halt mode. More... | |
| const Error * | GetHaltMode (HALT_MODE &mode) |
| Get the halt mode. More... | |
| const Error * | SetQuickStop (QUICK_STOP_MODE mode) |
| Set the quick stop mode. More... | |
| const Error * | GetQuickStop (QUICK_STOP_MODE &mode) |
| Get the quick stop mode. More... | |
Point to point move support (position profile mode) | |
| const Error * | SetupMove (ProfileConfigTrap &cfg) |
| Setup a point to point move, but do not start it. More... | |
| const Error * | SetupMove (ProfileConfigScurve &cfg) |
| Setup a point to point move, but do not start it. More... | |
| const Error * | SetupMove (ProfileConfigVel &cfg) |
| Setup a point to point move, but do not start it. More... | |
| const Error * | DoMove (ProfileConfigTrap &cfg, bool relative=false) |
| Perform a point to point move. More... | |
| const Error * | DoMove (ProfileConfigScurve &cfg, bool relative=false) |
| Perform a point to point move. More... | |
| const Error * | DoMove (ProfileConfigVel &cfg) |
| Perform a velocity profile move. More... | |
| const Error * | DoMove (uunit pos, bool relative=false) |
| Perform a point to point move. More... | |
| const Error * | StartMove (bool relative=false) |
| Start the move that's already been programmed. More... | |
| const Error * | MoveAbs (uunit pos) |
| Start an absolute point to point move to the specified position. More... | |
| const Error * | MoveRel (uunit dist) |
| Start a relative point to point move of the specified distance. More... | |
| const Error * | SetProfileConfig (ProfileConfig &cfg) |
| Configure the amplifier's parameters related to point-to-point moves. More... | |
| const Error * | GetProfileConfig (ProfileConfig &cfg) |
| Load a structure with all parameters related to point-to-point moves. More... | |
| const Error * | SetProfileType (PROFILE_TYPE type) |
| Set the motion profile type. More... | |
| const Error * | GetProfileType (PROFILE_TYPE &type) |
| Get the currently selected motion profile type. More... | |
| const Error * | SetTargetPos (uunit value) |
| Set the profile target position (i.e. More... | |
| const Error * | GetTargetPos (uunit &value) |
| Get the profile target position. More... | |
| const Error * | SetProfileVel (uunit value) |
| Set the profile velocity value (i.e. More... | |
| const Error * | GetProfileVel (uunit &value) |
| Get the profile velocity value. More... | |
| const Error * | SetProfileAcc (uunit value) |
| Set the profile acceleration value (i.e. More... | |
| const Error * | GetProfileAcc (uunit &value) |
| Get the profile acceleration value. More... | |
| const Error * | SetProfileDec (uunit value) |
| Set the profile deceleration value (i.e. More... | |
| const Error * | GetProfileDec (uunit &value) |
| Get the profile deceleration value. More... | |
| const Error * | SetProfileJerk (uunit value) |
| Set the jerk limit used with S-curve profiles.  More... | |
Profile velocity mode support | |
| const Error * | SetTargetVel (uunit value) |
| Set the target velocity used in profile velocity mode. More... | |
| const Error * | GetTargetVel (uunit &value) |
| Get the target velocity used in profile velocity mode. More... | |
Profile torque mode support | |
| const Error * | SetTorqueTarget (int16 value) |
| Set the amplifier target torque value. More... | |
| const Error * | GetTorqueTarget (int16 &value) |
| Get the current target torque value. More... | |
| const Error * | GetTorqueDemand (int16 &value) |
| Get the torque demand value. More... | |
| const Error * | GetTorqueActual (int16 &value) |
| Get the actual torque being applied by the motor at the moment. More... | |
| const Error * | SetTorqueSlope (int32 value) |
| Set the rate of change of torque for use in profile torque mode (AMPMODE_CAN_TORQUE). More... | |
| const Error * | GetTorqueSlope (int32 &value) |
| Get the rate of change of torque for use in profile torque mode (AMPMODE_CAN_TORQUE). More... | |
| const Error * | SetTorqueRated (int32 value) |
| Set the motor rated torque parameter. More... | |
| const Error * | GetTorqueRated (int32 &value) |
| Get the motor rated torque parameter. More... | |
PVT (interpolated position) trajectory support | |
| const Error * | SendTrajectory (Trajectory &trj, bool start=true) |
| Upload a PVT move trajectory to the amplifier and optionally start the move. More... | |
| const Error * | StartPVT (void) |
| Start a PVT move that has already been uploaded. More... | |
| const Error * | GetPvtBuffFree (int16 &n) |
| Get the number of free positions in the PVT segment buffer. More... | |
| const Error * | GetPvtSegID (uint16 &id) |
| Get the segment ID that the amplifier expects for the next PVT segment. More... | |
| const Error * | GetPvtBuffStat (uint32 &stat) |
| Get the amplifier's PVT buffer status word. More... | |
| const Error * | GetPvtSegPos (uunit &pos) |
| Get the starting position of the PVT segment currently active in the amplifier. More... | |
Amplifier event processing | |
| const Error * | WaitEvent (Event &e, Timeout timeout=-1) |
| Wait for an amplifier event condition. More... | |
| const Error * | WaitEvent (Event &e, Timeout timeout, AMP_EVENT &match) |
| Wait for an amplifier event condition. More... | |
| const Error * | WaitMoveDone (Timeout timeout=-1) |
| Wait for the currently running move to finish, or for an error to occur. More... | |
| const Error * | WaitHomeDone (Timeout timeout=-1) |
| Wait for the currently running homing move to finish, or for an error to occur. More... | |
| const Error * | ClearNodeGuardEvent (void) |
| This function attempts to clear a node guarding event condition. More... | |
| const Error * | GetEventMask (AMP_EVENT &e) |
| Get the current state of the amplifier's event mask. More... | |
| const Error * | GetErrorStatus (bool noComm=false) |
| Return an error object identifying the amplifiers status. More... | |
Unit conversion functions. | |
If unit conversions are enabled in CML_Settings.h, then these functions handle the details of converting from user position, velocity, acceleration & jerk units to the internal units used by the amplifier. | |
| virtual const Error * | SetCountsPerUnit (uunit cts) |
| Configure the user programmable units. More... | |
| virtual const Error * | GetCountsPerUnit (uunit &cts) |
| Get the number of encoder counts / user distance unit. More... | |
| virtual const Error * | SetCountsPerUnit (uunit load, uunit mtr) |
| Configure the user programmable units for a dual encoder system. More... | |
| virtual const Error * | GetCountsPerUnit (uunit &load, uunit &mtr) |
| Get the number of encoder counts / user distance unit for both encoders in a dual encoder system. More... | |
| virtual int32 | PosUser2Mtr (uunit pos) |
| Convert a position from user position units to internal amplifier units. More... | |
| virtual int32 | VelUser2Mtr (uunit vel) |
| Convert a velocity from user units to internal amplifier units. More... | |
| virtual int32 | AccUser2Mtr (uunit vel) |
| Convert an acceleration from user units to internal amplifier units. More... | |
| virtual uunit | PosMtr2User (int32 pos) |
| Convert a position from internal amplifier units to user units. More... | |
| virtual uunit | VelMtr2User (int32 vel) |
| Convert a velocity from internal amplifier units to user units. More... | |
| virtual uunit | AccMtr2User (int32 vel) |
| Convert an acceleration from internal amplifier units to user units. More... | |
| virtual int32 | PosUser2Load (uunit pos) |
| Convert a position from user position units to internal amplifier units. More... | |
| virtual int32 | VelUser2Load (uunit vel) |
| Convert a velocity from user units to internal amplifier units. More... | |
| virtual int32 | AccUser2Load (uunit acc) |
| Convert an acceleration from user units to internal amplifier units.  More... | |
| virtual uunit | PosLoad2User (int32 pos) |
| Convert a position from internal amplifier units to user units. More... | |
| virtual uunit | VelLoad2User (int32 vel) |
| Convert a velocity from internal amplifier units to user units. More... | |
| virtual uunit | AccLoad2User (int32 acc) |
| Convert an acceleration from internal amplifier units to user units.  More... | |
Linkage access | |
| class Linkage * | GetLinkage (void) |
| Return a pointer to the linkage that this amplifier is attached to. More... | |
| uint32 | GetLinkRef (void) |
| Return a reference to the linkage that this amplifier is attached to. More... | |
Non standard modes of operation. | |
These functions are used when running in modes other then the standard CANopen position modes. Note that at present the libraries offer only very limited support for these modes. | |
| const Error * | GetFuncGenConfig (FuncGenConfig &cfg) |
| Upload the current configuration of the amplifier's internal function generator. More... | |
| const Error * | SetFuncGenConfig (FuncGenConfig &cfg) |
| Configure the amplifier's internal function generator. More... | |
| const Error * | GetAnalogRefConfig (AnalogRefConfig &cfg) |
| Upload the amplifier's analog reference input configuration. More... | |
| const Error * | SetAnalogRefConfig (AnalogRefConfig &cfg) |
| Configure the amplifier's analog reference input. More... | |
| const Error * | GetPwmInConfig (PwmInConfig &cfg) |
| Upload the amplifier's PWM input pin configuration. More... | |
| const Error * | SetPwmInConfig (PwmInConfig &cfg) |
| Configure the amplifier's PWM input pins. More... | |
| const Error * | SetCurrentProgrammed (int16 crnt) |
| Set the programmed current value in 0.01 Amp units. More... | |
| const Error * | GetCurrentProgrammed (int16 &crnt) |
| Get the programmed current value. More... | |
| const Error * | SetVelocityProgrammed (uunit vel) |
| Set the programmed velocity value. More... | |
| const Error * | GetVelocityProgrammed (uunit &vel) |
| Get the programmed velocity value. More... | |
| const Error * | SetMicrostepRate (int16 rate) |
| Set the amplifier microstepping rate. More... | |
| const Error * | GetMicrostepRate (int16 &rate) |
| Get the amplifier microstepping rate. More... | |
Trace control functions | |
The amplifier supports an internal 'tracing' mechanism which allows certain internal variables to be sampled at a fixed rate and stored to internal memory. This mechanism is used by the CME program to implement the oscilloscope display of internal amplifier information. The following methods are available to allow this amplifier feature to be used by CML programs. | |
| const Error * | GetTraceStatus (AMP_TRACE_STATUS &stat, int16 &samp, int16 &sampMax) |
| Get the current status of the amplifier's trace system.  More... | |
| const Error * | GetTracePeriod (int16 &per) |
| Get the period of time between trace samples. More... | |
| const Error * | SetTracePeriod (int16 per) |
| Set the period of time between trace samples. More... | |
| const Error * | GetTraceTrigger (AMP_TRACE_TRIGGER &type, uint8 &chan, int32 &level, int16 &delay) |
| Get the current configuration of the amplifier's trace trigger. More... | |
| const Error * | SetTraceTrigger (AMP_TRACE_TRIGGER type, uint8 chan=0, int32 level=0, int16 delay=0) |
| Configure the amplifier's trace trigger. More... | |
| const Error * | GetTraceMaxChannel (uint8 &max) |
| Return the maximum number of trace channels supported by the amplifier. More... | |
| const Error * | GetTraceChannel (uint8 ndx, AMP_TRACE_VAR &value) |
| Get the amplifier variable current selected on one of the trace channels. More... | |
| const Error * | SetTraceChannel (uint8 ndx, AMP_TRACE_VAR value) |
| Select an amplifier trace variable to be sampled. More... | |
| const Error * | GetTraceData (int32 *data, int32 &max) |
| Upload any trace data captured in the amplifier. More... | |
| const Error * | TraceStart (void) |
| Start collecting trace data on the amplifier. More... | |
| const Error * | TraceStop (void) |
| Stop collecting trace data on the amplifier. More... | |
| Public Member Functions inherited from CopleyNode | |
| const Error * | FirmwareUpdate (Firmware &fw) |
| Use a special protocol to update the firmware in Copley CANopen devices. More... | |
| const Error * | SerialCmd (uint8 opcode, uint8 &ct, uint8 max=0, uint16 *data=0) |
| Send a serial port message to a Copley device over the CANopen network. More... | |
| Public Member Functions inherited from Node | |
| Node () | |
| Default CANopen node object constructor. More... | |
| Node (Network &net, int16 nodeID) | |
| Initialize the Node object. More... | |
| virtual | ~Node () |
| CANopen node destructor. | |
| virtual const Error * | StopGuarding (void) |
| Disable node guarding & heartbeat monitoring. More... | |
| virtual const Error * | StartHeartbeat (uint16 period, uint16 timeout) |
| Enable heartbeat messages from this node, and start a thread to monitor them. More... | |
| virtual const Error * | StartNodeGuard (uint16 guardTime, byte lifeFactor) |
| Enable node guarding on this node. More... | |
| virtual const Error * | UnInit (void) |
| Un-initialize the Node object. More... | |
| virtual NetworkType | GetNetworkType (void) |
| Return a value that identifies the type of network the node is currently attached to. More... | |
| virtual const Error * | PdoSet (uint16 n, PDO &pdo, bool enable=true) |
| Associate the passed PDO object with this node. More... | |
| virtual const Error * | PdoEnable (uint16 n, PDO &pdo) |
| Enable the passed PDO object. More... | |
| virtual const Error * | PdoDisable (uint16 n, PDO &pdo) |
| Disable the passed PDO object. More... | |
| virtual const Error * | RpdoDisable (uint16 n) |
| Disable the specified receive PDO. More... | |
| virtual const Error * | TpdoDisable (uint16 n) |
| Disable the specified transmit PDO. More... | |
| virtual const Error * | StartNode (void) |
| Start this node. More... | |
| virtual const Error * | StopNode (void) |
| Stop this node. More... | |
| virtual const Error * | PreOpNode (void) |
| Put this node in pre-operational state. More... | |
| virtual const Error * | ResetNode (void) |
| Reset this node. More... | |
| virtual const Error * | ResetComm (void) |
| Reset this node's communications. More... | |
| virtual const Error * | GetDeviceType (uint32 &devType) |
| Read the device type from the object dictionary. More... | |
| virtual const Error * | GetErrorRegister (byte &err) |
| Read the error register from the object dictionary. More... | |
| virtual const Error * | GetMfgStatus (uint32 &stat) |
| Read the manufacturer status register from the object dictionary. More... | |
| virtual const Error * | GetErrorHistory (uint16 &ct, uint32 *array) |
| Get the error history array (CANopen object 0x1003). More... | |
| virtual const Error * | ClearErrorHistory (void) |
| Clear the error history (object 0x1003) array for this node. More... | |
| virtual const Error * | GetMfgDeviceName (int32 &len, char *str) |
| Read the manufacturer's device name string from the object dictionary. More... | |
| virtual const Error * | GetMfgHardwareVer (int32 &len, char *str) |
| Read the manufacturer's Hardware version string from the object dictionary. More... | |
| virtual const Error * | GetMfgSoftwareVer (int32 &len, char *str) |
| Read the manufacturer's software version string from the object dictionary. More... | |
| virtual const Error * | GetIdentity (NodeIdentity &id) |
| Get the CANopen identity object for this node (object dictionary entry 0x1018). More... | |
| virtual const Error * | SetSynchId (uint32 id) |
| Set the COB-ID of the synch message. More... | |
| virtual const Error * | GetSynchId (uint32 &id) |
| Return the COB-ID of the synch message. More... | |
| virtual const Error * | SetSynchPeriod (uint32 per) |
| Set the SYNC message interval in microseconds. More... | |
| virtual const Error * | GetSynchPeriod (uint32 &per) |
| Get the SYNC message interval in microseconds. More... | |
| virtual const Error * | SynchStart (void) |
| Start producing SYNC messages on this node. More... | |
| virtual const Error * | SynchStop (void) |
| Stop producing SYNC messages on this node. More... | |
| virtual int16 | GetNodeID (void) |
| Return the node ID associated with this node. More... | |
| bool | IsInitialized (void) |
| Return true if this node object has been initialized. | |
| virtual int32 | maxSdoToNode (void) |
| Return the maximum number of bytes that can be sent in an SDO message. More... | |
| virtual int32 | maxSdoFromNode (void) |
| Return the maximum number of bytes that can be received in an SDO message. More... | |
| Public Member Functions inherited from RefObj | |
| RefObj (const char *name=0) | |
| Default constructor for a reference object. More... | |
| virtual | ~RefObj () |
| Reference object destructor. More... | |
| void | SetRefName (const char *name) |
| Assign a name to this reference. More... | |
| uint32 | GrabRef (void) |
| Grab a reference to this object. More... | |
| void | setAutoDelete (bool autoDeleteEna) |
| This function is used to enable or disable the autodelete function for a reference object. More... | |
| void | UnlockRef (void) |
| Unlock an object that was previously locked using RefObj::Lock. | |
Protected Member Functions | |
| const Error * | ClearEventLatch (EVENT_STATUS stat) |
| Clear the latched version of the amplifier's event status register. More... | |
| virtual void | HandleStateChange (NodeState from, NodeState to) |
| Handle an amplifier state change. More... | |
| const Error * | FormatPosInit (int32 pos, uint8 *data) |
| Format a PVT segment to set the initial 32-bit position on a drive. More... | |
| const Error * | FormatPvtSeg (int32 pos, int32 vel, uint8 time, uint8 *buff) |
| Format a PVT trajectory segment. More... | |
| const Error * | FormatPtSeg (int32 pos, uint8 time, uint8 *buff) |
| Format a PT trajectory segment. More... | |
| const Error * | SetPvtInitialPos (int32 pos, bool viaSDO=true) |
| Set the initial position for a PVT trajectory. More... | |
| const Error * | PvtBufferFlush (bool viaSDO=true) |
| Flush the amplifier's PVT trajectory buffer. More... | |
| const Error * | PvtBufferPop (uint16 n=1, bool viaSDO=true) |
| Pop the N most recently sent segments off the amplifier's PVT trajectory buffer. More... | |
| const Error * | PvtClearErrors (uint8 mask, bool viaSDO=true) |
| Clear the specified PVT buffer errors. More... | |
| const Error * | PvtWriteBuff (uint8 *buff, bool viaSDO=false) |
| Write to the PVT buffer on the amp. More... | |
| const Error * | PvtWriteBuff (uint8 buff[][8], int ct, bool viaSDO=false) |
| Write multiple PVT buffers to the drive. More... | |
| Protected Member Functions inherited from Node | |
| virtual void | HandleEmergency (CanFrame &frame) |
| Overload this function to handle emergency objects sent by this node. More... | |
| Protected Member Functions inherited from RefObj | |
| void | KillRef (void) |
| Destroy this reference. More... | |
Protected Attributes | |
| EventMap | eventMap |
| This is an event map that is used to track amplifier events and state changes. | |
Friends | |
| class | Linkage |
Additional Inherited Members | |
| Static Public Member Functions inherited from RefObj | |
| static void | ReleaseRef (uint32 id) |
| Release the local reference to this object. More... | |
| static RefObj * | LockRef (uint32 id) |
| Find the object associated with the passed reference number and lock it to prevent the object from being destroyed while I'm accessing it. More... | |
| static void | LogRefs (void) |
| This function is provided for debugging. More... | |
| Public Attributes inherited from Node | |
| SDO | sdo |
| This SDO may be used to get/set values in the node's object dictionary. More... | |
Copley Controls amplifier object.
This object represents a Copley Controls amplifier on the network.
The Amp object can be used directly for fairly easy control of an amplifier on the CANopen network. The object provides easy to use methods for setting and getting amplifier parameter blocks. It also handles many of the details of both point to point moves and the transfer of complex PVT profiles.
In addition, the standard Amp object provides several virtual functions which can be used in derived classes to signal the derived object on state changes or emergency conditions.
Construct and initialize an amplifier object using defaults for all amp settings.
| net | Reference to the network object for this amp. |
| nodeID | a valid node ID for the amp. For CANopen, the node ID should range from 1 to 127. For EtherCAT, node ID's >= 0 identify the node by it's EtherCAT alias. Negative ID's identify the node by network position (-1 is the first node, -2 is the second, etc). |
| Amp | ( | Network & | net, |
| int16 | nodeID, | ||
| AmpSettings & | settings | ||
| ) |
Construct and initialize an amplifier object.
| net | Reference to the Network for this amp. |
| nodeID | a valid node ID for the amp. For CANopen, the node ID should range from 1 to 127. For EtherCAT, node ID's >= 0 identify the node by it's EtherCAT alias. Negative ID's identify the node by network position (-1 is the first node, -2 is the second, etc). |
| settings | Amplifier settings to be used. |
Convert an acceleration from internal amplifier units to user units.
Internal to the amplifier, all accelerations are stored in units of 10 encoder counts / second^2. If user units are not enabled in CML_Settings.h, then user units are the same as amplifier units, and this function has no effect.
If user units are enabled, then this function converts from amplifier units to user units (defined using Amp::SetCountsPerUnit).
For dual encoder systems the unit conversion used by this function is based on the load encoder resolution. To convert motor encoder accelerations, use Amp::AccMtr2User. On single encoder systems either of these functions can be used.
| acc | The acceleration in units of 10 encoder counts / second^2 |
Convert an acceleration from internal amplifier units to user units.
This function converts using motor encoder units on a dual encoder system. Load encoder accelerations can be converted using Amp::AccLoad2User.
| acc | The acceleration in units of 10 encoder counts / second^2 |
Convert an acceleration from user units to internal amplifier units.
Internal to the amplifier, all accelerations are stored in units of 10 encoder counts / second / second. If user units are not enabled in CML_Settings.h, then user units are the same as amplifier units, and this function has no effect.
If user units are enabled, then this function converts from user units (defined using Amp::SetCountsPerUnit) to these internal amplifier units.
For dual encoder systems the unit conversion used by this function is based on the load encoder resolution. To convert motor encoder accelerations, use Amp::AccUser2Mtr. On single encoder systems either of these functions can be used.
| acc | The acceleration in user units |
Convert an acceleration from user units to internal amplifier units.
This function converts using motor encoder units on a dual encoder system. Load encoder accelerations can be converted using Amp::AccUser2Load.
| acc | The acceleration in user units |
| const Error * CheckStateForMove | ( | void | ) |
Check the amplifier's state to make sure a move can be started.
This function is used internally by the functions that start moves & homing. It looks at the current state of the amplifier and returns an appropriate error code if something is wrong that would cause problems during a move/home.
|
protected |
Clear the latched version of the amplifier's event status register.
This function is protected and generally only intended for internal use.
| stat | Identifies which bits to clear. Any bit set in this parameter will be cleared in the latched event status register. |
| const Error * ClearFaults | ( | void | ) |
Clear amplifier faults.
This function can be used to clear any latching faults on the amplifier (see Amp::SetFaultMask for details on latching fault conditions). It also clears tracking error conditions.
| const Error * ClearNodeGuardEvent | ( | void | ) |
This function attempts to clear a node guarding event condition.
Node guarding events occur when the amplifier fails to respond to it's heartbeat protocol for some reason. This could be caused by a network wiring problem, slow processing on the master controller (causing the amplifier guard message to be delayed or lost), or an amplifier error such as a reset or power down.
In any case, once a node guarding error is identified, the error condition must be cleared before any new moves may be performed.
This function attempts to clear the node guarding event condition, however if it determines that the amplifier has been reset then it fails and returns the error object AmpError::Reset. In this case, the amplifier object must be reinitialized before it can be used. The amp may be reinitialized by calling Amp::Init or Amp::ReInit.
If node guarding error become a problem, it may mean that the guard time is set too low. This can be adjusted when the amplifier object is initialized by the values in the AmpSettings object.
| const Error * Disable | ( | bool | wait = true | ) |
Disable the amplifier.
Note that if the brake delays are in use, then the amplifier may still be enabled when this function returns success. The outputs will actually be disabled after the amplifier finishes the braking procedure.
| wait | Wait for confirmation from the amplifier if true (default). |
Download data to an object in this Amps object dictionary.
The object number is adjusted based on the axis number if necessary.
| index | The index of the object to be downloaded. |
| sub | The sub-index of the object to be downloaded. |
| data | The value to be downloaded. |
Download data to an object in this Amps object dictionary.
The object number is adjusted based on the axis number if necessary.
| index | The index of the object to be downloaded. |
| sub | The sub-index of the object to be downloaded. |
| data | The value to be downloaded. |
Download data to an object in this Amps object dictionary.
The object number is adjusted based on the axis number if necessary.
| index | The index of the object to be downloaded. |
| sub | The sub-index of the object to be downloaded. |
| data | The value to be downloaded. |
Download data to an object in this Amps object dictionary.
The object number is adjusted based on the axis number if necessary.
| index | The index of the object to be downloaded. |
| sub | The sub-index of the object to be downloaded. |
| data | The value to be downloaded. |
Download data to an object in this Amps object dictionary.
The object number is adjusted based on the axis number if necessary.
| index | The index of the object to be downloaded. |
| sub | The sub-index of the object to be downloaded. |
| data | The value to be downloaded. |
Download data to an object in this Amps object dictionary.
The object number is adjusted based on the axis number if necessary.
| index | The index of the object to be downloaded. |
| sub | The sub-index of the object to be downloaded. |
| data | The value to be downloaded. |
Download data to an object in this Amps object dictionary.
The object number is adjusted based on the axis number if necessary.
| index | The index of the object to be downloaded. |
| sub | The sub-index of the object to be downloaded. |
| data | The value to be downloaded. |
| const Error * DoMove | ( | ProfileConfigTrap & | cfg, |
| bool | relative = false |
||
| ) |
Perform a point to point move.
The move will use the trapezoidal profile mode, and all parameters will be programmed before the move is started.
This function can also be used to update a move that is alread in progress.
| cfg | A structure holding all the move configuration parameters. |
| relative | This will be a relative move if true, absolute if false (default) |
| const Error * DoMove | ( | ProfileConfigScurve & | cfg, |
| bool | relative = false |
||
| ) |
Perform a point to point move.
The move will use the S-curve profile mode, and all parameters will be programmed before the move is started.
| cfg | A structure holding all the move configuration parameters. |
| relative | This will be a relative move if true, absolute if false (default) |
| const Error * DoMove | ( | ProfileConfigVel & | cfg | ) |
Perform a velocity profile move.
All parameters will be programmed before the move is started.
This function can also be used to update a move that is alread in progress.
| cfg | A structure holding all the move configuration parameters. |
Perform a point to point move.
It's assumed that the drive is already configured with the properly trajectory parameters (velocity, acceleration, deceleration, profile type, etc).
This function sets the trajectories target position to the passed value, and manipulates the control word to start the move. It can be used for either absolute moves or relative moves
| pos | Position to move to (absolute) or distance to move (relative). |
| relative | True if this is a relative move, false for absolute. |
Download data to an object in this Amps object dictionary.
The object number is adjusted based on the axis number if necessary.
| index | The index of the object to be downloaded. |
| sub | The sub-index of the object to be downloaded. |
| size | The number of bytes of data to be downloaded |
| data | A character array holding the data to be downloaded. |
| const Error * Enable | ( | bool | wait = true | ) |
Enable the amplifier.
| wait | If true, the function won't return until a status message from the amp is received indicating that it successfully enabled. |
Format a PVT segment to set the initial 32-bit position on a drive.
| pos | The 32-bit initial position |
| data | Buffer of at least 8 bytes where formatted data will be stored. |
Format a PT trajectory segment.
The position and time information passed to the function are organized into the proper format and stored in the passed buffer. The buffer is assumed to be at least 8 bytes long.
| pos | Position at start of segment (encoder counts) |
| time | Time till next segment (milliseconds) |
| buff | Points to the buffer where the message will be stored. |
Format a PVT trajectory segment.
The position, velocity and time information passed to the function are organized into the proper format and stored in the passed buffer. The buffer is assumed to be at least 8 bytes long.
| pos | Position at start of segment (encoder counts) |
| vel | Velocity at start of segment (0.1 counts/sec) |
| time | Time till next segment (milliseconds) |
| buff | Points to the buffer where the message will be stored. |
| const Error * GetAlgoPhaseInit | ( | AlgoPhaseInit & | cfg | ) |
Upload the current configuration parameters for the algorithmic phase init.
| cfg | A structure where the configuration parameters will be returned. |
Read the complete amplifier configuration from the amplifier and return it in the passed structure.
This structure holds every amplifier parameter that can be stored to the amplifier's internal flash memory. The contents of the structure represent the complete amplifier configuration.
| cfg | The structure which will hold the uploaded configuration. |
Read the Amplifier information parameters from the drive.
These parameters describe the amplifiers capabilities. They are read only.
| info | A structure that will be filled with the amplifier info |
Get the currently active amplifier mode of operation.
| mode | The active mode of operation is returned here |
| const Error * GetAmpName | ( | char * | name | ) |
Get the amplifier name stored in the amplifiers flash.
| name | The name of the drive is returned here. This buffer should be at least 50 bytes long to avoid overflow. |
Get the current amplifier temperature (degrees C).
| value | The value will be returned in this variable |
Get the coefficients used in the velocity loop command filter.
| f | A structure where the filter coefficients will be returned |
Get the raw voltage on the two analog encoder inputs (0.1 millivolt units).
If the amplifier has analog encoder inputs, then they will be read and returned.
| sin | The sine input of the analog encoder will be returned here. |
| cos | The cosine input of the analog encoder will be returned here. |
| const Error * GetAnalogRefConfig | ( | AnalogRefConfig & | cfg | ) |
Upload the amplifier's analog reference input configuration.
| cfg | A structure where the configuration parameters will be returned. |
| const Error * GetCammingConfig | ( | CammingConfig & | cfg | ) |
Upload the current configuration parameters for the camming.
| cfg | A structure where the configuration parameters will be returned. |
| const Error * GetCanNetworkConfig | ( | CanNetworkConfig & | cfg | ) |
Get the current CANopen network configuration programmed into the amplifier.
| cfg | A structure where the configuration parameters will be returned. |
Returns the present value of the CANopen device profile control word.
| value | Returns the control word value |
Get the number of encoder counts / user distance unit.
This function is only available when user units are selected in CML_Settings.h.
This value defaults to 1.0 (i.e. user distance units are in encoder counts). It can be adjusted if some other distance unit is desired.
 These units are always based on a time interval of seconds.
| cts | The count value will be returned here |
Get the number of encoder counts / user distance unit for both encoders in a dual encoder system.
This function is only available when user units are selected in CML_Settings.h.
These values default to 1.0 (i.e. user distance units are in encoder counts). It can be adjusted if some other distance unit is desired.
 These units are always based on a time interval of seconds.
| load | The load encoder scaling factor will be returned here |
| mtr | The motor encoder scaling factor will be returned here |
| const Error * GetCrntLoopConfig | ( | CrntLoopConfig & | cfg | ) |
Get the configuration values of the amplifiers current loop.
| cfg | A structure that will be filled with the config info. |
Get the actual motor current.
This current is based on the amplifiers current sensors, and indicates the portion of current that is being used to generate torque in the motor.
The current is returned in units of 0.01 amps.
| value | A variable that will store the returned value. |
Get the commanded motor current.
This current is the input to the current limiter. This value is also the output of the velocity loop when the motor is in either position or velocity control mode. When in current control mode, the commanded current is derived from the control source (analog input, PWM input, function generator, etc).
The current is returned in units of 0.01 amps.
| value | A variable that will store the returned value. |
Get the limited motor current.
The commanded current (GetCurrentCommand) is passed to a current limiter. The output of the current limiter is the limited current which is passed as an input to the current loop.
The current is returned in units of 0.01 amps.
| value | A variable that will store the returned value. |
Get the programmed current value.
This parameter is the current that the amplifier will attempt to maintain when set to the mode AMPMODE_PROG_CRNT.
| crnt | The current will be returned here (0.01 Amp units). |
Get the configuration for the D/A converter.
| cfg | A structure where the configuration will be returned |
| const Error * GetErrorStatus | ( | bool | noComm = false | ) |
Return an error object identifying the amplifiers status.
This function causes the amplifier object to examine it's event mask and return an error object corresponding to the most serious error present.
| noComm | If true, then no CAN message communications will be performed by this function. This is useful if the function is being called from a CAN message handler which can't perform SDO communications. If false (default), then the amplifier may be queried for more detailed error information. |
| const Error * GetEventLatch | ( | EVENT_STATUS & | stat | ) |
Get the amplifier's latched event status register.
This register is a copy of the normal event status register in which bits are latched, i.e. they are set bit not cleared. Bits in this register are only cleared in response to a Amp::ClearEventLatch function call (which is protected by the Amp object). This register is primarily used internally by the Amp object to detect reset conditions on the amplifier.
| stat | The register status is returned here. |
Get the current state of the amplifier's event mask.
The event mask is a bit-mapped variable identifies many interesting elements of the amplifiers state. The contents of this variable are built up from several different amplifier status words which are constantly updated over the CANopen network.
When the event mask is read using this function, no new messages are passed over the network. The current value of the event mask is simply returned. Any time the amplifier's state changes, it sends a message over the CANopen network which is used to update this mask.
It is also possible to wait on a particular value for this mask. See Amp::WaitEvent for details.
| e | The amplifier's event mask is returned here |
| const Error * GetEventStatus | ( | EVENT_STATUS & | stat | ) |
Get the amplifier's 'event status' register.
This is the main register used internal to the amplifier to describe it's current state.
| stat | The register status is returned here. |
| const Error * GetEventSticky | ( | EVENT_STATUS & | stat | ) |
Get the amplifier's 'sticky' event status register.
This register is a copy of the amplifiers event status register in which bits are set normally, but only cleared when the register is read (i.e. the bits are 'sticky'). It's useful for checking for transitory events which might me missed by reading the standard event status register.
| stat | The register status is returned here. |
Get the current value of the amplifier's fault mask.
This mask identifies which error conditions will be treated as latching faults by the amplifier.
| value | The fault mask will be returned here |
Get any active amplifier faults.
| value | A bit mask identifying the active faults will be returned here. |
| const Error * GetFuncGenConfig | ( | FuncGenConfig & | cfg | ) |
Upload the current configuration of the amplifier's internal function generator.
| cfg | A structure where the configuration will be returned. |
| const Error * GetGainScheduling | ( | GainScheduling & | cfg | ) |
Upload the current configuration parameters for the GainS cheduling.
| cfg | A structure where the configuration parameters will be returned. |
Get the current digital hall sensor state.
The hall state is the value of the hall sensors after any adjustments have been made to them based on the hallWiring parameter of the MtrInfo structure.
| value | variable that will store the returned value |
Get the halt mode.
This mode defines what happens when a halt command is issued to the amplifier.
| mode | The mode will be returned here. |
Get the high voltage bus voltage in units of 0.1 volts.
| value | The value will be returned in this variable |
Get the home acceleration.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the last home adjustment amount.
The value returned is distance that the home position was adjusted by on the last successful home opperation.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the most recently captured home sensor position.
| value | The captured position is returned here in units of encoder counts. |
| const Error * GetHomeConfig | ( | HomeConfig & | cfg | ) |
Load a structure with all parameters related to homing the amplifier.
| cfg | A structure where the configuration parameters will be returned. |
Get the home current.
The homing current is returned in 0.01 Amp units (i.e. a value of 123 would be 1.23 Amps).
| value | variable that will store the returned value |
Get the home current.
The homing delay is returned in units of milliseconds.
| value | variable that will store the returned value |
| const Error * GetHomeMethod | ( | COPLEY_HOME_METHOD & | method, |
| uint16 * | extended = 0 |
||
| ) |
Get the selected homing method.
| method | The home method will be returned here. |
| extended | If this pointer is non-null, then the extended homing method value will be returned here. If this pointer is null, then it will be ignored. |
Get the home offset value.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the home velocity used to move to a home switch.
This velocity is used for any home moves that may be made at a high velocity without effecting the quality of the home sensor detection.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the home velocity used to find a switch edge.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the coefficients used in the current loop input filter.
| f | A structure where the filter coefficients will be returned |
Get the coefficients used in the second current loop input filter.
| f | A structure where the filter coefficients will be returned |
Get the most recently captured encoder index position.
| value | The captured position is returned here in units of encoder counts. |
| const Error * GetInputConfig | ( | int8 | pin, |
| INPUT_PIN_CONFIG & | cfg | ||
| ) |
Get the input pin configuration for the specified input pin.
Each of the amplifier input pins can be configured to perform some function. This function configures the specified input to perform the specified function.
| pin | The input pin to check. Input pins are numbered starting from 0. Check the amplifier datasheet for the number of input pins available. |
| cfg | The input pin function will be returned in this variable. |
| const Error * GetInputConfig | ( | int8 | pin, |
| INPUT_PIN_CONFIG & | cfg, | ||
| uint16 & | axis | ||
| ) |
Get the input pin configuration for the specified input pin.
Each of the amplifier input pins can be configured to perform some function. This function configures the specified input to perform the specified function.
| pin | The input pin to check. Input pins are numbered starting from 0. Check the amplifier datasheet for the number of input pins available. |
| cfg | The input pin function will be returned in this variable. |
| axis | The axis number that this input pin is configured for |
Get the input pin debounce time for the specified input pin.
| pin | The input pin to configure. Input pins are numbered starting from 0. Check the amplifier datasheet for the number of input pins available. |
| value | The pins debounce time (milliseconds) is returned here. |
Get the present value of the general purpose input pins.
The input pin values are returned one per bit. The value of input pin 1 will be returned in bit 0 (1 if high, 0 if low), pin 2 will be in bit 1, etc.
| value | variable that will store the returned value |
| viaSDO | If true, an SDO will be used to read the input pins. If false (default), the most recent input value received from the amplifier via PDO will be returned. |
32-bit version to Get the present value of the general purpose input pins.
Note that only the lower 16 input pins are PDO mapped, so this function will always use an SDO access to read the full set of inputs. If the input of interest is one of the lower 16 pins, then the method Amp::GetInputs() is generally a much faster way to read the pin's state.
The input pin values are returned one per bit. The value of input pin 1 will be returned in bit 0 (1 if high, 0 if low), pin 2 will be in bit 1, etc.
| value | variable that will store the returned value |
| const Error * GetInputShapingFilter | ( | InputShaper & | f | ) |
Get the coefficients used in the input shaping filter.
| f | A structure where the filter coefficients will be returned |
Read the amplifier's programmable I/O pin configuration and return it in the passed config structure.
| cfg | A structure that holds the configuration settings. |
Get the IO Options.
See the Amp::SetIOOptions method for description.
| value | variable that will store the returned value |
Get the current state of the input pin pull up/down resisters.
Pull up/down resisters control how an undriven input pin will be interpreted by the amplifier. Depending on the model of amplifier being controlled, there may be zero or more groups of pull up/down resisters attached to some the input pins.
Each bit of this register is used to control one group of pull up/down resisters. Bit 0 controls group 0, etc.
Please refer to the amplifier data sheet for details on the number of groups of pull up/down resisters, and which input pins are included in each group.
| value | variable that will store the returned value |
32 Bit version of GetIoPullup.
This is useful on drives that support more then 16 pull up/down resistors. Please see Amp::GetIoPullup() for more details.
| value | variable that will store the returned value. |
| Linkage * GetLinkage | ( | void | ) |
Return a pointer to the linkage that this amplifier is attached to.
WARNING - this function is dangerous as the pointer is not locked. Use Amp::GetLinkRef instead!
| uint32 GetLinkRef | ( | void | ) |
Return a reference to the linkage that this amplifier is attached to.
Get the amplifier microstepping rate.
This parameter is only used in the diagnostic microstepping mode (AMPMODE_DIAG_USTEP).
| rate | The microstepping rate will be returned here (degrees / second). |
Get the actual current values read directly from the amplifier's current sensors.
Note that if the motor wiring is being swapped in software, the U and V reading will be swapped.
| u | The U winding current will be returned here. |
| v | The V winding current will be returned here. |
Read the motor information structure from the amplifier.
| info | A structure that will be filled with the motor info |
| const Error * GetNetworkOptions | ( | NetworkOptions & | cfg | ) |
Set the Network Options configuration.
| cfg | Reference to the NetworkOptions structure where the configuration data will be returned. |
|
virtual |
Return a reference ID to the network that this node is attached to.
Reimplemented from Node.
| const Error * GetOutputConfig | ( | int8 | pin, |
| OUTPUT_PIN_CONFIG & | cfg | ||
| ) |
Get the output configuration for the specified pin.
| pin | The output pin to check. |
| cfg | The pin configuration value will be returned here. |
| const Error * GetOutputConfig | ( | int8 | pin, |
| OUTPUT_PIN_CONFIG & | cfg, | ||
| uint16 & | axis | ||
| ) |
Get the output configuration for the specified pin.
| pin | The output pin to check. |
| cfg | The pin configuration value will be returned here. |
| axis | On multi-axis drives the axis number that this output pin is configured for will be returned here. |
| const Error * GetOutputConfig | ( | int8 | pin, |
| OUTPUT_PIN_CONFIG & | cfg, | ||
| uint32 & | mask | ||
| ) |
Get the output pin configuration for the specified pin.
| pin | The output pin to check. |
| cfg | The pin configuration value will be returned here. |
| mask | The pin's status bit selection mask will be returned here. |
| const Error * GetOutputConfig | ( | int8 | pin, |
| OUTPUT_PIN_CONFIG & | cfg, | ||
| uint32 & | mask, | ||
| uint16 & | axis | ||
| ) |
Get the output pin configuration for the specified pin.
| pin | The output pin to check. |
| cfg | The pin configuration value will be returned here. |
| mask | The pin's status bit selection mask will be returned here. |
| axis | On multi-axis drives the axis number that this output pin is configured for will be returned here |
| const Error * GetOutputConfig | ( | int8 | pin, |
| OUTPUT_PIN_CONFIG & | cfg, | ||
| uint32 & | param1, | ||
| uint32 & | param2 | ||
| ) |
Get the output pin configuration for the specified pin.
This function supports output pin configurations that require two 32-bit parameters.
| pin | The output pin to check. |
| cfg | The pin configuration value will be returned here. |
| param1 | The pin's first 32-bit parameter will be returned here |
| param2 | The pin's second 32-bit parameter will be returned here |
| const Error * GetOutputConfig | ( | int8 | pin, |
| OUTPUT_PIN_CONFIG & | cfg, | ||
| uint32 & | param1, | ||
| uint32 & | param2, | ||
| uint16 & | axis | ||
| ) |
Get the output pin configuration for the specified pin.
This function supports output pin configurations that require two 32-bit parameters.
| pin | The output pin to check. |
| cfg | The pin configuration value will be returned here. |
| param1 | The pin's first 32-bit parameter will be returned here |
| param2 | The pin's second 32-bit parameter will be returned here |
| axis | On multi-axis drives the axis number that this pin is configured for will be returned here |
Get the present value of the output pin control register.
This register shows the current state of all digital output pins. For each pin, the corresponding bit in the register will be 1 if the pin is active, and 0 if the pin is inactive. Bit 0 follows output pin 0, bit 1 follows pin 1, etc.
| value | variable that will store the returned value |
Get the motor phase angle.
The phase angle describes the motor's electrical position with respect to it's windings. It's an internal parameter used by the amplifier to commutate a brushless motor.
The angle is returned in degrees.
| value | variable that will store the returned value |
| const Error * GetPhaseMode | ( | AMP_PHASE_MODE & | mode | ) |
Get the current phasing mode configuration from the amplifier.
| mode | The mode information will be returned here. |
| const Error * GetPosCaptureCfg | ( | POS_CAPTURE_CFG & | cfg | ) |
Read the current configuration of the position capture mechanism.
| cfg | The position capture configuration value is returned here. |
| const Error * GetPosCaptureStat | ( | POS_CAPTURE_STAT & | stat | ) |
Read the current status of the position capture mechanism.
| stat | The position capture status value is returned here. |
Get the actual position used by the servo loop.
For dual encoder systems, this will be the load encoder position. To get the motor encoder position on such a system, use Amp::GetPositionMotor.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the instantaneous commanded position.
This position is the command input to the servo loop. The commanded position is calculated by the trajectory generator and updated every servo cycle.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the position error.
This is the difference between the instantaneous commanded position and the actual position.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the position error window.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | The position error window value will be returned here. |
Get the load encoder position.
For single encoder systems, this value is NOT USED.
For dual encoder systems, this function returns the load encoder position and is identical to the value returned by Amp::GetPositionActual. This is also the passive load position when the load encoder is configured to be in passive mode.
| value | variable that will store the returned value |
Get the actual motor position.
For single encoder systems, this value is identical to the value returned by Amp::GetPositionActual.
For dual encoder systems, this function returns the actual motor position and Amp::GetPositionActual may be used to get the load encoder position.
| value | variable that will store the returned value |
Get the position warning window.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
| const Error * GetPosLoopConfig | ( | PosLoopConfig & | cfg | ) |
Get the configuration values of the amplifiers position loop.
| cfg | A structure that will be filled with the config info. |
Get the profile acceleration value.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
| const Error * GetProfileConfig | ( | ProfileConfig & | cfg | ) |
Load a structure with all parameters related to point-to-point moves.
| cfg | A structure where the configuration parameters will be returned. |
Get the profile deceleration value.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the currently programmed jerk limit for S-curve profiles.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | The location in which the jerk value will be returned. |
| const Error * GetProfileType | ( | PROFILE_TYPE & | type | ) |
Get the currently selected motion profile type.
This profile type is used for point to point moves in which the amplifier calculates it's own trajectory.
| type | variable that will store the returned value |
Get the profile velocity value.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the number of free positions in the PVT segment buffer.
| n | A reference used to return the number of free positions |
Get the amplifier's PVT buffer status word.
| stat | A reference to a variable where the status will be returned |
Get the segment ID that the amplifier expects for the next PVT segment.
This starts at zero when the amp is reset, and is increased for every segment received.
| id | A reference to the variable where the ID will be written |
Get the starting position of the PVT segment currently active in the amplifier.
When running in PVT mode, this allows an approximation of the amplifier position to be retrieved without adding any additional overhead to the CANopen network.
The position returned by this function is only valid when running in PVT mode.
| pos | The position is returned here. |
| const Error * GetPwmInConfig | ( | PwmInConfig & | cfg | ) |
Upload the amplifier's PWM input pin configuration.
| cfg | A structure where the configuration parameters will be returned. |
| const Error * GetPwmMode | ( | AMP_PWM_MODE & | mode | ) |
Get the current PWM output mode configuration from the amplifier.
| mode | The mode information will be returned here. |
| const Error * GetQuickStop | ( | QUICK_STOP_MODE & | mode | ) |
Get the quick stop mode.
This mode defines what happens when a quick stop command is issued to the amplifier.
| mode | The mode will be returned here. |
Get the quick stop deceleration value.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the analog reference input voltage.
If the amplifier has an analog reference input, it's value will be returned in millivolts.
| value | The value will be returned in this variable |
| const Error * GetRegenConfig | ( | RegenConfig & | cfg | ) |
Upload the current configuration parameters for the power regeneration resister connected to the amplifier.
Note that not all amplifiers support a regen resister. Please see the amplifier datasheet to determine if this feature is available for the amplifier being used.
| cfg | A structure where the configuration parameters will be returned. |
Get the position window time value (milliseconds).
This timeout is used in conjunction with the position window value to identify when a motor has come to rest at the desired position.
| value | variable that will store the returned value |
Get the position window value.
This window, along with the position window time value, is used to identify when the motor has come to rest at the desired position.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
| const Error * GetSoftLimits | ( | SoftPosLimit & | cfg | ) |
Upload the current software limit switch settings from the amplifier.
| cfg | The limit switch settings will be returned in this structure. |
|
virtual |
Returns the present state of this node.
Note that this requires node guarding or heartbeats to be enabled.
Reimplemented from Node.
Get the current value of the drive's status word.
The drive status word indicates the drives current state in it's internal state machine. The drives state in turn identifies if the drive is enabled / disabled, whether a fault is present on the drive, whether it is in motion, etc.
This status word is part of the CANopen device profile (DSP-402). It's used internally by the amplifier object.
| value | Returns the current status word value |
Get the profile target position.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the target velocity used in profile velocity mode.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the actual torque being applied by the motor at the moment.
| value | The torque value is returned here. This is specified in thousandths of the motor rated torque (see Amp::SetTorqueTarget more more info). |
Get the torque demand value.
This is the torque that the amplifier is attempting to apply at the moment.
| value | The torque value is returned here. This is specified in thousandths of the motor rated torque (see Amp::SetTorqueTarget more more info). |
Get the motor rated torque parameter.
The motor's rated torque is the amount of torque that the motor can continuously output without damage.
| value | The motor's rated torque in 0.001 Nm units. For linear motors the units are 0.001 N. |
Get the rate of change of torque for use in profile torque mode (AMPMODE_CAN_TORQUE).
| value | The rate of change specified in thousandths of the total rated torque per second. |
Get the current target torque value.
This parameter is used in profile torque mode (AMPMODE_CAN_TORQUE) to specify the torque that should be applied by the motor.
| value | The torque value is returned here. This is specified in thousandths of the motor rated torque (see Amp::SetTorqueTarget more more info). |
| const Error * GetTraceChannel | ( | uint8 | ndx, |
| AMP_TRACE_VAR & | value | ||
| ) |
Get the amplifier variable current selected on one of the trace channels.
| ndx | The trace channel to get |
| value | The trace variable assigned to this channel will be returned here. |
Upload any trace data captured in the amplifier.
Trace data should only be uploaded when the traces are stopped. Uploading data while it is currently being collected in the amplifier can cause corrupt data to be uploaded.
The trace data is returned as an array of 32-bit integer values. If there are N currently active trace channels, and M samples of data have been collected, then a total of N x M integer values will be returned. In this case, the samples for channel n (0 <= n < N) will be located at postion n + m*N for 0 <= m < M.
| data | An array where the trace data will be returned. |
| max | On entry to this call, this parameter must hold the maximum number of 32-bit integer values to upload. On successful return this parameter will be filled with the total number of integers uploaded. |
Return the maximum number of trace channels supported by the amplifier.
| max | The number of channels is returned here. |
Get the period of time between trace samples.
When the trace system is running, the amplifier will sample and store it's internal variables this often.
Note that this parameter specifies time in units of the amplifier's 'reference period'. See Amp::GetTraceRefPeriod for more information.
| per | The trace period is returned here. |
Get the 'reference period' used with the amplifiers trace mechanism.
The amplifier internally samples it's trace channels at integer multiples of this time.
For example, if the amplifier's reference period is 100,000 nanoseconds, then setting the trace period to 12 would indicate that the amplifier should sample it's internal variables every 1.2 milliseconds.
| per | The reference period is returned here in units of nanoseconds. |
| const Error * GetTraceStatus | ( | AMP_TRACE_STATUS & | stat, |
| int16 & | samp, | ||
| int16 & | sampMax | ||
| ) |
Get the current status of the amplifier's trace system.
| stat | Information on whether the trace is currently running is returned in this parameter. |
| samp | The total number of trace samples collected is returned here. |
| sampMax | The maximum number of trace samples that will fit in the internal buffer is returned here. This value will change depending on how many trace channels are active and which variables are selected. |
| const Error * GetTraceTrigger | ( | AMP_TRACE_TRIGGER & | type, |
| uint8 & | chan, | ||
| int32 & | level, | ||
| int16 & | delay | ||
| ) |
Get the current configuration of the amplifier's trace trigger.
See Amp::SetTraceTrigger for more information about the trigger.
| type | The type of trigger to be used. |
| chan | Which trace channel to trigger off of. |
| level | The trigger level |
| delay | The delay between the occurance of the trigger and the start of data collection. |
| const Error * GetTrackingWindows | ( | TrackingWindows & | cfg | ) |
Get the configuration values of the amplifiers position & velocity tracking windows.
This function allows all tracking window paramters to be read from the amplifier as a group.
| cfg | A structure that will be filled with the config info. |
Get the instantaneous commanded acceleration passed out of the trajectory generator.
This acceleration is used by the position loop to calculate it's acceleration feed forward term.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the instantaneous commanded velocity passed out of the trajectory generator.
This velocity is used by the position loop to calculate it's velocity feed forward term.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
| const Error * GetUstepConfig | ( | UstepConfig & | cfg | ) |
Upload the current configuration parameters for the stepper.
| cfg | A structure where the configuration parameters will be returned. |
| const Error * GetVelLoopConfig | ( | VelLoopConfig & | cfg | ) |
Get the configuration values of the amplifiers velocity loop.
| cfg | A structure that will be filled with the config info. |
viDrain only in some firmware versions
Get the actual motor velocity.
The motor velocity is estimated by the amplifier based on the change in position seen at the encoder. For dual encoder systems, the load encoder veloctiy can be queried using the function Amp::GetVelocityLoad.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the commanded velocity.
The commanded velocity is the velocity value that is passed to the velocity limiter, and from there to the velocity control loop. If the amplifier is in position mode (i.e. the position loop is active), then this velocity is the output of the position control loop.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the limited velocity.
This velocity is the result of applying the velocity limiter to the commanded velocity (see GetVelocityCommand).
When the velocity loop is being driven by the position loop, the velocity limiter consists of a maximum velocity value only. When some other source is driving the velocity loop, the limiter also includes a maximum acceleration and deceleration value.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the load encoder velocity.
The load velocity is estimated by the amplifier based on the change in position seen at the load encoder. For dual encoder systems, the motor encoder veloctiy can be queried using the function Amp::GetVelocityActual.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the programmed velocity value.
This parameter is the velocity that the amplifier will attempt to maintain when set to the mode AMPMODE_PROG_VEL.
| vel | The velocity will be returned here. |
Get the position window time value (milliseconds).
| value | variable that will store the returned value |
Get the velocity warning window.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | variable that will store the returned value |
Get the coefficients used in the velocity loop command filter.
| f | A structure where the filter coefficients will be returned |
Get the coefficients used in the velocity loop output filter.
| f | A structure where the filter coefficients will be returned |
Get the coefficients used in the second velocity loop output filter.
| f | A structure where the filter coefficients will be returned |
Get the coefficients used in the third velocity loop output filter.
| f | A structure where the filter coefficients will be returned |
| const Error * GoHome | ( | void | ) |
Execute a home move.
The various homing parameters (method, velocity, etc) are assumed to have already be configured.
| const Error * GoHome | ( | HomeConfig & | cfg | ) |
Execute a home move.
The various homing parameters are passed in the HomeConfig structure.
This function simply programs all the homing parameters passed in the structure, then calls Amp::GoHome().
| cfg | The homing configuration parameter structure. |
| const Error * HaltMove | ( | void | ) |
Halt the current move.
The exact type of halt can be programmed using the Amp::SetHaltMode function.
Note that the halt function is only available when running in one of the standard CAN amplifier modes. If doing low level velocity or current control, then moves must be stopped externally.
Handle an amplifier state change.
This method wakes up any task waiting on the move done semaphore in the event of a guard error. If this feature is desired, this method should be called from any class that over rides this method.
Reimplemented from Node.
Initialize the amplifier object using all default settings.
| net | Reference to the Network for this amp. |
| nodeID | a valid node ID for the amp. For CANopen, the node ID should range from 1 to 127. For EtherCAT, node ID's >= 0 identify the node by it's EtherCAT alias. Negative ID's identify the node by network position (-1 is the first node, -2 is the second, etc). |
Reimplemented from Node.
| const Error * Init | ( | Network & | net, |
| int16 | nodeID, | ||
| AmpSettings & | settings | ||
| ) |
Initialize the amplifier object with custom amp settings.
| net | Reference to the Network for this amp. |
| nodeID | a valid node ID for the amp |
| settings | Amplifier settings to be used. |
Initialize an Amp object for use with a secondary axis of a multi-axis EtherCAT amplifier.
For Copley EtherCAT multi-axis drives (such as the AE2, BE2, etc), the drive is configured as a single node on the EtherCAT network with multiple axes of motion residing at that node. To control such a drive using CML, use a seperate Amp object for each axis.
The first axis of such a drive is the primary axis and should be initialized using the normal Amp::Init() function call just like a single axis amp. For any additional axes, use the Amp::InitSubAxis() call and pass in a reference to the primary Amp object.
Note that multi-axis CANopen drives are normally configured as multiple distinct nodes on the CANopen network. Do not use this method to initialize nodes on a multi-axis CANopen drive, instead use the Amp::Init() method for each Amp object.
| primary | Reference to the Amp object created for the primary (first) axis of the multi-axis EtherCAT drive. |
| axis | The axis number of the axis to be initialized. The axis number passed should be greater then or equal to two. Axis one is the primary axis and should be initialized using the Amp::Init() method. |
| bool IsHardwareEnabled | ( | void | ) |
Return true if the amplifier's PWM outputs are currently enabled.
| bool IsReferenced | ( | void | ) |
Return true if the amplifier has been successfully referenced (homed).
When an amplifier is first powered up (or after a reset) it does not know the absolute position of the motor. Once the home routine has been successfully executed, the encoder zero location is known and the amplifier is considered referenced.
Once an amplifier has been referenced, it will not loose reference until it is reset, or until a new home routine is executed. During the execution of a home routine, the amplifier is considered to be unreferenced. If the home routine is completed successfully, the amplifier will then be referenced again.
| bool IsSoftwareEnabled | ( | void | ) |
Return true if the amplifier is being enabled by software.
The amplifier outputs may still be disabled if this is true due to an error condition, etc.
Convert a jerk value from internal amplifier units to user units.
Internal to the amplifier, all jerk values are stored in units of 100 encoder counts / second^3. If user units are not enabled in CML_Settings.h, then user units are the same as amplifier units, and this function has no effect.
If user units are enabled, then this function converts from amplifier units to user units (defined using Amp::SetCountsPerUnit).
For dual encoder systems the unit conversion used by this function is based on the load encoder resolution.
| jrk | The jerk value in units of 100 encoder counts / second^3 |
Convert a jerk value from user units to internal amplifier units.
Internal to the amplifier, all jerk values are stored in units of 100 encoder counts / second ^ 3. If user units are not enabled in CML_Settings.h, then user units are the same as amplifier units, and this function has no effect.
If user units are enabled, then this function converts from user units (defined using Amp::SetCountsPerUnit) to these internal amplifier units.
For dual encoder systems the unit conversion used by this function is based on the load encoder resolution.
| jrk | The jerk in user units |
| const Error * LoadFromFile | ( | const char * | name, |
| int & | line | ||
| ) |
Load the specified amplifier data file.
This function presently supports loading *.ccx files created by the CME-2 program, version 3.1 and later.
| name | The name (and optionally path) of the file to load |
| line | If not NULL, the last line number read from the file is returned here. This is useful for finding file format errors. |
Start an absolute point to point move to the specified position.
This is identical to calling Amp::DoMove( pos )
| pos | The position to move to |
Start a relative point to point move of the specified distance.
This is identical to calling Amp::DoMove( dist, true )
| dist | The distance to move |
Convert a position from internal amplifier units to user units.
Internal to the amplifier, all positions are stored in units of encoder counts. If user units are not enabled in CML_Settings.h, then user units are also in encoder counts and this function has no effect.
If user units are enabled, then this function converts from amplifier units to user units (defined using Amp::SetCountsPerUnit).
For dual encoder systems the unit conversion used by this function is based on the load encoder resolution. To convert motor encoder positions, use Amp::PosMtr2User. On single encoder systems either of these functions can be used.
| pos | The position in encoder counts |
Convert a position from internal amplifier units to user units.
This function converts using motor encoder units on a dual encoder system. Load encoder positions can be converted using Amp::PosLoad2User.
| pos | The position in encoder counts |
Convert a position from user position units to internal amplifier units.
Internal to the amplifier, all positions are stored in units of encoder counts. If user units are not enabled in CML_Settings.h, then user units are also in encoder counts and this function has no effect.
If user units are enabled at compile time, then this function converts from user units (defined using Amp::SetCountsPerUnit) to these internal amplifier units.
For dual encoder systems the unit conversion used by this function is based on the load encoder resolution. To convert motor encoder positions, use Amp::PosUser2Mtr. On single encoder systems either of these functions can be used.
| pos | The position in user units |
Convert a position from user position units to internal amplifier units.
This function converts using motor encoder units on a dual encoder system. Load encoder positions can be converted using Amp::PosUser2Load.
| pos | The position in user units |
|
protected |
Pop the N most recently sent segments off the amplifier's PVT trajectory buffer.
If there are less then N segments on the buffer, then the buffer is cleared. Any profile running on the amplifier will continue to run (is not aborted) unless a buffer underflow occurs.
| n | The number of segments to pop off the buffer. Defaults to 1. |
| viaSDO | If true, use a SDO to download the message. If false, use a PDO. default is true. |
| void PvtStatusUpdate | ( | uint32 | status | ) |
Write to the PVT buffer on the amp.
We use a PDO to do this on CANopen, but use an SDO access on EtherCAT.
| buff | Points to a buffer of formatted data to be sent. The buffer length must be at least 8 bytes. |
| viaSDO | Only used on CANopen. If true, download using an SDO. |
Write multiple PVT buffers to the drive.
| buff | Points to a buffer of formatted data to be sent |
| ct | Number of buffers to write; |
| viaSDO | Only used on CANopen. If true, download using an SDO. |
| const Error * QuickStop | ( | void | ) |
Perform a 'quick stop' on the axis.
The exact meaning of a quick stop can be programmed using the Amp::SetQuickStop function. Regardless of the type of quick stop being performed, the amplifier will always end up disabled at the end of the quick stop. If disabling the amplifier is not desirable, then the Amp::HaltMove function should be used instead.
Note that the quick stop function is only available when running in one of the standard CAN amplifier modes. If doing low level velocity or current control, then moves must be stopped externally.
| const Error * ReInit | ( | void | ) |
Re-initialize an amplifier.
This function simply calls Amp::Init using the same parameters that were initially passed.
| const Error * Reset | ( | void | ) |
Reset the amplifier object.
This function should be used for Amp objects instead of Node::ResetNode(). It resets the amplifier and re-initializes the amplifier object.
Upload the passed amplifier configuration to the amplifier's workign memory, and then copy that working memory to flash.
| cfg | The structure which holds the new configuration. |
| const Error * SaveAmpConfig | ( | void | ) |
Save all amplifier parameters to internal flash memory.
Flash memory is a type of non-volatile RAM which allows amplifier parameters to be saved between power cycles. When this function is called, any amplifier parameters that may be stored to flash will be copied from their working (RAM) locations to the stored (flash) locations.
For a list of those amplifier parameters which may be saved to flash memory, see the AmpConfig structure. Every member of that structure represents an amplifier parameter that may be saved to flash.
| const Error * SendTrajectory | ( | Trajectory & | trj, |
| bool | start = true |
||
| ) |
Upload a PVT move trajectory to the amplifier and optionally start the move.
| trj | Reference to the trajectory that will be feed to the amp. A local pointer to this trajectory will be stored if the entire profile will not fit in the amplifiers on-board buffer. This pointer will be kept until the entire profile has been uploaded to the amp. It is therefore important to ensure that the trajectory object will remain valid (i.e. not be deallocated) until the amplifier object has called the Trajectory.Finish() method on it. |
| start | If true (the default), the profile will be started by this call. If false, the profile will be uploaded, but not started. Use true if this is a single axis move, false if this is part of a multi-axis move which needs to be synchronized. |
Clear the PVT segment cache
Make sure the trajectory object is ready to go
| const Error * SetAlgoPhaseInit | ( | AlgoPhaseInit & | cfg | ) |
Download a new configuration structure for the algorithmic phase init.
| cfg | A structure containing the configuration parameters to set. |
Update an amplifier's configuration from the passed structure.
The AmpConfig structure holds all amplifier parameters that may be stored in the amplifier's non-volatile flash memory. This function may be used to update all of these parameters in a single call.
Note that this function updates the copies of these variables in working RAM, not directly in the amplifier flash memory. To copy these parameters to non-volatile memory, call Amp::SaveAmpConfig after updating them.
| cfg | The structure which holds the new configuration. |
Set the amplifier mode of operation.
The mode of operation determines the top level control loop that will be controled (position, velocity, or current), and the source of that control (CANopen network, digital input pins, etc).
| mode | The mode of operation to be set |
| const Error * SetAmpName | ( | char * | name | ) |
Set the amplifier name stored in the amplifiers flash.
| name | The name of the drive to be set |
Set new coefficients for the analog reference input filter.
| f | A structure holding the filter coefficients |
| const Error * SetAnalogRefConfig | ( | AnalogRefConfig & | cfg | ) |
Configure the amplifier's analog reference input.
Note that some amplifier models do not support the analog reference.
| cfg | A structure holding the configuration to download |
| const Error * SetCammingConfig | ( | CammingConfig & | cfg | ) |
Download a new configuration structure for Camming.
| cfg | A structure containing the configuration parameters to set. |
| const Error * SetCanNetworkConfig | ( | CanNetworkConfig & | cfg | ) |
Set the CANopen node ID and bit rate configuration.
Note that the amplifier only uses this parameter at startup or after a reset.
| cfg | Structure holding the configuration to set. |
Set the amplifier's control word.
The control word is part of the CANopen device profile (DSP-402). It's used to enable/disable the amplifier, start moves, etc. This function is used internally by the Amp object.
| value | The control word value to set |
Configure the user programmable units.
Unit conversions may be enabled or disabled at compile time through a setting in CML_Settings.h. If this feature is disabled, then all position, velocity, acceleration & jerk values are passed as 32-bit integers in the amplifier's native units:
If unit conversions are enabled in CML_Settings.h, then these values are passed as double precision floating point values, and this function may be used to set a scaling factor for these units. The scaling factor is passed to this function as a number of encoder counts / user distance unit.
Velocity units are always equal to distance units / second. Likewise, acceleration and jerk units are distance units / second^2 and distance units / second^3.
For example, if the motor in question has a 1 micron encoder, then user units of meters, meters/sec, meters/sec^2, etc can be selected by passing a value of 1,000,000 to this function (i.e. the number of microns/meter).
When user units are enabled at compile time, the amplifier defaults to units of encoder counts, encoder counts / second, etc.
| cts | The number of encoder counts / user distance unit. |
Configure the user programmable units for a dual encoder system.
This method provides the same feature as the single encoder version however it takes two scaling parameters; a load encoder scaler and a motor encoder scaler. These two values are used to scale amplifier parameters based on which encoder they refer to.
| load | The load encoder scaling factor. This gives the number of load encoder counts / user position unit. |
| mtr | The motor encoder scaling factor. This gives the number of motor encoder counts / user position unit. |
| const Error * SetCrntLoopConfig | ( | CrntLoopConfig & | cfg | ) |
Update the amplifier's current loop configuration.
| cfg | A structure that will be filled with the config info. |
Set the programmed current value in 0.01 Amp units.
This parameter is only used when running in the mode AMPMODE_PROG_CRNT. The value programmed through this variable is the current that the amplifier will attempt to output.
| crnt | The current to output (0.01 Amp units). |
Set the D/A converter configuration.
| cfg | A structure holding the D/A converter configuration. |
Set the amplifier's fault mask.
The fault mask identifies which conditions will be treated as latching faults by the amplifier. If such a condition occurs, the amplifier's output will be disabled immediately, and will not be enabled until the fault condition is cleared.
| value | A bit mask identifying which fault conditions to latch. |
| const Error * SetFuncGenConfig | ( | FuncGenConfig & | cfg | ) |
Configure the amplifier's internal function generator.
| cfg | A structure holding the configuration to download |
| const Error * SetGainScheduling | ( | GainScheduling & | cfg | ) |
Download a new configuration structure for Gain Scheduling.
| cfg | A structure containing the configuration parameters to set. |
Set the halt mode.
When the amplifier's halt command is issued (Amp::HaltMove) the amplifier will attempt to stop the move in progress using the method defined by it's halt mode.
| mode | The mode to set |
Set the home acceleration.
This acceleration value will be used for all moves that are part of the home routine.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | the value to set |
| const Error * SetHomeConfig | ( | HomeConfig & | cfg | ) |
Configure the amplifier's homing related parameters.
The passed structure contains all parameters related to performing a home routine.
| cfg | A structure holding the configuration parameters. |
Set the home current.
The home current value is only used when homing to a hard stop. This parameter is specified in units of 0.01 Amps (i.e. a value of 123 would be 1.23 Amps).
| value | the value to set |
Set the home delay.
The home delay value is only used when homing to a hard stop. This parameter is specified in units of milliseconds.
| value | the value to set |
| const Error * SetHomeMethod | ( | COPLEY_HOME_METHOD | method, |
| uint16 | extended = 0 |
||
| ) |
Set the method used for homing the drive.
| method | The home method to set |
| extended | If the 'method' parameter is set to CHM_EXTENDED, then this value will be written to the extended homing parameter on the amplifier. For any other homing method this parameter is ignored. |
Set the home offset value.
This offset is the difference between the location of the homing sensor (as defined by the homing method), and the actual zero position. Once the home location has been found, the amplifier will use this offset to determine where the zero position location is.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | the value to set |
Set the home velocity used to move to a home switch.
This velocity will be used for any move in the home routine that can be done at relatively high speed. A second slower velocity can also be programed for the parts of the home routine that are speed sensitive.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | the value to set |
Set the home velocity used to find a switch edge.
This velocity will be used for any move in the home routine which is speed sensitive. This typically is a move in which the edge of a sensor is being searched for.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | the value to set |
Set the coefficients used in the current loop input filter.
| f | A structure holding the filter coefficients |
Set the coefficients used in the second current loop input filter.
| f | A structure holding the filter coefficients |
| const Error * SetInputConfig | ( | int8 | pin, |
| INPUT_PIN_CONFIG | cfg, | ||
| uint16 | axis = 0 |
||
| ) |
Set the input pin configuration for the specified input pin.
Each of the amplifier input pins can be configured to perform some function. This method configures the specified input to perform the specified function.
| pin | The input pin to configure. Input pins are numbered starting from 0. Check the amplifier datasheet for the number of input pins available. |
| cfg | The input pin function to be assigned to this pin. |
| axis | The axis to apply this input configuration to. This only applies to multi-axis drives. Default is 0 (first axis/axis A). |
Set the input pin debounce time for the specified input pin.
Each of the amplifier input pins can be configured ignore transient states that last less then the debounce time. This function configures the debounce time for a specific pin.
| pin | The input pin to configure. Input pins are numbered starting from 0. Check the amplifier datasheet for the number of input pins available. |
| value | The debounce time to use (milliseconds) |
| const Error * SetInputShapingFilter | ( | InputShaper & | f | ) |
Set new coefficients for the input shaping filter.
| f | A structure holding the filter coefficients |
Configure the amplifier's programmable I/O pins using the values passed in the config structure.
The inputCt and outputCt values of the config structure should indicate the total number of input & output pins to configure. If the amplifier has more pins then these values indicate, the configuration of the remaining amplifier pins will not be changed.
| cfg | A structure that holds the configuration settings. |
Set the IO Options.
This parameter is used to configure the optional features of the general purpose IO. Bits 0-3 describe whether several IO pins are used as a serial interface for expanded IO features. 0 is normal IO, 1 is AEM/APM development board LEDs and address switches. 2 is LEDs wired the same as the developers kit board, but using separate red & green LEDs for network status.
| value | The new value for the IOOptions configuration |
Set the current state of the input pin pull up/down resisters.
Pull up/down resisters control how an undriven input pin will be interpreted by the amplifier. Depending on the model of amplifier being controlled, there may be zero or more groups of pull up/down resisters attached to some the input pins.
Each bit of this register is used to control one group of pull up/down resisters. Bit 0 controls group 0, etc.
Please refer to the amplifier data sheet for details on the number of groups of pull up/down resisters, and which input pins are included in each group.
| value | The new value to write to the pull up/down control register. |
32 Bit version of SetIoPullup.
This is useful on drives that support more then 16 pull up/down resistors. Please see Amp::SetIoPullup() for more details.
| value | The new value to write to the pull up/down control register. |
Set the amplifier microstepping rate.
This parameter is only used in the diagnostic microstepping mode (AMPMODE_DIAG_USTEP).
| rate | The microstepping rate in degrees / second |
Update the amplifier's motor information.
| info | A structure that contains the motor info to be downloaded. |
| const Error * SetNetworkOptions | ( | NetworkOptions & | cfg | ) |
Set the Network Options configuration.
| cfg | Reference to the NetworkOptions structure containing the configuration data to be written to the amp. |
| const Error * SetOutputConfig | ( | int8 | pin, |
| OUTPUT_PIN_CONFIG | cfg, | ||
| uint32 | param1 = 0 , |
||
| uint32 | param2 = 0 , |
||
| uint16 | axis = 0 |
||
| ) |
Set the output pin configuration for the specified pin.
Each of the amplifier output pins can be configured to perform some function. These functions break down into several basic modes:
| pin | The output pin to configure. Output pins are numbered starting from 0. Check the amplifier datasheet for the number of output pins available. |
| cfg | The pin function to be assigned to this pin. |
| param1 | A 32-bit parameter used in conjunction with the output pin configuration to define the pin behavior. For most simple output pin modes this parameter is a bitmask that selects bits in a status register that the output should track. If the output pin is being configured for manual mode, then the mask is not used and does not need to be specified. |
| param2 | A second 32-bit parameter used in a few output pin configurations. |
| axis | On multi-axis drives this is used to configure which axis this output pin is configured for. |
Update the state of the manual output pins.
The passed value will be written to the output pin control register. Any of the output pins that have been configured as manual outputs will be updated based on the value of this register.
Bit 0 controls output pin 0, bit 1 sets output pin 1, etc.
Note that only those output pins that have been configured as manual outputs are effected by this command. Output pins that are configured to perform some other function (such as tracking bits in the event status register) are not effected. See Amp::SetOutputConfig for details on configuring the amplifier output pins.
Also note that this pin controls the active/inactive state of the outputs, not the high/low state. Each output pin can be individually configured as active high or active low. Setting a bit in the register to 1 sets the corresponding output pin active. Active high/low configuration is set using Amp::SetOutputConfig.
| value | The new value to write to the output pin control register. |
| const Error * SetPhaseMode | ( | AMP_PHASE_MODE | mode | ) |
Set the phasing mode configuration for the amplifier.
| mode | The phasing mode to set |
| const Error * SetPosCaptureCfg | ( | POS_CAPTURE_CFG | cfg | ) |
Set the position capture configuration.
The position capture mechanism in the amplifier allows the motor position to be captured by some event. The position can be captured by a transition on the encoder index signal, or by a transition on a general purpose input pin which has been configured as a 'home' input.
| cfg | The position capture configuration value is passed here. |
Set the actual position.
On dual encoder systems, this will set the load encoder position. Amp::SetPositionMotor may be used to set the motor position on such systems.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | The actual position of the motor. |
Set the position error window.
If the absolute value of the motor's position error ever exceeds this value, then a tracking error will occur.
A tracking error causes the amplifier to abort any move in progress, and attempt to bring the motor to a stop using it's velocity loop. The commanded velocity input to the velocity loop will be driven to zero, subject to the velocity loop acceleration and deceleration limits.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | The value to use for the position error window. |
Set the load encoder position.
On single encoder systems, this value is NOT USED.
For dual encoder systems, this will set the load encoder position. This is also the passive load position when the load encoder is configured to be in passive mode.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | The actual position of the motor. |
Set the actual motor position.
On dual encoder systems, this will set the motor encoder position. Amp::SetPositionActual may be used to set the load position on such systems.
| value | The actual position of the motor. |
Set the position warning window.
If the absolute value of the position error ever exceeds this value, then a tracking warning will result. A tracking warning causes a bit in the drives status to be set.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | the value to set |
| const Error * SetPosLoopConfig | ( | PosLoopConfig & | cfg | ) |
Update the amplifier's position loop configuration.
| cfg | A structure that will be filled with the config info. |
Set the profile acceleration value (i.e.
the acceleration that the motor will normally attain when starting the move).
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | The value to set. |
| const Error * SetProfileConfig | ( | ProfileConfig & | cfg | ) |
Configure the amplifier's parameters related to point-to-point moves.
| cfg | A structure holding the configuration parameters. |
Set the profile deceleration value (i.e.
the acceleration that the motor will normally attain when ending the move).
Note that S-curve profiles don't use a separate deceleration value. For S-curve moves, the value programmed in SetProfileAcc is also used for the deceleration segment at the end of the move.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | The value to set. |
Set the jerk limit used with S-curve profiles.
Jerk is the rate of change of acceleration.
Note that this value is only used with S-curve profiles.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | The jerk value to set |
| const Error * SetProfileType | ( | PROFILE_TYPE | type | ) |
Set the motion profile type.
The motion profile type is only used when running in 'position profile' mode. In this mode, the drive performs point to point moves using it's internal trajectory generator.
The motion profile type defines the type of trajectory profile that the drive will generate.
| type | The profile type to use |
Set the profile velocity value (i.e.
the velocity that the motor will normally attain during the move).
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | The value to set. |
Set the initial position for a PVT trajectory.
This function sends a full 32-bit position value which can be used to start a PVT move beyond the 24-bit limit of normal segments. It's normally used at the beginning of a PVT trajectory when the starting position is greater then 24-bits and the commanded position at the time of the move's start is not obvious.
| pos | The 32-bit initial position |
| viaSDO | If true, use a SDO to download the message. If false, use a PDO. default is true. |
| const Error * SetPwmInConfig | ( | PwmInConfig & | cfg | ) |
Configure the amplifier's PWM input pins.
Note that these settings are only used when the amplifier is controlled by it's PWM (or pulse/direction) input pins, i.e. not in CANopen mode.
| cfg | A structure holding the configuration to download |
| const Error * SetPwmMode | ( | AMP_PWM_MODE | mode | ) |
Set the PWM output mode configuration for the amplifier.
| mode | The PWM output mode to set |
| const Error * SetQuickStop | ( | QUICK_STOP_MODE | mode | ) |
Set the quick stop mode.
When the amplifier's quick stop command is issued (Amp::QuickStop), the amplifier will attempt to stop the move in progress using the method defined by it's quick stop mode.
| mode | The mode to set |
Set the quick stop deceleration value (i.e.
the acceleration that the motor will use when doing a quick stop).
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | The value to set. |
| const Error * SetRegenConfig | ( | RegenConfig & | cfg | ) |
Download a new configuration structure for the power regeneration resister.
Note that not all amplifiers support a regen resister. Please see the amplifier datasheet to determine if this feature is available for the amplifier being used.
| cfg | A structure containing the configuration parameters to set. |
Set the position window time value (milliseconds).
The drive will be considered to be settled in position after a move when it's absolute position error value has been within the position window for an amount of time greater then the position window time value.
| value | the value to set |
Set the position settling window.
The drive will be considered to be settled in position after a move when it's absolute position error value has been within the position window for an amount of time greater then the position window time value.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | the value to set |
| const Error * SetSoftLimits | ( | SoftPosLimit & | cfg | ) |
Set software limit switch settings.
The amplifier's software limit settings consist of a positive and negative absolute position. Any time the motors actual position is greater then the positive limit, or less then the negative limit, a limit event occurs. Software limit events are treated by the amplifer in the same way that physical limit switches are, no current will be output in the direction of the limit switch, and any running trajectory will be aborted.
Software limit switches are not used until the amplifier has been homed. Also, if the positive software limit is set to a value greater then or equal to the negative software limit, then the limits are disabled.
| cfg | The limit switch settings to use |
Set the profile target position (i.e.
the position to which the motor should move).
For relative moves, this function sets the distance to move.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | The position to move to |
Set the target velocity used in profile velocity mode.
This parameter is only used when the amplifier is set to profile velocity mode (AMPMODE_CAN_VELOCITY). When in this mode, this parameter defines the target velocity for motion.
This parameter is specified in "user units". See Amp::SetCountsPerUnit for details.
| value | The new target velocity. |
Set the motor rated torque parameter.
The motor's rated torque is the amount of torque that the motor can continuously output without damage.
| value | The motor's rated torque in 0.001 Nm units. For linear motors the units are 0.001 N. |
Set the rate of change of torque for use in profile torque mode (AMPMODE_CAN_TORQUE).
Setting this parameter to zero will cause the rate of change to be unlimited.
| value | The rate of change specified in thousandths of the total rated torque per second. For example, setting to 1000 would specify a slope of the full rated torque of the motor every second. |
Set the amplifier target torque value.
This parameter is used in profile torque mode (AMPMODE_CAN_TORQUE) to specify the desired target torque value. The actual torque commanded by the amplifier will ramp up/down to this value based on the programmed torque slope (see Amp::SetTorqueSlope).
The units used for this object are based on the CANopen DS402 specification. An applications note is available on Copley's web site which gives more information on exactly how to convert between these torque units and the commanded current in the drive. http://www.copleycontrols.com/Motion/pdf/Current-Scaling.pdf
| value | The torque value to be set. This is specified in thousandths of the motor rated torque. |
| const Error * SetTraceChannel | ( | uint8 | ndx, |
| AMP_TRACE_VAR | value | ||
| ) |
Select an amplifier trace variable to be sampled.
| ndx | The trace channel that the variable will be assigned to. |
| value | The trace variable to sample. |
Set the period of time between trace samples.
When the trace system is running, the amplifier will sample and store it's internal variables this often.
Note that this parameter specifies time in units of the amplifier's 'reference period'. See Amp::GetTraceRefPeriod for more information.
| per | The trace period to be set. |
| const Error * SetTraceTrigger | ( | AMP_TRACE_TRIGGER | type, |
| uint8 | chan = 0 , |
||
| int32 | level = 0 , |
||
| int16 | delay = 0 |
||
| ) |
Configure the amplifier's trace trigger.
The trigger acts something like the trigger on an oscilloscope. It allows some event to be specified which will cause the trace subsystem to start collecting data. Most trigger types watch one of the trace channels and constantly compare it's value to a level. The type of comparison made will depend on the type of trigger. For example, the trace can be triggered on the rising edge of a signal, on the falling edge, etc.
The trigger also allows a delay value to be specified. Trace data will start to be collected N trace periods after the trigger, where N is the delay value. The delay can also be negative, in which case the data will start to be collected before the trigger event.
| type | The trigger type. |
| chan | The trace channel to watch. This parameter defaults to 0 if not specified. |
| level | The trigger level. This parameter defaults to 0 if not specified. |
| delay | The trigger delay in trace sample periods. Defaults to 0 if not specified. |
| const Error * SetTrackingWindows | ( | TrackingWindows & | cfg | ) |
Update the amplifier's tracking window configuration.
This function allows all tracking window parameters to be configured with one function call.
| cfg | A structure that holds the configuration settings. |
| const Error * SetupMove | ( | ProfileConfigTrap & | cfg | ) |
Setup a point to point move, but do not start it.
The move may be subsequently started using Amp::StartMove().
The move will use the trapezoidal profile mode, and all parameters will be programmed based on the values passed in the cfg structure.
| cfg | A structure holding all the move configuration parameters. |
| const Error * SetupMove | ( | ProfileConfigScurve & | cfg | ) |
Setup a point to point move, but do not start it.
The move may be subsequently started using Amp::StartMove().
The move will use the S-curve profile mode, and all parameters will be programmed based on the values passed in the cfg structure.
| cfg | A structure holding all the move configuration parameters. |
| const Error * SetupMove | ( | ProfileConfigVel & | cfg | ) |
Setup a point to point move, but do not start it.
The move may be subsequently started using Amp::StartMove().
The move will use the velocity profile mode, and all parameters will be programmed based on the values passed in the cfg structure.
| cfg | A structure holding all the move configuration parameters. |
| const Error * SetUstepConfig | ( | UstepConfig & | cfg | ) |
Download a new configuration structure for the microstepper.
| cfg | A structure containing the configuration parameters to set. |
| const Error * SetVelLoopConfig | ( | VelLoopConfig & | cfg | ) |
Update the amplifier's velocity loop configuration.