【正文】
{ zhuan=z。 x+=z。 disp_count()。 //數(shù)據(jù)處理displaytolcd()。msec=0。z=0。}}/**//*端口初始化 */void int_all(){warning=0。 //關(guān)蜂鳴器z=0。 //初始化 z 的值count=0。 //初始化 count 的值z(mì)huan=0。 //初始化轉(zhuǎn)的值rw=0。 //選擇 LCD 寫數(shù)據(jù)指令delay(15)。 //延時(shí) 15mswrite_mand(0x38)。 //向 LCD1602 寫命令 38Hdelay(5)。 //延時(shí) 5mswrite_mand(0x0e)。 //向 LCD1602 寫命令 0EHdelay(5)。 //延時(shí) 5mswrite_mand(0x06)。 //向 LCD1602 寫命令 06HTMOD=0x01。 //內(nèi)部中斷定時(shí)器選擇TH0=0x66。 //50ms 定時(shí)TL0=0x50。EA=1。 //開中斷總開關(guān)ET0=1。 //開內(nèi)部中斷 0TR0=1。 //計(jì)時(shí)器開始工作IT0=1。 //外部中斷 0 為下降沿觸發(fā)EX0=1。 //開外部中斷 0天津工業(yè)大學(xué) 2022 屆本科生天津工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(論文) 30 }/**//*轉(zhuǎn)速過高警告程序 */void warning_speed(){if(zhuan=80) //高于 80 轉(zhuǎn)打開警告{warning=1。}if(zhuan80) //低于 80 轉(zhuǎn)關(guān)閉警告{warning=0。}}/**//*主函數(shù)*/void main(){int_all()。 //全局初始化while(1){warning_speed()。 //轉(zhuǎn)速警告}}/**/天津工業(yè)大學(xué) 2022 屆本科生天津工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(論文) 31 附錄 2 硬件實(shí)物圖外文文獻(xiàn)天津工業(yè)大學(xué) 2022 屆本科生天津工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(論文) 32 Algebraic OperatorsBesides the basic operations on fuzzy sets given above, namely intersection, union and plement we can define a large number of other algebraic operations which we now summarize.Definition. The algebraic sum, ,of two fuzzy sets with membership CAB???functions and is a fuzzy set with membership function A??B~ , .()()()BBAAxxx????????? X?We write = .C????(,)|ABX??? algebraic product, , of two fuzzy sets with membership C??function and is a fuzzy set with membership function A??B~ , .()()BAxx????? X?We write .??(,)|ABC????Definition. The bounded sum, , of two fuzzy sets with membership ???function and is a fuzzy set with membership function A??B~ .?()min1,()BAxx???? ??We write .?(,)|ABCX????Definition. The bounded difference, = , of two fuzzy sets with C?A?B?membership function and is a fuzzy set with membership functionA??B~ ?()mx0,()1BBAx?????? ??We write ?(,)|ABCX????The Cartesian product of fuzzy sets is defined as follows.天津工業(yè)大學(xué) 2022 屆本科生天津工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(論文) 33 Defintion. Let ,…, be fuzzy sets in ,…, .The Cartesian product is then a 1A?n1Xnfuzzy set in the space … with a membership functionX?n .??1 12.()mi()|,.),ni niiAAxxxX?????? ?Defintion. The mth power of a fuzzy set is a fuzzy set with the membership 1function .()(),mmAAx???? iixX?The Fuzzy AND and Fuzzy OR operators bine the logical AND and OR operators with the arithmetic norm. fuzzy AND of two fuzzy sets and is defined as ?B CAB???with membership function ??1()min(),()()2BBCABAAxxx???????????? ??where can be varied between 0 and 1 in order to weight the logical AND against ?the arithmetic mean. For =1 the fuzzy AND reduces to the logical AND and for ?=0 the fuzzy AND operator reduces to the arithmetic mean.? fuzzy OR of two fuzzy sets and is defined asA?B CAB???with menbership function ,??1()max(),()()2BBCABAAxxx????????????? ??[01]?? Defuzzification OperationsIn many practical applications we would like to obtain a crisp decision from the fuzzy analysis of the problem. For example, in a problem where a pany uses fuzzy logic to decide on one of many marketing panies the result of the fuzzy analysis should be exactly one , in a control problem (. the classic polebalancing problem) we would like a crisp decision for the force which should be applied to the cart. The following operators are monly used to extract a crisp decision from a fuzzy set.天津工業(yè)大學(xué) 2022 屆本科生天津工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(論文) 34 Definition. The minimum grade operator returns that support value which has the maximum grade (degree of truth). If there is no unique support value corresponding to be the maximum grade then it returns any one of these.Definition. The minimum grade operator returns that support value which has the minimum there is no unique support value corresponding to be the maximum grade then it returns any one of these.In many cases a small variation in the membership function can cause a very big variation in the decision (conclusion). For example , if we have a nonconvex fuzzy set, then a small variation might change the decision from the one maximum to the other. This can be problematic, especially in the case of control problems where it can be a major cause of instability. Hence, for control problems one often uses the centroid of the fuzzy set for the crisp control strategy.Definition. The centroid c (or centre of mass) of a fuzzy set, with membership F?function for is defined by ()Fx??X? ():FxXc??????in the case of a discrete membership function and by ():FxXc??????in the case where is continuous.()F??For some applications it can be useful to obtain a crisp set from a fuzzy set. For example, when trading with stocks, one might want to use fuzzy logic inference to decide which stocks should be sold.Definition. The cut operator returns a crisp set with a grade of 0 for support values ?with grade less than and 1 for support values which have a grade larger than or equal to .Definition. The cut operator returns a crisp set with a grade 1 for the support ? ?values which have the highest grade and 0 for the remaining support values.Example. Consider the discrete fuzzy set天津工業(yè)大學(xué) 2022 屆本科生天津工業(yè)大學(xué)畢業(yè)設(shè)計(jì)(論文) 35 .??(1,)2,.7(3,)4,.)(5,)(6,.2,019)F??The maximum grade is 5, the minimum grade is 3, the centroid is 3, the cut ??with = returns the crisp set ?{(1,1),(2,0),(3,0),(4,0),(5,1),(6,0),(7,0)}and the cut with = returns the crisp set ? {(1,1),(2,1),(3,0),(4,0),(5,1),(6,0),(7,0)}.There are a number of other defuzzification operators described in the literature, for example the weighted average method (only applies to symmetrical membership functions), the centre of sums, centre of l