motor_param.h 2.7 KB

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