A Deterministic Finite State Automaton for the Oriya Negative Verbal Forms

A Deterministic Finite State Automaton for the Oriya Negative Verbal Forms
A Deterministic Finite State Automaton for the Oriya Negative Verbal Forms

A Deterministic Finite State Automaton for the Oriya Negative Verbal Forms

Kalyanamalini Sahoo

ILTS Project

Dept. of Management Studies

Indian Institute of Science

Bangalore- 560012

kalyani@mgmt.iisc.ernet.in

Abstract

This paper discusses the processing of negative verbal forms in Oriya in a deterministic Finite State Automaton. A morphologically agglutinative language like Oriya has ‘phrasal’ or ‘constituent’ negation, where tense, aspect etc. impose restrictions on NEG marking. Negation can be marked by various NEG morphemes in various positions of the verbal form, but is marked only once. That is, the occurrence of a NEG morpheme restricts the occurrence of any other NEG marker in the verbal form. Such multiple positional slots for the NEG morpheme with respect to tense, aspect poses constraint for the processing of the string by FSA. The FSA being a unidirectional machine, cannot backtrack, and thus, cannot account for such mutual exclusiveness of the items if all the three NEG items are available in a single chart. So, to account for this problem, we propose different types of processing for the different positional slots of NEG morphemes.

1. Introduction

Morphological analysis of words is a basic tool for automatic language processing, and indispensable when dealing with agglutinative languages like Oriya. In this context, some applications, like spelling correction, do not need more than the segmentation of each word into its different component morphemes along with their morphological information. However, there are other applications such as lemmatization, tagging, phrase recognition, and determination of clause boundaries, which need an additional morphosyntactic parsing of the whole word. This work proposes a model for designing a morphological analyzer for Oriya negative verbal forms. This will not involve doing anything on the computer (for now!), just drawing out a finite-state machine that accepts valid sequences of morphemes in a negative verbal form and rejects invalid ones. 1.1 Negation

Negation is generally contrasted with affirmation, providing a polarity distinction between positive and negative. Languages differentiate between clausal and phrasal negations. In some languages, negation is primarily viewed as a clausal concept, in the sense that it would be unaffected by verbal categories like tense, aspect and evidentiality (or mood), i.e. English. A language like Oriya has phrasal or constituent negation, where tense, aspect etc. impose restrictions on NEG marking.

Languages use different devices to mark negation. Oriya has NEG affixes as well as NEG verbs. Negation can be marked by bound inflection on the verb, or can surface as an auxiliary verb. Finite and nonfinite verbal forms in Oriya have their own ways for being marked for negation. Negation can be marked by various NEG morphemes in various positions of the verbal form, but is marked only once. That is, the occurrence of a NEG morpheme restricts the occurrence of any other NEG marker in the verbal form. It can be marked at the beginning, middle or at the end of a finite verbal form, by the morphemes na-, naahan, and –ni/ naahin, respectively; while in non-finite verbal forms, the NEG affix na occurs invariably in a position immediately preceding the verbal root.

Such multiple positional slots for the NEG morpheme with respect to tense, aspect poses constraint for the processing of the string by a deterministic Finite State Automaton (FSA). The FSA being a unidirectional machine, cannot backtrack, and thus, cannot account for such mutual exclusiveness of the items if all the three NEG items are available in a single chart, and may over-generate. So, to account for this problem, we propose different types of processing for the different positional slots of NEG morphemes.

The remainder of this paper is organized as follows. Section 2 gives a brief description of the Oriya verbal forms. Section 3 and section 4 discuss NEG verb and NEG affixes, respectively. Section 5 summarizes the

NEG markers and the available positional slots for the NEG markers. Section 6 describes the architecture for morphological processing, specifies the phenomena covered by the analyzer, explains its design criteria, and presents the processing details. Finally, the paper ends with some concluding remarks.

2. Oriya verbal forms

Oriya is a syntactically head-final and morphologically agglutinative language. A number of morphemes carrying different grammatical functions get affixed to the verbal root to make a verbal form. The major inflectional subsystems that cluster around the verb are: tense, aspect, agreement markers, negation markers, auxiliary morpheme etc. Oriya verbal forms typically contain a sequence of morphemes followed by a verbal root, as in (1)-(2).

(1) (mun) khaa-u-th-il-i

I eat-PROG-AUX-PAST-1st sg

‘(I) was eating’

(2) (se) ne-i-th-ib-a

s/he take- PERF-AUX-PAST-3rd sg

‘(S/he) would have taken.’

Agreement distinguishes finite verbal forms from non-finite verbal forms in Oriya, although tense has extended functions in both finite as well as nonfinite constructions. Participials, gerundives, conditionals, infinitivals, telic affirmative affixes (Tel Aff) and conjunctive morphemes (CM), which lack agreement features are realized as non-finite verbal forms in Oriya. So, the classification of verbal forms can be shown in the language as follows [1]:

Vform

nonfinite finite

conjunctive conditional

gerundive infinitival

participial Tel Aff

Figure 1. The classification of verbal forms in

Oriya

The nonfinite verbal forms are realized by the suffixation of morphemes like the conjunctive morpheme -i, gerundive –ib-aa, participial –aa, ib-aa, il-aa, i/u-th-ib-aa conditional –ile, or infinitival -ib-aa-ku to the verbal root.

In a finite clause, the realization of the verbal root, Tense, and Agr is obligatory, while the realization of Asp, Aux, Modal or CM is optional. The sequence of items in

a finite verbal form can be shown as follows [1]:

(3) Root-(CM)-(Modal)-(Asp)-(Aux)-Tense-Agr

[2] also has proposed the same sequence of items but for CM and modal.

The telic affirmative affixes-Na, and -Ni contribute towards aspectual features of a verbal form. These morphemes indicate a strong sense of completion of the event, and thus, carry a subset of the features of the perfective aspectual morpheme i. They occur in the final position of the verbal form. Ni occurs in finite clauses while Na occurs in non-finite clauses. Ni does not occur in a NEG construction, while Na can occur in NEG constructions. Ni and the NEG marker ni are mutually exclusive and occur in the same positional slot in the construction.1

There is a rich structure in these morphological sequences, and in this paper we will model it by using a deterministic finite-state automaton. Such a morphological analyzer has to consider three main aspects ([3] Ritchie et al.,1992), [4]:

(4)

i) Morphographemics (also called morphophonology).

