新聞中心

        EEPW首頁 > 測試測量 > 設(shè)計應(yīng)用 > 大型貨車超載超速實時檢測系統(tǒng)

        大型貨車超載超速實時檢測系統(tǒng)

        作者: 時間:2014-04-18 來源:網(wǎng)絡(luò) 收藏

        本文引用地址:http://www.104case.com/article/259120.htm

        Void BeforeTheStateDidNotExercise(float* parameter,float weight,int *countR,int *countW)

        {

        (*countR)++;

        if(*countR>=17)

        *countR=0;

        if(weight>M)

        {

        (*countW)++;

        if(*countW>=12)

        {

        *parameter=0;

        *countW=0;

        overloadAlarm();//啟動報警

        }

        }

        }

        運動中超載處理程序:

        void campaignStatus(float* parameter,float weight,int *countR,int *countW,clock_t *start)

        {

        if(* parameter!=1)

        (*countR)++;

        momentNow();//記錄當(dāng)前時間

        *start=clock();

        t1recordTheCurrenttime();//記錄當(dāng)前時間

        if(weight>M)

        (*countW)++;

        if(*countR>=100)

        {

        if( *countW>=70)

        {

        overloadAlarm();//啟動報警

        * parameter=1;

        }

        *countR=0;

        *countW=0;

        }

        }

        運動后停車超載處理:

        void afterStoppingState(float* parameter,float weight,int *countR,int *countW,clock_t *finish)

        {

        (*countR)++;

        //記錄當(dāng)前時間t2

        *finish=clock();

        if(weight>M)

        (*countW)++;

        if(*countR>=100)

        {

        if(*countW30)

        {

        *parameter=-1;

        sendRelevantInformationToTheHost(countW,countR);// 發(fā)送相關(guān)信息到主機

        }

        *countR=0;

        *countW=0;

        }

        }

        //根據(jù)速度和參數(shù)K和parameter確定車體狀態(tài)

        void carStatus(float speed,float* parameter,float weight,int *countR,int *countW)

        {

        //超載持續(xù)時間

        clock_t start, finish;

        double duration;

        if(speed==0)

        {

        if(*parameter=0)

        BeforeTheStateDidNotExercise(parameter,weight,countR,countW);

        else

        afterStoppingState(parameter,weight,countR,countW,clock_t finish);

        }

        else

        campaignStatus(parameter,weight,countR,countW,clock_t start);

        //超重持續(xù)時間

        duration = (double)(finish - start) / CLOCKS_PER_SEC;

        printf( %f secondsn, duration );

        }

        //獲取當(dāng)前時間

        int momentNow(void)

        {

        time_t t;

        t=time(0);

        local=localtime(t);

        printf( %d-%d-%dn%d:%d:%dn,local->tm_year+1900,local->tm_mon,local->tm_mday,local->tm_hour,local->tm_min,local->tm_sec);

        return 0;

        }

        4.2 獲取速度模塊設(shè)計

        4.2.1 硬件設(shè)計

        本方法采用測量一個轉(zhuǎn)盤的轉(zhuǎn)速間接地測出貨車的速度,因此轉(zhuǎn)盤要與貨車的轉(zhuǎn)軸相連,轉(zhuǎn)盤的轉(zhuǎn)速與車軸的轉(zhuǎn)速成一定的關(guān)系。將轉(zhuǎn)盤等分為四等份,在每等份的分界線上安裝一塊磁鋼,如圖4.2所示。

        圖4.5 測速硬件原理

        的VCC端接5~12V直流電源,OUT端接到SPCE061A的IOB3(外部中斷2輸入口)[27],另一端接公共地。每次磁鋼經(jīng)過下方時,OUT端都會產(chǎn)生一個脈寬的負(fù)脈沖。

        稱重傳感器相關(guān)文章:稱重傳感器原理
        傾角傳感器相關(guān)文章:傾角傳感器原理


        評論


        相關(guān)推薦

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

        關(guān)閉
        主站蜘蛛池模板: 富平县| 中宁县| 高陵县| 拉孜县| 沅江市| 南京市| 四会市| 昆明市| 汽车| 满洲里市| 莎车县| 临夏县| 化隆| 清镇市| 甘肃省| 香港| 德令哈市| 肥乡县| 武威市| 信阳市| 响水县| 定兴县| 北海市| 寿宁县| 许昌市| 铜山县| 华阴市| 淅川县| 商南县| 将乐县| 丁青县| 曲沃县| 安阳市| 合川市| 库车县| 克什克腾旗| 比如县| 江达县| 两当县| 石泉县| 吐鲁番市|