新闻中心

EEPW首页 > 测试测量 > 设计应用 > 大型货车超载超速实时检测系统

大型货车超载超速实时检测系统

作者: 时间:2014-04-18 来源:网络 收藏

本文引用地址:https://www.eepw.com.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();//启动报警

}

}

}

运动中超载处理程序:

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

{

if(* parameter!=1)

(*countR)++;

momentNow();//记录当前时间

*start=clock();

t1recordTheCurrenttime();//记录当前时间

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)++;

//记录当前时间t2

*finish=clock();

if(weight>M)

(*countW)++;

if(*countR>=100)

{

if(*countW30)

{

*parameter=-1;

sendRelevantInformationToTheHost(countW,countR);// 发送相关信息到主机

}

*countR=0;

*countW=0;

}

}

//根据速度和参数K和parameter确定车体状态

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

{

//超载持续时间

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);

//超重持续时间

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

printf( %f secondsn, duration );

}

//获取当前时间

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 获取速度模块设计

4.2.1 硬件设计

本方法采用测量一个转盘的转速间接地测出货车的速度,因此转盘要与货车的转轴相连,转盘的转速与车轴的转速成一定的关系。将转盘等分为四等份,在每等份的分界线上安装一块磁钢,如图4.2所示。

图4.5 测速硬件原理

的VCC端接5~12V直流电源,OUT端接到SPCE061A的IOB3(外部中断2输入口)[27],另一端接公共地。每次磁钢经过下方时,OUT端都会产生一个脉宽的负脉冲。

称重传感器相关文章:称重传感器原理
倾角传感器相关文章:倾角传感器原理


评论


相关推荐

技术专区

关闭