This term covers orthographic variations that occur

when linking morphemes.

ii) Morphotactics.

Specification of which morphemes can or cannot

combine with each other to form valid words.

iii) Feature-combination.

Specification of how these morphemes can be grouped and how their morphosyntactic features can be

combined.

As a consequence of the rich morphology of Oriya we control morphotactic phenomena, as much as possible, in the morphological segmentation phase. Alternatively, a model with minimal morphotactic treatment (Ritchie et al) would produce too many possible analyses after segmentation, which should be rejected in a second phase. The morphological analyzer created by (Ritchie et al) does not adopt finite state mechanisms to control morphotactic phenomena. Their two-level implementation incorporates a straightforward morphotactics, reducing the number of sublexicons to the indispensable (prefixes, lemmas and suffixes). This approximation would be highly inefficient for agglutinative languages like Oriya, as it would create many nonsensical interpretations that should be rejected by the system. Therefore, we separate sequential morphotactics (i.e., which sequences of morphemes can or cannot combine with each other to 1We do not discuss it in detail, as it is not directly relevant for our work here.

form valid words), which will be recognized by means of

continuation classes, and non-sequential morphotactics like long-distance dependencies that will be controlled by the word-grammar.

3. The Negative verb

In Oriya, negation can surface as an auxiliary verb, that is, the negative marker has some of the usual properties of a verb, such as (tense)2, Agr. The Oriya negative auxiliaries, naahin and nuhai / nuhen seem to be derived from Sanskrit naasti and na bhavati, respectively. They correspond to the Oriya copular auxiliaries achh and aT. Like achh and aT, they occur in finite constructions only and have regular conjugations in the present tense. Each of them has a separate conjugation and is not used for the other.

naahin ‘not to be’, or ‘not to remain’ is the negative correlate of the copular auxiliary achhi‘to be’, or ‘to remain’, and thus behaves the similar way as achhi. Like achhi,it can be used as a copular auxiliary (like a main verb) as well as an auxiliary affix. Consider the following: (5) aaji se juga naahin ki

today that age be NEG -3rd sg PRT

se raajaa naahaanti

that king be NEG [+Hon]3rd sg

‘Today that time is not there, nor that king.’

(6) se kheL-u-naahin

he play-PROG- be NEG 3rd sg

‘He is not playing’.

In (5), naahin and naahaanti are used as independent verbs, while in (6) naahin functions as an auxiliary affix.

nuhen (short for nuhai from na+huai) is solely a full verb (as opposed to a bound morpheme). That is, it can be used only as an independent copula. It is the negative correlate of the equative copula verb aTe or aTai.

When the predicate is an adjective and denotes something habitual, usually nuhen is used. E.g.

(7) mun andha nuhen

I blind be NEG 1st sg

‘I am not blind.’

(8) mo baapaa Daaktara nuhanti

my father doctor be NEG [+Hon]3rd sg

‘My father is not a doctor.’

(9) kaban paark maaDraasre nuhen, baangaalor-re

Cubbon park Madras-PP be NEG 3rd sg, Bangalore-PP ‘Cubbon park is not in Madras, but in Bangalore.’

2 The negative auxiliaries appear in present tense only. (10) himaaLaya bhaaratara purbare nuhen,

Himalaya India’s east-PP be NEG 3rd sg

utarare (aTe)

north-PP (be 3rd sg)

‘The Himalayas is not on the east of India, it is on the north.’

Note that although the affirmative copula aTe can be dropped, nuhen cannot be dropped:

(11) a. se chhataaTaa mora (aTe)

that umbrella mine (be 3rd sg)

‘That umbrella is mine.’

b. se chhataaTaa mora nuhen

that umbrella mine be NEG 3rd sg

‘That umbrella is not mine.’

So, we can say that although dropping of the affirmative copula is very common in Oriya, dropping of the negative copula is not allowed.

4. NEG affixes

In Oriya, negation can be marked by bound inflection on the verb. The NEG morpheme has various morphological realizations in various positions of the verbal form. In finite constructions, negation can be marked at the beginning, middle or at the end of the verbal form, by the morphemes na-, naahan and –ni/ naahin3, respectively.4na is used in finite as well as in nonfinite constructions, while the other two NEG markers are used in finite constructions only.

4.1 NEG marking in nonfinite verbal forms

In a nonfinite construction, the NEG morpheme occurs being prefixed to the verbal root. Consider the following examples.

(12) se nakhaai chaaligalaa

he NEG-eat-CM walk-CM-go-PAST-3rd sg

‘He went away without eating.’

(13) mun nakaripaarile aau

I NEG-do-CM-modal-COND more

kaNa karibi

what do-FUT 1st sg

‘What shall I do if I cannot!’

3ni is the contracted form of naahin.

4 In the case of verbal adjectives, the NEG marker a occurs being prefixed to the verbal root. E.g.

(1) a-jaNaa loka (2) a-sijhaa anDaa

NEG-known man NEG-boiled egg

‘Unknown person.’ ‘Unboiled egg.’

In (12)-(13), the NEG marker always occurs in a position immediately preceding the verbal root. It cannot occur in any other position of the verbal form.

4.2 NEG marking in finite verbal forms

Consider NEG marking in finite constructions. The NEG marker can occur in various positions of the verbal form.

NEG in the initial position:

NEG morpheme can occur being prefixed to the verbal root, e.g.

(14) se na-khaa-i-paar-e

s/he NEG-eat- CM-modal-AGR

‘S/he may not eat.’

NEG can occur immediately preceding the Aux:

(15) mun jaainathaanti

I go- ASP perf-NEG-AUX-TENSE hyp-AGR

‘I would not have gone.’

(16) se jaa-i-na-th-il-aa

he root-ASP perf-NEG-AUX-TENSE past-AGR

‘He had not gone.’

In the presence of a main verb, modal and an Aux, the NEG marker usually occurs in a position immediately preceding the Aux; e.g.

(17) *se nakhaa-i-paar-i-th-ant-aa

he NEG-eat- CM-can-ASP-AUX-TENSE-AGR

‘He could not have eaten.’

(18) se khaa-i-paar-i-na-th-ant-aa

he eat-CM-can-ASP-NEG-AUX-TENSE-AGR

‘He could not have eaten.’

NEG at the place of Aux:

As we discussed earlier, the NEG auxiliary occurs in the same positional slot as that of the Aux morpheme. Being the NEG -correlate of the copular auxiliary morpheme achh, it can be used in PRES tense only. As we discussed above in (6), this NEG marker naahin is the co-relate of the aux-affix (not aux copula), and thus, is realized as an affix. E.g.

(19) mun khaaunaahin

I eat-ASP-NEG-AGR

‘I am not eating.’

(20) tume khaaunaahan

you eat-ASP-NEG-AGR

‘You are not eating.’

(21) mun khaaipaarunaahin

I eat-CM-modal-ASP-NEG-AGR

‘I am not able to eat.’ (22) tume khaaipaarunaahan

you eat-CM-modal-ASP-NEG-AGR

‘You are not able to eat.’

NEG at the final position of the verbal form:

The NEG morpheme at the final position is realized as ni/naahin. E.g.

(23) semaane khaanti-ni/naahin

they eat-Tense-AGR-NEG

‘They do not eat.’

(24) se khaailaa-ni/naahin

he eat-Tense- AGR-NEG

‘He did not eat.’

(25) se khaaiba-ni/naahin

he eat-Tense- AGR-NEG

‘He will not eat.’

(26) mun khaaipaaribi-ni/naahin

I eat- CM-Mod-Tense- AGR-NEG

‘I cannot eat.’

Note that although it resembles the NEG Aux naahin, it is different from that. Compare (19)-(21) with (23)-(26). The NEG Aux realizes the Agr features in (19)-(21), which is not found in the case of the NEG affix as in (23)-(26).

However, in the presence of ni,the construction cannot have aspectual realization as ni does not co-occur with Asp (or Asp-Aux) morphemes. In the presence of an Asp (or Asp-Aux) morpheme in the verbal form, the other neg marker na is realized, not ni. E.g.

(27) a. se khaa-u-na-th-il-aa

s/he eat-Asp-NEG-AUX-TENSE-AGR

‘S/he was not eating.’

b. *se khaa-u-th-il-aa-ni

s/he eat-Asp-AUX-TENSE-AGR-NEG

‘S/he was not eating.’

(28) a. se khaa-i-na-th-ib-a

s/he eat-ASP-NEG -AUX-TENSE-AGR

S/he will not have eaten.’

b.*se khaa-i-th-ib-a-ni

s/he eat-ASP-AUX-Tense-AGR-NEG

‘S/he will not have eaten.’

It indicates that ni might be the negative correlate of the telic affirmative affix Ni, which also does not co-occur with an aspectual morpheme. Both Ni and ni occur in the same positional slot too.

5. Summary

Summarizing, in nonfinite verbal forms the NEG marker -na occurs invariably prefixed to the verbal root, while in finite verbal forms, NEG is marked in three different ways.

The co-occurrence restriction of the three NEG markers in finite verbal form can be listed as follows:

(29)

i) na being prefixed to the verbal root occurs only

in present tense, and the construction has an

epistemic modality interpretation.

ii) NEG Aux naahan occurs only in the present tense; and the NEG morpheme, being prefixed to

the Aux morpheme [na+aux morpheme], occurs

in all the other tenses

iii) ni/naahin does not co-occur with Asp-Aux morphemes.

In the following section, we will survey the kinds of morphological knowledge that needs to be represented to produce a well-formed verbal form in Oriya. For this purpose, we choose 'Finite State Automaton' for the computation of verbal forms.

6. A Deterministic Finite State Automaton

Since we cannot list every word in the language, computational lexicons are structured as a list of stems and affixes with a representation of the morphotactics. One way to model morphotactics is the finite-state automaton. We use a deterministic FSA to solve the problem of morphological recognition. It will determine whether an input string of morphemes makes up a legitimate Oriya negative verbal form or not.

6.1 The Machinery

A (deterministic) Finite State Automaton (FSA) is an abstract device that receives a string of symbols as input, reads the string one symbol at a time from left to right, and after reading the last symbol halts and indicates either acceptance or rejection of the input. The automaton performs computation by reacting on a class of inputs (on strings or sequences of symbols). It produces a class of outputs distinct from the inputs. The concept of a state is the central notion of an automaton. A state of an automaton is analogous to the arrangement of bits in the memory banks and registers of an actual computer. But here, as we are abstracting away from the physical realizations, we consider a state as a characteristic of an automaton which changes during the course of a computation and which serves to determine the relationship between inputs and outputs. For our automaton, the memory consists simply of the states themselves. The computations of an FSA are directed by a ‘program’, which is a finite state of instructions for changing from state to state as the automaton reads input symbols. Given an input, the computation begins in a designated state, the initial state. After reading the input, the automaton either accepts or rejects it after some finite amount of computation.

Thus, an FSA can be visualized as composed of

(30)

i) a control box, which at any point in the

computation can be in one of the allowed

internal states

ii) a reading head, which scans a single symbol of the input.

In a more formal way, a deterministic finite state automaton can be defined as follows [5], [6].

A (deterministic) finite-state automaton is a quintuple ( Q, |, q0, F, δ) where

- Q is a finite set of N states q0, q1, … , q N

- | is a finite input alphabet of symbols

- q0∈ Q is the initial state

- F ? Q, the set of final states

-δ(q,i) is the transition function or transition matrix between states. Given a state q ∈ Q and an input symbol i ∈|, δ(q,i) returns a new state q′∈ Q. δ is thus a relation from Q×| to Q.

Thus, if the automaton is in a state q ∈ Q and the symbol read from the input is a, then d (q,a) uniquely determines the state to which the automaton passes. This property entails high run-time efficiency, since the time it takes to recognize a string is linearly proportional to its length.

6.2 The FSA for Oriya

This section discusses how the FSA can be conceived as applying to Oriya verb forms. For finite and nonfinite constructions, we illustrate the process separately.

[The Figure 2 should be here.]

[The Figure 3.1, 3.2 and 3.3 should be here.]

The automaton is represented as a directed graph: a finite set of vertices (nodes), together with a set of directed links between pairs of vertices called arcs. Each node corresponds to a state. States are represented as circles with name tags in them. Arcs are represented by arrows going from one state to another state. The final states are represented by rectangles.

The machine starts at the initial state, runs through a sequence of states by computing a morpheme in each transition, and ends in the final state. The path moves from the initial point on the left to the final point on the right, proceeding in the direction of arrows. Once the arrow moves one step, there is no backward movement (Of course, recursion of an item can be shown by using closed loops). Each state through which the speaker passes represents the grammatical restrictions that limit the choice of the next morpheme. The resulting FSA is deterministic in the sense that given an input symbol and a current state, a unique next state is determined.

It starts at the initial state (Q0), checks the next morpheme of the input. If it matches the symbol on an arc leaving the current state, then it crosses that arc, and moves to the next state, and thus, advances one symbol in the input. Such a process gets iterated until the machine reaches the final state, successfully recognizing all the morphemes in the input string. But if the machine gets some input that does not match an arc, then it gets stuck there and never gets to the final state. This is considered as the FSA/machine rejecting or failing to accept an input.

For nonfinite constructions (cf. Figure 2), the FSA starts at the initial state (Q0). From the initial state it can choose the Root state directly or Root via the Neg state, depending on whether it is an affirmative or negative construction. From the Root state, it has various options to move to the next state: it can move to the CM final state, participial aa state, conditional ile state, conjunctive morpheme (CM) nonfinal state, Asp state, or Tense state, out of which the first three states are final states while the last three states are non-final states. From the CM nonfinal state, it can choose either Modal state or Tel Aff state (Na), which is a final state too. From the Modal state it chooses Asp state. This Asp state can be a final or a non-final state. If it is a final state, then it stops there, while in the case of a non-final state, it can traverse further. From the non-final Asp state, it can choose Aux state, and from Aux state, it moves to the Tense state. From the Tense state it can move to the participial state, which is a final state. Likewise, the FSA processes the verbal forms until it reaches the final state.

For implementation, we can test how a non-finite verbal form in the language be processed by this machine. Take a concrete example like (31):

(31) na-kar-i

NEG-root-CM

‘Not having done’

This negative verbal form can be processed as follows. It has 3 states. State 0 is the initial state and state 3 is the final state. It also has 3 transitions.

Q = {q0, q1, q2, q3}

| = {na, kar, i}

Q0= the initial state (IS)

F = { q3}

δ(q,i) can be defined by the transition table as follows: Table 1. The state transition table for

the FSA for na-kar-I

Input

State Na kar i

1

2

3:

1 ? ?

? 2 ?

? ? 3

? ? ?

In the transition table, state3 is marked with a colon to indicate that it is a final state. ? indicates an illegal or missing transition. It can be read as follows: “if we are in state 0 and we see the input na, we must go to the state 1. If we are in state 0 and we see the input kar or i, we fail.”

Similarly, the FSA computes the verbal forms in a finite construction. As we discussed earlier, in a finite construction, the NEG morpheme can occur in three possible positions and the occurrence of a NEG morpheme restricts the occurrence of any other Neg marker in the verbal form. But such mutual exclusiveness of the items creates problem for a deterministic FSA, as it cannot backtrack to account for it, if all the three NEG positions are available in a single chart, and may over generate. So, to avoid this, we have 3 charts for finite constructions (cf. Figure 3.1, 3.2 and 3.3), each showing a different position of the NEG morpheme in a verbal form. As the figures 2 and 3 show, the machine starts at the initial state and proceeds in the direction indicated by the arrows, computing the verbal forms successfully.

7. Conclusion

We specify the co-occurrence restrictions of the NEG morphemes in a verbal form and use the FSA to solve the problem of morphological recognition; determining whether an input string of morphemes makes up a legitimate Oriya word or not. Such a morphological analyzer will help us to build a computational lexicon structured as a list of stems and affixes with a representation of the morphotactics and also can be used for designing a morphosyntactic analysis for each word in unrestricted Oriya texts. The design of the deterministic FSA we propose is new for Oriya, as far as we know. We

think that our design could be interesting for the treatment of other agglutinative languages too.

References

[1] Sahoo, K. Oriya Verb Morphology and Complex Verb

Constructions.Ph.D dissertation. Norwegian

University of Science and Technology, Trondheim,

Norway. 2001.

[2] Nayak, R. Non-finite clauses in Oriya. Doctoral dissertation,

CIEFL, Hyderabad. 1987. [3] Ritchie G., S. G. Pullman, A. W. Black, G. J.Russel

Computational Morphology: Practical Mechanisms

for the English Lexicon. ACL-MIT Series on Natural

Language Processing, MIT Press. 1992.

[4] Sproat R. Morphology and Computation. ACL-MIT Press

series in Natural Language Processing. 1992.

[5] Jurafsky, D. & J. H. Martin. Speech and Language

Processing: An Introduction to Natural Language

Processing, Computational Linguistics, and Speech

Recognition. New Jersey: Prentice Hall. 2000.

[6] Roche, E. & Y. Schabes (eds.). Finite State Language

Processing. The MIT Press. 1997.

智能小车舵机控制精编版

智能小车舵机控制精编 版 MQS system office room 【MQS16H-TTMS2A-MQSS8Q8-MQSH16898】

1 //只利用一个定时器 T0,定时时间为,定义一个角度标识,数值为 1、2、3、4、5, //实现、1ms、、2ms、高电平的输出,再定义一个变量,数值最大为 40,实现周期为 20ms。 //每次进入定时中断,判断此时的角度标识,进行 //相应的操作。比如此时为 5,则进入的前 5 次中断期间,信号输出为高电平,即为的 //高电平。剩下的 35 次中断期间,信号输出为低电平,即为的低电平。这样总的时间 //是 20ms,为一个周期。 //用51板上s1和s2按键 //用P1^7输出 PWM信号控制舵机 #include "" unsigned char count; //次数标识 sbit pwm =P1^7 ; //PWM信号输出 sbit jia =P3^0; //角度增加按键检测IO口 sbit jan =P3^1; //角度减少按键检测IO口 sbit jianwei=P3^4; //按键位 unsigned char jd; //角度标识 sbit dula=P2^6; sbit wela=P2^7; unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d, 0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e void delay(unsigned char i)//延时 { unsigned char j,k; for(j=i;j>0;j--) for(k=125;k>0;k--); } void Time0_Init() //定时器初始化 { TMOD = 0x01; //定时器0工作在方式1 IE= 0x82; TH0= 0xfe; TL0= 0x33; //晶振, TR0=1; //定时器开始 } void Time0_Int() interrupt 1 //中断程序 { TH0 = 0xfe; //重新赋值 TL0 = 0x33; if(count

智能车舵机PD运算

