motor_param.h 2.0 KB

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