motor_param.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. #ifndef _MOTOR_PARAM_H__
  2. #define _MOTOR_PARAM_H__
  3. #include "bsp/bsp.h"
  4. #include "os/os_types.h"
  5. #include "foc/core/PMSM_FOC_Core.h"
  6. /* 电机外特性map, 每个转速点对应的最大扭矩 */
  7. typedef struct {
  8. s16 rpm;
  9. s16 torque;
  10. }motor_map_t;
  11. typedef struct{
  12. s16 torque;
  13. s16 d;
  14. s16 q;
  15. }torque2dq_t;
  16. typedef torque2dq_t torque_map_t;
  17. s16 get_max_torque_for_rpm(s16 rpm);
  18. void mpta_fw_lookup(float rpm, float torque, DQ_t *dq_out);
  19. #if CONFIG_MOT_TYPE==MOTOR_BLUESHARK_NEW1
  20. #define MOTOR_R 0.010f
  21. #define MOTOR_Ld (0.000120f*0.5f)
  22. #define MOTOR_Lq (0.000200f*0.5f)
  23. #define MOTOR_POLES 4
  24. #define MOTOR_ENC_OFFSET 0.0F
  25. #define CONFIG_MAX_MOTOR_TORQUE 40.0F
  26. #define TRQ_PI_KP 0.14F
  27. #define TRQ_PI_KI 0.15F
  28. #define CONFIG_CURRENT_BANDWITH 1000.0f /* 电流环带宽 */
  29. #define CONFIG_DEFAULT_PHASE_CURR_LIM 200
  30. #define CONFIG_MAX_FW_D_CURR 100.0F //d轴最大的退磁电流
  31. #define MOTOR_NR 0x11
  32. #elif CONFIG_MOT_TYPE==MOTOR_BLUESHARK_A1
  33. #define MOTOR_R 0.011f
  34. #define MOTOR_Ld (0.000140F*0.5f)
  35. #define MOTOR_Lq (0.000300f*0.5f)
  36. //#define MOTOR_R 0.033f
  37. //#define MOTOR_Ld (0.000168f * 0.5f)//(0.000140F*0.5f)
  38. //#define MOTOR_Lq (0.000330f * 0.5f)//(0.000340f*0.5f)
  39. #define MOTOR_POLES 4
  40. #define MOTOR_ENC_OFFSET 0.0F
  41. #define CONFIG_MAX_MOTOR_TORQUE 400.0f//45.0F
  42. #define TRQ_PI_KP 0.05F
  43. #define TRQ_PI_KI 0.01F
  44. #define TRO_PI_KD 0.0F
  45. #define MOTOR_NR 0x16
  46. #define CONFIG_CURRENT_BANDWITH 1000.0f /* 电流环带宽 */
  47. #define CONFIG_DEFAULT_PHASE_CURR_LIM 500
  48. #define CONFIG_MAX_FW_D_CURR 300.0F //d轴最大的退磁电流
  49. #elif CONFIG_MOT_TYPE==MOTOR_BLUESHARK_NEW2
  50. #define MOTOR_R 0.013f
  51. #define MOTOR_Ld (0.000140f*0.5f)
  52. #define MOTOR_Lq (0.000320f*0.5f)
  53. #define MOTOR_POLES 4
  54. #define MOTOR_ENC_OFFSET 250.0F
  55. #define CONFIG_MAX_MOTOR_TORQUE 40.0F
  56. #define TRQ_PI_KP 0.14F
  57. #define TRQ_PI_KI 0.15F
  58. #define MOTOR_NR 0x12
  59. #define CONFIG_CURRENT_BANDWITH 1000.0f /* 电流环带宽 */
  60. #define CONFIG_DEFAULT_PHASE_CURR_LIM 200
  61. #define CONFIG_MAX_FW_D_CURR 100.0F //d轴最大的退磁电流
  62. #elif CONFIG_MOT_TYPE==MOTOR_BLUESHARK_ZD_100
  63. #define MOTOR_R 0.008f
  64. #define MOTOR_Ld (0.000125f*0.5f)
  65. #define MOTOR_Lq (0.000091f*0.5f)
  66. #define MOTOR_POLES 5
  67. #define MOTOR_ENC_OFFSET 145.0F
  68. #define CONFIG_MAX_MOTOR_TORQUE 200.0F
  69. #define TRQ_PI_KP 0.6F //0.13f
  70. #define TRQ_PI_KI 0.5F
  71. #define MOTOR_NR 0x13
  72. #define CONFIG_CURRENT_BANDWITH 1000.0f /* 电流环带宽 */
  73. #define CONFIG_DEFAULT_PHASE_CURR_LIM 200
  74. #define CONFIG_MAX_FW_D_CURR 100.0F //d轴最大的退磁电流
  75. #elif CONFIG_MOT_TYPE==MOTOR_BLUESHARK_OLD
  76. #define MOTOR_R 0.012f
  77. #define MOTOR_Ld (0.000143f*0.5f)
  78. #define MOTOR_Lq (0.000205f*0.5f)
  79. #define MOTOR_POLES 5
  80. #define MOTOR_ENC_OFFSET 180.0F
  81. #define CONFIG_MAX_MOTOR_TORQUE 40.0F
  82. #define TRQ_PI_KP 0.14F
  83. #define TRQ_PI_KI 0.15F
  84. #define MOTOR_NR 0x14
  85. #define CONFIG_CURRENT_BANDWITH 1000.0f /* 电流环带宽 */
  86. #define CONFIG_DEFAULT_PHASE_CURR_LIM 200
  87. #define CONFIG_MAX_FW_D_CURR 100.0F //d轴最大的退磁电流
  88. #elif CONFIG_MOT_TYPE==MOTOR_3505
  89. //编码器电机 3505
  90. #define MOTOR_R 0.08f
  91. #define MOTOR_Ld 0.000032f
  92. #define MOTOR_Lq 0.000032f
  93. #define MOTOR_POLES 10
  94. #define CONFIG_MAX_MOTOR_CURR 20.0F
  95. #define TRQ_PI_KP 0.14F
  96. #define TRQ_PI_KI 0.15F
  97. #define MOTOR_NR 0x15
  98. #define CONFIG_CURRENT_BANDWITH 1000.0f /* 电流环带宽 */
  99. #endif
  100. #endif /* _MOTOR_PARAM_H__ */