新聞中心

EEPW首頁(yè) > 模擬技術(shù) > 設(shè)計(jì)應(yīng)用 > 利用MAXQ7667確定超聲傳感器的諧振頻率和阻尼特性

利用MAXQ7667確定超聲傳感器的諧振頻率和阻尼特性

作者: 時(shí)間:2012-09-14 來(lái)源:網(wǎng)絡(luò) 收藏
; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">  {

  // Use the "damping_half_time" routine to measure the time in μs that it takes for the

  // ringing to drop to half of the peak value. Do this at more than one frequency so that

  // one of the frequencies will be within range of the transducer.

  wait2measure = damping_half_time(128, 88); //Measure damping time at 35kHz.

  halfpeak = damping_half_time(256, 101); //Measure damping time at 40kHz.

  if (wait2measure halfpeak) {wait2measure = halfpeak;} // Save the longest time.

  halfpeak = damping_half_time(384, 113); //Measure damping time at 45kHz.

  if (wait2measure halfpeak) {wait2measure = halfpeak;} // Save the longest time.

  // Repeatedly pulse the transducer with a constant width pulse while sweeping the receiver

  // frequency. Use the half-time value from the damping test (wait2measure) for the interval

  // between pulse transmission and reading LPFD (lowpass filter data).

  PLLF_bit.PLLF = 0; // Start the sweep at 30kHz.

  BPH = 77; // Pulse ~6.3μs. This value is easy to maintain over frequency.

  peak = 0;

  number_of_steps = 0;

  do // Sweep from 30kHz to 50kHz with step_size * 39.062500kHz.

  {

  usWaitTimer2(5000); // Wait 5ms for the frequency to settle.

  STIM = 0; // Reset the system timer. It controls the Pulse to LPF read time.

  BPH_bit .BSTT = 1; // Send burst.

  while(STIM wait2measure) {} // Wait the specified amount of time for the ringing to dampen.

  lpfdata[number_of_steps]= LPFD; // Store the LPF reading.

  if(lpfdata[number_of_steps]> peak) {peak = lpfdata[number_of_steps];} //Save the peak value.

  number_of_steps++;

  PLLF_bit.PLLF = number_of_steps * step_size; // Increase the frequency.

  BPH = 77 + number_of_steps; // Increase the duty cycle to maintain pulse width.

  } while (PLLF 512-step_size);



關(guān)鍵詞: MAXQ7667 超聲傳感器 諧振頻率 阻尼特性

評(píng)論


相關(guān)推薦

技術(shù)專區(qū)

關(guān)閉