新聞中心

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

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

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

本文引用地址:http://www.butianyuan.cn/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();//啟動(dòng)報(bào)警

}

}

}

運(yùn)動(dòng)中超載處理程序:

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

{

if(* parameter!=1)

(*countR)++;

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

*start=clock();

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

if(weight>M)

(*countW)++;

if(*countR>=100)

{

if( *countW>=70)

{

overloadAlarm();//啟動(dòng)報(bào)警

* parameter=1;

}

*countR=0;

*countW=0;

}

}

運(yùn)動(dòng)后停車超載處理:

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

{

(*countR)++;

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

*finish=clock();

if(weight>M)

(*countW)++;

if(*countR>=100)

{

if(*countW30)

{

*parameter=-1;

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

}

*countR=0;

*countW=0;

}

}

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

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

{

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

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ù)時(shí)間

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

printf( %f secondsn, duration );

}

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

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è)計(jì)

4.2.1 硬件設(shè)計(jì)

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

圖4.5 測(cè)速硬件原理

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

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


評(píng)論


相關(guān)推薦

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

關(guān)閉