⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cml_ampdef.h

📁 美国COPLEY驱动器,程序开发工具之一.
💻 H
📖 第 1 页 / 共 4 页
字号:
   /// second output parameter
   OUTCFG_POSITION_WINDOW      = 0x0004,

   /// The output pin will go active when the motor actual position crosses
   /// through a programmed value in the low to high direction.
   /// The pin will stay active for a programmed amount of time.
   /// The first output parameter specifies the position, and the second 
   /// output parameter specifies the time to remain active in milliseconds.
   OUTCFG_POSITION_TRIG_LOW2HIGH = 0x0005,

   /// The output pin will go active when the motor actual position crosses
   /// through a programmed value in the high to low direction.
   /// The pin will stay active for a programmed amount of time.
   /// The first output parameter specifies the position, and the second 
   /// output parameter specifies the time to remain active in milliseconds.
   OUTCFG_POSITION_TRIG_HIGH2LOW = 0x0006,

   /// The output pin will go active when the motor actual position crosses
   /// through a programmed value in either direction.
   /// The pin will stay active for a programmed amount of time.
   /// The first output parameter specifies the position, and the second 
   /// output parameter specifies the time to remain active in milliseconds.
   OUTCFG_POSITION_TRIG        = 0x0007,

   /// If set the output pin is used as Sync output. This bit can only
   /// be used with  output pin 0. 
   OUTCFG_SYNC_OUTPUT	       = 0x0200,

   /// This bit may be ORed with any of the other output pin configuration 
   /// values to make them active high.
   OUTCFG_ACTIVE_HIGH          = 0x0100
};

/***************************************************************************/
/**
This enumeration is used to specify the mode of operation of the amplifier.

The amplifier mode of operation specifies the control method to be used by 
the amplifier, as well as the source of input to that control structure.

The amplifier can be controlled in servo mode or in microstepping mode.  When
running in servo mode the amplifier uses up to three nested control loops.
These loops control current, velocity and position.  In microstepping mode
the low level current loop is retained, but the upper level loops are replaced
with a simple position command.

The command source of the amplifier will normally be the CANopen network itself.
However, the amplifier also supports several low level control methods in which
commands are received through analog or digital input pins, or even from an 
internal function generator.

Normally, only the CANopen modes of operation will be used when running over
the CANopen network.  These modes are AMPMODE_CAN_PROFILE, AMPMODE_CAN_VELOCITY,
AMPMODE_CAN_HOMING, and AMPMODE_CAN_PVT.  Each of these modes can be used on 
either servo or microstepping drives.  It's typically not necessary to 
specify the type of control method (servo or microstepping) to be used with 
these modes as it can be determined by the type of amplifier being used.  Servo
amplifier's (such as Accelnet) default to servo mode, and microstepping amplifiers
(such as Stepnet) will default to microstepping mode.  If this default is not
appropriate for the application, then the control method may be forced by ORing
in one of the following two values; AMPMODE_CAN_SERVO and AMPMODE_CAN_USTEP.

*/
/***************************************************************************/
enum AMP_MODE
{

   /// In this mode the CANopen network sends move commands to the amplifier,
   /// and the amplifier uses it's internal trajectory generator to perform 
   /// the moves.
   /// This mode conforms to the CANopen device profile for motion control
   /// (DSP-402) profile position mode.
   AMPMODE_CAN_PROFILE      = 0x0001,

   /// In this mode the CANopen network commands target velocity values to the 
   /// amplifier.  The amplifier uses it's programmed acceleration and deceleration
   /// values to ramp the velocity up/down to the target.
   ///
   /// Note that support for profile velocity mode was added in amplifier firmware
   /// version 3.06.  Earlier versions of firmware will report an error if this
   /// mode is selected.
   AMPMODE_CAN_VELOCITY     = 0x0003,

   /// In this mode the CANopen network commands torque values to the amplifier.
   ///
   /// Note that support for profile torque mode was added in amplifier firmware
   /// version 3.34.  Earlier versions of firmware will report an error if this
   /// mode is selected.
   AMPMODE_CAN_TORQUE       = 0x0004,

   /// This mode is used to home the motor (i.e. find the motor zero position)
   /// under the control of the CANopen network.
   /// This mode conforms to the CANopen device profile for motion control
   /// (DSP-402) homing mode.
   AMPMODE_CAN_HOMING       = 0x0006,

   /// In this mode the CANopen master calculates the motor trajectory and
   /// streams it over the CANopen network as a set of points that the 
   /// amplifier interpolated between.
   /// This mode conforms to the CANopen device profile for motion control
   /// (DSP-402) interpolated position mode.
   AMPMODE_CAN_PVT          = 0x0007,

   /// This value may be combined with one of the standard CAN control modes to
   /// specify that servo control should be used.  This is most often specified
   /// when a microstepping amplifier (such as the Stepnet) is to be used in 
   /// servo mode.
   AMPMODE_CAN_SERVO        = 0x1E00,

