HVBLDC_Sensored-Settings.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* =================================================================================
  2. File name: HVBLDC_Sensored-Settings.H
  3. Description: Incremental Build Level control file.
  4. ================================================================================= */
  5. #ifndef PROJ_SETTINGS_H
  6. /*------------------------------------------------------------------------------
  7. Following is the list of the Build Level choices.
  8. ------------------------------------------------------------------------------*/
  9. #define LEVEL1 1 // Module check out (do not connect the motors)
  10. #define LEVEL2 2 // Verify ADC, calibrate the offset, run the motor open loop
  11. #define LEVEL3 3 // Verify closed-loop operation of BLDC, not regulated.
  12. #define LEVEL4 4 // Verify the closed current loop and current PI controller.
  13. #define LEVEL5 5 // Verify the closed speed loop and speed PI controller.
  14. /*------------------------------------------------------------------------------
  15. This line sets the BUILDLEVEL to one of the available choices.
  16. ------------------------------------------------------------------------------*/
  17. #define BUILDLEVEL 5
  18. #ifndef BUILDLEVEL
  19. #error Critical: BUILDLEVEL must be defined !!
  20. #endif // BUILDLEVEL
  21. //------------------------------------------------------------------------------
  22. #ifndef TRUE
  23. #define FALSE 0
  24. #define TRUE 1
  25. #endif
  26. #define PI 3.14159265358979
  27. // Define the system frequency (MHz)
  28. #if (DSP2803x_DEVICE_H==1)
  29. #define SYSTEM_FREQUENCY 60
  30. #elif (DSP280x_DEVICE_H==1)
  31. #define SYSTEM_FREQUENCY 100
  32. #endif
  33. // Define the ISR frequency (kHz)
  34. #define ISR_FREQUENCY 20
  35. #define PWM_FREQUENCY 20
  36. // Parameter Initializations
  37. #define ALIGN_DUTY 0x0400 //默认占空比
  38. #define LOOP_CNT_MAX 0
  39. // This machine parameters are based on BLDC motor
  40. // Define the BLDC motor parameters
  41. #define RS 2.35 // Stator resistance (ohm)
  42. #define RR // Rotor resistance (ohm)
  43. #define LS 0.007 // Stator inductance (H)
  44. #define LR // Rotor inductance (H)
  45. #define LM // Magnatizing inductance (H)
  46. #define POLES 10 // Number of poles
  47. // Define the base quantites
  48. #define BASE_VOLTAGE 310 // Base peak phase voltage (volt)
  49. #define BASE_CURRENT 3 // Base peak phase current (amp)
  50. #define BASE_TORQUE 1.9 // Base torque (N.m)
  51. #define BASE_FLUX 41.8 //V/krpm // Base flux linkage (volt.sec/rad)
  52. #define BASE_FREQ 291//1750 // 使用一个换相周期//291 // Base electrical frequency (Hz)
  53. #endif