| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- #ifndef _MOTOR_PARAM_H__
- #define _MOTOR_PARAM_H__
- #include "bsp/bsp.h"
- #include "os/os_types.h"
- /* 电机外特性map, 每个转速点对应的最大扭矩 */
- typedef struct {
- s16 rpm;
- s16 torque;
- }motor_map_t;
- s16 get_max_torque_for_rpm(s16 rpm);
- #if CONFIG_MOT_TYPE==MOTOR_BLUESHARK_NEW1
- #define MOTOR_R 0.010f
- #define MOTOR_Ld (0.000120f*0.5f)
- #define MOTOR_Lq (0.000200f*0.5f)
- #define MOTOR_POLES 4
- #define MOTOR_ENC_OFFSET 0.0F
- #define CONFIG_MAX_MOTOR_TORQUE 40.0F
- #define TRQ_PI_KP 0.14F
- #define TRQ_PI_KI 0.15F
- #define CONFIG_CURRENT_BANDWITH 1000.0f /* 电流环带宽 */
- #define CONFIG_MAX_FW_D_CURR 100.0F //d轴最大的退磁电流
- #define MOTOR_NR 0x11
- #elif CONFIG_MOT_TYPE==MOTOR_BLUESHARK_A1
- #define MOTOR_R 0.022f
- #define MOTOR_Ld (0.000140F*0.5f)
- #define MOTOR_Lq (0.000340f*0.5f)
- #define MOTOR_POLES 4
- #define MOTOR_ENC_OFFSET 0.0F
- #define CONFIG_MAX_MOTOR_TORQUE 200.0F
- #define TRQ_PI_KP 0.08F
- #define TRQ_PI_KI 0.1F
- #define TRO_PI_KD 1.0F
- #define MOTOR_NR 0x16
- #define CONFIG_CURRENT_BANDWITH 2000.0f /* 电流环带宽 */
- #define CONFIG_MAX_FW_D_CURR 150.0F //d轴最大的退磁电流
- #elif CONFIG_MOT_TYPE==MOTOR_BLUESHARK_NEW2
- #define MOTOR_R 0.013f
- #define MOTOR_Ld (0.000140f*0.5f)
- #define MOTOR_Lq (0.000320f*0.5f)
- #define MOTOR_POLES 4
- #define MOTOR_ENC_OFFSET 250.0F
- #define CONFIG_MAX_MOTOR_TORQUE 40.0F
- #define TRQ_PI_KP 0.14F
- #define TRQ_PI_KI 0.15F
- #define MOTOR_NR 0x12
- #define CONFIG_CURRENT_BANDWITH 1000.0f /* 电流环带宽 */
- #define CONFIG_MAX_FW_D_CURR 100.0F //d轴最大的退磁电流
- #elif CONFIG_MOT_TYPE==MOTOR_BLUESHARK_ZD_100
- #define MOTOR_R 0.008f
- #define MOTOR_Ld (0.000125f*0.5f)
- #define MOTOR_Lq (0.000091f*0.5f)
- #define MOTOR_POLES 5
- #define MOTOR_ENC_OFFSET 145.0F
- #define CONFIG_MAX_MOTOR_TORQUE 200.0F
- #define TRQ_PI_KP 0.6F //0.13f
- #define TRQ_PI_KI 0.5F
- #define MOTOR_NR 0x13
- #define CONFIG_CURRENT_BANDWITH 1000.0f /* 电流环带宽 */
- #define CONFIG_MAX_FW_D_CURR 100.0F //d轴最大的退磁电流
- #elif CONFIG_MOT_TYPE==MOTOR_BLUESHARK_OLD
- #define MOTOR_R 0.012f
- #define MOTOR_Ld (0.000143f*0.5f)
- #define MOTOR_Lq (0.000205f*0.5f)
- #define MOTOR_POLES 5
- #define MOTOR_ENC_OFFSET 180.0F
- #define CONFIG_MAX_MOTOR_TORQUE 40.0F
- #define TRQ_PI_KP 0.14F
- #define TRQ_PI_KI 0.15F
- #define MOTOR_NR 0x14
- #define CONFIG_CURRENT_BANDWITH 1000.0f /* 电流环带宽 */
- #define CONFIG_MAX_FW_D_CURR 100.0F //d轴最大的退磁电流
- #elif CONFIG_MOT_TYPE==MOTOR_3505
- //编码器电机 3505
- #define MOTOR_R 0.08f
- #define MOTOR_Ld 0.000032f
- #define MOTOR_Lq 0.000032f
- #define MOTOR_POLES 10
- #define CONFIG_MAX_MOTOR_CURR 20.0F
- #define TRQ_PI_KP 0.14F
- #define TRQ_PI_KI 0.15F
- #define MOTOR_NR 0x15
- #define CONFIG_CURRENT_BANDWITH 1000.0f /* 电流环带宽 */
- #endif
- #endif /* _MOTOR_PARAM_H__ */
|