   /// This value may be combined with one of the standard CAN control modes to
   /// specify that microstepping control should be used.  This is most often specified
   /// when a servo amplifier (such as the Accelnet) is to be used in 
   /// microstepping mode.
   AMPMODE_CAN_USTEP        = 0x2800,

   /// Disable the amplifier.  In this mode, none of the controls loops are
   /// running, and no voltage will be applied across the motor windings.
   AMPMODE_DISABLED         = 0x0000,

   /// Current mode in which the command to the current loop is simply a 
   /// static value that may be programmed over the serial port or CANopen
   /// network.
   /// The programmed current value can be set with the function 
   /// Amp::SetCurrentProgrammed
   AMPMODE_PROG_CRNT        = 0x0100,

   /// Current mode in which the command to the current loop is derived from
   /// the analog input.  Note that some amplifier models do not support an
   /// analog input.  Please refer to the amplifier datasheet to determine if
   /// this mode is applicable.
   AMPMODE_AIN_CRNT         = 0x0200,

   /// Current mode in which the command to the current loop is derived from
   /// the digital input pins.  One or two of the digital inputs are used as
   /// a PWM input command which is interpreted as a current command.
   /// Please refer to the amplifier data sheet to determine which input(s)
   /// should be used in this mode.
   AMPMODE_DIN_CRNT         = 0x0300,

   /// Current mode in which the command to the current loop is derived from
   /// the internal function generator.
   AMPMODE_FGEN_CRNT        = 0x0400,

   /// Velocity mode in which the command to the velocity loop is simply a
   /// static value that may be programmed over the serial or CANopen 
   /// network.
   /// The programmed velocity value can be set with the function 
   /// Amp::SetVelocityProgrammed
   AMPMODE_PROG_VEL         = 0x0B00,

   /// Velocity mode in which the command to the velocity loop is derived from
   /// the analog input.  Note that some amplifier models do not support an
   /// analog input.  Please refer to the amplifier datasheet to determine if
   /// this mode is applicable.
   AMPMODE_AIN_VEL          = 0x0C00,

   /// Velocity mode in which the command to the velocity loop is derived from
   /// the digital input pins.  One or two of the digital inputs are used as
   /// a PWM input command which is interpreted as a velocity command.
   /// Please refer to the amplifier data sheet to determine which input(s)
   /// should be used in this mode.
   AMPMODE_DIN_VEL          = 0x0D00,

   /// Velocity mode in which the command to the velocity loop is derived from
   /// the internal function generator.
   AMPMODE_FGEN_VEL         = 0x0E00,

   /// Position mode in which the command to the position loop is derived from
   /// the digital input pins.  Two of the digital inputs can be configured as
   /// either a master encoder input (quadrature input), a step & direction 
   /// input, or a step up / step down input.
   /// Please refer to the amplifier data sheet to determine which inputs
   /// should be used in this mode.
   AMPMODE_DIN_POS          = 0x1700,

   /// Position mode in which the command to the position loop is derived from
   /// the internal function generator.
   AMPMODE_FGEN_POS         = 0x1800,

   /// Position mode in which the command to the position loop is derived from
   /// CAM tables located in the amplifiers memory.
   AMPMODE_CAM_POS          = 0x1900,

   /// Microstepping mode in which the commanded position is derived from
   /// the digital input pins.  Two of the digital inputs can be configured as
   /// either a master encoder input (quadrature input), a step & direction 
   /// input, or a step up / step down input.
   /// Please refer to the amplifier data sheet to determine which inputs
   /// should be used in this mode.
   AMPMODE_DIN_USTEP        = 0x2100,

   /// Microstepping mode in which the commanded position is derived from
   /// the internal function generator.
   AMPMODE_FGEN_USTEP       = 0x2200,

   /// Diagnostic microstepping mode.  This is a very simple microstepping
   /// mode that can be used for motor setup and testing.  A constant motor 
   /// current is set by the programmed current value, and the motor phase
   /// is microstepped at a fixed rate.  The position and velocity loops are
   /// not used in this mode.
   AMPMODE_DIAG_USTEP       = 0x2A00
};

/***************************************************************************/
/**
Amplifier event status word bit definitions.
*/
/***************************************************************************/
enum EVENT_STATUS
{
   ESTAT_SHORT_CRCT    = 0x00000001,  ///< Amplifier short circuit 
   ESTAT_AMP_TEMP      = 0x00000002,  ///< Amplifier over temperature
   ESTAT_OVER_VOLT     = 0x00000004,  ///< Amplifier over voltage
   ESTAT_UNDER_VOLT    = 0x00000008,  ///< Amplifier under voltage
   ESTAT_MTR_TEMP      = 0x00000010,  ///< Motor over temperature
   ESTAT_ENCODER_PWR   = 0x00000020,  ///< Encoder power error
   ESTAT_PHASE_ERR     = 0x00000040,  ///< Phasing error
   ESTAT_CRNT_LIM      = 0x00000080,  ///< Current limited
   ESTAT_VOLT_LIM      = 0x00000100,  ///< Voltage limited
   ESTAT_POSLIM        = 0x00000200,  ///< Positive limit switch triggered
   ESTAT_NEGLIM        = 0x00000400,  ///< Negative limit switch triggered
   ESTAT_DISABLE_INPUT = 0x00000800,  ///< Enable input pin not set
   ESTAT_SOFT_DISABLE  = 0x00001000,  ///< Disabled due to software request
   ESTAT_STOP          = 0x00002000,  ///< Try to stop motor (after disable, before brake)
   ESTAT_BRAKE         = 0x00004000,  ///< Brake actuated
   ESTAT_PWM_DISABLE   = 0x00008000,  ///< PWM outputs disabled
   ESTAT_SOFTLIM_POS   = 0x00010000,  ///< Positive software limit reached
   ESTAT_SOFTLIM_NEG   = 0x00020000,  ///< Negative software limit reached
   ESTAT_TRK_ERR       = 0x00040000,  ///< Tracking error
   ESTAT_TRK_WARN      = 0x00080000,  ///< Tracking warning
   ESTAT_RESET         = 0x00100000,  ///< Amplifier has been reset
   ESTAT_POSWRAP       = 0x00200000,  ///< Encoder position wrapped (rotory) or hit limit (linear).
   ESTAT_FAULT         = 0x00400000,  ///< Latching fault in effect
   ESTAT_VEL_LIMIT     = 0x00800000,  ///< Velocity is at limit
   ESTAT_ACC_LIMIT     = 0x01000000,  ///< Acceleration is at limit
   ESTAT_TRK_WIN       = 0x02000000,  ///< Not in tracking window if set
   ESTAT_HOME          = 0x04000000,  ///< Home switch is active
   ESTAT_MOVING        = 0x08000000,  ///< Trajectory generator active OR not yet settled
   ESTAT_VEL_WIN       = 0x10000000,  ///< Velocity error outside of velocity window when set.
   ESTAT_PHASE_INIT    = 0x20000000   ///< Set when using algorithmic phase init mode & phase not initialized.
};

/***************************************************************************/
/**
Amplifier events.  This enumeration provides a list of events that can be
used to wait on amplifier conditions.
*/
/***************************************************************************/
enum AMP_EVENT
{
   /// Set when a move is finished and the amplifier has settled in to position 
   /// at the end of the move.  Cleared when a new move is started.
   AMPEVENT_MOVEDONE      = 0x00000001,

   /// Set when the trajectory generator finishes a move.  The motor may not 
   /// have settled into position at this point.  Cleared when a new move is
   /// started.
   AMPEVENT_TRJDONE       = 0x00000002,

   /// A node guarding (or heartbeat) error has occurred.  This indicates that
   /// the amplifier failed to respond within the expected amount of time for
   /// either a heartbeat or node guarding message.  This could be caused by 
   /// a network wiring problem, amplifier power down, amp reset, etc.
   /// This bit is set when the error occurs, and is cleared by a call to the
   /// function Amp::ClearNodeGuardEvent.
   AMPEVENT_NODEGUARD     = 0x00000004,

   /// This event bit is used internally by the amplifier object.  It is set
   /// when the amp acknowledges a new move start.
   AMPEVENT_SPACK         = 0x00000008,

   /// A latching amplifier fault has occurred.  The specifics of what caused
   /// the fault can be obtained by calling Amp::GetFaults, and the fault conditions
   /// can be cleared by calling Amp::ClearFaults.
   AMPEVENT_FAULT         = 0x00000010,

   /// A non-latching amplifier error has occurred.  
   AMPEVENT_ERROR         = 0x00000020,

   /// The amplifier's absolute position error is greater then the window
   /// set with Amp::SetPositionWarnWindow.
   AMPEVENT_POSWARN       = 0x00000040,

   /// The amplifier's absolute position error is greater then the window
   /// set with Amp::SetSettlingWindow.
   AMPEVENT_POSWIN        = 0x00000080,

   /// The amplifier's absolute velocity error is greater then the window
   /// set with Amp::SetVeliocityWarnWindow
   AMPEVENT_VELWIN        = 0x00000100,

   /// The amplifier's outputs are disabled.  The reason for the disable
   /// can be determined by Amp::GetEventStatus
   AMPEVENT_DISABLED      = 0x00000200,

   /// The positive limit switch is currently active
   AMPEVENT_POSLIM        = 0x00000400,

   /// The negative limit switch is currently active
   AMPEVENT_NEGLIM        = 0x00000800,

   /// The positive software limit is currently active
   AMPEVENT_SOFTLIM_POS   = 0x00001000,

   /// The negative software limit is currently active
   AMPEVENT_SOFTLIM_NEG   = 0x00002000,

   /// The amplifier is presently performing a quick stop sequence
   AMPEVENT_QUICKSTOP     = 0x00004000,

   /// The last profile was aborted without finishing
   AMPEVENT_ABORT         = 0x00008000,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -