motor_param.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 MOTOR_NR 0x11
  22. #elif CONFIG_MOT_TYPE==MOTOR_BLUESHARK_A1
  23. #define MOTOR_R 0.018f
  24. #define MOTOR_Ld (0.000140F*0.5f)
  25. #define MOTOR_Lq (0.000300f*0.5f)
  26. #define MOTOR_POLES 4
  27. #define MOTOR_ENC_OFFSET 0.0F
  28. #define CONFIG_MAX_MOTOR_TORQUE 40.0F
  29. #define TRQ_PI_KP 0.14F
  30. #define TRQ_PI_KI 0.15F
  31. #define MOTOR_NR 0x16
  32. #define CONFIG_CURRENT_BANDWITH 2000.0f /* 电流环带宽 */
  33. #elif CONFIG_MOT_TYPE==MOTOR_BLUESHARK_NEW2
  34. #define MOTOR_R 0.013f
  35. #define MOTOR_Ld (0.000140f*0.5f)
  36. #define MOTOR_Lq (0.000320f*0.5f)
  37. #define MOTOR_POLES 4
  38. #define MOTOR_ENC_OFFSET 250.0F
  39. #define CONFIG_MAX_MOTOR_TORQUE 40.0F
  40. #define TRQ_PI_KP 0.14F
  41. #define TRQ_PI_KI 0.15F
  42. #define MOTOR_NR 0x12
  43. #define CONFIG_CURRENT_BANDWITH 1000.0f /* 电流环带宽 */
  44. #elif CONFIG_MOT_TYPE==MOTOR_BLUESHARK_ZD_100
  45. #define MOTOR_R 0.008f
  46. #define MOTOR_Ld (0.000125f*0.5f)
  47. #define MOTOR_Lq (0.000091f*0.5f)
  48. #define MOTOR_POLES 5
  49. #define MOTOR_ENC_OFFSET 145.0F
  50. #define CONFIG_MAX_MOTOR_TORQUE 200.0F
  51. #define TRQ_PI_KP 0.6F //0.13f
  52. #define TRQ_PI_KI 0.5F
  53. #define MOTOR_NR 0x13
  54. #define CONFIG_CURRENT_BANDWITH 1000.0f /* 电流环带宽 */
  55. #elif CONFIG_MOT_TYPE==MOTOR_BLUESHARK_OLD
  56. #define MOTOR_R 0.012f
  57. #define MOTOR_Ld (0.000143f*0.5f)
  58. #define MOTOR_Lq (0.000205f*0.5f)
  59. #define MOTOR_POLES 5
  60. #define MOTOR_ENC_OFFSET 180.0F
  61. #define CONFIG_MAX_MOTOR_TORQUE 40.0F
  62. #define TRQ_PI_KP 0.14F
  63. #define TRQ_PI_KI 0.15F
  64. #define MOTOR_NR 0x14
  65. #define CONFIG_CURRENT_BANDWITH 1000.0f /* 电流环带宽 */
  66. #elif CONFIG_MOT_TYPE==MOTOR_3505
  67. //编码器电机 3505
  68. #define MOTOR_R 0.08f
  69. #define MOTOR_Ld 0.000032f
  70. #define MOTOR_Lq 0.000032f
  71. #define MOTOR_POLES 10
  72. #define CONFIG_MAX_MOTOR_CURR 20.0F
  73. #define TRQ_PI_KP 0.14F
  74. #define TRQ_PI_KI 0.15F
  75. #define MOTOR_NR 0x15
  76. #define CONFIG_CURRENT_BANDWITH 1000.0f /* 电流环带宽 */
  77. #endif
  78. #endif /* _MOTOR_PARAM_H__ */