粉粉嫩嫩的18虎白女,白丝女仆猛 喷水爽自慰,欧美嫩小槡BBBB槡BBBB槡,午夜视频在线免费观看,国产一级a毛一级a看免费视频

當前位置(zhi) : 首頁 > 應用方案 > 智能終端設備 >  智能電(dian)動牙刷方案(an)

軟(ruan)硬(ying)件全開(kai)源,航(hang)芯方案(an)分享 | 智能(neng)電(dian)動牙刷方案(an)


當代口(kou)腔(qiang)問題頻發,讓人(ren)(ren)們越來(lai)(lai)越重視口(kou)腔(qiang)衛(wei)生。傳統的(de)(de)(de)(de)刷(shua)(shua)(shua)牙(ya)(ya)(ya)(ya)(ya)方式(shi)(shi),由(you)于個人(ren)(ren)習慣(guan)和刷(shua)(shua)(shua)牙(ya)(ya)(ya)(ya)(ya)方式(shi)(shi)的(de)(de)(de)(de)不(bu)(bu)同,會不(bu)(bu)同程(cheng)度(du)地導(dao)致牙(ya)(ya)(ya)(ya)(ya)齦受損(sun),牙(ya)(ya)(ya)(ya)(ya)菌斑去除不(bu)(bu)徹底等問題。而電動(dong)(dong)牙(ya)(ya)(ya)(ya)(ya)刷(shua)(shua)(shua)設備,基于其相對程(cheng)序化的(de)(de)(de)(de)刷(shua)(shua)(shua)牙(ya)(ya)(ya)(ya)(ya)方式(shi)(shi),可(ke)根據(ju)個人(ren)(ren)口(kou)腔(qiang)特性(xing)支持自(zi)主選擇(ze),調節(jie)刷(shua)(shua)(shua)牙(ya)(ya)(ya)(ya)(ya)力(li)度(du)。而且(qie)在(zai)刷(shua)(shua)(shua)牙(ya)(ya)(ya)(ya)(ya)過(guo)程(cheng)中(zhong),不(bu)(bu)需要(yao)過(guo)多的(de)(de)(de)(de)手部動(dong)(dong)作(zuo),僅需要(yao)調節(jie)刷(shua)(shua)(shua)牙(ya)(ya)(ya)(ya)(ya)的(de)(de)(de)(de)角(jiao)度(du),更多的(de)(de)(de)(de)清(qing)潔(jie)工作(zuo)交付由(you)牙(ya)(ya)(ya)(ya)(ya)刷(shua)(shua)(shua)本身的(de)(de)(de)(de)特性(xing)來(lai)(lai)完成。方便人(ren)(ren)們的(de)(de)(de)(de)同時也更能有效的(de)(de)(de)(de)減(jian)少(shao)口(kou)腔(qiang)問題。


電(dian)動(dong)牙(ya)刷類型


現(xian)在市(shi)面上電動牙刷(shua)品類繁多(duo),從刷(shua)頭的方(fang)式(shi)(shi)可將(jiang)其(qi)分為兩大類型:旋轉式(shi)(shi)和振動式(shi)(shi)(也(ye)叫(jiao)聲波式(shi)(shi))。參考



圖1. 電動牙刷工作方式(shi)對比圖


旋轉式(shi)電動(dong)(dong)牙(ya)刷是由電機帶動(dong)(dong)刷頭(tou)旋轉,牙(ya)面清潔(jie)度高(gao)(gao),但牙(ya)縫(feng)清潔(jie)能(neng)力薄弱且相較(jiao)于振(zhen)(zhen)動(dong)(dong)式(shi),更(geng)易損傷(shang)牙(ya)釉質(zhi)。而振(zhen)(zhen)動(dong)(dong)式(shi),由電機帶動(dong)(dong)刷頭(tou)進行上下的高(gao)(gao)頻(pin)振(zhen)(zhen)動(dong)(dong),高(gao)(gao)頻(pin)擺(bai)動(dong)(dong)的刷頭(tou)能(neng)高(gao)(gao)效完成洗(xi)刷牙(ya)齒的動(dong)(dong)作,可以讓牙(ya)膏與(yu)水(shui)的混合(he)物產(chan)生(sheng)大量(liang)微小(xiao)的氣(qi)(qi)泡,氣(qi)(qi)泡爆裂時(shi)產(chan)生(sheng)的壓(ya)力可以更(geng)深入牙(ya)縫(feng)達到深度的清潔(jie)效果(guo)。