/**********************舵机增量式PID算法*********************** double ref = 0;//设置参数设定值 double feb = 0;//采样反馈过程值 int pwm_var = 0; //PID调整量 int PWM_out = 0; //PWM输出量 double Uo = 0; double Ek = 0; double Ei = 0; double Ed = 0; #define Kp 8 //PID调节的比例常数 #define Ti 0.05 //PID调节的积分常数 #define Td 0.02 //PID调节的微分时间常数 #define T 0.02 //采样周期 #define Kpp Kp * ( 1 + (T / Ti) + (Td / T) ) #define Ki (-Kp) * ( 1 + (2 * Td / T ) ) #define Kd Kp * Td / T //#define Kpp 4 //#define Ki 0.8 //#define Kd 20 //误差的阀值,小于这个数值的时候,不做PID调整,避免误差较小时频繁调节引起震荡 #define Emin 3 //调整值限幅,防止积分饱和 #define Umax 100 #define Umin -100 //输出值限幅 #define Pmax 15500 #define Pmin 200 /////////////////////////////////////////////////////////////////// ////// PID运算 ///////

智能车中的舵机入门

单片机控制舵机 修改浏览权限 | 删除.什么是舵机: 舵机如下所示: 有三根线,一般依次是地,电源(5V左右),信号(信号的幅值>=3.3V),不清楚各个脚打开舵机一测量就知道了。 2.其工作原理是: 控制信号由接收机的通道进入信号调制芯片,获得直流偏置电压。它内部有一个基准电路,产生周期为20ms,宽度为1.5ms的基准信号,将获得的直流偏 置电压与电位器的电压比较,获得电压差输出。最后,电压差的正负输出到电机驱动芯片决定电机的正反转。当电机转速一定时,通过级联减速齿轮带动电位器旋转,使得电压差为0,电机停止转动。当然我们可以不用去了解它的具体工作原理,知道它的控制原理就够了。就象我们使用晶体管一样,知道可以拿它来做开关管或放大管就行了,至于管内的电子具体怎么流动是可以完全不用去考虑的。 3.舵机的控制: 舵机的控制一般需要一个20ms左右的时基脉冲,该脉冲的高电平部分一般为 0.5ms~2.5ms范围内的角度控制脉冲部分。以180度角度伺服为例,那么对应的控制关 系是这样的: 0.5ms--------------0度;

1.0ms------------45度; 1.5ms------------90度; 2.0ms-----------135度; 2.5ms-----------180度; 重要说明: 1:上面部分还是成线形关系的,Y=90X-45(X单位是ms,Y单位是度数:) 2:上面所说的0度45度等是指度45度位置(什么意思呢:我说明一下就知道了,就拿45度位置来说,若舵机停在0度位置,下载45度位置程序后则舵机停在45度,即顺时针走了45度,若当时舵机在135度位置,则反转90度到45度位置。所以舵机不存在正转反转问题。这点非常重要。 3:若想转动到45度位置,要一直产生1.0ms的高电平(即PA0=1; Delay(1ms);PA0=0;Delay(20ms);要不停的产生这个高低电平,产生PWM脉冲 请看下形象描述吧: 下面是我在ATMEGA32上的测试程序,开发软件:ICC AVR #include typedef struct BYTE_BIT { unsigned BIT0:1; unsigned BIT1:1; unsigned BIT2:1;

51红外循迹小车报告(舵机版)最终版

简易教程

前言 往届全国大学生电子设计竞赛曾多次出现了集光、机、电于一体的简易智能小车题目,此次,笔者在通过多次论证、比较与实验之后,制作出了简易小车的寻迹电路系统。 整个系统基于普通玩具小车的机械结构,利用小车的底盘、前后轮电机及其自动复原装置,能够平稳跟踪路面黑色轨迹运行。系统分为检测、控制、驱动三个模块。首先利用光电对接收管和路面信号进行检测,然后经过比较器处理,对软件控制模块进行实时控制,输出相应的信号给驱动芯片驱动电机转动,从而控制整个小车的运动。 智能小车能在画有黑线的白纸“路面”上行驶,这是由于黑线和白纸对光线的反射系数不同,小车可根据接收到的反射光的强弱来判断“道路”---黑线,最终实现简单的循迹运动。 个人水平有限,有错误不足之处,还望各位前辈同学多多包含,指出修正,完善。谢谢! 李学云王维 2016年7月27号

目录 前言 (1) 第一部分硬件设计 (1) 1.1 车模选择 (1) 1.2传感器选择 (1) 1.3 控制模块选择 (2) 第二部分软件设计及调试 (3) 2.1 开发环境 (3) 2.2总体框架 (3) 2.3 舵机程序设计与调试 (3) 2.3.1 程序设计 (3) 2.3.2 调试 (3) 2.3.3 程序代码 (4) 2.4 传感器调试 (5) 2.4.1 传感器好坏的检测 (5) 2.4.2 单片机能否识别信号并输出信号 (5) 2.5 综合调试 (7) 附录1 (9) 第一篇舵机(舵机及转向控制原理) (9) 1.1概述 (9) 1.2舵机的组成 (10) 1.3舵机工作原理 (11) 1.4舵机使用中应注意的事项 (12) 1.5如何利用程序实现转向 (12) 1.6舵机测试程序 (13) 附录2 (14) 第二篇光电红外传感器 (14) 2.1传感器的原理 (14) 2.2红外光电传感器ST188 结构图 (15) 2.3传感器的选择 (15) 2.4传感器的安装 (16) 2.5使用方法 (16) 2.7红外传感器输入输出调试程序 (17)

飞思卡尔--智能车舵机讲解

飞思卡尔--智能车舵机讲解

2.2 舵机的安装 完成了玩具车的拆卸之后要做的第二步就是安装舵机,现在市场上卖的玩具车虽然也具有转向 功能,但是前轮的转向多是依靠直流电机来驱动,无论向哪个方向转都是一下打到底,无法控制转 过固定的角度,因此根据我们的设计需求,需要将原有的转向部分替换成现有的舵机,以实现固定 转角的转向。舵机的实物图如图 2.1所示。 需要说明的是由于小车系玩具车改装,在安装舵机是需要合理的利用小车的结构,将舵机安装 牢固,同时还需注意合理利用购买舵机是附赠的齿轮,从而将舵机固定在合适的位置。舵机的安装 方式有俯式、卧式多种,不同的安装方法力臂长短、响应速度都有所不同,这一点请自己根据实际 情况合理选择,图 2.2 为舵机的安装图。 5

图 2.1 舵机实物图图 2.2 舵机安装图 舵机安装过程中有一点需要尤其注意,由于舵机不是360°可转的,因此必须保证车轮左右转 的极限在舵机的转角范围之内。 舵机安装完毕之后就可以对小车的转角进行控制了,但是由于玩具车的车体设计往往限制了小 车的转角,因此可以对小车进行局部的“破坏”来增大前轮的转角,要知道在比赛中追求速度的同 时一个大的转角对小车的可控性会有一个很大的提升,如图2.3 所示,就是对增加小车转角的一个 改造,这是我在去年小车比赛中的用法。将阻碍前轮转角的一部分用烙铁直接烫掉。 但是这种做法也有风险,由于你的改造会破坏小车的整体 7

结构,有可能会对小车的硬件结构造 成破坏,因此如果你的小车在改造之后显得过于脆弱的话那你就要对你的小车采取些加固措施了。 3.4 舵机转向模块设计 舵机是小车转向的控制机构,具有体积小、力矩大、外部机械设计简单、稳定性高等特 点,无论是在硬件还是软件舵机设计是小车控制部分的重要组成部分,舵机的主要工作流程 为:控制信号→控制电路板→电机转动→齿轮组减速→舵盘转动→位置反馈电位计→控制电路板反馈。图 3.11 为舵机的实物图。 7

飞思卡尔 智能车舵机控制

智能车的制作中,看经验来说,舵机的控制是个关键.相比驱动电机的调速,舵机的控制对于智能车的整体速度来说要重要的多. PID算法是个经典的算法,一定要将舵机的PID调好,这样来说即使不进行驱动电机的调速(匀速),也能跑出一个很好的成绩. 机械方面: 从我们的测试上来看,舵机的力矩比较大,完全足以驱动前轮的转向.因此舵机的相应速度就成了关键.怎么增加舵机的响应速度呢?更改舵机的电路?不行,组委会不允许.一个非常有效的办法是更改舵机连接件的长度.我们来看看示意图: 从上图我们能看到,当舵机转动时,左右轮子就发生偏转.很明显,连接件长度增加,就会使舵机转动更小的转角而达到同样的效果.舵机的特点是转动一定的角度需要一定的时间.不如说(只是比喻,没有数据),舵机转动10度需要2ms,那么要使轮子转动同样的角度,增长连接件后就只需要转动5度,那么时间是1ms,就能反应更快了.据经验,这个舵机的连接件还有必要修改.大约增长0.5倍~2倍. 在今年中,有人使用了两个舵机分别控制两个轮子.想法很好.但今年不允许使用了.

接下来就是软件上面的问题了. 这里的软件问题不单单是软件上的问题,因为我们要牵涉到传感器的布局问题.其实,没有人说自己的传感器布局是最好的,但是肯定有最适合你的算法的.比如说,常规的传感器布局是如下图: 这里好像说到了传感器,我们只是略微的一提.上图只是个示意图,意思就是在中心的地方传感器比较的密集,在两边的地方传感器比较的稀疏.这样做是有好处的,大家看车辆在行驶到转弯处的情况: 相信看到这里,大家应该是一目了然了,在转弯的时候,车是偏离跑道的,所以两边比较稀疏还是比较科学的,关于这个,我们将在传感器中在仔细讨论。 在说到接下来的舵机的控制问题,方法比较的多,有人是根据传感器的状态,运用查表法差出舵机应该的转角,这个做法简单,而且具有较好的滤波"效果",能够将错误的传感器状态滤掉;还有人根据计算出来的传感器的中心点(比

关于智能车舵机

伺服马达原理与控制, 模拟舵机和数字舵机的区别, 以及常见问题解决 伺服马达原理与控制 1、伺服马达内部结构 伺服马达内部包括了一个小型直流马达;一组变速齿轮组;一个反馈可调电位器;及一块电子控制板。其中,高速转动的直流马达提供了原始动力,带动变速(减速)齿轮组,使之产生高扭力的输出,齿轮组的变速比愈大,伺服马达的输出扭力也愈大,也就是说越能承受更大的重量,但转动的速度也愈低 伺服马达内部结构图 2、伺服马达的工作原理 伺服马达是一个典型闭环反馈系统,其原理可由下图表示:

伺服马达工作原理图 减速齿轮组由马达驱动,其终端(输出端)带动一个线性的比例电位器作位置检测,该电位器把转角坐标转换为一比例电压反馈给控制线路板,控制线路板将其与输入的控制脉冲信号比较,产生纠正脉冲,并驱动马达正向或反向地转动,使齿轮组的输出位置与期望值相符,令纠正脉冲趋于为0,从而达到使伺服马达精确定位的目的。 3、如何控制伺服马达 标准的微型伺服马达有三条控制线,分别为:电源、地及控制。电源线与地线用于提供内部的直流马达及控制线路所需的能源,电压通常介于4V—6V之间,该电源应尽可能与处理系统的电源隔离(因为伺服马达会产生噪音)。甚至小伺服马达在重负载时也会拉低放大器的电压,所以整个系统的电源供应的比例必须合理。 输入一个周期性的正向脉冲信号,这个周期性脉冲信号的高电平时间通常在1ms—2ms 之间,而低电平时间应在5ms到20ms之间,并不很严格,下表表示出一个典型的20ms周期性脉冲的正脉冲宽度与微型伺服马达的输出臂位置的关系:

4、伺服马达的电源引线 电源引线有三条,如图中所示。伺服马达三条线中白色的线是控制线,接到控制芯片上。中间的是SERVO工作电源线(红色),一般工作电源是5V。第三条是地线。 5、伺服马达的运动速度 伺服马达的瞬时运动速度是由其内部的直流马达和变速齿轮组的配合决定的,在恒定的电压驱动下,其数值唯一。但其平均运动速度可通过分段停顿的控制方式来改变,例如,我们可把动作幅度为90o的转动细分为128个停顿点,通过控制每个停顿点的时间长短来实现0o—90o变化的平均速度。对于多数伺服马达来说,速度的单位由“度数/秒”来决定。 6、使用伺服马达的注意事项 除非你使用的是数码式的伺服马达,否则以上的伺服马达输出臂位置只是一个不准确的大约数。 普通的模拟微型伺服马达不是一个精确的定位器件,即使是使用同一品牌型号的微型伺服马达产品,他们之间的差别也是非常大的,在同一脉冲驱动时,不同的伺服马达存在±10o 的偏差也是正常的。 正因上述的原因,不推荐使用小于1ms及大于2ms的脉冲作为驱动信号,实际上,伺服马达的最初设计表也只是在±45o的范围。而且,超出此范围时,脉冲宽度转动角度之间

智能小车舵机控制

// 只利用一个定时器T0 ,定时时间为,定义一个角度标识,数值为1 、2、3、4、5,// 实现、1ms、、2ms、高电平的输出,再定义一个变量,数值最大为40 ,实现周期为// 每次进入定时中断,判断此时的角度标识,进行 // 相应的操作。比如此时为5 ,则进入的前5 次中断期间,信号输出为高电平,即为 // 高电平。剩下的35 次中断期间,信号输出为低电平,即为的低电平。这样总的时间// 是 20ms,为一个周期。 // 用51 板上s1 和s2 按键 // 用P1^7 输出PWM信号控制舵机 #include "" sbit dula=P2^6; sbit wela=P2^7; unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d, 0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e void delay(unsigned char i)// { unsigned char j,k; for(j=i;j>0;j--) for(k=125;k>0;k--); } void Time0_Init() // { TMOD = 0x01; // IE= 0x82; TH0= 0xfe; TL0= 0x33; // TR0=1; // } void Time0_Int() interrupt 1 // { TH0 = 0xfe; // TL0 = 0x33; if(count

智能小车循迹(舵机版)

#include #include #define uchar unsigned char #define uint unsigned int void scan(); void init_time0(); void Direction(uchar jd); void DELAY(uint xms); void pwm_ENA(uchar k); sbit l_1=P1^0; sbit l_2=P1^1; sbit l_3=P1^2; sbit cen=P1^3; sbit r_1=P1^6; sbit r_2=P1^5; sbit r_3=P1^4; sbit duoji=P2^7; sbit pwm1=P2^0; sbit pwm2=P2^1; uchar count,cycle,jd; uchar flag=0; void main() { DELAY(3000); P1=0x00; cycle=0; count=0; jd=12; init_time0(); while(1) { scan(); } } void scan() { if(cen==0) //中 { flag=0; } else if(r_1==0) //右1

{ flag=1; } else if(r_2==0) //右2 { flag=2; } else if(r_3==0) //右3 P14 { flag=3; } else if(l_1==0) //左1 { flag=4; } else if(l_2==0) //左2 P11 { flag=5; } else if(l_3==0) //左3 P12 { flag=6; } switch(flag) { case 0: {Direction(12);pwm_ENA(5);break;} // P13 case 1: {Direction(15);pwm_ENA(3);break;} // delay(1);;pwm_ENA1(1) P16 case 2: {Direction(14);pwm_ENA(3);break;} // P15 case 3: {Direction(13);pwm_ENA(4);break;} //run()run() P14 case 4: {Direction(9);pwm_ENA(3);break;} // delay(1) pwm_ENA1(1); P10 case 5: {Direction(10);pwm_ENA(3);break;} // P11

飞思卡尔智能车入门指南

飞思卡尔智能车入门指南 概述 智能车巡线是一个半实时随动系统。系统不断传感前方赛道的信息,根据赛道偏转情况计算前轮转向角度,再配合后轮的动力,达到巡线的目的。如下图: 该系统主要涉及知识领域有:单片机、传感器、电机、舵机、电路等,附带着涉及到一些调试手段知识。以下就从这几方面简要介绍。 速度控制 给电机加一个恒定的电压,电机最终会以某个恒定速度转动。适当增加电压,电机速度会加快,最终稳定在一个更快的速度。故调节电机所加电压即可调节电机转速。由于单片机是数字电路,只能控制电压为“有”或“无”,于是我们让电压在“有”和“无”之间反复跳动,那么电压的有效值在电池电压到0之间可连续变化。实际加载在电机上的电压是一个方波,方波的高电平时间长度比方波周期为占空比,占空比越高电压的有效值越高。100%占空比相当于电池直接接在电机上,0%占空比相当于断路,0~100%相当于降压。 单片机普通输出口只能提供小电流的信号电,无法给电机提供功率,故使用MOS管。用单片机的信号控制MOS管的通断,起到开关的作用。开关串联在电池与电机之间,即可给电机提供功率。 单片机方波信号的频率一般在K的数量级(1000Hz)。假设现在给电机50%占空比的方波,信号频率为1K,电机以某个恒定速度转动。适当改变信号周期会发现电机转速略有变化。信号频率很小(例如几十赫兹)或者很大(例如几兆赫兹)时,电机转速会较慢,在某个适中的值时速度达到最大值。此时电机能量转化效率最高。此时固定信号频率不变,改变信号占空比,电机转速和占空比基本成正比。 若以恒定占空比驱动电机,在负载发生变化时,电机速度也会发生变化。若希望电机负载变化而电机仍能匀速转动,应采用闭环控制。给电机安装速度传感器(例如:光电编码器),每隔固定的时间检测光电编码器旋转的圈数(例如:每10ms检测一次光电编码器在过去的10ms内旋转了多少圈),该圈数即可换算成速度。当发现实际转速比目标转速慢时,适当增

智能小车舵机控制

智能小车舵机控制 Company Document number:WTUT-WT88Y-W8BBGB-BWYTT-19998

1 //只利用一个定时器 T0,定时时间为,定义一个角度标识,数值为 1、2、3、4、5, //实现、1ms、、2ms、高电平的输出,再定义一个变量,数值最大为 40,实现周期为 20ms。 //每次进入定时中断,判断此时的角度标识,进行 //相应的操作。比如此时为 5,则进入的前 5 次中断期间,信号输出为高电平,即为的 //高电平。剩下的 35 次中断期间,信号输出为低电平,即为的低电平。这样总的时间 //是 20ms,为一个周期。 //用51板上s1和s2按键 //用P1^7输出 PWM信号控制舵机 #include "" unsigned char count; //次数标识 sbit pwm =P1^7 ; //PWM信号输出 sbit jia =P3^0; //角度增加按键检测IO口 sbit jan =P3^1; //角度减少按键检测IO口 sbit jianwei=P3^4; //按键位 unsigned char jd; //角度标识 sbit dula=P2^6; sbit wela=P2^7; unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,

0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e void delay(unsigned char i)//延时 { unsigned char j,k; for(j=i;j>0;j--) for(k=125;k>0;k--); } void Time0_Init() //定时器初始化 { TMOD = 0x01; //定时器0工作在方式1 IE= 0x82; TH0= 0xfe; TL0= 0x33; //晶振, TR0=1; //定时器开始 } void Time0_Int() interrupt 1 //中断程序 { TH0 = 0xfe; //重新赋值 TL0 = 0x33; if(count

舵机工作原理详解及智能车单片机(飞思卡尔)控制的实现(程序)

舵机工作原理详解及单片机(飞思卡尔和51)控制的实现(程序) 1、概述 舵机最早出现在航模运动中。在航空模型中,飞行机的飞行姿态是通过调节发动机和各个控制舵面来实现的。举个简单的四通飞机来说,飞机上有以下几个地方需要控制: 1.发动机进气量,来控制发动机的拉力(或推力); 2.副翼舵面(安装在飞机机翼后缘),用来控制飞机的横滚运动; 3.水平尾舵面,用来控制飞机的俯仰角; 4.垂直尾舵面,用来控制飞机的偏航角; 遥控器有四个通道,分别对应四个舵机,而舵机又通过连杆等传动元件带动舵面的转动,从而改变飞机的运动状态。舵机因此得名:控制舵面的伺服电机。 不仅在航模飞机中,在其他的模型运动中都可以看到它的应用:船模上用来控制尾舵,车模中用来转向等等。由此可见,凡是需要操作性动作时都可以用舵机来实现。 2、结构和控制 一般来讲,舵机主要由以下几个部分组成,舵盘、减速齿轮组、位置反馈电位计5k、直流电机、控制电路板等。 工作原理:控制电路板接受来自信号线的控制信号(具体信号待会再讲),控制电机转 动,电机带动一系列齿轮组,减速后传动至输出舵盘。舵机的输出轴和位置反馈电位计是相连的,舵盘转动的同时,带动位置反馈电位计,电位计将输出一个电压信号到控制电路板,进行反馈,然后控制电路板根据所在位置决定电机的转动方向和速度,从而达到目标停止。舵机的基本结构是这样,但实现起来有很多种。例如电机就有有刷和无刷之分,齿轮有塑料和金属之分,输出轴有滑动和滚动之分,壳体有塑料和铝合金之分,速度有快速和慢速之分,体积有大中小三种之分等等,组合不同,价格也千差万别。例如,其中小舵机一般称作微舵,同种材料的条件下是中型的一倍多,金属齿轮是塑料齿轮的一倍多。需要根据需要选用不同类型。

智能小车舵机控制

1 //只利用一个定时器 T0,定时时间为,定义一个角度标识,数值为 1、2、3、4、5, //实现、1ms、、2ms、高电平的输出,再定义一个变量,数值最大为 40,实现周期为 20ms。//每次进入定时中断,判断此时的角度标识,进行 //相应的操作。比如此时为 5,则进入的前 5 次中断期间,信号输出为高电平,即为的 //高电平。剩下的 35 次中断期间,信号输出为低电平,即为的低电平。这样总的时间 //是 20ms,为一个周期。 //用51板上s1和s2按键 //用P1^7输出 PWM信号控制舵机 #include "" unsigned char count; //次数标识 sbit pwm =P1^7 ; //PWM信号输出 sbit jia =P3^0; //角度增加按键检测IO口 sbit jan =P3^1; //角度减少按键检测IO口 sbit jianwei=P3^4; //按键位 unsigned char jd; //角度标识 sbit dula=P2^6; sbit wela=P2^7; unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d, 0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e void delay(unsigned char i)//延时 { unsigned char j,k; for(j=i;j>0;j--) for(k=125;k>0;k--); } void Time0_Init() //定时器初始化 { TMOD = 0x01; //定时器0工作在方式1 IE= 0x82; TH0= 0xfe; TL0= 0x33; //晶振, TR0=1; //定时器开始 } void Time0_Int() interrupt 1 //中断程序 { TH0 = 0xfe; //重新赋值 TL0 = 0x33; if(count

飞思卡尔智能车制作全过程---舵机篇

飞思卡尔智能车制作全过程---舵机篇 智能车的制作中,看经验来说,舵机的控制是个关键.相比驱动电机的调速,舵机的控制对于智能车的整体速度来说要重要的多. PID算法是个经典的算法,一定要将舵机的PID调好,这样来说即使不进行驱动电机的调速(匀速),也能跑出一个很好的成绩. 机械方面: 从我们的测试上来看,舵机的力矩比较大,完全足以驱动前轮的转向.因此舵机的相应速度就成了关键.怎么增加舵机的响应速度呢?更改舵机的电路?不行,组委会不允许.一个非常有效的办法是更改舵机连接件的长度.我们来看看示意图: 从上图我们能看到,当舵机转动时,左右轮子就发生偏转.很明显,连接件长度增加,就会使舵机转动更小的转角而达到同样的效果.舵机的特点是转动一定的角度需要一定的时间.不如说(只是比喻,没有数据),舵机转动10度需要2ms,那么要使轮子转动同样的角度,增长连接件后就只需要转动5度,那么时间是1ms,就能反应更快了.据经验,这个舵机的连接件还有必要修改.大约增长0.5倍~2倍. 在今年中,有人使用了两个舵机分别控制两个轮子.想法很好.但今年不允许使用了.

接下来就是软件上面的问题了. 这里的软件问题不单单是软件上的问题,因为我们要牵涉到传感器的布局问题.其实,没有人说自己的传感器布局是最好的,但是肯定有最适合你的算法的.比如说,常规的传感器布局是如下图: 这里好像说到了传感器,我们只是略微的一提.上图只是个示意图,意思就是在中心的地方传感器比较的密集,在两边的地方传感器比较的稀疏.这样做是有好处的,大家看车辆在行驶到转弯处的情况: 相信看到这里,大家应该是一目了然了,在转弯的时候,车是偏离跑道的,所以两边比较稀疏还是比较科学的,关于这个,我们将在传感器中在仔细讨论。 在说到接下来的舵机的控制问题,方法比较的多,有人是根据传感器的状态,运用查表法差出舵机应该的转角,这个做法简单,而且具有较好的滤波"效果",能够将错误的传感器状态滤掉;还有人根据计算出来的传感器的中心点(比

相关文档
最新文档