|
eyou_planet_sdk 1.0
eyou_planet_sdk library
|
宏定义 | |
| #define | EXTERNFUNC |
| #define | PLANET_SUCCESS (0) |
| #define | PLANET_FAILED_ERRORDEVIECTYPE (1) |
| #define | PLANET_FAILED_DEVICEDISABLED (2) |
| #define | PLANET_FAILED_SETFAILED (3) |
| #define | PLANET_FAILED_MAXBYTESLIMIT (4) |
| #define | PLANET_FAILED_NORECEIVE (5) |
| #define | PLANET_FAILED_UNKNOW (100) |
类型定义 | |
| typedef void(* | planet_SendCallFunc) (unsigned id, const unsigned char *data, unsigned size) |
| 发送数据回调函数 | |
| typedef void(* | planet_ReceiveCallFunc) (unsigned id, const unsigned char *data, unsigned size) |
| 接收数据回调函数 | |
枚举 | |
| enum | planet_DeviceType { planet_DeviceType_USBCAN2 = 4 , planet_DeviceType_Canable = 11 } |
| 设备类型 更多... | |
| enum | planet_Baudrate { planet_Baudrate_500 = 500 , planet_Baudrate_1000 = 1000 } |
| 波特率 更多... | |
函数 | |
| EXTERNFUNC int | planet_setSendCallFunction (planet_SendCallFunc callFunc) |
| 设置发送数据回调函数,可以通过该函数捕获实际发送的can数据 | |
| EXTERNFUNC int | planet_setReceiveCallFunction (planet_ReceiveCallFunc callFunc) |
| 设置接收数据回调函数,可以通过该函数捕获实际接收的can数据 | |
| EXTERNFUNC int | planet_initDLL (planet_DeviceType devType, unsigned devIndex, unsigned channel, planet_Baudrate baudrate) |
| 初始化dll,调用其他函数前,必须先调用该函数进行初始化,初始化成功后设备自动打开 | |
| EXTERNFUNC int | planet_freeDLL (unsigned devIndex) |
| 关闭设备,释放资源,成功初始化设备后,需要在程序结束时调用该函数 | |
| EXTERNFUNC int | planet_getHeartbeat (unsigned devIndex, unsigned id, bool *heartbeat, unsigned timeout=100) |
| 获得电机心跳状态 | |
| EXTERNFUNC int | planet_getMotorType (unsigned devIndex, unsigned id, unsigned *type, unsigned timeout=100) |
| 获得电机类型 | |
| EXTERNFUNC int | planet_getSerialNumber (unsigned devIndex, unsigned id, unsigned *serialNum, unsigned timeout=100) |
| 获得电机序列号 | |
| EXTERNFUNC int | planet_getHardwareVersion (unsigned devIndex, unsigned id, unsigned *hdVersion, unsigned timeout=100) |
| 获得硬件版本号 | |
| EXTERNFUNC int | planet_getFirmwareVersion (unsigned devIndex, unsigned id, unsigned *fmVersion, unsigned timeout=100) |
| 获得电机固件版本号 | |
| EXTERNFUNC int | planet_getCurrent (unsigned devIndex, unsigned id, float *current, unsigned timeout=100) |
| 获得电机电流值(q值) | |
| EXTERNFUNC int | planet_getVelocity (unsigned devIndex, unsigned id, float *velocity, unsigned timeout=100) |
| 获得电机速度(rpm) | |
| EXTERNFUNC int | planet_getPosition (unsigned devIndex, unsigned id, float *position, unsigned timeout=100) |
| 获得电机位置(°) | |
| EXTERNFUNC int | planet_getTargetCurrent (unsigned devIndex, unsigned id, float *current, unsigned timeout=100) |
| 获得目标电流值(q值) | |
| EXTERNFUNC int | planet_setTargetCurrent (unsigned devIndex, unsigned id, float current, unsigned timeout=100) |
| 设置目标电流值(q值) | |
| EXTERNFUNC int | planet_getTargetVelocity (unsigned devIndex, unsigned id, float *velocity, unsigned timeout=100) |
| 获得电机目标速度(rpm) | |
| EXTERNFUNC int | planet_setTargetVelocity (unsigned devIndex, unsigned id, float velocity, unsigned timeout=100) |
| 设置电机目标速度(rpm) | |
| EXTERNFUNC int | planet_getTargetPosition (unsigned devIndex, unsigned id, float *position, unsigned timeout=100) |
| 获得电机目标位置(°) | |
| EXTERNFUNC int | planet_setTargetPosition (unsigned devIndex, unsigned id, float position, unsigned timeout=100) |
| 设置电机目标位置(°),该函数不适用于同步位置模式,位置模式下设置电机目标位置 参见:quick_setTargetPosition | |
| EXTERNFUNC int | planet_quick_setTargetPosition (unsigned devIndex, unsigned id, float position) |
| 设置电机目标位置(°),该函数用于同步位置模式,实现快写,无需等待控制器返回确认,可以快速连续设置,实现轨迹规划 | |
| EXTERNFUNC int | planet_getTargetAcceleration (unsigned devIndex, unsigned id, float *acc, unsigned timeout=100) |
| 获得电机目标加速度(rpm/s) | |
| EXTERNFUNC int | planet_setTargetAcceleration (unsigned devIndex, unsigned id, float acc, unsigned timeout=100) |
| 设置电机目标加速度(rpm/s) | |
| EXTERNFUNC int | planet_getTargetDeceleration (unsigned devIndex, unsigned id, float *dec, unsigned timeout=100) |
| 获得电机目标减速度(rpm/s) | |
| EXTERNFUNC int | planet_setTargetDeceleration (unsigned devIndex, unsigned id, float dec, unsigned timeout=100) |
| 设置电机目标减速度(rpm/s) | |
| EXTERNFUNC int | planet_getMode (unsigned devIndex, unsigned id, unsigned *mode, unsigned timeout=100) |
| 获得电机控制模式 | |
| EXTERNFUNC int | planet_setMode (unsigned devIndex, unsigned id, unsigned mode, unsigned timeout=100) |
| 设置电机控制模式 | |
| EXTERNFUNC int | planet_getEnabled (unsigned devIndex, unsigned id, bool *enable, unsigned timeout=100) |
| 获得电机使能状态 | |
| EXTERNFUNC int | planet_setEnabled (unsigned devIndex, unsigned id, bool enable, unsigned timeout=100) |
| 设置电机使能状态 | |
| EXTERNFUNC int | planet_getStopRunState (unsigned devIndex, unsigned id, bool *state, unsigned timeout=100) |
| EXTERNFUNC int | planet_setStopRunState (unsigned devIndex, unsigned id, bool state, unsigned timeout=100) |
| 设置电机停止状态 | |
| EXTERNFUNC int | planet_getAlert (unsigned devIndex, unsigned id, unsigned *alert, unsigned timeout=100) |
| 获得电机的警告 | |
| EXTERNFUNC int | planet_getElectronicGearRatio (unsigned devIndex, unsigned id, float *ratio, unsigned timeout=100) |
| 获得电机的电子齿轮比 | |
| EXTERNFUNC int | planet_getVoltage (unsigned devIndex, unsigned id, float *voltage, unsigned timeout=100) |
| 获得电机的电压(V) | |
| EXTERNFUNC int | planet_getProtectedVoltage (unsigned devIndex, unsigned id, float *voltage, unsigned timeout=100) |
| 获得电机的保护电压(V) | |
| EXTERNFUNC int | planet_setProtectedVoltage (unsigned devIndex, unsigned id, float voltage, unsigned timeout=100) |
| 设置电机的保护电压(V) | |
| EXTERNFUNC int | planet_getTemperature (unsigned devIndex, unsigned id, float *tem, unsigned timeout=100) |
| 获得电机的温度(℃) | |
| EXTERNFUNC int | planet_getProtectedTemperature (unsigned devIndex, unsigned id, float *protectedTem, unsigned timeout=100) |
| 获得电机的保护温度(℃) | |
| EXTERNFUNC int | planet_setProtectedTemperature (unsigned devIndex, unsigned id, float tem, unsigned timeout=100) |
| 设置电机保护温度(℃) | |
| EXTERNFUNC int | planet_getRecoveryTemperature (unsigned devIndex, unsigned id, float *recoveryTem, unsigned timeout=100) |
| 获得电机恢复温度(℃) | |
| EXTERNFUNC int | planet_setRecoveryTemperature (unsigned devIndex, unsigned id, float tem, unsigned timeout=100) |
| 设置电机恢复温度(℃) | |
| EXTERNFUNC int | planet_getPOfCurrentLoop (unsigned devIndex, unsigned id, unsigned *p, unsigned timeout=100) |
| 获得电流环p值 | |
| EXTERNFUNC int | planet_setPOfCurrentLoop (unsigned devIndex, unsigned id, unsigned p, unsigned timeout=100) |
| 设置电流环p值 | |
| EXTERNFUNC int | planet_getIOfCurrentLoop (unsigned devIndex, unsigned id, unsigned *i, unsigned timeout=100) |
| 获得电流环i值 | |
| EXTERNFUNC int | planet_setIOfCurrentLoop (unsigned devIndex, unsigned id, unsigned i, unsigned timeout=100) |
| 设置电流环i值 | |
| EXTERNFUNC int | planet_getPOfVelocityLoop (unsigned devIndex, unsigned id, unsigned *p, unsigned timeout=100) |
| 获得速度环p值 | |
| EXTERNFUNC int | planet_setPOfVelocityLoop (unsigned devIndex, unsigned id, unsigned p, unsigned timeout=100) |
| 设置速度环p值 | |
| EXTERNFUNC int | planet_getIOfVelocityLoop (unsigned devIndex, unsigned id, unsigned *i, unsigned timeout=100) |
| 获得速度环i值 | |
| EXTERNFUNC int | planet_setIOfVelocityLoop (unsigned devIndex, unsigned id, unsigned i, unsigned timeout=100) |
| 设置速度环i值 | |
| EXTERNFUNC int | planet_getPOfPositionLoop (unsigned devIndex, unsigned id, unsigned *p, unsigned timeout=100) |
| 获得位置环p值 | |
| EXTERNFUNC int | planet_setPOfPositionLoop (unsigned devIndex, unsigned id, unsigned p, unsigned timeout=100) |
| 设置位置环p值 | |
| EXTERNFUNC int | planet_getIOfPositionLoop (unsigned devIndex, unsigned id, unsigned *i, unsigned timeout=100) |
| 获得位置环i值 | |
| EXTERNFUNC int | planet_setIOfPositionLoop (unsigned devIndex, unsigned id, unsigned i, unsigned timeout=100) |
| 设置位置环i值 | |
| EXTERNFUNC int | planet_getIntegralLimit (unsigned devIndex, unsigned id, float *limit, unsigned timeout=100) |
| 获得力矩环积分限制 | |
| EXTERNFUNC int | planet_setIntegralLimit (unsigned devIndex, unsigned id, float limit, unsigned timeout=100) |
| 设置力矩环积分限制 | |
| EXTERNFUNC int | planet_getMaxCurrent (unsigned devIndex, unsigned id, float *current, unsigned timeout=100) |
| 获得电机最大电流值(q值) | |
| EXTERNFUNC int | planet_setMaxCurrent (unsigned devIndex, unsigned id, float current, unsigned timeout=100) |
| 设置电机最大电流值(q值) | |
| EXTERNFUNC int | planet_getMaxVelocity (unsigned devIndex, unsigned id, float *velocity, unsigned timeout=100) |
| 获得电机最大速度值(rpm) | |
| EXTERNFUNC int | planet_setMaxVelocity (unsigned devIndex, unsigned id, float velocity, unsigned timeout=100) |
| 设置电机最大速度值(rpm) | |
| EXTERNFUNC int | planet_getMaxVelocityOfVelocityLadderCurve (unsigned devIndex, unsigned id, float *velocity, unsigned timeout=100) |
| 获得速度梯形曲线的最大速度(rpm) | |
| EXTERNFUNC int | planet_setMaxVelocityOfVelocityLadderCurve (unsigned devIndex, unsigned id, float velocity, unsigned timeout=100) |
| 设置速度梯形曲线的最大速度(rpm) | |
| EXTERNFUNC int | planet_getMaxAccelerationOfVelocityLadderCurve (unsigned devIndex, unsigned id, float *acc, unsigned timeout=100) |
| 获得速度梯形曲线的最大加速度(rpm/s) | |
| EXTERNFUNC int | planet_setMaxAccelerationOfVelocityLadderCurve (unsigned devIndex, unsigned id, float acc, unsigned timeout=100) |
| 设置速度梯形曲线的最大加速度(rpm/s) | |
| EXTERNFUNC int | planet_getMaxDecelerationOfVelocityLadderCurve (unsigned devIndex, unsigned id, float *dec, unsigned timeout=100) |
| 获得速度梯形曲线的最大减速度(rpm/s) | |
| EXTERNFUNC int | planet_setMaxDecelerationOfVelocityLadderCurve (unsigned devIndex, unsigned id, float dec, unsigned timeout=100) |
| 设置速度梯形曲线的最大减速度(rpm/s) | |
| EXTERNFUNC int | planet_getMaxVelocityOfPositionLadderCurve (unsigned devIndex, unsigned id, float *dec, unsigned timeout=100) |
| 获得位置梯形曲线的最大速度(rpm) | |
| EXTERNFUNC int | planet_setMaxVelocityOfPositionLadderCurve (unsigned devIndex, unsigned id, float velocity, unsigned timeout=100) |
| 设置位置梯形曲线的最大速度(rpm) | |
| EXTERNFUNC int | planet_getMaxAccelerationOfPositionLadderCurve (unsigned devIndex, unsigned id, float *acc, unsigned timeout=100) |
| 获得位置梯形曲线的最大加速度(rpm/s) | |
| EXTERNFUNC int | planet_setMaxAccelerationOfPositionLadderCurve (unsigned devIndex, unsigned id, float acc, unsigned timeout=100) |
| 设置位置梯形曲线的最大加速度(rpm/s) | |
| EXTERNFUNC int | planet_getMaxDecelerationOfPositionLadderCurve (unsigned devIndex, unsigned id, float *dec, unsigned timeout=100) |
| 获得位置梯形曲线的最大减速度(rpm/s) | |
| EXTERNFUNC int | planet_setMaxDecelerationOfPositionLadderCurve (unsigned devIndex, unsigned id, float dec, unsigned timeout=100) |
| 设置位置梯形曲线的最大减速度(rpm/s) | |
| EXTERNFUNC int | planet_getLimitState (unsigned devIndex, unsigned id, bool *state, unsigned timeout=100) |
| 获得电机限位状态 | |
| EXTERNFUNC int | planet_setLimitState (unsigned devIndex, unsigned id, bool state, unsigned timeout=100) |
| 设置电机的限位状态 | |
| EXTERNFUNC int | planet_getMaxPosition (unsigned devIndex, unsigned id, float *position, unsigned timeout=100) |
| 获得电机最大位置(°) | |
| EXTERNFUNC int | planet_setMaxPosition (unsigned devIndex, unsigned id, float position, unsigned timeout=100) |
| 设置电机最大位置(°) | |
| EXTERNFUNC int | planet_getMinPosition (unsigned devIndex, unsigned id, float *position, unsigned timeout=100) |
| 获得电机最小位置(°) | |
| EXTERNFUNC int | planet_setMinPosition (unsigned devIndex, unsigned id, float position, unsigned timeout=100) |
| 设置电机最小位置(°) | |
| EXTERNFUNC int | planet_getOriginPositionOffset (unsigned devIndex, unsigned id, float *offset, unsigned timeout=100) |
| 获得电机的位置偏置(原始数据,没有进行q24转换) | |
| EXTERNFUNC int | planet_getPositionOffset (unsigned devIndex, unsigned id, float *offset, unsigned timeout=100) |
| 获得电机的位置偏置(°) | |
| EXTERNFUNC int | planet_setPositionOffset (unsigned devIndex, unsigned id, float position, unsigned timeout=100) |
| 设置电机的位置偏置(°) | |
| EXTERNFUNC int | planet_getSingleLapPositionRange (unsigned devIndex, unsigned id, int *range, unsigned timeout=100) |
| 获得上电时刻单圈位置范围值 | |
| EXTERNFUNC int | planet_setSingleLapPositionRange (unsigned devIndex, unsigned id, int range, unsigned timeout=100) |
| 设置电机上电时刻的单圈位置范围值 | |
| EXTERNFUNC int | planet_getAntiCoggingTorqueEnabled (unsigned devIndex, unsigned id, bool *enable, unsigned timeout=100) |
| 获取抗齿槽转矩补偿状态 | |
| EXTERNFUNC int | planet_setAntiCoggingTorqueEnabled (unsigned devIndex, unsigned id, bool enable, unsigned timeout=100) |
| 设置抗齿槽转矩补偿 | |
| EXTERNFUNC int | planet_getBrakeEnabled (unsigned devIndex, unsigned id, bool *enable, unsigned timeout=100) |
| 获取抱闸使能状态 | |
| EXTERNFUNC int | planet_setBrakeEnabled (unsigned devIndex, unsigned id, bool enable, unsigned timeout=100) |
| 设置抱闸使能状态 | |
| EXTERNFUNC int | planet_getCanBaudrate (unsigned devIndex, unsigned id, int *baudrate, unsigned timeout=100) |
| 获得电机的波特率 | |
| EXTERNFUNC int | planet_setCanBaudrate (unsigned devIndex, unsigned id, int baudrate, unsigned timeout=100) |
| 设置电机的波特率 | |
| EXTERNFUNC int | planet_setID (unsigned devIndex, unsigned id, unsigned newId, unsigned timeout=100) |
| 设置电机的id(范围是1~255) | |
| EXTERNFUNC int | planet_saveParas (unsigned devIndex, unsigned id, unsigned timeout=100) |
| 保存控制器参数,当前修改的控制器参数,重新上电后仍然生效 | |
| EXTERNFUNC int | planet_getProductInfo (unsigned devIndex, unsigned id, unsigned *info, unsigned timeout=100) |
| 获取产品信息 | |
| EXTERNFUNC int | planet_setProductInfo (unsigned devIndex, unsigned id, unsigned info, unsigned timeout=100) |
| 设置产品信息 | |
| EXTERNFUNC int | planet_getProtectionSwitch (unsigned devIndex, unsigned id, unsigned *value, unsigned timeout=100) |
| 读取保护开关状态 | |
| EXTERNFUNC int | planet_setProtectionSwitch (unsigned devIndex, unsigned id, unsigned value, unsigned timeout=100) |
| 设置保护开关状态 | |
| EXTERNFUNC int | planet_getRatedTorque (unsigned devIndex, unsigned id, unsigned *torque, unsigned timeout=100) |
| 读取额定扭矩 | |
| EXTERNFUNC int | planet_getDefaultTorqueFactor (unsigned devIndex, unsigned id, unsigned *factor, unsigned timeout=100) |
| 读取默认扭矩因子 | |
| EXTERNFUNC int | planet_getTorqueFactor (unsigned devIndex, unsigned id, unsigned *factor, unsigned timeout=100) |
| 读取扭矩因子 | |
| EXTERNFUNC int | planet_setTorqueFactor (unsigned devIndex, unsigned id, unsigned factor, unsigned timeout=100) |
| 设置扭矩因子 | |
| EXTERNFUNC int | planet_getStallProtectionTime (unsigned devIndex, unsigned id, unsigned *time, unsigned timeout=100) |
| 读取堵转保护时间 | |
| EXTERNFUNC int | planet_setStallProtectionTime (unsigned devIndex, unsigned id, unsigned time, unsigned timeout=100) |
| 设置堵转保护时间 | |
| EXTERNFUNC int | planet_getFPGAErrorCount (unsigned devIndex, unsigned id, unsigned *count, unsigned timeout=100) |
| 读取FPGA通讯错误计数 | |
| EXTERNFUNC int | planet_getSecondEncoderAngle (unsigned devIndex, unsigned id, unsigned *angle, unsigned timeout=100) |
| 读取第二磁编角度参数 | |
| EXTERNFUNC int | planet_getSecondaryEncoderOffset (unsigned devIndex, unsigned id, unsigned *offset, unsigned timeout=100) |
| 读取第二磁编校准偏移 | |
| EXTERNFUNC int | planet_setSecondaryEncoderOffset (unsigned devIndex, unsigned id, unsigned offset, unsigned timeout=100) |
| 设置第二磁编校准偏移 | |
| EXTERNFUNC int | planet_getFirstEncoderAngle (unsigned devIndex, unsigned id, unsigned *offset, unsigned timeout=100) |
| 读取第一磁编角度参数 | |
| EXTERNFUNC int | planet_writeData (unsigned devIndex, unsigned id, unsigned char *sendData, int sendLength) |
| 发送can数据,数据长度不能超过8 | |
| #define EXTERNFUNC |
| #define PLANET_FAILED_DEVICEDISABLED (2) |
执行失败,设备不存在
| #define PLANET_FAILED_ERRORDEVIECTYPE (1) |
执行失败,不支持的设备类型
| #define PLANET_FAILED_MAXBYTESLIMIT (4) |
执行失败,发送的字节数超出限制
| #define PLANET_FAILED_NORECEIVE (5) |
执行失败,没有接收到回应数据
| #define PLANET_FAILED_SETFAILED (3) |
执行失败,写入控制器数据失败
| #define PLANET_FAILED_UNKNOW (100) |
执行失败,未知错误
| #define PLANET_SUCCESS (0) |
执行成功
| typedef void(* planet_ReceiveCallFunc) (unsigned id, const unsigned char *data, unsigned size) |
接收数据回调函数
| id | 电机id |
| data | can数据 |
| size | 数据长度 |
| typedef void(* planet_SendCallFunc) (unsigned id, const unsigned char *data, unsigned size) |
发送数据回调函数
| id | 电机id |
| data | can数据 |
| size | 数据长度 |
| enum planet_Baudrate |
| enum planet_DeviceType |
| EXTERNFUNC int planet_freeDLL | ( | unsigned | devIndex | ) |
关闭设备,释放资源,成功初始化设备后,需要在程序结束时调用该函数
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| EXTERNFUNC int planet_getAlert | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | alert, | ||
| unsigned | timeout = 100 ) |
获得电机的警告
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| alert | 存放读取的电机警告 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getAntiCoggingTorqueEnabled | ( | unsigned | devIndex, |
| unsigned | id, | ||
| bool * | enable, | ||
| unsigned | timeout = 100 ) |
获取抗齿槽转矩补偿状态
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| enable | 存放读取的使能状态 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getBrakeEnabled | ( | unsigned | devIndex, |
| unsigned | id, | ||
| bool * | enable, | ||
| unsigned | timeout = 100 ) |
获取抱闸使能状态
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| enable | 存放读取的使能状态 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getCanBaudrate | ( | unsigned | devIndex, |
| unsigned | id, | ||
| int * | baudrate, | ||
| unsigned | timeout = 100 ) |
获得电机的波特率
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| baudrate | 存放读取的电机波特率 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getCurrent | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | current, | ||
| unsigned | timeout = 100 ) |
获得电机电流值(q值)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| current | 存放读取的电流值(q值) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getDefaultTorqueFactor | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | factor, | ||
| unsigned | timeout = 100 ) |
读取默认扭矩因子
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| factor | 存放读取的扭矩因子 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getElectronicGearRatio | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | ratio, | ||
| unsigned | timeout = 100 ) |
获得电机的电子齿轮比
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| ratio | 存放读取的电机电子齿轮比 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getEnabled | ( | unsigned | devIndex, |
| unsigned | id, | ||
| bool * | enable, | ||
| unsigned | timeout = 100 ) |
获得电机使能状态
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| enable | 存放读取的电机使能状态 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getFirmwareVersion | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | fmVersion, | ||
| unsigned | timeout = 100 ) |
获得电机固件版本号
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| fmVersion | 存放读取的固件版本号 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getFirstEncoderAngle | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | offset, | ||
| unsigned | timeout = 100 ) |
读取第一磁编角度参数
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| offset | 存放读取的参数值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getFPGAErrorCount | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | count, | ||
| unsigned | timeout = 100 ) |
读取FPGA通讯错误计数
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| count | 存放读取的错误计数值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getHardwareVersion | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | hdVersion, | ||
| unsigned | timeout = 100 ) |
获得硬件版本号
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| hdVersion | 存放读取的硬件版本号 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getHeartbeat | ( | unsigned | devIndex, |
| unsigned | id, | ||
| bool * | heartbeat, | ||
| unsigned | timeout = 100 ) |
获得电机心跳状态
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| heartbeat | 存放读取的心跳状态 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getIntegralLimit | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | limit, | ||
| unsigned | timeout = 100 ) |
获得力矩环积分限制
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| limit | 存放读取的积分限制 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getIOfCurrentLoop | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | i, | ||
| unsigned | timeout = 100 ) |
获得电流环i值
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| i | 存放读取的电流环i值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getIOfPositionLoop | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | i, | ||
| unsigned | timeout = 100 ) |
获得位置环i值
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| i | 存放读取的位置环i值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getIOfVelocityLoop | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | i, | ||
| unsigned | timeout = 100 ) |
获得速度环i值
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| i | 存放读取的速度环i值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getLimitState | ( | unsigned | devIndex, |
| unsigned | id, | ||
| bool * | state, | ||
| unsigned | timeout = 100 ) |
获得电机限位状态
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| state | 存放读取的限位状态 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getMaxAccelerationOfPositionLadderCurve | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | acc, | ||
| unsigned | timeout = 100 ) |
获得位置梯形曲线的最大加速度(rpm/s)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| acc | 存放读取的位置梯形曲线的最大加速度(rpm/s) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getMaxAccelerationOfVelocityLadderCurve | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | acc, | ||
| unsigned | timeout = 100 ) |
获得速度梯形曲线的最大加速度(rpm/s)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| acc | 存放读取的速度梯形曲线的最大加速度(rpm/s) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getMaxCurrent | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | current, | ||
| unsigned | timeout = 100 ) |
获得电机最大电流值(q值)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| current | 存放读取的电机最大电流值(q值) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getMaxDecelerationOfPositionLadderCurve | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | dec, | ||
| unsigned | timeout = 100 ) |
获得位置梯形曲线的最大减速度(rpm/s)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| dec | 存放读取的位置梯形曲线最大减速度(rpm/s) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getMaxDecelerationOfVelocityLadderCurve | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | dec, | ||
| unsigned | timeout = 100 ) |
获得速度梯形曲线的最大减速度(rpm/s)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| dec | 存放读取的速度梯形曲线的最大减速度(rpm/s) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getMaxPosition | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | position, | ||
| unsigned | timeout = 100 ) |
获得电机最大位置(°)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| position | 存放读取的电机最大位置(°) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getMaxVelocity | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | velocity, | ||
| unsigned | timeout = 100 ) |
获得电机最大速度值(rpm)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| velocity | 存放读取的电机最大速度值(rpm) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getMaxVelocityOfPositionLadderCurve | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | dec, | ||
| unsigned | timeout = 100 ) |
获得位置梯形曲线的最大速度(rpm)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| dec | 存放读取的位置梯形曲线最大速度(rpm) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getMaxVelocityOfVelocityLadderCurve | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | velocity, | ||
| unsigned | timeout = 100 ) |
获得速度梯形曲线的最大速度(rpm)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| velocity | 存放读取的速度梯形曲线最大速度(rpm) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getMinPosition | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | position, | ||
| unsigned | timeout = 100 ) |
获得电机最小位置(°)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| position | 存放读取的电机最小位置(°) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getMode | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | mode, | ||
| unsigned | timeout = 100 ) |
获得电机控制模式
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| mode | 存放读取的电机控制模式,模式如下: 1: 轮廓位置控制模式 3: 速度模式 4: 电流模式 5: 同步位置模式 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getMotorType | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | type, | ||
| unsigned | timeout = 100 ) |
获得电机类型
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| type | 存放读取的电机类型 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getOriginPositionOffset | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | offset, | ||
| unsigned | timeout = 100 ) |
获得电机的位置偏置(原始数据,没有进行q24转换)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| offset | 存放读取的电机的位置偏置(原始数据,没有进行q24转换 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getPOfCurrentLoop | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | p, | ||
| unsigned | timeout = 100 ) |
获得电流环p值
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| p | 存放读取的电流环p值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getPOfPositionLoop | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | p, | ||
| unsigned | timeout = 100 ) |
获得位置环p值
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| p | 存放读取的位置环p值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getPOfVelocityLoop | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | p, | ||
| unsigned | timeout = 100 ) |
获得速度环p值
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| p | 存放读取的速度环p值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getPosition | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | position, | ||
| unsigned | timeout = 100 ) |
获得电机位置(°)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| position | 存放读取的电机位置(°) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getPositionOffset | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | offset, | ||
| unsigned | timeout = 100 ) |
获得电机的位置偏置(°)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| offset | 存放读取的电机的位置偏置(°) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getProductInfo | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | info, | ||
| unsigned | timeout = 100 ) |
获取产品信息
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| info | 存放读取的信息 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getProtectedTemperature | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | protectedTem, | ||
| unsigned | timeout = 100 ) |
获得电机的保护温度(℃)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| protectedTem | 存放读取的电机保护温度(℃) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getProtectedVoltage | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | voltage, | ||
| unsigned | timeout = 100 ) |
获得电机的保护电压(V)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| voltage | 存放读取的电机保护电压(V) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getProtectionSwitch | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | value, | ||
| unsigned | timeout = 100 ) |
读取保护开关状态
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| value | 存放读取的使能状态 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getRatedTorque | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | torque, | ||
| unsigned | timeout = 100 ) |
读取额定扭矩
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| torque | 存放读取的扭矩值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getRecoveryTemperature | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | recoveryTem, | ||
| unsigned | timeout = 100 ) |
获得电机恢复温度(℃)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| recoveryTem | 存放读取的电机恢复温度(℃) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getSecondaryEncoderOffset | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | offset, | ||
| unsigned | timeout = 100 ) |
读取第二磁编校准偏移
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| offset | 存放读取的偏移值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getSecondEncoderAngle | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | angle, | ||
| unsigned | timeout = 100 ) |
读取第二磁编角度参数
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| angle | 存放读取的参数 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getSerialNumber | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | serialNum, | ||
| unsigned | timeout = 100 ) |
获得电机序列号
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| serialNum | 存放读取的电机序列号 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getSingleLapPositionRange | ( | unsigned | devIndex, |
| unsigned | id, | ||
| int * | range, | ||
| unsigned | timeout = 100 ) |
获得上电时刻单圈位置范围值
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| range | 存放读取的单圈范围值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getStallProtectionTime | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | time, | ||
| unsigned | timeout = 100 ) |
读取堵转保护时间
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| time | 存放读取的时间 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getStopRunState | ( | unsigned | devIndex, |
| unsigned | id, | ||
| bool * | state, | ||
| unsigned | timeout = 100 ) |
获得电机停止状态
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| state | 存放读取的电机停止状态 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getTargetAcceleration | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | acc, | ||
| unsigned | timeout = 100 ) |
获得电机目标加速度(rpm/s)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| acc | 存放读取的电机目标加速度(rpm/s) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getTargetCurrent | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | current, | ||
| unsigned | timeout = 100 ) |
获得目标电流值(q值)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| current | 存放读取的目标电流值(q值) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getTargetDeceleration | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | dec, | ||
| unsigned | timeout = 100 ) |
获得电机目标减速度(rpm/s)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| dec | 存放读取的电机目标减速度(rpm/s) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getTargetPosition | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | position, | ||
| unsigned | timeout = 100 ) |
获得电机目标位置(°)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| position | 存放读取的电机目标位置(°) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getTargetVelocity | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | velocity, | ||
| unsigned | timeout = 100 ) |
获得电机目标速度(rpm)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| velocity | 存放读取的电机目标速度(rpm) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getTemperature | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | tem, | ||
| unsigned | timeout = 100 ) |
获得电机的温度(℃)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| tem | 存放读取的电机温度(℃) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getTorqueFactor | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned * | factor, | ||
| unsigned | timeout = 100 ) |
读取扭矩因子
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| factor | 存放读取的扭矩因子 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getVelocity | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | velocity, | ||
| unsigned | timeout = 100 ) |
获得电机速度(rpm)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| velocity | 存放读取的电机速度(rpm) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_getVoltage | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float * | voltage, | ||
| unsigned | timeout = 100 ) |
获得电机的电压(V)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| voltage | 存放读取的电机电压(V) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_initDLL | ( | planet_DeviceType | devType, |
| unsigned | devIndex, | ||
| unsigned | channel, | ||
| planet_Baudrate | baudrate ) |
初始化dll,调用其他函数前,必须先调用该函数进行初始化,初始化成功后设备自动打开
| devType | 设备类型 |
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| channel | 通道,该参数只针对创芯设备生效,设置0或1 |
| baudrate | 波特率 |
| EXTERNFUNC int planet_quick_setTargetPosition | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | position ) |
设置电机目标位置(°),该函数用于同步位置模式,实现快写,无需等待控制器返回确认,可以快速连续设置,实现轨迹规划
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| position | 电机目标位置(°) |
| EXTERNFUNC int planet_saveParas | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned | timeout = 100 ) |
保存控制器参数,当前修改的控制器参数,重新上电后仍然生效
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setAntiCoggingTorqueEnabled | ( | unsigned | devIndex, |
| unsigned | id, | ||
| bool | enable, | ||
| unsigned | timeout = 100 ) |
设置抗齿槽转矩补偿
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| enable | 使能状态 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setBrakeEnabled | ( | unsigned | devIndex, |
| unsigned | id, | ||
| bool | enable, | ||
| unsigned | timeout = 100 ) |
设置抱闸使能状态
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| enable | 使能状态 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setCanBaudrate | ( | unsigned | devIndex, |
| unsigned | id, | ||
| int | baudrate, | ||
| unsigned | timeout = 100 ) |
设置电机的波特率
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| baudrate | 电机波特率 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setEnabled | ( | unsigned | devIndex, |
| unsigned | id, | ||
| bool | enable, | ||
| unsigned | timeout = 100 ) |
设置电机使能状态
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| enable | 电机使能状态 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setID | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned | newId, | ||
| unsigned | timeout = 100 ) |
设置电机的id(范围是1~255)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 原先电机id |
| newId | 新的电机id |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setIntegralLimit | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | limit, | ||
| unsigned | timeout = 100 ) |
设置力矩环积分限制
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| limit | 积分限制 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setIOfCurrentLoop | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned | i, | ||
| unsigned | timeout = 100 ) |
设置电流环i值
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| i | 存放读取的电流环i值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setIOfPositionLoop | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned | i, | ||
| unsigned | timeout = 100 ) |
设置位置环i值
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| i | 位置环i值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setIOfVelocityLoop | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned | i, | ||
| unsigned | timeout = 100 ) |
设置速度环i值
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| i | 速度环i值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setLimitState | ( | unsigned | devIndex, |
| unsigned | id, | ||
| bool | state, | ||
| unsigned | timeout = 100 ) |
设置电机的限位状态
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| state | 电机限位状态 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setMaxAccelerationOfPositionLadderCurve | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | acc, | ||
| unsigned | timeout = 100 ) |
设置位置梯形曲线的最大加速度(rpm/s)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| acc | 最大加速度(rpm/s) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setMaxAccelerationOfVelocityLadderCurve | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | acc, | ||
| unsigned | timeout = 100 ) |
设置速度梯形曲线的最大加速度(rpm/s)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| acc | 最大加速度(rpm/s) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setMaxCurrent | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | current, | ||
| unsigned | timeout = 100 ) |
设置电机最大电流值(q值)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| current | 最大电流值(q值) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setMaxDecelerationOfPositionLadderCurve | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | dec, | ||
| unsigned | timeout = 100 ) |
设置位置梯形曲线的最大减速度(rpm/s)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| dec | 最大减速度(rpm/s) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setMaxDecelerationOfVelocityLadderCurve | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | dec, | ||
| unsigned | timeout = 100 ) |
设置速度梯形曲线的最大减速度(rpm/s)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| dec | 最大减速度(rpm/s) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setMaxPosition | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | position, | ||
| unsigned | timeout = 100 ) |
设置电机最大位置(°)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| position | 最大位置(°) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setMaxVelocity | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | velocity, | ||
| unsigned | timeout = 100 ) |
设置电机最大速度值(rpm)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| velocity | 最大速度值(rpm) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setMaxVelocityOfPositionLadderCurve | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | velocity, | ||
| unsigned | timeout = 100 ) |
设置位置梯形曲线的最大速度(rpm)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| velocity | 最大速度(rpm) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setMaxVelocityOfVelocityLadderCurve | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | velocity, | ||
| unsigned | timeout = 100 ) |
设置速度梯形曲线的最大速度(rpm)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| velocity | 速度梯形曲线的最大速度(rpm) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setMinPosition | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | position, | ||
| unsigned | timeout = 100 ) |
设置电机最小位置(°)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| position | 最小位置(°) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setMode | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned | mode, | ||
| unsigned | timeout = 100 ) |
设置电机控制模式
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| mode | 电机模式,模式如下: 1: 轮廓位置控制模式 3: 速度模式 4: 电流模式 5: 位置模式 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setPOfCurrentLoop | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned | p, | ||
| unsigned | timeout = 100 ) |
设置电流环p值
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| p | 电流环p值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setPOfPositionLoop | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned | p, | ||
| unsigned | timeout = 100 ) |
设置位置环p值
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| p | 位置环p值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setPOfVelocityLoop | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned | p, | ||
| unsigned | timeout = 100 ) |
设置速度环p值
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| p | 速度环p值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setPositionOffset | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | position, | ||
| unsigned | timeout = 100 ) |
设置电机的位置偏置(°)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| position | 电机的位置偏置(°) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setProductInfo | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned | info, | ||
| unsigned | timeout = 100 ) |
设置产品信息
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| info | 产品信息 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setProtectedTemperature | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | tem, | ||
| unsigned | timeout = 100 ) |
设置电机保护温度(℃)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| tem | 保护温度(℃) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setProtectedVoltage | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | voltage, | ||
| unsigned | timeout = 100 ) |
设置电机的保护电压(V)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| voltage | 电机保护电压(V) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setProtectionSwitch | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned | value, | ||
| unsigned | timeout = 100 ) |
设置保护开关状态
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| value | 使能状态 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setReceiveCallFunction | ( | planet_ReceiveCallFunc | callFunc | ) |
设置接收数据回调函数,可以通过该函数捕获实际接收的can数据
| callFunc | 回调函数地址 |
| EXTERNFUNC int planet_setRecoveryTemperature | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | tem, | ||
| unsigned | timeout = 100 ) |
设置电机恢复温度(℃)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| tem | 存放读取的电机恢复温度(℃) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setSecondaryEncoderOffset | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned | offset, | ||
| unsigned | timeout = 100 ) |
设置第二磁编校准偏移
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| offset | 偏移值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setSendCallFunction | ( | planet_SendCallFunc | callFunc | ) |
设置发送数据回调函数,可以通过该函数捕获实际发送的can数据
| callFunc | 回调函数地址 |
| EXTERNFUNC int planet_setSingleLapPositionRange | ( | unsigned | devIndex, |
| unsigned | id, | ||
| int | range, | ||
| unsigned | timeout = 100 ) |
设置电机上电时刻的单圈位置范围值
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| range | 单圈范围值 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setStallProtectionTime | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned | time, | ||
| unsigned | timeout = 100 ) |
设置堵转保护时间
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| time | 时间 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setStopRunState | ( | unsigned | devIndex, |
| unsigned | id, | ||
| bool | state, | ||
| unsigned | timeout = 100 ) |
设置电机停止状态
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| state | 电机停止状态 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setTargetAcceleration | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | acc, | ||
| unsigned | timeout = 100 ) |
设置电机目标加速度(rpm/s)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| acc | 电机目标加速度(rpm/s) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setTargetCurrent | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | current, | ||
| unsigned | timeout = 100 ) |
设置目标电流值(q值)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| current | 目标电流值(q值) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setTargetDeceleration | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | dec, | ||
| unsigned | timeout = 100 ) |
设置电机目标减速度(rpm/s)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| dec | 电机目标减速度(rpm/s) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setTargetPosition | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | position, | ||
| unsigned | timeout = 100 ) |
设置电机目标位置(°),该函数不适用于同步位置模式,位置模式下设置电机目标位置 参见:quick_setTargetPosition
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| position | 电机目标位置(°) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setTargetVelocity | ( | unsigned | devIndex, |
| unsigned | id, | ||
| float | velocity, | ||
| unsigned | timeout = 100 ) |
设置电机目标速度(rpm)
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| velocity | 电机目标速度(rpm) |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_setTorqueFactor | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned | factor, | ||
| unsigned | timeout = 100 ) |
设置扭矩因子
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| factor | 扭矩因子 |
| timeout | 函数执行后,等待timeout毫秒来接收执行结果 |
| EXTERNFUNC int planet_writeData | ( | unsigned | devIndex, |
| unsigned | id, | ||
| unsigned char * | sendData, | ||
| int | sendLength ) |
发送can数据,数据长度不能超过8
| devIndex | 设备索引,第一个设备设置为0,第二个设备设置为1,以此类推 |
| id | 电机id |
| sendData | 将要发送的can数据 |
| sendLength | can数据长度(不超过8位) |