linux cnc overview

34
LinuxCNC 初初 DMP Electronics Inc. intern 初初初 初初初初 OS-Lab

Upload: nylon

Post on 25-Jun-2015

1.463 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Linux cnc overview

LinuxCNC初探

DMP Electronics Inc.intern 陳伯綸(中正資工 OS-Lab)

Page 2: Linux cnc overview

Outline● About CNC

● LinuxCNC: Install、 Settings、 compiler

● LinuxCNC Software Overview

● LinuxCNC HAL development

Page 3: Linux cnc overview

Wikipedia

Page 4: Linux cnc overview

Work Flow

Page 5: Linux cnc overview

Software Flow of NC System

Page 6: Linux cnc overview

The Progress Direction of the CNC System

Page 7: Linux cnc overview

Download● http://www.linuxcnc.org/index.php/english/downlo

ad

Page 8: Linux cnc overview

Install build-dev● http://www.linuxcnc.org/hardy/dists/hardy/

linuxcnc● 2.5/source/linuxcnc_2.5.3.dsc

Page 9: Linux cnc overview

Install build-dev & Git

Page 10: Linux cnc overview

Get Source

Page 11: Linux cnc overview

Building LinuxCNC

Page 12: Linux cnc overview

Building LinuxCNC

Page 13: Linux cnc overview

Building LinuxCNC

Page 14: Linux cnc overview

Building LinuxCNC

Page 15: Linux cnc overview

Building LinuxCNC

Page 16: Linux cnc overview

Building LinuxCNC

Page 17: Linux cnc overview

Source File

Page 18: Linux cnc overview

Simple LinuxCNC Controlled Machine

Page 19: Linux cnc overview

LinuxCNC Hierarchical

Page 20: Linux cnc overview

LinuxCNC Message Links

Page 21: Linux cnc overview

EMCTASK

Page 22: Linux cnc overview

EMCMOT

Page 23: Linux cnc overview

EMCIO

Page 24: Linux cnc overview

The Configuration Files

INI : The ini file overrides defaults that are compiled into the LinuxCNC code.

HAL: The HAL files start up process modules and provide linkages between LinuxCNC signals and specific hardware pins.

VAR: The var file is a way for the interpreter to save some values from one run to the next. These values are saved from one run to another but not always saved immediately.

TBL:The tbl file saves tool information. NML: The nml file configures the communication channels

used by the LinuxCNC. It is normally setup to run all of the communication within a single computer but can be modified to communicate between several computers.

Page 25: Linux cnc overview

The Configuration Files

The INI File Components Comments Sections Variables Custom Sections and Variables

Page 26: Linux cnc overview

The Configuration Files

Hardware Abstraction Layer (HAL)

Component Parameter Pin Physical_Pin Signal Type Function Thread

Page 27: Linux cnc overview

Hardware Abstraction Layer (HAL)

Component A HAL component is a piece of software with well-defined inputs,

outputs, and behavior, that can be installed and interconnected as needed.

Parameter Many hardware components have adjustments that are not connected

to any other components but still need to be accessed. There are two types of parameters: input & Output .

Pin Hardware components have terminals which are used to interconnect

them. The HAL equivalent is a pin or HAL pin. HAL pins are software entities that exist only inside the computer.

Physical_Pin Many I/O devices have real physical pins or terminals that connect to

external hardware. To avoid confusion, these are referred to as physical pins. These are the things that stick out into the real world.

Page 28: Linux cnc overview

Hardware Abstraction Layer (HAL)

Signal In a physical machine, the terminals of real hardware components are

interconnected by wires.

Type Bit - a single TRUE/FALSE or ON/OFF value float - a 64 bit floating point value, with approximately 53 bits of

resolution and over 1000 bits of dynamic range. u32 - a 32 bit unsigned integer, legal values are 0 to 4,294,967,295 s32 - a 32 bit signed integer, legal values are -2,147,483,647 to

+2,147,483,647 Both pins and signals have types, and signals can only be connected

to pins of the same type

Page 29: Linux cnc overview

Hardware Abstraction Layer (HAL)

Function Each function is a block of code that performs a specific action. The

system integrator can use threads to schedule a series of functions to be executed in a particular order and at specific time intervals.

Thread A thread is a list of functions that runs at specific intervals as part of a

realtime task. When a thread is first created, it has a specific time interval (period), but no functions. Functions can be added to the thread, and will be executed in order every time the thread runs.

Page 30: Linux cnc overview

Hardware Abstraction Layer (HAL)

HAL Commands loadrt

The command loadrt loads a real time HAL component. Real time component functions need to be added to a thread to be updated at the rate of the thread

addf The command addf adds a real time component function to a

thread. You have to add a function from a HAL real time component to a thread to get the function to update at the rate of the thread.

Page 31: Linux cnc overview

Hardware Abstraction Layer (HAL)

HAL Commands loadusr

The command loadusr loads a user space HAL component. User space programs are their own separate processes, which optionally talk to other HAL components via pins and parameters. You cannot load real time components into user space.

net The command net creates a connection between a signal and and

one or more pins. If the signal does not exist net creates the new signal.

Page 32: Linux cnc overview

Hardware Abstraction Layer (HAL)

HAL Commands setp

The command setp sets the value of a pin or parameter. The valid values will depend on the type of the pin or parameter.

unlinkp The command unlinkp unlinks a pin from the connected signal. If no

signal was connected to the pin prior running the command, nothing happens.

Page 33: Linux cnc overview

LinuxCNC HAL development

Show me the coding

Page 34: Linux cnc overview

Thanks for your listening