출처 : 네이버 지식인.

 


 LMS(Least Mean Square)

 

이 방법은 많은 데이터가 주어졌을때 그 데이터들이 이루는 그래프를

 

산출해내기 위하여 사용하는 방법들 중 하나입니다.

 

즉 2차원 데이터들이 다음과 같이 주어졌다고 하면

 

(1,2) (2,5) (3,8) (4,10) (5,14)

 

이들이 이루는 1차원 직선을 찾고 싶다면 다음과 같이 가정합니다.

 

y=ax

 

이 그래프에 위의 5개의 데이터를 대입하여 a를 찾아내고

 

그 오차가 가장 적은 a를 선택하는 방법이 LMS입니다.,


이제, 예를 들어 보겠습니다.




출처: WiKi 


위 그래프는 위키 백과에서 회귀 분석을 설명할때 사용된 그림입니다.

파란색의 점들이 각각의 샘플들이라면, 이들의 경향성을 따라서 직선을 그은것이 바로 위에서 설명한 LMS 수식으로 표현것입니다. 즉, 아주 간단한 근사화 방법으로써 실제로 많이 쓰이지만 그렇게 정확도가 높지는 않습니다.


이러한 데이터 혹은 샘플 혹은 어떠한 분포도를 하나의 수식으로 표현하기 위해서, 이를 모델화 한다고 합니다. 모델은 우리가 원하는 물리적인 현상을 잘 반영해야 합니다. 하지만 분명 오차가 발생하기 때문에, 이를 최소자승법을 통하여 원하는 결과값이 나오도록 하는 오류를 최소화 하는 변수값을 알아내는것이 핵심입니다. 

이를 식으로 다시 이야기 해보겠습니다.

참조 : The Method of Least Squares of Steven J. Miller∗


앞서 보여드린 그림에서 각 점들은 x,y축의 좌표값을 가진 데이터라고 가정한다면, (x1,y1) ,....(xn,yn)으로 표현이 가능합니다. 그리고 이 값들의 분포를 나타내기 위한 직선의 방정식으로 y=ax + b 을 사용할수 있습니다.

이때의 a,b는 x,y의 경향성을 가장 잘 표현할수있는 그래서 오류를 최소화하는 어떤 값이라 할수있습니다.


그리고 이를 효과적으로 계산하기위해서는 몇가지 방법들이 존재합니다.

http://darkpgmr.tistory.com/56

위의 블로그에 가사면 좀더 자세히 계산법, 적용의 예, 한계 까지 모두 포스팅이 되어있으므로 생략하겠습니다.



 




'N.&C. > Optimization' 카테고리의 다른 글

A Tutorial on Cross-Layer Optimization in Wireless Networks  (0) 2013.07.23
[Lagrangian] 라그랑지언  (0) 2013.07.09

 

 

 

 

 

 

http://www.kics.or.kr/home/kor/

 

 

2013년도 하계종합학술발표회

 

일시 2013년 6월 19일 ~ 2013년 6월 21일 장소 라마다프라자 제주호텔
초록제출 기간 2013년 3월 4일 ~ 2013년 5월 15일 심사결과 통보일 2013년 5월 22일
사전등록 기간 2013년 5월 22일 ~ 2013년 6월 3일
문의처 한국통신학회 사무국 학술발표회 담당자 / 02-3453-5555(6) / conf1@kics.or.kr / conf2@kics.or.kr

 

 

'Bookmark > Conference' 카테고리의 다른 글

IEEE GLOBECOM 2016  (0) 2016.07.07
2013 DGIF  (0) 2013.11.04
Mobicom  (0) 2013.04.24

http://portal.osek-vdx.org/

 

1. OSEK이란?

 

OSEK(Open Systems and their Interfaces for the Electronics in Motor Vehicles) + VDX(Vehicle Distributed eXecutive)

 

- Initial Partners of OSEK : BMW, BOSCH, SIEMENS VDO, VOLKSWAGEN AG, DAIMLER CHRYSLER...

