📄 axis.lyx
字号:
\layout SectionShow EMC Status\layout StandardAXIS includes a program called \begin_inset Quotes eld\end_inset emctop\begin_inset Quotes erd\end_inset which shows some of the details of EMC's state. You can run this program by invoking \noun on Machine > Show EMC Status\layout Standard\begin_inset Float figurewide falsecollapsed false\layout CaptionEMC Status Window\layout Standard\align center \begin_inset Graphics filename axis-emctop.png width 80page%\end_inset \end_inset \layout StandardThe name of each item is shown in the left column. The current value is shown in the right column. If the value has recently changed, it is shown on a red background.\layout SectionMDI Interface\layout StandardAXIS includes a program called \begin_inset Quotes eld\end_inset mdi\begin_inset Quotes erd\end_inset which allows text-mode entry of MDI commands to a running EMC session. You can run this program by opening a terminal and typing\layout LyX-Codemdi /path/to/emc.nml\layout StandardOnce it is running, it displays the prompt \family typewriter MDI>\family default . When a blank line is entered, the machine's current position is shown. When a command is entered, it is sent to EMC to be executed. A sample session of MDI is shown in Figure \begin_inset LatexCommand \ref{cap:MDI-Session}\end_inset .\layout LyX-Code\begin_inset Float figurewide falsecollapsed false\layout CaptionMDI Session\begin_inset LatexCommand \label{cap:MDI-Session}\end_inset \layout LyX-Code$ mdi ~/emc2/configs/sim/emc.nml \newline MDI> \newline (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)\newline MDI> G1 F5 X1\newline MDI> \newline (0.5928500000000374, 0.0, 0.0, 0.0, 0.0, 0.0)\newline MDI> \newline (1.0000000000000639, 0.0, 0.0, 0.0, 0.0, 0.0)\end_inset \layout Sectionaxis-remote\layout StandardAXIS includes a program called \begin_inset Quotes eld\end_inset axis-remote\begin_inset Quotes erd\end_inset which can send certain commands to a running AXIS. The available commands are shown by running \family typewriter axis-remote --help\family default and include checking whether AXIS is running (\family typewriter --ping\family default ), loading a file by name, reloading the currently loaded file (\family typewriter --reload\family default ), and making AXIS exit (\family typewriter --quit\family default ).\layout SectionManual Tool Change\begin_inset LatexCommand \index{Manual Tool Change}\end_inset \begin_inset LatexCommand \label{sec:Manual-Tool-Change}\end_inset \layout StandardEMC2 includes a userspace hal component called \begin_inset Quotes eld\end_inset hal_manualtoolchange\begin_inset Quotes erd\end_inset , which shows a window (Figure \begin_inset LatexCommand \ref{cap:The-Manual-Toolchange}\end_inset ) when a \family typewriter M6\family default command is issued. After the OK button is pressed, execution of the program will continue.\layout StandardThe HAL configuration file \family typewriter configs/sim/axis_manualtoolchange.hal\family default shows the HAL commands necessary to use this component.\layout Standardhal_manualtoolchange can be used even when AXIS is not used as the GUI. This component is most useful if you have presettable tools and you use the tool table.\layout Standard\begin_inset Float figurewide falsecollapsed false\layout CaptionThe Manual Toolchange Window\begin_inset LatexCommand \label{cap:The-Manual-Toolchange}\end_inset \layout Standard\align center \begin_inset Graphics filename manualtoolchange.png\end_inset \end_inset \layout SectionPython modules \layout StandardAXIS\begin_inset LatexCommand \index{AXIS}\end_inset includes several Python\begin_inset LatexCommand \index{Python}\end_inset modules which may be useful to others. For more information on one of these modules, use \begin_inset Quotes eld\end_inset \family typewriter pydoc <module name>\family default \begin_inset Quotes erd\end_inset or read the source code. These modules include:\layout Itemizeemc provides access to the EMC command, status, and error channels\layout Itemize\family typewriter gcode\family default provides access to the rs274ngc interpreter\layout Itemize\family typewriter rs274\family default provides additional tools for working with rs274ngc files\layout Itemize\family typewriter hal\family default allows the creation of userspace HAL components written in Python\layout Itemize\family typewriter _togl\family default provides an OpenGL widget that can be used in Tkinter applications\layout Itemize\family typewriter minigl\family default provides access to the subset of OpenGL used by AXIS\layout StandardTo use these modules in your own scripts, you must ensure that the directory where they reside is on Python's module path. When running an installed version of EMC2, this should happen automatically. When running \begin_inset Quotes eld\end_inset in-place\begin_inset Quotes erd\end_inset , this can be done by using \family typewriter scripts/emc-environment\family default .\layout SectionLathe Mode\begin_inset LatexCommand \index{lathe}\end_inset \layout StandardBy including the line \layout QuoteLATHE = 1\layout Standardin the [DISPLAY] section of the ini file, AXIS selects lathe mode. The \begin_inset Quotes eld\end_inset Y\begin_inset Quotes erd\end_inset axis is not shown in coordinate readouts, the view is changed to show the Z axis extending to the right and the X axis extending towards the bottom of the screen, and several controls (such as those for preset views) are removed.\layout StandardPressing \begin_inset Quotes eld\end_inset V\begin_inset Quotes erd\end_inset zooms out to show the entire file, if one is loaded.\layout StandardWhen in lathe mode, the shape of the loaded tool (if any) is shown.\layout Standard\begin_inset Float figurewide falsecollapsed false\layout CaptionLathe Mode showing the lathe tool shape\layout Standard\align center \begin_inset Graphics filename axis-lathe-tool.png\end_inset \end_inset \layout SectionAdvanced Configuration\layout SubsectionProgram Filters\begin_inset LatexCommand \index{Program Filters}\end_inset \layout StandardAXIS has the ability to send loaded files through a \begin_inset Quotes eld\end_inset filter program\begin_inset Quotes erd\end_inset . This filter can do any desired task: Something as simple as making sure the file ends with '\family typewriter M2\family default ', or something as complicated as detecting whether the input is a depth image, and generating g-code to mill the shape it defines.\layout StandardThe \family typewriter [FILTER]\family default section of the ini file controls how filters work. First, for each type of file, write a \family typewriter PROGRAM_EXTENSION\family default line. Then, specify the program to execute for each type of file. This program is given the name of the input file as its first argument, and must write rs274ngc code to standard output. This output is what will be displayed in the text area, previewed in the display area, and executed by EMC when \begin_inset Quotes eld\end_inset Run\begin_inset Quotes erd\end_inset . The following lines add support for the \begin_inset Quotes eld\end_inset image-to-gcode\begin_inset Quotes erd\end_inset converter included with EMC2:\layout LyX-Code[FILTER]\newline PROGRAM_EXTENSION = .png,.gif Greyscale Depth Image\newline png = image-to-gcode\newline gif = image-to-gcode\layout StandardIt is also possible to specify an interpreter:\layout LyX-CodePROGRAM_EXTENSION = .py Python Script\newline py = python\layout StandardIn this way, any Python script can be opened, and its output is treated as g-code. One such example script is available at \family typewriter nc_files/holecircle.py\family default . This script creates g-code for drilling a series of holes along the circumference of a circle.\layout Standard\begin_inset Float figurewide falsecollapsed false\layout CaptionCircular Holes\layout Standard\align center \begin_inset Graphics filename holes.png\end_inset \end_inset \layout StandardIf the environment variable AXIS_PROGRESS_BAR is set, then lines written to stderr of the form\layout LyX-CodeFILTER_PROGRESS=%d\layout Standardwill set the AXIS progress bar to the given percentage. This feature should be used by any filter that runs for a long time.\layout SubsectionThe X Resource Database\layout StandardThe colors of most elements of the AXIS user interface can be customized through the X Resource Database. The sample file \family typewriter axis_light_background\family default changes the colors of the backplot window to a \begin_inset Quotes eld\end_inset dark lines on white background\begin_inset Quotes erd\end_inset scheme, and also serves as a reference for the configurable items in the display area.\layout StandardFor information about the other items which can be configured in Tk applications, see the Tk manpages.\layout StandardBecause modern desktop environments automatically make some settings in the X Resource Database that adversely affect AXIS, by default these settings are ignored. To make the X Resource Database items override AXIS defaults, include the following line in your X Resources:\layout LyX-Code*Axis*optionLevel: widgetDefault\layout Standardthis causes the built-in options to be created at the option level \begin_inset Quotes eld\end_inset widgetDefault\begin_inset Quotes erd\end_inset , so that X Resources (which are level \begin_inset Quotes eld\end_inset userDefault\begin_inset Quotes erd\end_inset ) can override them.\layout Subsection\begin_inset LatexCommand \label{sub:Physical-jog-wheels}\end_inset Physical jog wheels\layout StandardTo improve the interaction of AXIS with physical jog wheels, the axis currently selected in the GUI is also reported on a pin with a name like \family typewriter axisui.jog.x\family default . Except for a short time when the active axis has just been changed, exactly one of these pins is \family typewriter TRUE\family default at one time, and the rest are \family typewriter FALSE\family default .\layout StandardAfter AXIS has created these HAL pins, it executes the halfile named in \family typewriter [HAL]POSTGUI_HALFILE\family default . Unlike \family typewriter [HAL]HALFILE\family default , only one such file may be used.\layout Subsectionaxisrc\begin_inset LatexCommand \index{.axisrc}\end_inset \layout StandardIf it exists, the contents of \family typewriter ~/.axisrc\family default are executed as Python source code just before the AXIS gui is displayed. The details of what may be written in the axisrc are subject to change during the development cycle.\layout StandardThe lines shown in Figure \begin_inset LatexCommand \ref{cap:Sample-.axisrc-file}\end_inset add Control-Q as a keyboard shortcut for Quit and turns on \begin_inset Quotes eld\end_inset Distance to go\begin_inset Quotes erd\end_inset by default.\layout Standard\begin_inset Float figurewide falsecollapsed false\layout CaptionSample .axisrc file\begin_inset LatexCommand \label{cap:Sample-.axisrc-file}\end_inset \layout LyX-Coderoot_window.bind("<Control-q>", "destroy .")\newline help2.append(("Control-Q", "Quit"))\newline vars.show_distance_to_go.set(1)\end_inset \layout SubsectionExternal Editor\begin_inset LatexCommand \index{External Editor}\end_inset \layout StandardThe menu options File > Edit... and File > Edit Tool Table... become available after defining the editor in the ini section [DISPLAY]. Useful values include \family typewriter EDITOR=gedit\family default and \family typewriter EDITOR=gnome-terminal -e vim\family default . For more information, see the DISPLAY section of the INI Configuration Chapter in the Integrators Manual.\layout SubsectionVirtual Control Panel\begin_inset LatexCommand \index{Virtual Control Panel}\end_inset \layout StandardAXIS can display a custom virtual control panel in the right-hand pane. You can program buttons, indicators, data displays and more. For more information, see the Integrators Manual.\layout SubsectionSpecial Comments\begin_inset LatexCommand \index{Special Comments}\end_inset \layout StandardSpecial comments can be inserted into the G Code file to control how the preview of AXIS behaves. In the case where you want to limit the drawing of the preview use these special comments. Anything between the (AXIS,hide) and (AXIS,show) will not be drawn during the preview. Anything after a (AXIS,stop) will not be drawn during the preview.\layout Itemize(AXIS,hide) Stops the preview\layout Itemize(AXIS,show) Resumes the preview\layout Itemize(AXIS, stop) Stops the preview to the end of the file.\the_end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -