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

📄 commands.h

📁 Luminary Micro BLDC motor control software
💻 H
📖 第 1 页 / 共 3 页
字号:
//! <i>Command:</i>
//! \verbatim
//!     TAG_CMD 0x04 CMD_START_DATA_STREAM {checksum}
//! \endverbatim
//!
//! <i>Response:</i>
//! \verbatim
//!     TAG_STATUS 0x04 CMD_START_DATA_STREAM {checksum}
//! \endverbatim
//
//*****************************************************************************
#define CMD_START_DATA_STREAM   0x23

//*****************************************************************************
//
//! Stops the real-time data output stream.  The output stream should be
//! stopped before real-time data items are added to or removed from the
//! stream to avoid unexpected changes in the stream data (it will all
//! be valid data, there is simply no easy way to know what real-time data
//! items are in a #TAG_DATA packet if changes are made while the output stream
//! is running).
//!
//! <i>Command:</i>
//! \verbatim
//!     TAG_CMD 0x04 CMD_STOP_DATA_STREAM {checksum}
//! \endverbatim
//!
//! <i>Response:</i>
//! \verbatim
//!     TAG_STATUS 0x04 CMD_STOP_DATA_STREAM {checksum}
//! \endverbatim
//
//*****************************************************************************
#define CMD_STOP_DATA_STREAM    0x24

//*****************************************************************************
//
//! Starts the motor running based on the current parameter set, if it is
//! not already running.
//!
//! <i>Command:</i>
//! \verbatim
//!     TAG_CMD 0x04 CMD_RUN {checksum}
//! \endverbatim
//!
//! <i>Response:</i>
//! \verbatim
//!     TAG_STATUS 0x04 CMD_RUN {checksum}
//! \endverbatim
//
//*****************************************************************************
#define CMD_RUN                 0x30

//*****************************************************************************
//
//! Stops the motor, if it is not already stopped.
//!
//! <i>Command:</i>
//! \verbatim
//!     TAG_CMD 0x04 CMD_STOP {checksum}
//! \endverbatim
//!
//! <i>Response:</i>
//! \verbatim
//!     TAG_STATUS 0x04 CMD_STOP {checksum}
//! \endverbatim
//
//*****************************************************************************
#define CMD_STOP                0x31

//*****************************************************************************
//
//! Stops the motor, if it is not already stopped.  This may take more
//! aggressive action than #CMD_STOP at the cost of precision.  For
//! example, for a stepper motor, the stop command would ramp the speed down
//! before stopping the motor while emergency stop would stop stepping
//! immediately; in the later case, it is possible that the motor will spin
//! a couple of additional steps, so position accuracy is sacrificed.  This
//! is needed for safety reasons.
//!
//! <i>Command:</i>
//! \verbatim
//!     TAG_CMD 0x04 CMD_EMERGENCY_STOP {checksum}
//! \endverbatim
//!
//! <i>Response:</i>
//! \verbatim
//!     TAG_STATUS 0x04 CMD_EMERGENCY_STOP {checksum}
//! \endverbatim
//
//*****************************************************************************
#define CMD_EMERGENCY_STOP      0x32

//*****************************************************************************
//
//! Specifies the version of the firmware on the motor drive.
//
//*****************************************************************************
#define PARAM_FIRMWARE_VERSION  0x00

//*****************************************************************************
//
//! Specifies the rate at which the real-time data is provided by the
//! motor drive.
//
//*****************************************************************************
#define PARAM_DATA_RATE         0x01

//*****************************************************************************
//
//! Specifies the minimum speed at which the motor can be run.
//
//*****************************************************************************
#define PARAM_MIN_SPEED         0x02

//*****************************************************************************
//
//! Specifies the maximum speed at which the motor can be run.
//
//*****************************************************************************
#define PARAM_MAX_SPEED         0x03

//*****************************************************************************
//
//! Specifies the desired speed of the the motor.
//
//*****************************************************************************
#define PARAM_TARGET_SPEED      0x04

//*****************************************************************************
//
//! Contains the current speed of the motor.  This is a read-only value
//! and matches the corresponding real-time data item.
//
//*****************************************************************************
#define PARAM_CURRENT_SPEED     0x05

//*****************************************************************************
//
//! Specifies the rate at which the speed of the motor is changed when
//! increasing its speed.
//
//*****************************************************************************
#define PARAM_ACCEL             0x06

//*****************************************************************************
//
//! Specifies the rate at which the speed of the motor is changed when
//! decreasing its speed.
//
//*****************************************************************************
#define PARAM_DECEL             0x07

//*****************************************************************************
//
//! Specifies the target position of the motor.
//
//*****************************************************************************
#define PARAM_TARGET_POS        0x08

//*****************************************************************************
//
//! Contains the current position of the motor.  This is a read-only value
//! and matches the corresponding real-time data item.
//
//*****************************************************************************
#define PARAM_CURRENT_POS       0x09

//*****************************************************************************
//
//! Selects between open-loop and closed-loop mode of the motor drive.
//
//*****************************************************************************
#define PARAM_CLOSED_LOOP       0x0a

//*****************************************************************************
//
//! Indicates whether or not an encoder feedback is present on the motor.
//!  Things that require the encoder feedback in order to operate
//! (for example, closed-loop speed control) will be automatically disabled
//! when there is no encoder feedback present.
//
//*****************************************************************************
#define PARAM_ENCODER_PRESENT   0x0b

//*****************************************************************************
//
//! Specifies the type of waveform modulation to be used to drive the motor.
//
//*****************************************************************************
#define PARAM_MODULATION        0x0c

//*****************************************************************************
//
//! Specifies the direction of rotation for the motor.
//
//*****************************************************************************
#define PARAM_DIRECTION         0x0d

//*****************************************************************************
//
//! Specifies the mapping of motor drive frequency to motor drive voltage
//! (commonly referred to as the V/f table).
//
//*****************************************************************************
#define PARAM_VF_TABLE          0x0e

//*****************************************************************************
//
//! Specifies the base PWM frequency used to generate the motor drive
//! waveforms.
//
//*****************************************************************************
#define PARAM_PWM_FREQUENCY     0x0f

//*****************************************************************************
//
//! Specifies the dead time between the high- and low-side PWM signals for
//! a motor phase when using complimentary PWM outputs.
//
//*****************************************************************************
#define PARAM_PWM_DEAD_TIME     0x10

//*****************************************************************************
//
//! Specifies the rate at which the PWM duty cycle is updated.
//
//*****************************************************************************
#define PARAM_PWM_UPDATE        0x11

//*****************************************************************************
//
//! Specifies the minimum width of a PWM pulse; pulses shorter than this
//! value (either positive or negative) are removed from the output.
//! A high pulse shorter than this value will result in the PWM signal
//! remaining low, and a low pulse shorter than this value will result in the
//! PWM signal remaining high.
//
//*****************************************************************************
#define PARAM_PWM_MIN_PULSE     0x12

//*****************************************************************************
//
//! Specifies the wiring configuration of the motor.  For example, for an
//! AC induction motor, this could be one phase or three phase;
//! for a stepper motor, this could be unipolar or bipolar.
//
//*****************************************************************************
#define PARAM_MOTOR_TYPE        0x13

//*****************************************************************************
//
//! Specifies the number of pole pairs in the motor.
//
//*****************************************************************************
#define PARAM_NUM_POLES         0x14

//*****************************************************************************
//
//! Specifies the number of lines in the (optional) optical encoder attached
//! to the motor.
//
//*****************************************************************************
#define PARAM_NUM_LINES         0x15

//*****************************************************************************
//
//! Specifies the minimum current supplied to the motor when operating.  If
//! the current drops below this value, then an undercurrent alarm is asserted.
//
//*****************************************************************************
#define PARAM_MIN_CURRENT       0x16

//*****************************************************************************
//
//! Specifies the maximum current supplied to the motor when operating.  If
//! the current goes above this value, then an overcurrent alarm is asserted.
//
//*****************************************************************************
#define PARAM_MAX_CURRENT       0x17

//*****************************************************************************
//
//! Specifies the minimum bus voltage when the motor is operating. If the
//! bus voltage drops below this value, then an undervoltage alarm is asserted.
//
//*****************************************************************************
#define PARAM_MIN_BUS_VOLTAGE   0x18

//*****************************************************************************
//
//! Specifies the maximum bus voltage when the motor is operating. If the
//! bus voltage goes above this value, then an overvoltage alarm is asserted.
//
//*****************************************************************************
#define PARAM_MAX_BUS_VOLTAGE   0x19

//*****************************************************************************
//
//! Specifies the P coefficient for the PI controller used to adjust the
//! motor speed to track to the requested speed.
//
//*****************************************************************************
#define PARAM_SPEED_P           0x1a

//*****************************************************************************
//
//! Specifies the I coefficient for the PI controller used to adjust the
//! motor speed to track to the requested speed.
//
//*****************************************************************************
#define PARAM_SPEED_I           0x1b

//*****************************************************************************
//
//! Specifies the bus voltage at which the brake circuit is first applied.
//! If the bus voltage goes above this value, then the brake circuit is
//! engaged.
//
//*****************************************************************************
#define PARAM_BRAKE_ON_VOLTAGE  0x1c

//*****************************************************************************
//
//! Specifies the bus voltage at which the brake circuit is disengaged.
//! If the brake circuit is engaged and the bus voltage drops below this
//! value, then the brake circuit is disengaged.
//
//*****************************************************************************
#define PARAM_BRAKE_OFF_VOLTAGE 0x1d

//*****************************************************************************
//
//! Specifies whether the on-board user interface should be active or inactive.
//
//*****************************************************************************
#define PARAM_USE_ONBOARD_UI    0x1e

//*****************************************************************************
//
//! Specifies the amount of time to precharge the bridge before starting the
//! motor drive.
//
//*****************************************************************************
#define PARAM_PRECHARGE_TIME    0x1f

//*****************************************************************************
//
//! Specifies whether DC bus voltage compensation should be performed.
//
//*****************************************************************************
#define PARAM_USE_BUS_COMP      0x20

//*****************************************************************************
//
//! Specifies the range of the V/f table.
//
//*****************************************************************************
#define PARAM_VF_RANGE          0x21

//*****************************************************************************
//
//! Specifies the motor control mode.
//
//*****************************************************************************
#define PARAM_CONTROL_MODE      0x22

//*****************************************************************************
//
//! Specifies the motor winding current decay mode.
//
//*****************************************************************************
#define PARAM_DECAY_MODE        0x23

//*****************************************************************************
//

⌨️ 快捷键说明

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