- VDX Member : Renault, Psa peugeot, citroen

 

::Motivation::
-High, recurring expense in the development and variant management of control unit software
-Incompatibility of control units made by different manufactures due to different interfaces and protocols

 

1-2. Goal

 

: 어플리케이션 SW를 어떻게 하면 이식성높게 만들수 있을까?  SW의 재사용을 어떻게 높일수 있을까?

 

1-3. System philosophy


1) Standardized interface
      : C와 같이 사용가능. System services are specified in an ISO/ANSI-C like syntax


2) Scalability
     : Different conformance classes, various scheduling mechanisms, configuration features


3) Error Checking
     : 개발단계시 에러체크는 Extended status for development phase로, 양산시 standard status for production phase

 

   4) Portability of application software
     : 기본적으로 표준 인터페이스로 개발하기 때문에 어플리케이션의 개발이 매우 쉽다. •A language for a

        OIL(OSEK Implementation Language) 라는 OSEK의 표준문법을 사용함 = Portability


5) Support of Portability
      : Increase portability of an application between various OSEK implementations


6) Support for automotive requirements(reliability, real-time capability and cost sensitivity)
      : Users statically specifies the number of tasks, resources, and alarms
        Predictable and documented behavior

 

1-4. major characters

- Task management  (Apps 을 task unit으로 나눠서 스케줄링한다)
   - Activation/Termination of tasks
   - Management of task states, task switching
   Synchronization
   - Event control
   - Resource management
     Interrupt management
     Alarms
     Intra processor message handling
     Error handing, tracing and debugging
   - OS provides six hook routines

 

 

2. Specification of OSEK OS

 

"  Tree processing levels로 나눠진다. "
  - Interrupt level
  - Logical level for scheduler
  - Task level

 

 

 

 

2-2. Objectives of Conformance classes

  - Provide convenient group of OS features for easier understanding and discussion

   : 구분을 통한 높은 가독성과 개발에 편리
  - Allow partial implementations
  - Create and upgrade path from classes of lesser functionally to classes of higher functionality with no changes   

     to the application

 

 

 

  Task의 분류는 위의 도표와 같이 Basic Task들을 Conformance classes로 나눈다.

  구체적인 내용은 아래의 그림참조.

 

 

 

 

2-3. Task management :  Task들을 나누는 이유는 '모듈화'

 

- Complex control software can be subdivided in parts executed according to their real-time requirements
- A task provide the framework for the execution of functions
- OS provides concurrent and asynchronous execution of tasks

 OSEK에서 제공하는 Two different task concepts
 : Basic Tasks (left), Extended Tasks (right)

   함수같은것.

 

 

 

- Activating a task : System Services,   ActivateTask or ChainTask
                          After activation, the task is ready to execute from the first statement
 - Multiple requesting of task activation
: Basic task only, Records parallel activation of a basic task already activated
 - Task switching mechanism
Scheduler
 - Decides which task shall be started and the triggering of all necessary OSEK OS internal activities
 :The scheduler is activated whenever a task switch is possible

 

 

2-4 Task Priority
The value 0 is defined as the lowest priority of a task (낮은값이 높은 우선순위를 가진다)
Not support the dynamic priority management  (절대적인 우선순위 고정)
     :User cannot change it at the time of execution
A preempted task is considered to be the first(oldest) task in the ready list
A task being released from the waiting state is treated like the last(newest) task

 

  **OSEK규격에서 제공하는 스케줄러의 예시

 

 

 

  수행중인 Task가 있는데 더 high-priority task가 ready가 되면 기존 Task를 대기로 놓되, 대신 다음번에 가장 높은 순위로 실행시켜준다는 내용..

 

-Scheduling policy


***Full preemptive scheduling 방식

 

 


- Rescheduling points
  •Termination of a task : TerminateTask
  •Termination of a task witch explicit activating of a successor task : ChainTask (다음실행할 task지정)

  •Activating a task at task level : Activate Task
  •Explicit wait call : WaitEvent
  •Setting an event to a waiting task : SetEvent
  •Release of resource : ReleaseResource
  •Return from interrupt level to task level

 

