利用MAXQ7667确定超声传感器的谐振频率和阻尼特性

时间:2012-09-14来源:网络
/20120914023949976.gif" width=650>

  详细图片(PDF, 325kB)

  图5. 输出曲线图示例

  附录A. 软件例程

  MAXQ7667传感器校准文件

  // This routine measures the transducer damping at the specified frequency (PLLfreq).

  // The system timer is used to measure when the LPF output (LPFD) has dropped to 1/2 the peak value.

  // This is the settling time that will be used later when doing the frequency sweep.

  unsigned damping_half_time (unsigned PLLfreq, unsigned pulse_width)

  {

  unsigned short i;

  unsigned short peak = 0;

  unsigned short half_peak = 0;

  unsigned short temp = 0;

  SCNT_bit.STIME = 0; // Make sure system timer is off.

  STIM = 0; // Clear the system timer.

  SCNT_bit.STDIV = 4; // Set system timer prescale divider to 16 (1µs per cycle).

  PLLF_bit.PLLF = PLLfreq; // Set the PLL frequency.

  BPH = pulse_width; // Pulse width = BPH/(receive frequency * 400) when BDIV = 0xC.

  usWaitTimer2(10000); // Let the PLL settle for 10ms.

  SCNT_bit.STIME = 1; // Start the system timer.

  BPH_bit .BSTT = 1; // Send a burst.

  usWaitTimer2(50); // Wait for LPF to partially settle.

  RunTimer0_us(20); // Start timer # 1 with a reload time of every 20µs.

  for (i = 0; i 200; i++)

  {

  temp = LPFD; // Read the output of the lowpass filter.

  if (temp > 0x2000 temp > peak) {peak = temp;} // Save the peak value if it is greater than 2000.

  if (temp peak/2 half_peak == 0) // If LPFD is less than half the peak value and the half peak time

1 2 3 4 5 6

关键词: MAXQ7667 超声传感器 谐振频率 阻尼特性

加入微信
获取电子行业最新资讯
搜索微信公众号:EEPW

或用微信扫描左侧二维码

相关文章

查看电脑版