📄 integrator_intro.lyx
字号:
lyxscale 75 width 80page% keepAspectRatio\end_inset \layout Caption\begin_inset LatexCommand \label{fig:The AXIS Graphical Interface}\end_inset The AXIS Graphical Interface\end_inset \begin_inset Float figurewide falsecollapsed false\layout Standard\align center \begin_inset Graphics filename keystick.png\end_inset \layout Caption\begin_inset LatexCommand \label{fig:The Keystick Interface}\end_inset The Keystick interface\end_inset \begin_inset Float figurewide falsecollapsed false\layout Standard\align center \begin_inset Graphics filename mini.png lyxscale 50 width 80page% keepAspectRatio\end_inset \layout Caption\begin_inset LatexCommand \label{fig:The Mini Graphical Interface}\end_inset The Mini Graphical Interface\end_inset \begin_inset Float figurewide falsecollapsed false\layout Standard\align center \begin_inset Graphics filename tkemc.png lyxscale 50 width 80page% keepAspectRatio\end_inset \layout Caption\begin_inset LatexCommand \label{fig:TkEmc_Graphical_Interface}\end_inset The TkEmc Graphical Interface\end_inset \begin_inset Float figurewide falsecollapsed false\layout Standard\added_space_top smallskip \added_space_bottom smallskip \align center \begin_inset Graphics filename xemc.png display color width 80page% keepAspectRatio\end_inset \layout Caption\begin_inset LatexCommand \label{fig:XEMC_Graphical_Interface}\end_inset The XEMC Graphical Interface\end_inset \layout StandardTkemc and Mini will run on Linux, Mac, and Microsoft Windows if the Tcl/Tk programming language has been installed. The Mac and Microsoft Windows version can connect to a real-time EMC2 running on a Linux machine via a network connection, allowing the monitoring of the machine from a remote location. Instructions for installing and configuring the connection between a Mac or Microsoft Machine and a PC running the EMC2 can be found in the Integrators Handbook.\layout SubsectionMotion Controller EMCMOT \begin_inset LatexCommand \label{sub:Motion-Controller-EMCMOT}\end_inset \layout StandardMotion control includes sampling the position of the axes to be controlled, computing the next point on the trajectory, interpolating between these trajectory points, and computing an output to the motors. For servo systems, the output is based on a PID compensation algorithm. For stepper systems, the calculations run open-loop, and pulses are sent to the steppers based on whether their accumulated position is more than a pulse away from their commanded position. The motion controller includes programmable software limits, and interfaces to hardware limit and home switches.\layout StandardThe motion controller is written to be fairly generic. Initialization files (with the same syntax as Microsoft Windows INI\begin_inset LatexCommand \index{INI}\end_inset files) are used to configure parameters such as number and type of axes (e.g., linear or rotary), scale factors between feedback devices (e.g., encoder counts) and axis units\begin_inset LatexCommand \index{units}\end_inset (e.g., millimeters), servo gains, servo and trajectory planning cycle times, and other system parameters. Complex kinematics for robots can be coded in C according to a prescribed interface to replace the default 3-axis Cartesian machine kinematics routines. \layout SubsectionDiscrete I/O Controller EMCIO\begin_inset LatexCommand \index{EMCIO}\end_inset \begin_inset LatexCommand \label{sub:Discrete-I/O-Controller}\end_inset \layout StandardDiscrete I/O controllers are highly machine-specific, and are not customizable in general using the INI file technique used to configure the more generic motion controller. However, since EMC2 uses the HAL, reconfiguration of the I/O subsystem has become very powerful and flexible. EMC2 contains a Programmable Logic Controller module (behaves just like a hardware PLC\begin_inset LatexCommand \index{PLC}\end_inset ) that can be used for very complex scenarios (tool changers, etc.). \layout StandardIn EMC2 there is only one big I/O controller, which provides support for all kinds of actions and hardware control. All its outputs and inputs are HAL pins (more on this later on), so you can use only the subset that fits your hardware and is necessary for your application.\layout SubsectionTask Executor EMCTASK\begin_inset LatexCommand \index{EMCTASK}\end_inset \begin_inset LatexCommand \label{sub:Task-Executor-EMCTASK}\end_inset \layout Standard\begin_inset Float figurewide falsecollapsed false\layout Caption\begin_inset LatexCommand \label{fig:Process_diagram}\end_inset EMC2 Process Diagram\layout Standard\align center \begin_inset Graphics filename whatpc.png keepAspectRatio\end_inset \end_inset \layout StandardThe Task Executor is responsible for interpreting G and M code programs whose behavior does not vary appreciably between machines. G-code programming is designed to work like a machinist might work. The motion or turns of a hand wheel are coded into blocks. If a machinist wanted his mill to move an inch in the +X direction at some feed rate, he might slowly turn the hand wheel five turns clockwise in 20 seconds. The same machinist programming that same move for CNC might write the following block of code.\layout LyX-CodeG1 F3 X1.000\layout StandardG1 means that the machine is supposed to run at a programmed feed rate rather than at the fastest speed that it can (G0 is the way to command a rapid move like you would make above the work when not cutting). The F3 means that it should travel at 3 inches a minute or 3 millimeters a minute if it is working in metric mode. The X1.000 (assuming that the X axis started at zero) means the machine should move one inch in the positive X direction. You will read quite a bit more about G-code in the programming chapters .\layout StandardFigure \begin_inset LatexCommand \ref{fig:Process_diagram}\end_inset is a block diagram of how a personal computer running the EMC2 is used to control a machine with G-code\begin_inset LatexCommand \index{G-code}\end_inset . The actual G-code can be sent using the MDI\begin_inset LatexCommand \index{MDI}\end_inset (Machine Device Interface) mode or it can be sent as a file when the machine is in Auto\begin_inset LatexCommand \index{Auto}\end_inset mode. These choices are made by the operator and entered using one of the Graphical User Interfaces available with the software. \layout StandardG-code is sent to the interpreter which compares the new block with what has already been sent to it. The interpreter then figures out what needs to be done for the motion and input or output systems and sends blocks of canonical commands to the task and motion planning programs.\layout SubsectionModes of Operation\begin_inset LatexCommand \label{sub:Modes-of-Operation}\end_inset \layout StandardWhen an EMC2 is running, there are three different major modes used for inputting commands. These are Manual\begin_inset LatexCommand \index{Manual}\end_inset , Auto\begin_inset LatexCommand \index{Auto}\end_inset , and MDI\begin_inset LatexCommand \index{MDI}\end_inset . Changing from one mode to another makes a big difference in the way that the EMC2 behaves. There are specific things that can be done in one mode that can not be done in another. An operator can home an axis in manual mode but not in auto or MDI modes. An operator can cause the machine to execute a whole file full of G-codes in the auto mode but not in manual or MDI. \layout StandardIn manual mode, each command is entered separately. In human terms a manual command might be \begin_inset Quotes eld\end_inset turn on coolant\begin_inset Quotes erd\end_inset or \begin_inset Quotes eld\end_inset jog X at 25 inches per minute.\begin_inset Quotes erd\end_inset These are roughly equivalent to flipping a switch or turning the hand wheel for an axis. These commands are normally handled on one of the graphical interfaces by pressing a button with the mouse or holding down a key on the keyboard. In auto mode, a similar button or key press might be used to load or start the running of a whole program of G-code that is stored in a file. In the MDI mode the operator might type in a block of code and tell the machine to execute it by pressing the <return> or <enter> key on the keyboard.\layout StandardSome motion control commands are available and will cause the same changes in motion in all modes. These include \shape smallcaps \noun on abort\shape default \noun default \begin_inset LatexCommand \index{ABORT}\end_inset , \shape smallcaps \noun on estop\shape default \noun default \begin_inset LatexCommand \index{ESTOP}\end_inset , and \shape smallcaps \noun on feed rate override\shape default \noun default \begin_inset LatexCommand \index{feed override}\end_inset . Commands like these should be self explanatory.\layout StandardThe AXIS user interface removes some of the distinctions between Auto and the other modes by making Auto-commands available at most times. It also blurs the distinction between Manual and MDI because some Manual commands like Touch Off are actually implemented by sending MDI commands.\layout SubsectionInformation Display \begin_inset LatexCommand \label{sub:Information-Display}\end_inset \layout StandardWhile an EMC2 is running, each of the modules keeps up a conversation with the others and with the graphical display. It is up to the display to select from that stream of information what the operator needs to see, and to arrange it on the screen in a way that makes it easy for the operator to understand. Perhaps the most important display is the mode the EMC2 is running in. You will want to keep your eye on the mode display.\layout StandardRight up there with knowing what mode is active is consistent display of the position of each axis. Most of the interfaces will allow the operator to read position based upon actual or commanded position as well as machine or relative position. \layout Description\noindent Machine\begin_inset LatexCommand \index{Position: Machine}\end_inset This is the position of an axis relative to the place where it started or was homed. \layout Description\noindent Relative\begin_inset LatexCommand \index{Position: Relative}\end_inset This is the position of an axis after work or tool or other offsets have been applied. \layout Description\noindent Actual\begin_inset LatexCommand \index{Position: Actual}\end_inset This is the real position of the axis within the machine or relative system. \layout Description\noindent Commanded\begin_inset LatexCommand \index{Position: Commanded}\end_inset This is where the axis is commanded to be.\layout StandardThese may all be exactly the same if no offsets have been applied and there is no deadband set in the INI file. Deadband is a small distance which is assumed to be close enough -- perhaps one stepper pulse or one encoder count. \layout StandardIt is also important to see any messages or error codes sent by the EMC2. These are used to request the operator change a tool, to describe problems in G-code programs, or to tell why the machine stopped running.\layout StandardAs you work your way through this text, you will be learning, bit by bit, how to set up and run a machine with your copy of the EMC2 software. While you are learning about setting up and running a mini mill here, you will be thinking of other applications and other capabilities. These are the topics of the other linuxcnc.org handbooks.\layout SectionThinking Like An Integrator\begin_inset LatexCommand \label{sec:Thinking-Integrator}\end_inset \layout StandardThe biggest task of a machine integrator is figuring out how to connect a PC running the EMC2 to a machine and configuring the software so that it runs the machine correctly. \layout SubsectionUnits\begin_inset LatexCommand \index{units}\end_inset \begin_inset LatexCommand \label{sub:Units}\end_inset \layout StandardUnits can be confusing. You might ask, \begin_inset Quotes eld\end_inset Does it work in inches, feet, centimeters, millimeters, or what?\begin_inset Quotes erd\end_inset There are several possible answers to this question but the best one is that it works in the units that you set it to work in. \layout StandardAt a machine level, we set each axis's units to some value using an INI variable that looks like this.\layout LyX-CodeUNITS = inch\layout Standardor\layout LyX-CodeUNITS = mm\layout StandardAfter we have decided upon a value for the units for an axis, we tell the EMC2 how may step pulses or encoder pulses it should send or read for each unit of distance to be traveled. Once we have done this, the EMC2 knows how to count units of distance. However it is very important to understand that this counting of distance is different from the commanding of distance. You can command distance in millimeters or inches without even thinking about the units that you defined. There are G-codes that allow you to switch easily between metric and imperial.\the_end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -