2023年全國(guó)碩士研究生考試考研英語(yǔ)一試題真題(含答案詳解+作文范文)_第1頁(yè)
已閱讀1頁(yè),還剩33頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、<p>  BLDC Motor Speed Estimation Using PDC Timer Module</p><p>  1 Speed Calculation of BLDC </p><p>  1.1 Summary of BLDC</p><p>  Since current BLDC has substituted the elec

2、trical commutator for the mechanical one, it eliminates the disadvantages of noise, spark, electromagnetic disturbance, short lifetime, etc. Now BLDC is provided with advantages of simple structure, dependable operation

3、and easy maintenance as AC motor does, as well as advantages of high efficient, no excitation cost and functional speed regulation as traditional DC motor does. So it is widely used in various fields of industrial contro

4、l now.</p><p>  1.2 PDC Module Introduction </p><p>  SPMC75F2413A provides two channels of 16 bit PDC (Phase Detection Control, PDC) timers used for capture function and PWM operation. It also

5、supports position detection features for Brushless-DC motor application. The PDC timers are very suitable for both mechanical speed calculation, with ACI and BLDC motor included, and phase commutation for changing curren

6、t conduction according to position information. Figure 1-1 shows the block diagram of entire PDC timers, channel 0 and channel 1. For detail</p><p>  Table 1-1 PDC Timer</p><p>  Figure 1-1 PDC

7、Timers Block Diagram </p><p>  1.3 PDC Operation </p><p>  This note mainly depicts PDC application in motor speed measurement. For detailed PDC introduction, please refer to “SPMC75F2413A Progr

8、amming Guide” authored by Sunplus. </p><p>  PDC module has four types of registers to perform speed measurement: Timer control register P_TMRx_Ctrl (x = 0, 1), position detection control register P_POSx_Dec

9、tCtrl (x = 0, 1), input output control register P_TMRx_IOCtrl (x = 0, 1), and timer interrupt enable register P_TMRx_INT (x = 0, 1). Where, P_TMRx_Ctrl and P_POSx_DectCtrl are introduced in detail. </p><p> 

10、 1.31Input Output Control Register </p><p>  P_TMRx_Ctrl(x = 0, 1)</p><p>  Bit 15:14 </p><p>  SPCK: Capture input sample clock select. These bits select the capture input sample c

11、lock. Capture input will be sampled with sample clock. Pulses shorter than four sample clocks will be considered invalid, and will be ignored.</p><p>  00 = FCK/1 </p><p>  01 = FCK/2</p>

12、<p>  10 = FCK/4 </p><p>  11 = FCK/8</p><p>  Bit 13:10 </p><p>  MODE: Modes select. These bits are used to select the timer operation modes. </p><p>  0000 = N

13、ormal operation (continuous counter up counting) </p><p>  0100 = Phase counting mode 1 </p><p>  0101 = Phase counting mode 2 </p><p>  0110 = Phase counting mode 3 </p><

14、;p>  0111 = Phase counting mode 4 </p><p>  1x0x = Edge-aligned PWM mode (continuous counter up counting, PWM output) </p><p>  1x1x = Center-aligned PWM mode (continuous counter up/down coun

15、ting, PWM output)</p><p><b>  Bit 9:8 </b></p><p>  CLEGS: Counter clear edge select. These bits select the counter clearing edge when the clearing source is in input capture mode.&l

16、t;/p><p>  00 = do not clear </p><p>  01 = rising edge </p><p>  10 = falling edge </p><p>  11 = both edge</p><p><b>  Bit 7:5 </b></p>&

17、lt;p>  CCLS: Counter clear source select. These bits select the TCNT counter clearing source. </p><p>  000 = TCNT clearing disabled </p><p>  001 = TCNT cleared by P_TMRx_TGRA (x = 0, 1) cap

18、ture input </p><p>  010 = TCNT cleared by P_TMRx_TGRB (x = 0, 1) capture input </p><p>  011 = TCNT cleared by P_TMRx_TGRC (x = 0, 1) capture input </p><p>  100 = TCNT cleared by

19、every P_POSx_DectData (x = 0, 1) change 6 times</p><p>  101 = TCNT cleared by every P_POSx_DectData (x = 0, 1) change 3 times </p><p>  110 = TCNT cleared by P_POSx_DectData (x = 0, 1) position

20、 detection data change </p><p>  111 = TCNT cleared by P_TMRx_TPR (x = 0, 1) compare match</p><p><b>  Bit 4:3 </b></p><p>  CKEGS: Clock edge select, These bits select

21、 the input clock edge. When the input clock is counted using both edges, the input clock period is halved. When FCK/1 is selected as counter clock, counter will count at rising edge if count at both edges is selected.<

22、;/p><p>  00 = Count at rising edge </p><p>  01 = Count at falling edge </p><p>  1X = Count at both edges</p><p>  Bit 2:0 </p><p>  TMRPS: Timer pre-sca

23、lar select. These bits select the TCNT counter clock source. It can be selected independently for each channel.</p><p>  000 = Counts on FCK /1 </p><p>  001 = Counts on FCK /4 </p><p

24、>  010 = Counts on FCK /16 </p><p>  011 = Counts on FCK /64 </p><p>  100 = Counts on FCK /256 </p><p>  101 = Counts on FCK /1024 </p><p>  110 = Counts on TCLKA p

25、in input </p><p>  111 = Counts on TCLKB pin input</p><p>  Control register configuration </p><p>  P_TMRx_Ctrl(x = 0, 1) is used for the selection of input capture during speed me

26、asurement. Rather than being a general input signal, the input capture is a period between two position detection changes triggered by PDC interrupt. This period must be counted with a certain frequency supported by a cl

27、ock source. Thus, the counters on this function must be configured. </p><p>  MODE: Select a timer operation mode in seven modes. However, only the normal operation (continuous counter up counting) mode can

28、be selected in this application, because the other six modes are all related to phase counting mode or PWM mode. </p><p>  CCLS: Select a TCNT counter clearing source from eight settings. In this application

29、, one among the three can be set: 100, 101 or 110, which respectively indicates that TCNT is cleared for once every 6/3/1 times P_the POSx_DectData (x = 0, 1) changes. Also, they can be described as: TCNT is cleared for

30、once every 360/180/60 electrical degree rotation of BLDC. This setting is critical for converting electrical revolution to mechanical revolution and measuring the BLDC speed.</p><p>  CKEGS: Select the input

31、 clock edge, which can be rising, falling or both edges. When the input clock is counted using both edges, the input clock period is halved. Note to count this factor on during the BLDC speed calculation. </p><

32、;p>  TMRPS: Select the TCNT counter clock source from eight settings. This setting determines the precision and the range during BLDC speed measurement. See the example code below: </p><p>  P_TMR0_Ctrl,

33、B.MODE = 0; // Normal Counting mode </p><p>  P_TMR0_Ctrl, B.CCLS = 6; // TCNT cleared by P_POSx_DectData (x = 0, 1) </p><p>  // Each time position detection data ch

34、ange </p><p>  P_TMR0_Ctrl, B.CKEGS = 0; // Counting at rising edge </p><p>  P_TMR0_Ctrl, B.TMRPS = 3; // Select FCK/64 clock source </p><p&g

35、t;  1.3.2 Position Detection Control Register </p><p>  P_POSx_DectCtrl(x = 0, 1) </p><p>  Bit 15:14 </p><p>  SPLCK: Sampling clock select. Select FCK/4, FCK/8, FCK/32, or FCK/1

36、28 for position sampling clock </p><p>  00 = FCK/4 </p><p>  01 = FCK/8 </p><p>  10 = FCK/32 </p><p>  11 = FCK/128</p><p><b>  Bit 13:12</b>

37、</p><p>  SPLMOD: Sampling mode select. Select one of three modes: sampling when PWM signal is active (PWM is on), sampling regularly, or sampling when lower side (UN, VN, WN) phases are conducting current.

38、</p><p>  00 = Sample when UPWM/VPWM/WPWM bit is set in P_TMRx_OutputCtrl (x = 3, 4) register and generate the PWM waveform</p><p>  01 = Sample regularly </p><p>  10 = Sample when

39、 lower phases is in active state and conducting current </p><p>  11 = Reserved</p><p><b>  Bit 11:8</b></p><p>  SPLCNT: Sampling count select. These bits select the sa

40、mpling count for the valid external position detection signals. The position signals must be sampled continuously match as many times as the sampling count set, for the position signals to be considered valid. The valid

41、settings are from 1 to 15 times. Note that count 0 and 1 are assumed to be one time.</p><p><b>  Bit : 7</b></p><p>  PDEN: Position detection enable. This bit enables/disables the p

42、osition detection function for position input pins TIOA~C. When enabled, the input signals of these pins will be sampled and the results will be latched to PDR [2:0] bits in POS_DectData register. When disabled, PDR [2:0

43、] will remain its status. </p><p>  0 = Disable </p><p>  1 = Enable</p><p><b>  Bit 6:0</b></p><p>  SPDLY: Sampling delay. These bits set a delay time clo

44、ck in which at SPLCK clock source. It is used to stop sampling in order to prevent erroneous detection due to noise that occurs immediately after PWM output turns on.</p><p>  Position detection control regi

45、ster </p><p>  When the position detection changing event occurs, the P_TMRx_TCNT (x = 0, 1) value can be transferred to TGRA. If the position detection interrupt enable bit PDCIE is set to 1 in the correspo

46、nding P_TMRx_INT (x = 0, 1) register, the PDC interrupt routine will be called to process the data. </p><p>  SPLCK: Select sampling clock from FCK/4, FCK/8, FCK/32, or FCK/128 for position sampling clock, w

47、hich determines the detection precision of position change. Proper setting of SPLCK, SPLCNT and SPDLY will help to prevent erroneous detection and filter the disturbance. </p><p>  SPLMOD: Select one of thes

48、e three modes: sampling when PWM signal is active (PWM is on), sampling regularly, or sampling when lower side (UN, VN, WN) phases are conducting current. </p><p>  SPLCNT: Sampling count select. The valid s

49、ettings are from 1 to 15 times. Note that count 0 and 1 are both assumed to be one time. </p><p>  PDEN: This bit enables/disables the position detection function for position input pins TIOA~C. </p>

50、<p>  SPDLY: Sampling delay with the range of 0 to 127.</p><p>  The setting example is shown as blew. </p><p>  P_POS0_DectCtrl, B.SPLCK = 2; // Count on FCK/32 </p

51、><p>  P_POS0_DectCtrl, B.SPLMOD = 1; // Sample regularly </p><p>  P_POS0_DectCtrl, B.SPLCNT = 10; // Sample 10 times </p><p>  P_POS0_DectCtrl,

52、B.PDEN = 1; // Enable position detection</p><p>  P_POS0_DectCtrl, B.SPDLY = 100; // Sample Delay</p><p>  1.4 Speed Calculation</p><p>  In ord

53、er to obtain the exact parameters, the data must be filtered after captured. There are many filter algorithms, such as low-pass filter, moving average filter, median filter, average filter, limiting filtering, first-orde

54、r filter, moving average filtering, etc. In general, the data can be considered valid after processed by these filters. Then the speed can be calculated by substituting these parameters data in the formula. </p>&

55、lt;p>  Assume Fcap is PDC capture clock frequency; p is the pole-pair of BLDC rotor; TCNT is cleared every m P_POSx_DectData (x = 0, 1) changes, that is, TCNT is cleared at every rad rotation (m=1, 3, 6), and the posi

56、tion data is Ncap</p><p>  Since: (Formula 1- 1)</p><p><b>  and =, </b></p><p>  Since electrical degree = p x mechanical ro

57、tation then the mechanical angular </p><p>  velocity is (Formula 1- 2)</p><p>  with the unit of rad/min. Take n as the indicator. </p><p>

58、  So: rad/min (Formula 1- 3) </p><p>  n summarize: rpm (Formula 1- 4) </p><p>  From the formula above, we can obverse that n is related to Fcap, m,

59、 Ncap and p (that is a constant when BLDC is selected) .</p><p>  Suppose there is a BLDC with 2 pole-pair, 4000rpm rated speed. We will show you how to set the parameters of Fcap and m. </p><p>

60、;  When m= 1, TCNT is cleared every time P_POSx_DectData (x = 0, 1) changes, , that is, TCNT is cleared for once every 60 electrical degree rotation of BLDC. </p><p>  With a certain clock frequency, the mot

61、or rotation speed can be calculated by the Formula 1- 4 at the highest speed when Ncap is 1 and the lowest speed when Ncap is 0xffff. </p><p>  Table 1-2 Motor Speed VS Clock Frequency</p><p>  

62、@When m= 3, TCNT is cleared for once every 3 times P_POSx_DectData (x = 0, 1) changes, that is, TCNT is cleared every 180 electrical degree rotation of BLDC. </p><p>  From the Formula 1- 4, we can see that

63、the measurable motor speed when m= 3 is three times higher than that when m= 1, provided that other parameters are the same. </p><p> ?。繵hen m= 6, TCNT is cleared every 6 times P_POSx_DectData (x = 0, 1) cha

64、nges, that is, TCNT is cleared every 360 electrical degree rotation of BLDC.</p><p>  From the Formula 1- 4, we can see that the measurable motor speed when m= 6 is six times higher than that when m= 1, prov

65、ides that other parameters are the same. </p><p>  Above all, it is better to set m= 1 to ensure the veracity of positions. Since the highest speed can be applied, it is important to select the lowest speed.

66、 Assume the lowest measure speed is 200 rpm, we can set Fcap as FCK/16, FCK/64, FCK/256 or FCK/1024. FCK/16 is recommended to be selected for higher veracity.</p><p>  1.5 Noise Immunity </p><p>

67、;  Through programming the bit value of SPLCNT (sampling count select) and SPDLY (sampling delay) in P_POSx_DectCtrl(x = 0, 1), users could avoid the erroneous detection due to noise that occurs immediately after PWM out

68、put turns on. It can ensure the correctness of speed measurement and phase commutation in BLDC . </p><p>  The valid settings are from 1 to 15 times. Note that count 0 and 1 are both assumed to be one time.

69、These bits select the sampling count for the valid external position detection signals. The position signals must be sampled continuously match as many times as the sampling count set, for the position signals to be cons

70、idered valid. Then the sharp pulse can be filtered by this method. SPLCK selects the sampling clock. Figure 1-2 shows the sampling counting and Figure 1-3 shows the noise immunity </p><p>  Figure 1-2 Sampli

71、ng Counting </p><p>  Figure 1-3 Noise Immunity Pulse </p><p>  See Figure 1-2 , the SPLCNT setting is 10. When sampling the position signal with the frequency that SPLCK selected, a high-to-low

72、 transition occurs in hall3 at 0 to1 counting. Then sample the hall signal for ten executive times. If they are all of the same value, the hall signal can be considered valid. </p><p>  When SPLCNT setting i

73、s 10, a high-to-low transition occurs in hall3 at the first counting, while a low-to-high transition occurs at the fourth counting. Then reset the counter, sample hall3 for ten executive times. If they are all of the sam

74、e value, the position signals can be considered as 011b still. By this way, a sharp pulse occurring in the signals can be filtered, which prevents the position signals from being disturbed. So the position signal will no

75、t be sampled if it varies quicker than </p><p>  2 Software Design </p><p>  2.1 Software Description </p><p>  This application note is designed for motor speed measurement when dr

76、iving BLDC, which is performed by PDC position detection change interrupt. </p><p>  2.2 Source File </p><p>  2.3 DMC Interface</p><p>  Speed1_Now: Current speed by calculation &l

77、t;/p><p>  User_R0: PDC Data captured by PDC interrupt </p><p>  2.4 Subroutines </p><p>  3 Design Tips </p><p>  3.1 Demo Listing </p><p>  /*= = = = = =

78、= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ </p><p>  // Example </p><p>  /*= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ </p&

79、gt;<p>  #include "Spmc75_regs.h" </p><p>  #include "Spmc_typedef.h" </p><p>  #include "unspmacro.h" </p><p>  #include "Spmc75_SPDET.h&q

80、uot; </p><p><b>  main() </b></p><p><b>  { </b></p><p>  Spmc75_System_Init(); //System initialization </p><p><b>  while(1) </b>&l

81、t;/p><p><b>  { </b></p><p>  MC75_DMC_UART_Service(); //DMC service </p><p><b>  } </b></p><p><b>  } </b></p><p>  //= =

82、 = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</p><p>  // Description: IRQ1 interrupt source is XXX, used to XXX </p><p>  // Notes: Speed measurement through

83、PDC </p><p>  //= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = </p><p>  void IRQ1(void)__attribute__((ISR)); </p><p>  void IRQ1(void) </p

84、><p><b>  { </b></p><p>  if(P_TMR0_Status, B.PDCIF && P_TMR0_INT, B.PDCIE) </p><p><b>  { </b></p><p>  Spmc75_PDCETSPD_ISR(); // PDC capt

85、ure interrupt for the motor speed calculation. </p><p><b>  } </b></p><p><b>  } </b></p><p>  //= = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

86、= = = = = = = = = = = = </p><p>  // Description: IRQ6 interrupt source is XXX, used to XXX </p><p>  // Notes: DMC receiving ISR </p><p>  //= = = = = = = = = = = = = = = = = = = =

87、 = = = = = = = = = = = = = = = = = = = = = = </p><p>  void IRQ6(void) __attribute__ ((ISR)); </p><p>  void IRQ6(void) </p><p><b>  { </b></p><p>  if(P_IN

88、T_Status, B.UARTIF) </p><p><b>  { </b></p><p>  if(P_UART_Status, B.RXIF) MC75_DMC_RcvStream(); </p><p><b>  } </b></p><p><b>  } </b&

89、gt;</p><p>  Sub-function for speed measurement </p><p>  #define TMRPSFCK (24.0E+6)/64 //Counter clock source </p><p>  #define PAIRPOLE 2 //BLDC pole pairs </p><p>  

90、#define PDCCLEAR 1 //CNT clear source </p><p>  #define SPDLIMIT 5000 //Define the highest motor speed to avoid the disturbance due to sharp pulse </p><p>  #define RADIX (UInt32)((TMRPSFCK*60*P

91、DCCLEAR) //(6*PAIRPOLE)) </p><p>  #define MAXRPM (UInt16)(RADIX/SPDLIMIT) </p><p>  static UInt16 a Filter[CAPBSIZE]; //Moving average filter data </p><p>  static UInt16 *ptr = a

92、Filter; //Pointer to array </p><p>  void Spmc75_PDCETSPD_ISR(void) </p><p><b>  { </b></p><p>  static UInt32 summation= 0; </p><p>  UInt16 original, uiSp

93、eed; </p><p>  P_TMR0_Status, B.PDCIF = 1; // Clear interrupt flag </p><p>  original = P_TMR0_TGRA, W; //Read PDC captured data </p><p>  //Limit th

94、e highest speed </p><p>  if(original > P_TMR0_TCNT, W && original > MAXRPM) </p><p><b>  { </b></p><p>  //Accumulate the captured data and perform moving

95、 filter </p><p>  summation -= *ptr; </p><p>  *ptr = original; </p><p>  summation += *ptr; </p><p>  //Loop the array </p><p>  if((++ptr) > (a Filter

96、+CAPBSIZE-1)) ptr = a Filter;</p><p>  // Average the accumulation data </p><p>  original = (UInt16)(summation >> SHIFTDIV); </p><p>  uiSpeed = (UInt32)RADIX/original; </

97、p><p>  //Speed calculation </p><p>  SPMC_DMC_Save_Aux(0, original); </p><p>  //Transmit captured data to DMC </p><p>  SPMC_DMC_Save_SpdNow(1, uiSpeed); </p><

98、;p>  //Send data to DMC </p><p><b>  } </b></p><p><b>  } </b></p><p>  3.2 Main Process Description </p><p>  The main program performs syst

99、em initialization and DMC data detection. While the DMC data detection can also be performed in a timer interrupt with a certain frequency. Figure 3-1 shows the coding flow. </p><p>  Figure 3-1 Main Process

100、 </p><p>  3.3 ISR Description</p><p>  In PDC interrupt, system reads and filters the data, then calculates the motor speed. The coding flow is shown as Figure 3-2 . </p><p>  Figu

101、re 3-2 ISR Process </p><p>  3.4Testing Hardware </p><p>  This example is designed for the purpose of study and reference, so we simply need to input a position signal to test the system. The h

102、ardware connection is shown as Figure 3-3 . </p><p>  Figure 3-3 Test Hardware Connection </p><p>  Where, the position signal can be generated by MCU or special timing logic circuit instead of

103、necessarily being the real signal from BLDC (see Figure 3-4 and Figure 3-5 ). The frequency of position detection change can be adjusted by the potentiometer or ADC in MCU system </p><p>  Figure 3-4 Hall Si

104、gnal </p><p>  Figure 3-4 shows the three position signals timing with the sequence of 010b, 011b, 001b, 101b, 100b, 110b. </p><p>  Figure 3-5 Hall signal </p><p>  Figure 3-5 show

105、s Hall3, Hall2, Hall1 timing with the sequence of 110b, 100b, 101b, 001b, 011b, 010b. It is the same to test in real BLDC. The two timings present the different motor directions: move forward or move backward. </p>

106、<p>  The Hall.spj file in Appendix shows the code for simulating hall signal with SPMC75F2413A. We can use ADC0 voltage to simulate the speed variation, where IOD15, IOD14 and IOD13 are corresponding to Hall3, Ha

107、ll2 and Hall1 respectively and IOA0/AN0 is used for ADC conversion to adjust the simulated speed. </p><p>  用SPMC75的PDC定時(shí)器做BLDC電機(jī)的速度檢測(cè)</p><p>  一、BLDC的速度測(cè)算</p><p>  1 直流無刷電動(dòng)機(jī)概述</

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 眾賞文庫(kù)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論