--------------------------------------------------------------------------------------------------------

*** Non preemptive scheduling

 

 

 

-Rescheduling points
  •Termination of a task : TerminateTask
  •Termination of a task witch explicit activating of a successor task : ChainTask
  •Explicit call of scheduler : Schedule
  •Explicit wait call : WaitEvent

 

 

3. Synchronization

 

 3-1. Event mechanism
- A means of synchronization
- Only provided for extended tasks
- System services
- SetEvent, WaitEvent, GetEvent, ClearEvent

 

 

 

    : Task2가 런닝상태있다가 Wait Event() 실행이되면 release 상태나 wait 상태로 간다.

 

 3-2. Event mechanism

 

1) Synchronization of preemptable extended tasks

 

 

2) Synchronization of non preemptable extended tasks

 

 

 

 

3-3 Resource management

- Co-ordinate concurrent access of several tasks with different priorities to shard resources
- Shared resources
  : E.g. scheduler, program sequences, memory or hardware
- System services
  : GetResource, ReleaseResource  (2가지의 리소스 호출만 존재함/ 동시획득은 못함, 바이너리 세마포어와 동일한원리)
- Ensures that
  :  * Two tasks cannot occupy the same resource at the same time
   

    * Priority inversion can not occur

 

   -> 우선순위 기반의 스케줄링이라면 위와같은 현상이 일어나지 않지만, 리소스의 공유로 인해 발생한다.


    * Deadlocks do not occur by use of these resources

 

  -> 서로의 리소스충돌로 인한 데드락 상태.  OSEK에서 Ceiling Protocol 사용을 통하여 위와같은 현상을 예방해준다.

 

3-4 Priority Ceiling Protocol

- To avoid the problems of priority inversion and deadlocks
- Behavior of priority ceiling protocol
   • Each resource has own ceiling priority
   • If the task requires a resource, and its current priority is lower that the ceiling priority of the resource, the priority

      of the task is raised to the ceiling priority of the resource
   • If the task release the resource, the priority of this task is reset to the original priority

 

 

  -> 우선순위도치나 데드락을 방지한다.

 

3-5. Interrupt Management

  :  OSEK에선 2가지로 ISR나누어서 사용한다.

 - Two ISR Categories
1) ISR Category 1  : Dose not use an OS System services
2) ISR Category 2 : Can use the OS system service

 

 -Rescheduling
Takes place on termination of the ISR category 2
The number of Interrupt priorities
Depends on the controller and implementation

 

- Alarms  : 반복적으로 발생하는 이벤트를 처리하기 위한 서비스
             Services for processing recurring events
- Counters
: Represented by a counter value 

     •“ticks”, and counter specific constants
- Alarm management
: An alarm will expire when a predefined counter value is reached
  Statically assigned at system generation time to
     •One counter
     •Activates task, sets event or calls alarm-callback routine

 

Example)

 

 

 

 

4. Intra Processor Message Handling

 

-Provided by OSEK COM specification
CCCA, CCCB only
Transmission of data between tasks


-Actions on receiving messages
Generation of an event
Activation of a task
Execution of a callback function

 

 

 

 

 

 

4-2. Hook Routines

: 특정한 상황에서 OS에 의해 호출되는 함수로써, 디버깅이나 모니터링 용도로 사용된다.

OSEK에는 Six hook routines이 존재한다.

   - Functions called by OSEK OS
- Have predefined names
- Enable
        • Reactions to special situation

        : ErrorHook, COMErrorHook
        • Monitoring or debugging services
           : PreTaskHook, PostTaskHook
        • Initialization or finalization by user
        : StartupHook, ShutdownHook

 

 

 

 

 

 

 

 

'Nobody tells you about.. > RTOS' 카테고리의 다른 글

[Embedded Systems] FSM :: Finite-State Machines  (0) 2013.05.17

+ Recent posts