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

📄 cml_ampdef.h

📁 美国COPLEY驱动器,程序开发工具之一.
💻 H
📖 第 1 页 / 共 4 页
字号:
   /// Jerk limited (S-curve) profile.  In this mode, position, velocity, acceleration,
   /// and jerk (rate of change of acceleration) may be specified.
   PROFILE_SCURVE = 3
};

/***************************************************************************/
/**
Amplifier phasing mode.  This enumeration gives the legal values for the 
amplifier phasing mode setting.  The phasing mode controls what type of input
the amplifier uses to determing the phase angle when commutating a brushless
DC motor.
*/
/***************************************************************************/
enum AMP_PHASE_MODE
{
   /// Use a combination of hall sensors and encoder input.  The hall sensors
   /// are used at startup, and will be used to constantly adjust the phase
   /// angle on every hall transition.  This is the default phase mode, and 
   /// should be used when both hall sensors and encoder input are present.
   PHASE_MODE_ENCODER   = 0,

   /// Phase using only the hall sensor inputs.  This mode gives rougher 
   /// operation then the encoder based mode, however it can be used when no
   /// encoder input is available.
   PHASE_MODE_TRAP      = 1,

   /// Use both encoder & hall inputs, but only use the hall inputs on startup
   /// and ignore them after that.  This mode should normally not be used unless
   /// there is a good reason to ignore the hall inputs after startup.
   PHASE_MODE_NOADJUST  = 2,

   /// This phase mode is used to force brushed DC motor output.  It should only
   /// be used when the amplifier is connected to a brushed DC motor.
   PHASE_MODE_BRUSHED   = 4,

   /// Phase using the encoder only.  In this mode, the amplifier will use an
   /// algorithmic phase initialization on startup.  This mode can be used when an
   /// encoder is present, but no halls are available.
   PHASE_MODE_NOHALL    = 5
};

/***************************************************************************/
/**
Amplifier PWM output mode.  This enumeration gives the legal values for setting
up the amplifier's PWM output mode.  The PWM output mode controls some details 
of how the amplifier drives it's PWM outputs.
*/
/***************************************************************************/
enum AMP_PWM_MODE
{
   /// Standard PWM mode.  This mode should be selected for most applications.
   PWM_MODE_STANDARD    = 0x0000,

   /// This bit forces the amplifier into PWM bus clamping mode.  Bus clamping
   /// mode is a different method of driving the PWM outputs.  It can produce
   /// less switching loss at the expense of greater cross over distortion.
   PWM_MODE_FORCECLAMP  = 0x0001,

   /// Automatically switch between bus clamping and normal output mode based
   /// on the PWM duty cycle.  Bus clamping mode is used at high duty cycles,
   /// normal mode is used at low duty cycles.
   PWM_MODE_AUTOCLAMP   = 0x0002,

   /// If this bit is set, the amplifier's output voltage is limited using a
   /// method known as hexagonal limiting.  If this bit is clear, circular limiting
   /// is used.  Hexagonal limiting gives the maximum voltage output at the 
   /// expense of some added torque ripple.  Higher top speeds may be attained
   /// using hexagonal limiting.
   PWM_MODE_HEXLIMIT    = 0x0010
};

/***************************************************************************/
/**
Amplifier trace variables.  This enumeration lists the amplifier variables that
are available for use with the amplifier's internal trace routine.
*/
/***************************************************************************/
enum AMP_TRACE_VAR
{
   TRACEVAR_HIGH_VOLT    = 6,         ///< High voltage bus
   TRACEVAR_TEMP         = 37,        ///< Amplifier temperature
   TRACEVAR_ANALOG_REF   = 5,         ///< Analog reference input
   TRACEVAR_ENC_SIN      = 46,        ///< Analog encoder sine
   TRACEVAR_ENC_COS      = 47,        ///< Analog encoder cosine

   TRACEVAR_PHASE        = 36,        ///< Motor phase angle
   TRACEVAR_HALLS        = 40,        ///< Hall sensor state
   TRACEVAR_INPUTS       = 48,        ///< digital input pins (after deadtime)
   TRACEVAR_RAW_INPUTS   = 33,        ///< digital input pins (before deadtime)
   TRACEVAR_EVENTS       = 38,        ///< Event status register
   TRACEVAR_EVENTLATCH   = 39,        ///< Latched version of event status register

   TRACEVAR_CRNT_A       = 3,         ///< Actual current, current sensor A
   TRACEVAR_CRNT_B       = 4,         ///< Actual current, current sensor B
   TRACEVAR_CRNT_CMD     = 7,         ///< Commanded current (before limiting)
   TRACEVAR_CRNT_LIM     = 8,         ///< Commanded current (after limiting)
   TRACEVAR_CRNT_CMD_D   = 9,         ///< Commanded current, D axis
   TRACEVAR_CRNT_CMD_Q   = 10,        ///< Commanded current, Q axis
   TRACEVAR_CRNT_ACT_D   = 13,        ///< Actual current, calculated for D axis
   TRACEVAR_CRNT_ACT_Q   = 14,        ///< Actual current, calculated for Q axis
   TRACEVAR_CRNT_ERR_D   = 15,        ///< Current loop error, D axis
   TRACEVAR_CRNT_ERR_Q   = 16,        ///< Current loop error, Q axis
   TRACEVAR_VOLT_D       = 19,        ///< Current loop output voltage, D axis
   TRACEVAR_VOLT_Q       = 20,        ///< Current loop output voltage, Q axis

   TRACEVAR_VEL_MTR      = 23,        ///< Motor velocity with some filtering
   TRACEVAR_VEL_RAW      = 50,        ///< Motor velocity, unfiltered
   TRACEVAR_VEL_LOAD     = 43,        ///< Load encoder velocity
   TRACEVAR_VLOOP_CMD    = 24,        ///< Velocity loop commanded velocity (before limiting)
   TRACEVAR_VLOOP_LIM    = 25,        ///< Velocity loop commanded velocity (after limiting)
   TRACEVAR_VLOOP_ERR    = 26,        ///< Velocity loop error

   TRACEVAR_LOAD_POS     = 28,        ///< Load encoder position
   TRACEVAR_MTR_POS      = 31,        ///< Motor encoder position
   TRACEVAR_POS_ERR      = 30,        ///< Position error
   TRACEVAR_CMD_POS      = 29,        ///< Commanded position from trajectory generator
   TRACEVAR_CMD_VEL      = 44,        ///< Commanded velocity from trajectory generator
   TRACEVAR_CMD_ACC      = 45,        ///< Commanded acceleration from trajectory generator
   TRACEVAR_DEST_POS     = 49         ///< Destination position
};

/***************************************************************************/
/**
 Amplifier trace status bits.  The amplifier's trace mechanism reports it's 
 status as a collection of these bits.
 */
/***************************************************************************/
enum AMP_TRACE_STATUS
{
   TRACESTAT_RUNNING      = 0x0001,
   TRACESTAT_TRIGGERED    = 0x0002,
   TRACESTAT_SAMPLED      = 0x0004,
   TRACESTAT_NODELAY      = 0x0008
};

/***************************************************************************/
/**
Amplifier trace trigger settings.
 */
/***************************************************************************/
enum AMP_TRACE_TRIGGER
{
   /// These bits define which of the trace channels to use for 
   /// triggering.  Not all trigger types require a trace channel,
   /// for those this value is ignored.
   TRACETRIG_CHANNEL    = 0x000F,

   /// These bits define the trace trigger type to use.
   TRACETRIG_TYPE       = 0x0F00,

   /// Trace trigger type none.  The trace is triggered 
   /// immediately on start.	
   TRACETRIG_NONE       = 0x0000,

   /// Trigger as soon as the value on the selected variable 
   /// is above the trigger level.
   TRACETRIG_ABOVE      = 0x0100,

   /// Trigger as soon as the value on the selected variable 
   /// is below the trigger level.
   TRACETRIG_BELOW      = 0x0200,

   /// Trigger when the value on the selected variable changes
   /// from below the trigger level to above it.
   TRACETRIG_RISE       = 0x0300,

   /// Trigger when the value on the selected variable changes
   /// from above the trigger level to below it.
   TRACETRIG_FALL       = 0x0400,

   /// Treat the trigger level as a bit mask which selects one or more
   /// bits on the selected trace variable.  The trigger occurs as soon
   /// as any of the selected bits are set.
   TRACETRIG_BITSET     = 0x0500,

   /// Treat the trigger level as a bit mask which selects one or more
   /// bits on the selected trace variable.  The trigger occurs as soon
   /// as any of the selected bits are clear.
   TRACETRIG_BITCLR     = 0x0600,

   /// Trigger any time the selected trace variable value changes.
   TRACETRIG_CHANGE     = 0x0700,

   /// Treat the trigger level as a bit mask which selects one or more
   /// bits on the amplifier's event status register.  The trigger occurs
   /// as any of the selected bits are set.  Note that this trigger type
   /// does not use a trace variable.
   TRACETRIG_EVENTSET   = 0x0800,

   /// Treat the trigger level as a bit mask which selects one or more
   /// bits on the amplifier's event status register.  The trigger occurs
   /// as any of the selected bits are clear.  Note that this trigger type
   /// does not use a trace variable.
   TRACETRIG_EVENTCLR   = 0x0900,

   /// Trigger at the start of the next function generator cycle.  This trigger
   /// type is only useful when running in function generator mode.  It does
   /// not use a trace variable or the trigger level.
   TRACETRIG_FGEN_CYCLE = 0x0A00,

   /// If this bit is set, then the trigger is allowed to occure even if the 
   /// trace setup delay has not yet occured.  Normally, if a negative trace
   /// delay is set then that much time must expire after the trace has been
   /// started before a trigger will be recognized.  If this bit is set, the
   /// trigger will be recognized even if the setup delay hasn't been met.
   TRACETRIG_NODELAY    = 0x4000,

   /// Only take a single sample for each trigger.  Normally, the occurance of the
   /// trigger causes the trace to begin sampling data and stop when the trace
   /// buffer is full.  If this bit is set, each trigger occurance will cause a 
   /// single sample of trace data.
   TRACETRIG_SAMPLE     = 0x8000
};

/***************************************************************************/
/**
Position capture configuration.

The amplifier is able to capture the encoder position on one of two events;
either the encoder index signal, or a general purpose input pin which has been
configured as a home switch.

This enumeration gives the values that my be used to configure this capture 
mechanism using the Amp::SetPosCaptureCfg method.
 */
/***************************************************************************/
enum POS_CAPTURE_CFG
{
   /// If this bit is set, the rising edge of the encoder index signal 
   /// will be used to capture the index position.
   CAPTURE_INDEX_RISING      = 0x0001,

   /// If this bit is set, the falling edge of the encoder index signal
   /// will be used to capture the index position.
   CAPTURE_INDEX_FALLING     = 0x0002,

   /// If this bit is set, then index capture values will not be overwritten
   /// if a new index edge is received before the previously captured value
   /// has been read.
   CAPTURE_INDEX_LATCH       = 0x0004,

   /// If this bit is set, then captured home sensor positions will not be
   /// overwritten if a new home input edge is received before the previous
   /// captured value was read.
   CAPTURE_HOME_LATCH        = 0x0040,

   /// If this bit is set, then the high speed input based position capture
   /// is enabled.  Note that this features requires firmware versions >=
   /// 5.12 to work.
   CAPTURE_HIGH_SPEED_INPUT  = 0x0100,

   /// If this bit is set, then captured high speed input positions will not
   /// be overwritten if a new input is received before the previous position
   /// was read.
   CAPTURE_HIGH_SPEED_INPUT_LATCH = 0x0400
};

/***************************************************************************/
/**
  Position capture status register value.

  The current status of the position capture mechanism may be read from the 
  amplifier using the method Amp::GetPosCaptureCfg.

  This status value is bitmapped as described by this enumeration.  Any bits
  not described here should be ignored.  Bits not described here are reserved
  and may be either 1 or 0.
 */
/***************************************************************************/
enum POS_CAPTURE_STAT
{
   /// If this bit is set it indicates that a new encoder index position has
   /// been captured.  This position may be read using the method
   /// Amp::GetIndexCapture.  Reading the captured position will cause this
   /// bit to be cleared.
   CAPTURE_INDEX_FULL         = 0x0001,

   /// If this bit is set it indicates that a new encoder index was received
   /// before the previous captured index position was read from the amplifier.
   /// The setting of the CAPTURE_INDEX_LATCH bit in the capture control register
   /// determines whether or not the new captured position was stored.  If the
   /// CAPTURE_INDEX_LATCH configuration bit is set, then the new captured position
   /// will be lost.  If this bit is clear then the newly captured position will
   /// overwrite the previous position.
   /// 
   /// Reading the captured position will cause this bit to be cleared.
   CAPTURE_INDEX_OVER         = 0x0008,

   /// If this bit is set it indicates that a new home sensor position has
   /// been captured.  This position may be read using the method
   /// Amp::GetHomeCapture.  Reading the captured position will cause this
   /// bit to be cleared.
   CAPTURE_HOME_FULL          = 0x0010,

   /// If this bit is set it indicates that a new home sensor transition was received
   /// before the previous captured home position was read from the amplifier.
   /// The setting of the CAPTURE_HOME_LATCH bit in the capture control register
   /// determines whether or not the new captured position was stored.  If the
   /// CAPTURE_HOME_LATCH configuration bit is set, then the new captured position
   /// will be lost.  If this bit is clear then the newly captured position will
   /// overwrite the previous position.
   /// 
   /// Reading the captured position will cause this bit to be cleared.
   CAPTURE_HOME_OVER          = 0x0080
};

CML_NAMESPACE_END()

#endif

⌨️ 快捷键说明

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