라인 트레이서 - 세미나 (광운대 바람 박성우님)

41
바람 24기 박성우 Line Tracer

Upload: naver-d2

Post on 07-Jan-2017

2.032 views

Category:

Technology


3 download

TRANSCRIPT

바람 24기 박성우

Line  Tracer

목차

o Line  Tracer란?o Line  Tracer  모터선정o Sensor  Control

n 정규화

n 가중치

o Controlo PID  Controller

n PD  위치제어기n PI  속도제어기

o Line  Tracer  구동알고리즘

Line  Tracer란?o Line  Tracer  :  라인을 따라주행하는모바일로봇

Line  Tracer란?  <비교>

Line  Tracer란?  <비교>

Line  Tracer란?

Sensor

Position  Control

Motor

Speed  Control

+

Line Tracer

Line  Trace  모터선정

Or

Planetary Geared Motor with Encoder

Planetary Geared Motor

Line  Trace  모터선정

Sensor  Control

Sensor  Control

0 1 2 3 4 5 6 7

0 0 0 0 1 1 0 0

수광부

Line

센서값

- Case By Case형식-각 Case에 따른 가중치를 준다.-주행이 매끄럽지 못하여 고속 주행이 어렵다.

<Non-Linear>

o Non  Liner의 경우

Sensor  Control

정규화

가중치

Sensor  Controlo 정규화

n 일정하지않은 Data들의형태를맞추는과정

n LineTracer가주행하는환경에따른센서값이다르며각센서마다의값도다르기때문에사용.

MIN MAX

ADC0 10 80

ADC1 6 90

Sensor  Controlo

Sensor  Controlo 가중치

n LineTracer가안정적으로돌도록하기위해서각센서값에해당하는가중치를곱하여주는것.

가중치

Sensor  Controlo 가중치

n LineTracer가안정적으로돌도록하기위해서각센서값에해당하는가중치를곱하여주는것.

-­8 -­4 -­2 -­1 1 2 4 8가중치

Sensor  Controlo 가중치

Sensor  Controlo

Controlo ON/OFF Control

n 단순한 ON/OFF제어의경우 Control  Output의변화가크다n Control  Output  이 Target에대해진동하는특징

Controlo P  Control  (Proportional  Control)

n Error에비례한제어n ON,OFF제어보다 Target에대한가까운수렴이가능n Steady  State  Error  발생

Controlo P  Control  (Proportional  Control)

P gain 10 P gain 30

Controlo PI  Control  (Proportional   Integral  Control)

n P제어만했을경우,  Target에가까워지지만 Control  Output과Target이완전히일치하지않는다.(Steady  State  Error발생)

n P제어에서생기는 Steady  State  Error를시간적으로누적,Control  Output을증가하여 Steady  State  Error를줄인다.  

n Transient  Response  이악화되는경향이있다.

Controlo PI  Control  (Proportional   Integral  Control)

P gain 10 I gain 2 P gain 10 I gain 5

Controlo PD  Control  (Proportional  Differential  Control)

n 오차가변화하는비율에따라서비례하는제어

n D제어단독으로사용하지않고 P제어혹은 I제어와함께사용한다.n Target에수렴하는속도를향상시키지만발산가능성이존재

Controlo PD  Control  (Proportional  Differential  Control)

P gain 10 D gain 1 P gain 10 D gain 5

Controlo PID  Control(Proportional   Integral  Differential  Control)

n PI제어로실제 Target에가깝게하는제어는완벽하게할수있다.  하지만수렴하는데일정한시간(시정수)이필요.→ 제어 응답속도를줄여줄수있는 D제어기를추가

n 처음에는 Over  Drive하는 듯이제어하여,  신속하게목표값에수렴하도록제어한다.→ Transient  Response,  Steady  State  Error  모두개선이가능한제어기

Controlo 정리

장점 단점

P제어 Target수렴정확도향상 Steady State  Error  발생

PI제어 정확한 Target수렴 Overshoot발생

PD제어 수렴속도향상 발산가능성

PID제어 안정적인제어

Controlo 정리

PID  Controllero PID  Controller란?

n 비례-­적분-­미분제어기(PID  제어기)  는실제응용분야에서가장많이사용되는대표적인형태의제어기.

n 어떠한목표값에 System이수렴하여야하는경우사용.

PID  Controller

PID  Controllero PD  위치제어기

n Line  Tracer의중앙이 Line에 수렴하도록하기위하여PD위치제어기를사용.

PD_Control  =  Kp  x  Error  +  Kd  x  (Error  – Pre_Error)

-­ Error  =  Reference  – SensorData

-­ Pre_Error  =  이전주기의에러값

PID  Controllero PI  속도제어기

n Line  Tracer의각모터가목표한속도로회전하도록하기위해사용하는제어기

n 각모터의엔코더값을카운트하고이를현재값으로사용

PI_Control =  Kp x  Error  +  Ki  x  Error_Sum +  Pre_Control

-­ Error  =  Reference  – Encoder_Count-­ Error_Sum +=  (Error)  x  (delta_time)

*delta_time :  시간변화량*Pre_Control : 이전주기의조작량

-­ Error_Sum에대한제한이필요

PID  Controllero Encoder

PID  Controllero Incremental  Encoder

PID  Controllero Incremental  Encoder

n 모터의속도나회전량을펄스로만들어출력하는센서.n A상,  B상으로두개의펄스를출력하며각펄스는 90도위상차를지님.

PID  Controllero Absolute  Encoder

PID  Controllero Absolute  Encoder

중심에 가까운 쪽 MSB (최대단위 BIT)제일 바깥쪽 LSB(최소단위 BIT)

->한개만 읽어도 현재 각도를 알 수 있다.

Line  Tracer구동알고리즘o Line  Tracer  구동알고리즘

n Line  Tracer의중심이 Line의 중심을따라간다.n Line이왼쪽으로벗어나면왼쪽모터를빠르게돌리고우측모터를느리게돌려 LineTracer가중심을찾도록한다.

Line Sensing

Line  Tracer구동알고리즘o 1.  정규화,  IF문을 사용한 Line  Tracer  구동알고리즘

0 1 2 3 4 5 6 7

0 0 0 0 1 1 0 0

수광부

Line

이진화된정규화값

if(Sensor_Value == 0b00001100){OCR1A = 400;OCR1B = 300;

}

Line  Tracer구동알고리즘o 2.  Sensor  Control과 PD위치제어기를 사용한구동알고리즘

Sensor Control

PD Controller

Line Sensing

ADC 값

현재 Line 위치

PWM Duty

Line  Tracer구동알고리즘o 3.  Sensor  Control과 PD위치제어기,  PI속도제어기를사용한구동알고리즘

Sensor Control

PD Controller

Line Sensing

ADC 값

현재 Line 위치

PI ControllerPI Controller

목표 각속도

Encode펄스

PWM Duty

Q  /  A