振(zhen)(zhen)(zhen)動(dong)式(shi)的實(shi)現有兩種方式(shi),一種由偏心(xin)振(zhen)(zhen)(zhen)動(dong)電(dian)機(ji)(ji)(ji)實(shi)現,多用于中(zhong)低檔的電(dian)動(dong)牙(ya)刷(shua)方案。該種方式(shi)的電(dian)動(dong)牙(ya)刷(shua)振(zhen)(zhen)(zhen)動(dong)感強,振(zhen)(zhen)(zhen)動(dong)無(wu)序。另(ling)一種則是采(cai)用線性電(dian)機(ji)(ji)(ji),業內也稱(cheng)之為磁(ci)懸浮(fu)電(dian)機(ji)(ji)(ji)。



圖(tu)(tu)2. 磁懸(xuan)浮電(dian)機示意圖(tu)(tu)


磁懸浮(fu)電(dian)(dian)機的(de)優點在于(yu)其在工(gong)作運行噪聲小,機身(shen)振(zhen)(zhen)感低,振(zhen)(zhen)動能量集中,清潔(jie)效果佳。因(yin)此,本(ben)文采用ACM32F030作為主控芯片,基于(yu)磁懸浮(fu)電(dian)(dian)機提出一(yi)款電(dian)(dian)動牙刷的(de)設(she)計方案(an)。


設計方案(an)


本(ben)文(wen)描述的電動牙刷(shua)方(fang)案,是基于上海航芯ACM32F030系列的MCU進行設(she)計,整體(ti)的方(fang)案框圖如(ru)下(xia)所示:



圖3. 基于(yu)ACM32F030/070電動牙刷(shua)設計(ji)方案框圖


ACM32F0X0 系(xi)列(lie)是一款支持多(duo)種(zhong)低功(gong)(gong)耗(hao)模式(shi)的通(tong)(tong)用(yong)MCU。集成12位1.6 Msps高(gao)(gao)精(jing)度ADC以及比較器(qi)(qi)、運放、觸控按鍵控制(zhi)器(qi)(qi)、段式(shi)LCD控制(zhi)器(qi)(qi),內(nei)置高(gao)(gao)性(xing)能定時器(qi)(qi)、多(duo)路UART、LPUART、SPI、I2C等(deng)豐(feng)富的通(tong)(tong)訊外設(she),內(nei)建(jian)AES、TRNG等(deng)信息安全模塊,支持多(duo)種(zhong)低功(gong)(gong)耗(hao)模式(shi),具有高(gao)(gao)整(zheng)合度、高(gao)(gao)抗干擾(rao)、高(gao)(gao)可靠性(xing)的特(te)點(dian)。本產(chan)品(pin)采用(yong)ARM Cortex-M0系(xi)列(lie)內(nei)核,最高(gao)(gao)工(gong)作頻率(lv)64MHz。足以滿足一般的電動牙刷方案的需求(qiu)。



掃碼即可立即購買ACM32F070KBU7
備注:ACM32F030和070軟硬件兼容



掃碼即可立即購買開發板


軟硬件下載鏈接如下:


? 人機(ji)交互系統(tong)


本(ben)文論述的(de)設(she)計(ji)方案中(zhong)的(de)人機交(jiao)互功能是采用簡單的(de)LED和(he)按鍵(jian)的(de)方式(shi)進行實現(xian)。共有(you)1個按鍵(jian)和(he)6個LED。按鍵(jian)需實現(xian)設(she)備的(de)開關機以及模式(shi)切換(huan)功能。設(she)備會根(gen)據(ju)按鍵(jian)按下時間的(de)長短(duan)來判定當(dang)前的(de)動作是需要切換(huan)模式(shi)或(huo)是開關機操作。6個LED中(zhong)有(you)3個用于工作模式(shi)指(zhi)(zhi)示(shi),最大可支持7種工作模式(shi)(23-1),本(ben)設(she)計(ji)方案中(zhong)僅提供(gong)了(le)三種模式(shi)。另外3個LED用于系(xi)統(tong)狀態(tai)指(zhi)(zhi)示(shi),包(bao)括正常,欠壓(ya),充電(dian),充滿4種電(dian)壓(ya)狀態(tai)。


長短按識別程序:


void keyPressHandler(void)
{
  key.isPressed = Key_GetPressValue();
  switch(key.pressState)
  {
    case 0:
      if(key.isPressed)
      {
        key.pressTime = 0;
        key.pressState = 1;
      }
      break;
    case 1:    /*  eliminate jitter  */
      if(key.isPressed)
      {
        if(++key.pressTime > 10)
          key.pressState = 2;
      }
      else
        key.pressState = 0;
      break;
    case 2:    /*  whether long press is existed  */
      if(key.isPressed)
      {
        if(++key.pressTime > LONG_PRESS_TIME)
          key.pressState = 3;
      }
      else
      {
        if(key.shortPressHandler != NULL)
          key.shortPressHandler();
        else
          DEBUG_KEY("have no short press handler!!\r\n");
        key.pressState = 0;
      }
      break;
    case 3:
      if(key.longPressHandler != NULL)
        key.longPressHandler();
      else
        DEBUG_KEY("have no long press handler!!\r\n");
      key.pressState = 4;
      break;
    case 4:    /*  wait for releasing key  */
      if(key.isPressed == 0)
        key.pressState = 0;
      break;
  }
}


工作指示程序:


void appMotorModeLedControl(void)
{
  static uint8_t state = 0xFF;
       
  if(sys.status == SYSTEM_RUNMODE)
  {
    if(state != sys.motorStatus)
    {
      state = sys.motorStatus;
      if(sys.motorStatus == 0)
      {
        ModeLed_Select(MODE_LED_1, MODE_LED_ON);
      }
      else if(sys.motorStatus == 1)
      {
        ModeLed_Select(MODE_LED_2, MODE_LED_ON);
      }
      else if(sys.motorStatus == 2)
      {
        ModeLed_Select(MODE_LED_3, MODE_LED_ON);
      }
    }
  }
  else
  {
    state = 0xFF;
    ModeLed_Select(MODE_LED_UNKNOWN, MODE_LED_OFF);
  }
}


系統(tong)指示程序:


void appSysLedController(void)
{
  static uint8_t led_state = 0xFF;
       
  if(led_state != led.state)
  {
    led_state = led.state;
    if(led.state == LED_OFF)
    {
      led.duty = 0;
      PowerLed_Select(PWR_LED_UNKNOWN, PWR_LED_OFF);
      PWM_dutySet(PWM_LED, led.duty);
    }
    else if(led.state == LED_TWINKLE)    // low power warning
    {
      led.duty = 0;
      PowerLed_Select(PWR_LED_R, PWR_LED_ON);
      PWM_dutySet(PWM_LED, led.duty);
    }
    else if(led.state == LED_ON)
    {
      led.duty = 0;
      PowerLed_Select(PWR_LED_R, PWR_LED_OFF);
      PWM_dutySet(PWM_LED, led.duty);
    }
    else if(led.state == LED_BREATHE)
    {
      if(led.duty == PWM_DUTY_MAX)
        led.dir = LED_FADE;
      else
        led.dir = LED_BRIGHTER;
    }
    else
      led.state = LED_OFF;
  }
  else{
    if(led.state == LED_BREATHE)
    {
      PowerLed_Select(PWR_LED_UNKNOWN, PWR_LED_OFF);
      if(led.dir == LED_BRIGHTER)
      {
        if(led.duty < PWM_DUTY_MAX)
          led.duty += BREATHE_INTERVAL;
        else
        {
          if(++led.cnt > BREATHE_HOLD_TIME)
          {
            led.dir = LED_FADE;
            led.cnt = 0;
          }
        }
      }
      else
      {
        if(led.duty > BREATHE_INTERVAL)
          led.duty -= BREATHE_INTERVAL;
        else
        {
          led.duty = 0;
          if(++led.cnt > BREATHE_HOLD_TIME)
          {
            led.dir = LED_BRIGHTER;
            led.cnt = 0;
          }
        }
      }
      PWM_dutySet(PWM_LED, led.duty);
    }
  }
}


? 電源及功耗管理


電動牙刷產(chan)品的(de)續航能力也是一直備受人們關(guan)注。本設(she)計方(fang)案在低功耗的(de)處理,摒(bing)棄(qi)了一般(ban)的(de)休眠方(fang)式,直接采(cai)用關(guan)閉電源來避免設(she)備在不工作狀態(tai)下的(de)設(she)備功耗。整個設(she)備的(de)供電線路共有三種(zhong),如(ru)下圖(tu)所示。



圖4. 基于ACM32F030的電動牙刷供電電路(部分)


正(zheng)常(chang)情況下,設(she)備不在充電(dian)(dian)時(shi)(shi)(shi),VCHARG電(dian)(dian)壓(ya)為0,需要關機(ji)(ji)時(shi)(shi)(shi),按(an)鍵彈開(kai)(kai),PWR_KEY為低(di)電(dian)(dian)平(ping),芯片(pian)內部(bu)程序也將PWR_LOCK拉低(di),此時(shi)(shi)(shi)Q2關斷,Q2的(de)(de)(de)D極電(dian)(dian)壓(ya)同VBAT,從而引起Q1斷開(kai)(kai),VCCIN斷電(dian)(dian),系(xi)統關機(ji)(ji)。而開(kai)(kai)機(ji)(ji)時(shi)(shi)(shi),按(an)鍵按(an)下,PWR_KEY先被拉至高電(dian)(dian)平(ping),Q2導(dao)通(tong),Q2的(de)(de)(de)D極拉低(di),則Q1導(dao)通(tong),設(she)備供電(dian)(dian),程序檢測到開(kai)(kai)機(ji)(ji),拉高PWR_LOCK,此時(shi)(shi)(shi),盡管按(an)鍵彈開(kai)(kai),PWR_LOCK仍(reng)然會(hui)提供Q2的(de)(de)(de)導(dao)通(tong)電(dian)(dian)壓(ya),系(xi)統正(zheng)常(chang)工作。充電(dian)(dian)時(shi)(shi)(shi),Q2的(de)(de)(de)導(dao)通(tong)電(dian)(dian)壓(ya)會(hui)由VCHARG提供,系(xi)統保持在工作狀態,此時(shi)(shi)(shi)會(hui)程序會(hui)檢測系(xi)統的(de)(de)(de)運行狀態,在不需要啟動時(shi)(shi)(shi),進入休眠狀態。


電(dian)源管(guan)理部分,則(ze)通過鋰(li)電(dian)池(chi)(chi)充電(dian)芯(xin)(xin)片檢測(ce)是否進行充電(dian),同時通過一路ADC監測(ce)電(dian)池(chi)(chi)電(dian)壓(ya)(ya)。為(wei)減少芯(xin)(xin)片工作負擔,電(dian)池(chi)(chi)電(dian)壓(ya)(ya)的(de)(de)欠壓(ya)(ya)和滿電(dian)通過ADC門限電(dian)壓(ya)(ya)功(gong)能來實現(xian)。ADC的(de)(de)門限電(dian)壓(ya)(ya)初始化程序如(ru)下(xia):


// ADC Watchdog config
  ADC_WDT_Handle.ITMode      = ENABLE;
  ADC_WDT_Handle.WatchdogMode  = ADC_ANALOGWATCHDOG_RCH_ALL;
  ADC_WDT_Handle.Channel      = channel;
  ADC_WDT_Handle.HighThreshold  = (HIGH_POWER_THS * 0x0FFF) / VREF ;
  ADC_WDT_Handle.LowThreshold  = (LOW_POWER_THS * 0x0FFF) / VREF ;


? 智能管(guan)理(li)系(xi)統


智(zhi)能管理(li)(li)系統(tong)分(fen)(fen)為兩個部分(fen)(fen),一部分(fen)(fen)為上(shang)位(wei)機(ji)(ji)的(de)(de)數(shu)(shu)(shu)(shu)(shu)據處理(li)(li),由云(yun)(yun)端(duan)處理(li)(li),另(ling)一部分(fen)(fen)是(shi)電(dian)動牙(ya)刷(shua)(shua)數(shu)(shu)(shu)(shu)(shu)據記(ji)錄和傳(chuan)輸(shu)。整(zheng)個的(de)(de)實現過(guo)(guo)程(cheng)(cheng)可(ke)簡述為,電(dian)動牙(ya)刷(shua)(shua)通(tong)過(guo)(guo)慣性測量儀QMI8658C記(ji)錄電(dian)動牙(ya)刷(shua)(shua)在使用過(guo)(guo)程(cheng)(cheng)中的(de)(de)運動軌跡,并(bing)實時將該部分(fen)(fen)數(shu)(shu)(shu)(shu)(shu)據以及整(zheng)個系統(tong)的(de)(de)工(gong)作參數(shu)(shu)(shu)(shu)(shu)通(tong)過(guo)(guo)BLE發送到手(shou)機(ji)(ji),手(shou)機(ji)(ji)連接(jie)云(yun)(yun)端(duan),并(bing)將數(shu)(shu)(shu)(shu)(shu)據傳(chuan)輸(shu)至(zhi)云(yun)(yun)平臺(tai)進(jin)行數(shu)(shu)(shu)(shu)(shu)據解析,分(fen)(fen)析用戶刷(shua)(shua)牙(ya)的(de)(de)健(jian)康指數(shu)(shu)(shu)(shu)(shu),并(bing)將相(xiang)關建(jian)議(yi)反饋至(zhi)手(shou)機(ji)(ji)。電(dian)動牙(ya)刷(shua)(shua)作為數(shu)(shu)(shu)(shu)(shu)據采集(ji)設備,需(xu)上(shang)報實時數(shu)(shu)(shu)(shu)(shu)據,結構(gou)如下(xia):


typedef __packed struct{
  uint32_t time;          // This shows the relative time of each activity
  uint16_t location[3];        // This shows the acceleration of brush when using
  uint16_t pressure;        // This is the force between tooth and brush
  uint16_t angle[3];        // This shows the angle between brush
       
}BLE_RealTimeDataDef;        // This define the data structure about brushing tooth in real time


其中,location為(wei)(wei)三軸的(de)加速度,angle為(wei)(wei)三軸的(de)角(jiao)度。定時上(shang)傳電動牙刷的(de)相關實時數(shu)據。上(shang)位機根據一系列點(dian)位數(shu)據進行建模計算可得到整(zheng)個(ge)牙刷的(de)運動軌跡。


? 電機驅動系統(tong)


電(dian)動牙刷的(de)驅動系統是通過H橋芯片MX612E進行處理,MX612E的(de)輸入端連接芯片的(de)PWM互(hu)補輸出端口。如下(xia)圖所示:



圖5. 電(dian)動(dong)牙(ya)刷電(dian)機(ji)驅動(dong)電(dian)路


本設(she)計中的(de)電(dian)(dian)動(dong)牙(ya)刷(shua)(shua)采用(yong)磁(ci)懸浮(fu)電(dian)(dian)機(ji),內部構造和直流無刷(shua)(shua)電(dian)(dian)機(ji)相(xiang)似,但相(xiang)比于直流無刷(shua)(shua)電(dian)(dian)機(ji),其(qi)僅(jin)有兩相(xiang)輸(shu)入端。這也就(jiu)造成(cheng)該(gai)電(dian)(dian)機(ji)在通(tong)電(dian)(dian)后(hou),正(zheng)(zheng)負(fu)極(ji)不(bu)變的(de)情況下,電(dian)(dian)機(ji)旋轉至某(mou)一(yi)角度(du)(du)形成(cheng)平(ping)衡(heng)后(hou)將會停(ting)止(zhi)旋轉。切換正(zheng)(zheng)負(fu)極(ji)后(hou)則又會在另一(yi)個(ge)方向旋轉形成(cheng)平(ping)衡(heng)。在電(dian)(dian)動(dong)牙(ya)刷(shua)(shua)的(de)正(zheng)(zheng)常(chang)工作中,是通(tong)過兩相(xiang)的(de)正(zheng)(zheng)負(fu)極(ji)切換來使電(dian)(dian)機(ji)正(zheng)(zheng)反旋轉從(cong)而帶(dai)動(dong)刷(shua)(shua)頭做高頻運(yun)動(dong)的(de)。因此,其(qi)電(dian)(dian)機(ji)速度(du)(du)的(de)控(kong)制(zhi)依靠于輸(shu)出(chu)PWM的(de)輸(shu)出(chu)頻率而非占空(kong)比。控(kong)制(zhi)代(dai)碼如下:


void PWM_freqSet(uint8_t PWMx, uint16_t freq)
{
  uint32_t arr;
  if(IS_PWM_INSTANCE(PWMx) == 0)  return;
  if(freq == 0)
  {
    TIM15->ARR = 0;
    return;
  }
  if(freq > PWM_FREQ_MAX)  freq = PWM_FREQ_MAX;
  if(freq < PWM_FREQ_MIN) freq = PWM_FREQ_MIN;
  arr = (PWM_TIMER_FRE / freq);
  if(PWMx == PWM_MOTOR)
  {
    TIM15->ARR = arr-1;
    TIM15->CCR1 = arr / 2;
  }
}


上例中,PWM的占(zhan)空比(bi)為50%,使得在(zai)一個PWM周期內,電(dian)機可完成一次往返(fan)運動。


本文提出的(de)(de)(de)設計方案的(de)(de)(de)主旨是將電(dian)動(dong)牙(ya)(ya)刷智(zhi)能(neng)(neng)化,在(zai)提高人們(men)刷牙(ya)(ya)效率(lv)的(de)(de)(de)同時,也(ye)能(neng)(neng)達(da)到進(jin)一步保證人們(men)刷牙(ya)(ya)質量的(de)(de)(de)目的(de)(de)(de)。通(tong)過電(dian)動(dong)牙(ya)(ya)刷對慣(guan)性的(de)(de)(de)數據采集,實時上(shang)傳至云端(duan),并對數據進(jin)行處理,恢復用戶(hu)的(de)(de)(de)刷牙(ya)(ya)軌跡(ji),給出合理建議,糾正用戶(hu)不良的(de)(de)(de)刷牙(ya)(ya)習(xi)慣(guan)。磁(ci)懸浮(fu)電(dian)機的(de)(de)(de)高頻振動(dong)也(ye)能(neng)(neng)有效清(qing)除口腔污漬。歲月恒久遠,牙(ya)(ya)齒永相隨 ^-^。


上海(hai)航芯 · 原廠(chang)直連: