1. Componentes del archivo INI
Un archivo INI típico sigue un diseño bastante simple, que incluye;
-
comentarios
-
secciones
-
variables
Cada uno de estos elementos está separado en líneas individuales. Cada final de línea o el carácter de nueva línea crea un nuevo elemento.
1.1. Comentarios
Una línea de comentario se inicia con un ";" o una marca "#". Cuando el lector INI ve cualquiera de estas marcas al comienzo de una línea, el resto de la línea es ignorado por el software. Los comentarios se pueden usar para describir qué hará un elemento INI.
; Este es mi archivo de configuración de fresadora. # Configurado el 12 de enero de 2012
Los comentarios también se pueden usar para desactivar una variable. Esto hace más fácil elegir entre diferentes variables.
DISPLAY = axis # DISPLAY = touchy
En esta lista, la variable DISPLAY se establecerá en Axis porque el otro valor está comentado. Si alguien edita descuidadamente una lista como esta y deja dos de las líneas sin comentar, se utilizará la primera encontrada.
Tener en cuenta que dentro de una variable, los caracteres "#" y ";" no denotan comentarios:
INCORRECTO = valor # y un comentario # Comentario correcto CORRECTO = valor
1.2. Secciones
Las partes relacionadas de un archivo INI se separan en secciones. El nombre de una sección se encierra entre paréntesis cuadrados como este: [ESTA_SECCION]. El orden de las secciones no es importante. Las secciones comienzan en el nombre de sección y finalizan en el siguiente nombre de sección.
Las siguientes secciones son utilizadas por LinuxCNC:
-
[EMC]información general -
[DISPLAY]configuraciones relacionadas con la interfaz gráfica de usuario -
[FILTER]configuración de los programas de filtro de entrada -
[RS274NGC]configuración utilizada por el intérprete de código G -
[EMCMOT]configuraciones utilizadas por el controlador de movimiento en tiempo real -
[TASK]configuraciones utilizadas por el controlador de tareas -
[HAL]especifica archivos .hal -
[HALUI]comandos MDI utilizados por HALUI -
[APPLICATIONS]otras aplicaciones que iniciará LinuxCNC -
[TRAJ]configuraciones adicionales utilizadas por el controlador de movimiento en tiempo real -
[JOINT_n]variables de articulaciones individuales -
[AXIS_l]variables de eje individuales -
[KINS]variables de cinemáticas -
[EMCIO]configuración utilizada por el controlador de E/S
1.3. Variables
Una línea de variable se compone de un nombre de variable, un signo igual (=) y un valor. Todo, desde el primer carácter que no sea espacio en blanco después del = hasta el final de la línea, se pasa como valor, por lo que puedes incrustar espacios en símbolos de cadena si los deseas o los necesitas. Un nombre de variable a menudo es llamado palabra clave o keyword.
MACHINE = Mi máquina
Una línea variable puede extenderse a varias líneas con un caracter de barra diagonal inversa (\). Se permite un máximo de MAX_EXTEND_LINES (== 20). No debe haber espacios en blanco que sigan al carácter de barra invertida final.
Los identificadores de sección no pueden extenderse a varias líneas.
APP = sim_pin \ ini.0.max_acceleration \ ini.1.max_acceleration \ ini.2.max_acceleration \ ini.0.max_velocity \ ini.1.max_velocity \ ini.2.max_velocity
Los valores booleanos pueden ser uno de TRUE, YES o 1 para verdadero/activado y otro de FALSE, NO o 0 para false/desactivado. No son sensibles a mayúsculas.
Las siguientes secciones detallan cada sección del archivo de configuración, utilizando valores de muestra para las líneas de configuración.
Las variables que utiliza LinuxCNC siempre deben usar nombres de sección y nombres de variables como se muestra.
1.4. Secciones personalizadas y variables
La mayoría de las configuraciones de muestra utilizan secciones y variables personalizadas para poner todas las configuraciones en una ubicación para mayor comodidad.
Para agregar una variable personalizada a una sección LinuxCNC existente, simplemente incluye la variable en esa sección.
[JOINT_0] TYPE = LINEAR ... SCALE = 16000
Para introducir una sección personalizada con sus propias variables, agregar la sección y variables al archivo INI.
[PROBE] Z_FEEDRATE = 50 Z_OFFSET = 12 Z_SAFE_DISTANCE = -10
Para usar las variables personalizadas en tu archivo HAL, coloca la sección y el nombre de la variable en lugar del valor.
setp offset.1.offset [PROBE]Z_OFFSET setp stepgen.0.position-scale [JOINT_0]SCALE
|
Nota
|
El valor almacenado en la variable debe coincidir con el tipo especificado por el pin del componente. |
Para usar las variables personalizadas en el código G, usar la sintaxis de variable global #<_ini[sección]variable>. El siguiente ejemplo muestra una simple rutina touch-off del eje Z para una ruteadora o fresadora que utiliza una placa de sonda.
G91 G38.2 Z#<_ini[probe]z_safe_distance> F#<_ini[probe]z_feedrate> G90 G1 Z#5063 G10 L20 P0 Z#<_ini[probe]z_offset>
1.5. Inclusión de archivos
Un archivo INI puede incluir el contenido de otro archivo usando una directiva #INCLUDE.
#INCLUDE archivoEl nombre del archivo se puede especificar como:
-
un archivo en el mismo directorio que el archivo INI
-
un archivo relativo al directorio de trabajo
-
un nombre de archivo absoluto (comienza con /)
-
un nombre de archivo relativo al directorio de usuario (comienza con ~)
Se admiten varias directivas #INCLUDE.
#INCLUDE joint_0.inc #INCLUDE ../parallel/joint_1.inc #INCLUDE below/joint_2.inc #INCLUDE /home/myusername/myincludes/display.inc #INCLUDE ~/linuxcnc/myincludes/rs274ngc.inc
Las directivas #INCLUDE son admitidas solo con un nivel de expansión (un archivo incluido no puede incluir archivos adicionales). La extensión de archivo recomendada es .inc. No utilice una extensión de archivo .ini para archivos incluidos.
2. Secciones del archivo INI
2.1. Sección [EMC]
-
VERSION = 1.1- La versión del formato de esta configuración. Cualquier otro valor distinto de 1.1 hará que se ejecute el verificador de configuración e intente actualizar la configuración al nuevo estilo de configuración ejes/articulaciones. -
MACHINE = Mi máquina- Este es el nombre del controlador de la máquina, que se imprime en la parte superior de la mayoría de las interfaces gráficas. Puedes poner aquí lo que sea, siempre que lo hagas en una sola línea. -
DEBUG = 0- Nivel de depuración 0 significa que no se imprimirán mensajes cuando LinuxCNC esté ejecutándose desde una terminal. Las banderas de depuración generalmente son útiles solo para desarrolladores. Ver src/emc/nml_intf/debugflags.h para otras configuraciones. -
RCS_DEBUG = 1- Mensajes de depuración de RCS a mostrar. Imprime predeterminadamente solo errores (1) si los bits de EMC_DEBUG_RCS enDEBUGno están activos, de lo contrario imprime todo (-1). Usar este para seleccionar los mensajes de depuración de RCS. Ver en src/libnml/rcs/rcs_print.hh todas las banderas de MODE. -
RCS_DEBUG_DEST = STDOUT- Donde sacar los mensajes RCS_DEBUG (NULL, STDOUT, STDERR, FILE, LOGGER, MSGBOX). -
RCS_MAX_ERR = -1- Número después del cual ya no se reportarán mas errores RCS (-1 = infinito). -
NML_FILE = /usr/share/linuxcnc/linuxcnc.nml- Establecer si se quiere usar un archivo de configuración NML no predeterminado.
2.2. Sección [DISPLAY]
Los diferentes programas de interfaz de usuario utilizan diferentes opciones, y no todas las opciónes son compatibles con todas las interfaces de usuario. Hay varias interfaces como AXIS, GMOCCAPY, Touchy, QtDragon y Gscreen de QtVCP. AXIS es una interfaz para usar con computadora y monitor normales. Touchy es para usar con pantallas táctiles. GMOCCAPY se puede usar en ambos tipos y también ofrece muchas conexiones para controles de hardware. Las descripciones de las interfaces se encuentran en la sección Interfaces del manual de usuario.
-
DISPLAY = axis- The file name of the executable providing the user interface to use. Prominent valid options are (all in lower case):axis,touchy,gmoccapy,gscreen,tklinuxcnc,qtvcp,qtvcp qtdragonorqtvcp qtplasmac. -
POSITION_OFFSET = RELATIVE- El sistema de coordenadas (RELATIVEoMACHINE) a mostrar en el DRO cuando se inicia la interfaz de usuario. El sistema de coordenada RELATIVE refleja los offsets de coordenadas G92 y G5x vigentes en cada momento. -
POSITION_FEEDBACK = COMMANDED- El valor de coordenadas (COMMANDEDoACTUAL) a mostrar en el DRO cuando se inicia la interfaz de usuario. En AXIS esto se puede cambiar desde el menú "Ver". La posición COMMANDED es la posición solicitada por LinuxCNC. La posición ACTUAL es la posición retroalimentada de los motores si se tiene retroalimentacion como la mayoría de los servosistemas. Por lo general, se utiliza el valor COMMANDED. -
DRO_FORMAT_MM = %+08.6f- Ajusta el formato DRO predeterminado en modo métrico (normalmente 3 decimales y 6 dígitos rellenados con espacios a la izquierda). El ejemplo anterior rellenará con ceros, mostrará 6 dígitos decimales y forza mostrar un signo + para números positivos. El formateo sigue la práctica de Python: https://docs.python.org/2/library/string.html#format-specification-mini-language. Se generará un error si el formato no puede aceptar un valor de punto flotante. -
DRO_FORMAT_IN = % 4.1f- Ajusta el formato DRO predeterminado en modo imperial (normalmente 4 decimales, y 6 dígitos rellenados con espacios a la izquierda). El ejemplo anterior mostrará solo un dígito decimal. El formato sigue la práctica de Python: https://docs.python.org/2/library/string.html#format-specification-mini-language . Se generará un error si el formato no puede aceptar un valor de punto flotante. -
CONE_BASESIZE = .25- Override the default cone/tool base size of .5 in the graphics display. Valid values are between 0.025 and 2.0. -
DISABLE_CONE_SCALING = TRUE- Any non-empty value (including "0") will override the default behavior of scaling the cone/tool size using the extents of the currently loaded G-code program in the graphics display. -
MAX_FEED_OVERRIDE = 1.2- El ajuste máximo de alimentación que puede seleccionar el usuario. 1.2 significa 120% de la velocidad de alimentación programada. -
MIN_SPINDLE_OVERRIDE = 0.5- El ajuste mínimo del husillo que el usuario puede seleccionar. 0.5 significa el 50% de la velocidad programada del husillo. (Esto se usa para establecer la velocidad mínima del husillo.) -
MIN_SPINDLE_0_OVERRIDE = 0.5- El ajuste mínimo del husillo que el usuario puede seleccionar. 0.5 significa el 50% de la velocidad programada del husillo. (Esto se usa para establecer la velocidad mínima del husillo). En una máquina de múltiples husillos habrá entradas para cada número de husillo. Solo lo usan interfases de usuario basadas en Qtvcp. -
MAX_SPINDLE_OVERRIDE = 1.0- El ajuste máximo del husillo que el usuario puede seleccionar. 1.0 significa el 100% de la velocidad programada del husillo. -
MAX_SPINDLE_0_OVERRIDE = 1.0- El ajuste máximo de alimentación que el usuario puede seleccionar. 1.2 significa 120% de la velocidad de alimentación programada. En una máquina de múltiples husillos habrá entradas para cada número de husillo. Solo lo usan interfases de usuario basadas en QtVCP. -
DEFAULT_SPINDLE_SPEED = 100- Las RPM predeterminadas del husillo cuando se inicia en modo manual. Si esta configuración no está presente, el valor predeterminado es 1 RPM para AXIS y 300 RPM para GMOCCAPY.-
obsoleta - Usar en cambio la sección [SPINDLE_n]
-
-
DEFAULT_SPINDLE_0_SPEED = 100- Las RPM predeterminadas del husillo en modo manual. En una máquina con múltiples husillos habrá entradas para cada número de husillo. Solo usado por interfases de usuario basadas en QtVCP.-
obsoleta - Usar en cambio la sección [SPINDLE_n].
-
-
SPINDLE_INCREMENT = 200- Incremento utilizado al hacer clic en los botones de aumento/disminución. Utilizada sólo por las interfaces basadas en QtVCP.-
obsoleta - Usar en cambio la sección [SPINDLE_n].
-
-
MIN_SPINDLE_0_SPEED = 1000- Las RPM mínimas que pueden seleccionarse manualmente. En máquinas con múltiples husillo habrá entradas para cada número de husillo. Usada sólo por interfaces de usuario basadas en QtVCP.-
obsoleta - Usar en cambio la sección [SPINDLE_n].
-
-
MAX_SPINDLE_0_SPEED = 20000- Las RPM máximas que se pueden seleccionar manualmente. En una máquina con múltiples husillos habrá entradas para cada número de husillo. Solo usada por interfaces de usuario basadas en QtVCP.-
obsoleta - Usar en cambio la sección [SPINDLE_n].
-
-
PROGRAM_PREFIX = ~/linuxcnc/nc_files- La ubicación predeterminada para archivos de código G, subrutinas nombradas y códigos M definidos por el usuario. Se busca en el directorioPROGRAM_PREFIXantes que en los directorios listados en[RS274]SUBROUTINE_PATHy[RS274]USER_M_PATH. -
INTRO_GRAPHIC = emc2.gif- La imagen que se muestra en la pantalla de inicio. -
INTRO_TIME = 5- El tiempo máximo a mostrar la pantalla de inicio, en segundos. -
CYCLE_TIME = 0.05- Tiempo de ciclo de despliegue de la GUI. Dependiendo de la pantalla, puede ser un segundos o ms (de preferencia ms). A menudo es la tasa de actualización en vez de el tiempo de espera entre actualizaciones. Si no se configura correctamente el tiempo de actualización, puede que la pantalla no responda o se vea entrecortada. Un valor de 100 ms (0.1 s) es una configuración común, aunque en un rango entre 50 - 200 ms (.05 - .2 s) puede ser usable. Un CPU con poca energía puede ver mejoras con un valor más alto. Normalmente el valor predeterminado esta bien. -
PREVIEW_TIMEOUT = 5- Tiempo de espera (en segundos) para cargar la previsualización gráfica de código G. Actualmente, sólo AXIS. -
HOMING_PROMPT = TRUE- Any non-empty value (including "0") will enable showing a prompt message with homing request, when the Power On button is pressed in AXIS GUI. Pressing the "Ok" button in prompt message is equivalent to pressing the "Home All" button(or the Ctrl-HOME key). -
FOAM_W = 1.5- Establece la altura de espuma W. -
FOAM_Z = 0- Establece la altura de espuma Z. -
GRAPHICAL_MAX_FILE_SIZE = 20- El tamaño más grande (en mega bytes) que se mostrará gráficamente. Si el programa es más grande que esto, se mostrará una caja delimitada. Predeterminadamente, ésta configuración está a 20 MB o 1/4 de la memoria del sistema, lo que sea más bajo. Un valor negativo se interpreta como ilimitado.
|
Nota
|
GladeVCP y PyVCP utilizan los siguientes elementos [DISPLAY], consulte la sección Incrustando una pestaña del capítulo GladeVCP o el Capítulo PyVCP para más información. |
-
EMBED_TAB_NAME = GladeVCP demo -
EMBED_TAB_COMMAND = halcmd loadusr -Wn gladevcp gladevcp -c gladevcp -x {XID\} -u ./gladevcp/hitcounter.py ./gladevcp/manual-example.ui -
DEFAULT_LINEAR_VELOCITY = .25- La velocidad predeterminada para trotes lineales, en unidades máquina por segundo. -
MIN_VELOCITY = .01- El valor más bajo aproximado del control deslizante de trote. -
MAX_LINEAR_VELOCITY = 1.0- La velocidad máxima para trotes lineales, en unidades de máquina por segundo. -
MIN_LINEAR_VELOCITY = .01- El valor más bajo aproximado del deslizante de trote. -
DEFAULT_ANGULAR_VELOCITY = .25- La velocidad predeterminada para trotes angulares, en unidades máquina por segundo. -
MIN_ANGULAR_VELOCITY = .01- El valor más bajo aproximado del deslizante de trote angular. -
MAX_ANGULAR_VELOCITY = 1.0- La velocidad máxima para trotes angulares, en unidades de máquina por segundo. -
INCREMENTS = 1 mm, .5 in, ...- Define los incrementos disponibles para trotes incrementales. Los INCREMENTS se pueden usar para ajustar los valores predeterminados. Los valores pueden ser números decimales (p. ej. 0.1000) o números fraccionarios (p. ej. 1/16), opcionalmente seguidos por una unidad (cm, mm, um, inch, in o mil). Si no se especifica una unidad, se supone la unidad de máquina. Las distancias métricas e imperiales se pueden mezclar: INCREMENTS = 1 inch, 1 mil, 1 cm, 1 mm, 1 um es una entrada válida. -
GRIDS = 10 mm, 1 in, ...- Define los valores preestablecidos para las líneas de cuadrícula. El valor se interpreta de la misma manera queINCREMENTS. -
OPEN_FILE = /ruta/completa/a/archivo.ngc- El archivo que se mostrará en la gráfica de vista previa cuando se inicie AXIS. Una cadena en blanco "" no cargará ningún archivo en el arranque. GMOCCAPY no usará esta configuración, ya que ofrece una entrada correspondiente en su página de configuración. -
EDITOR = gedit- El editor que se usará al seleccionar Archivo> Editar para editar código G desde el menú de AXIS. Esto debe configurarse para que este elemento de menú trabaje. Otra entrada válida esgnome-terminal -e vim. Esta entrada no se aplica a GMOCCAPY ya que esta GUI tiene un editor integrado. -
TOOL_EDITOR = tooledit- El editor que se utilizará al editar la tabla de herramientas (por ejemplo, al seleccionar "Archivo > Editar datos de herramienta …" en AXIS). Otras entradas validas songedit,gnome-terminal -e vimygvim. Esta entrada no se aplica a GMOCCAPY ya que esta GUI tiene un editor integrado. -
PYVCP = /archivo.xml- El archivo de descripción del panel PyVCP. Ver el << cha:pyvcp,capítulo PyVCP >> para más información. -
PYVCP_POSITION = BOTTOM- La ubicación del panel PyVCP en la interfaz de usuario AXIS. Si se omite esta variable, el panel pasará por defecto al lado derecho. La única alternativa valida esBOTTOM. Ver el << cha:pyvcp,Capítulo PyVCP >> para más información. -
LATHE = 1- Cualquier valor no vacío (incluido "0") hace que Axis utilice el "modo torno" con una vista superior y con Radio y Diámetro en el DRO. -
BACK_TOOL_LATHE = 1- Cualquier valor no vacío (incluido "0") hace que Axis utilice el "modo torno de herramienta trasera" con el eje X invertido. -
FOAM = 1- Cualquier valor no vacío (incluido "0") hace que Axis cambie la visualización para el modo cortador por espuma. -
GEOMETRY = XYZABCUVW- Controla la vista previa y el backplot de movimiento giratorio. Este elemento consiste en una secuencia de letras de eje, opcionalmente precedidas por un signo "-":-
Las letras X,Y,Z especifican la traslación a lo largo de la coordenada nombrada.
-
Las letras A,B,C especifican rotación alrededor de los correspondientes ejes X, Y, Z.
-
Las letras U,V,W especifican traslación a lo largo de los ejes relacionados X, Y, Z.
-
Cada letra especificada debe ocurrir en
[TRAJ]COORDINATESpara que tenga efecto. -
Un caracter especial "-" precediendo a cualquier letra invierte la dirección de la operación.
-
Las operaciones de traslación y rotación se evalúan de derecha a izquierda. De tal manera que usar
GEOMETRY=ZYZBCespecifica una rotación C seguida de una rotación B seguida por traslaciones Z, Y, X. El ordenamiento consecutivo de letras de traslación es inmaterial. -
La cadena apropiada de GEOMETRY depende de la configuración de la máquina y de las cinemáticas usadas para controlarla. El orden de las letras es importante. Por ejemplo, rotar alrededor de C y luego B es diferente que rotar alrededor de B y luego C.
-
Las rotaciones se aplican predeterminadamente con respecto al origen de máquina. Ejemplo:
GEOMETRY=CXYZprimero traslada al punto de control X, Y, Z y luego realiza una rotación C alrededor del eje Z centrado en el origen de máquina. -
Ejemplo de traslación UVW:
GEOMETRY=XYZUVWprovoca mover UVW en el sistema de coordenadas de la herramienta y mover XYZ en el sistema de coordenadas del material. -
Las máquinas de corte de espuma (
FOAM = 1) deben especificar "XY;UV" o dejar el valor en blanco aunque este valor se ignore actualmente en el modo de cortador de espuma. Una versión futura puede definir qué significa ";", pero si lo hace "XY;UV" significará lo mismo que el predeterminado para espuma actual. -
Experimental: Si se incluye el signo de exclamación (
!) en la cadena GEOMETRY, muestra los puntos para las rotaciones A, B, C respecto a los offsets X, Y, Z establecidos por los códigos G5x, G92. Ejemplo: UsandoGEOMETRY = !CXZpara una máquina con[TRAJ]COORDINATES=XZC. Esta provisión aplica sólo para gráficos en vivo (previsualizaciones de código G deben hacerse con offsets G5x, G92 cero. Esto se puede facilitar configurando offsets en programas sólo cuando la tarea se ejecuta como se indica en #<_task> == 1. Si existen offsets distintos de cero en el arranque por persistencia, se debe poner en cero los offsets y recargar la vista previa.
NotaSi no se incluye [DISPLAY]GEOMETRYen el archivo INI, un predeterminado es proporcionado por el programa GUI[DISPLAY]DISPLAY(típicamente "XYZABCUVW"). -
-
ARCDIVISION = 64- Establece la calidad de la vista previa de los arcos. Los arcos se previsualizan dividiéndolos en una serie de líneas rectas; un semicírculo se divide en ARCDIVISIÓN partes. Los valores más grandes dan una vista previa más precisa, pero tardan más tiempo en cargar y dan como resultado una pantalla más lenta. Los valores más pequeños dan una vista previa menos precisa, pero tarda menos tiempo en cargar y puede resultar en un despliegue más rápido. El valor predeterminado de 64 significa que un círculo de hasta 3 pulgadas se mostrará con precision de 1 mil (.03%). -
MDI_HISTORY_FILE =- El nombre del archivo de historial MDI local. Si no se especifica, AXIS guardará el historial MDI en .axis_mdi_history en el directorio de usuario. Esto es útil si tiene múltiples configuraciones en una computadora. -
JOG_AXES =- El orden en que se asignan las teclas de trote a las letras del eje. Las flechas izquierda y derecha se asignan a la letra del primer eje, arriba y abajo a la segunda, página arriba/página abajo a la tercera, y corchetes izquierdo y derecho a la cuarta. Si no se especifica, el valor predeterminado se determina a partir de los valores de[TRAJ]COORDINATES,[DISPLAY]LATHEy[DISPLAY]FOAM. -
JOG_INVERT =- Para cada letra de eje, se invierte la dirección del trote. El valor predeterminado es "X" para tornos y en blanco en el resto.NotaLa configuración de JOG_AXESyJOG_INVERTse aplican al trote modo universal por letra de eje de coordenadas y están vigentes mientras se encuentra en modo universal después de un homing exitoso. Cuando se opera en modo articulación anterior al homing, las teclas de trote del teclado se asignan en una secuencia fija: izquierda/derecha: joint0, arriba/abajo: joint1, página arriba/ página abajo: joint2, corchete izquierdo/derecho: joint3 -
USER_COMMAND_FILE = mycommands.py- El nombre de un archivo Python opcional, específico de configuración originado por la GUI AXIS en lugar del archivo específico del usuario~/.axisrc.
|
Nota
|
El siguiente elemento [DISPLAY] es utilizado únicamente por la interfaz TKLinuxCNC. |
-
HELP_FILE = tklinucnc.txt- Ruta al archivo de ayuda.
2.3. [FILTER] Section
AXIS and GMOCCAPY have the ability to send loaded files through a filter program. This filter can do any desired task: Something as simple as making sure the file ends with M2, or something as complicated as detecting whether the input is a depth image, and generating G-code to mill the shape it defines. The [FILTER] section of the INI file controls how filters work. First, for each type of file, write a PROGRAM_EXTENSION-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 LinuxCNC when Run.
-
PROGRAM_EXTENSION = .extension Description
If your post processor outputs files in all caps you might want to add the following line:
PROGRAM_EXTENSION = .NGC XYZ Post Processor
The following lines add support for the image-to-G-code converter included with LinuxCNC.
PROGRAM_EXTENSION = .png,.gif,.jpg # Greyscale Depth Image png = image-to-gcode gif = image-to-gcode jpg = image-to-gcode
An example of a custom G-code converter located in the linuxcnc directory.
PROGRAM_EXTENSION = .gcode 3D Printer gcode = /home/mill/linuxcnc/convert.py
|
Nota
|
The program file associated with an extension must have either the full path to the program or be located in a directory that is on the system path. |
It is also possible to specify an interpreter:
PROGRAM_EXTENSION = .py Python Script py = python
In this way, any Python script can be opened, and its output is treated as G-code. One such example script is available at nc_files/holecircle.py. This script creates G-code for drilling a series of holes along the circumference of a circle. Many more G-code generators are on the LinuxCNC Wiki site https://wiki.linuxcnc.org/.
Python filters should use the print function to output the result to AXIS.
This example program filters a file and adds a W axis to match the Z axis. It depends on there being a space between each axis word to work.
#!/usr/bin/env python3 import sys def main(argv): openfile = open(argv[0], 'r') file_in = openfile.readlines() openfile.close() file_out = [] for line in file_in: # print(line) if line.find('Z') != -1: words = line.rstrip('\n') words = words.split(' ') newword = '' for i in words: if i[0] == 'Z': newword = 'W'+ i[1:] if len(newword) > 0: words.append(newword) newline = ' '.join(words) file_out.append(newline) else: file_out.append(line) for item in file_out: print("%s" % item) if __name__ == "__main__": main(sys.argv[1:])
-
FILTER_PROGRESS=%d
Si se establece la variable de entorno AXIS_PROGRESS_BAR, entonces las líneas escritas a stderr de la forma de arriba establecen la barra de progreso de AXIS en el porcentaje dado. Esta característica debería ser utilizada por cualquier filtro que se ejecute por un tiempo prolongado.
2.4. [RS274NGC] Section
-
PARAMETER_FILE = myfile.var- El archivo ubicado en el mismo directorio que el archivo INI que contiene los parámetros utilizados por el intérprete (guardado entre ejecuciones). -
ORIENT_OFFSET = 0- A float value added to the R word parameter of an M19 Orient Spindle operation. Used to define an arbitrary zero position regardless of encoder mount orientation. -
RS274NGC_STARTUP_CODE = G17 G20 G40 G49 G64 P0.001 G80 G90 G92.1 G94 G97 G98- A string of NC codes that the interpreter is initialized with. This is not a substitute for specifying modal G-codes at the top of each NGC file, because the modal codes of machines differ, and may be changed by G-code interpreted earlier in the session. -
SUBROUTINE_PATH = ncsubroutines:/tmp/testsubs:lathesubs:millsubs- Specifies a colon (:) separated list of up to 10 directories to be searched when single-file subroutines are specified in G-code. These directories are searched after searching[DISPLAY]PROGRAM_PREFIX(if it is specified) and before searching[WIZARD]WIZARD_ROOT(if specified). The paths are searched in the order that they are listed. The first matching subroutine file found in the search is used. Directories are specified relative to the current directory for the INI file or as absolute paths. The list must contain no intervening whitespace. -
G64_DEFAULT_TOLERANCE =n (Default: 0) Default P value for G64 if P is not called out. -
G64_DEFAULT_NAIVETOLERANCE =n (Default: 0) Default Q value for G64 if Q is not called out. -
CENTER_ARC_RADIUS_TOLERANCE_INCH =n (Default: 0.00005) -
CENTER_ARC_RADIUS_TOLERANCE_MM =n (Default: 0.00127) -
USER_M_PATH = myfuncs:/tmp/mcodes:experimentalmcodes- Specifies a list of colon (:) separated directories for user defined functions. Directories are specified relative to the current directory for the INI file or as absolute paths. The list must contain no intervening whitespace.A search is made for each possible user defined function, typically (M100-M199). The search order is:
-
[DISPLAY]PROGRAM_PREFIX(if specified) -
If
[DISPLAY]PROGRAM_PREFIXis not specified, search the default location: nc_files -
Luego busca en cada directorio de la lista
[RS274NGC]USER_M_PATH.The first executable M1xx found in the search is used for each M1xx.
NotaThe maximum number of USER_M_PATHdirectories is defined at compile time (typ:USER_DEFINED_FUNCTION_MAX_DIRS == 5). -
-
INI_VARS = 1(Predeterminado: 1)
Permite que los programas de código G lean valores del archivo INI usando el formato #<_ini[sección]nombre>. Ver parámetros del código G. -
HAL_PIN_VARS = 1(Predeterminado: 1)
Permite que los programas de código G lean los valores de los pines HAL usando el formato #<_hal[Elemento Hal]> El acceso a esta variable es de solo lectura. Consulte parámetros de código G para obtener más detalles y una advertencia importante. -
RETAIN_G43 = 0(Predeterminado: 0)
Cuando está configurado, puede activar G43 después de cargar la primer herramienta, y luego despreocuparse de eso durante el transcurso del programa. Cuando usted finalmente descargue la última herramienta, el modo G43 es cancelado. -
OWORD_NARGS = 0(Predeterminado 0)
Si esta función está habilitada, una subrutina llamada puede determinar el número de parámetros posicionales reales pasados al inspeccionar el parámetro#<n_args>. -
NO_DOWNCASE_OWORD = 0(Predeterminado: 0)
Conservar mayúsculas y minúsculas en los nombres O-word dentro de los comentarios si está configurado, permite leer elementos HAL en mayúsculas y minúsculas en comentarios estructurados como(debug, #<_hal[MixedCaseItem]). -
OWORD_WARNONLY = 0(Predeterminado: 0)
Advertir en lugar de error en caso de errores en las subrutinas O-word. -
DISABLE_G92_PERSISTENCE = 0(Default: 0) Allow to clear the G92 offset automatically when config start-up. -
DISABLE_FANUC_STYLE_SUB = 0(Default: 0) If there is reason to disable Fanuc subroutines set it to 1. -
PARAMETER_G73_PECK_CLEARANCE = .020 (default: Metric machine: 1mm, imperial machine: .050 inches) Chip breaking back-off distance in machine units
-
PARAMETER_G83_PECK_CLEARANCE = .020 (default: Metric machine: 1mm, imperial machine: .050 inches) Clearance distance from last feed depth when machine rapids back to bottom of hole, in machine units.
|
Nota
|
Las seis opciones anteriores fueron controladas por la máscara de bits
|
|
Nota
|
[WIZARD]WIZARD_ROOT is a valid search path but the Wizard has not been fully implemented and the results of using it are unpredictable. |
-
LOG_LEVEL = 0Specify the log_level (default: 0) -
LOG_FILE = file-name.log
For specify the file used for log the data. -
REMAP=M400 modalgroup=10 argspec=Pq ngc=myprocedureSee Remap Extending G-code chapter for details. -
ON_ABORT_COMMAND=O <on_abort> callSee Remap Extending G-code chapter for details.
2.5. [EMCMOT] Section
This section is a custom section and is not used by LinuxCNC directly. Most configurations use values from this section to load the motion controller. For more information on the motion controller see the Motion section.
-
EMCMOT = motmod- the motion controller name is typically used here. -
BASE_PERIOD = 50000- the Base task period in nanoseconds. -
SERVO_PERIOD = 1000000- This is the "Servo" task period in nanoseconds. -
TRAJ_PERIOD = 100000- Este es el período de la tarea Planificador de trayectoria en nanosegundos. -
COMM_TIMEOUT = 1.0- Number of seconds to wait for Motion (the realtime part of the motion controller) to acknowledge receipt of messages from Task (the non-realtime part of the motion controller). -
HOMEMOD =alternate_homing_module [home_parms=value] La variable HOMEMOD es opcional. Si se especifica, usa un módulo (construido por el usuario) en lugar del predeterminado (homemod). Los parámetros del módulo (home_parms) pueden incluirse si los soporta el módulo especificado. La configuración puede ser anulada desde la línea de comandos usando la opción -m ($ linuxcnc -h).
2.6. [TASK] Section
-
TASK = milltask- Specifies the name of the task executable. The task executable does various things, such as-
communicate with the UIs over NML,
-
communicate with the realtime motion planner over non-HAL shared memory, and
-
interpreta código G. Currently there is only one task executable that makes sense for 99.9% of users, milltask.
-
-
CYCLE_TIME = 0.010- The period, in seconds, at which TASK will run. This parameter affects the polling interval when waiting for motion to complete, when executing a pause instruction, and when accepting a command from a user interface. There is usually no need to change this number.
2.7. [HAL] section
-
HALFILE = example.hal- Execute the file example.hal at start up.If
HALFILEis specified multiple times, the files are interpreted in the order they appear in the INI file. HAL files are descriptive, the execution of what is described in HAL files is triggered by the threads in which functions are embedded, not by the reading of the HAL file. Almost all configurations will have at least oneHALFILE, and stepper systems typically have two such files, i.e., one which specifies the generic stepper configuration (core_stepper.hal) and one which specifies the machine pin out (xxx_pinout.hal).Los archivos HAL especificados en la variable
HALFILESse encuentran con una búsqueda. Si el archivo nombrado se encuentra en el directorio que contiene el archivo INI, se utiliza. Si el archivo nombrado no se encuentra en este directorio de archivos INI, se realiza una búsqueda utilizando una biblioteca de sistema de archivos HAL.If LinuxCNC is started with the
linuxcncscript using the "-Hdirname" option, the specified dirname is prepended to the search described above so that dirname is searched first. The "-Hdirname" option may be specified more than once, directories are prepended in order.A HALFILE may also be specified as an absolute path (when the name starts with a / character). Absolute paths are not recommended as their use may limit relocation of configurations.
-
HALFILE = texample.tcl[arg1 [arg2] …] - Execute the tcl file texample.tcl at start up with arg1, arg2, etc. as argv list. Files with a .tcl suffix are processed as above but use haltcl for processing. See the HALTCL Chapter for more information. -
HALFILE = LIB:sys_example.hal- Execute the system library file sys_example.hal at start up. Explicit use of the LIB: prefix causes use of the system library HALFILE without searching the INI file directory. -
HALFILE = LIB:sys_texample.tcl[arg1 [arg2 …]] - Execute the system library file sys_texample.tcl at start up. Explicit use of the LIB: prefix causes use of the system library HALFILE without searching the INI file directory.
HALFILE items specify files that loadrt HAL components and make signal connections between component pins. Common mistakes are
-
omission of the addf statement needed to add a component’s function(s) to a thread,
-
incomplete signal (net) specifiers.
Omission of required addf statements is almost always an error. Signals usually include one or more input connections and a single output (but both are not strictly required). A system library file is provided to make checks for these conditions and report to stdout and in a pop-up GUI:
HALFILE = LIB:halcheck.tcl [nopopup]
|
Nota
|
The LIB:halcheck.tcl line should be the last [HAL]HALFILE. Specify the nopopup option to suppress the popup message and allow immediate starting. Connections made using a POSTGUI_HALFILE are not checked. |
-
TWOPASS = ON- Utilice el procesamiento de dos pasos para cargar componentes HAL. Con el procesamiento TWOPASS, las líneas[HAL]HALFILEse procesan en dos pasadas. En el primer pase (pass0), se leen todos los HALFILES y se acumulan múltiples aspectos de los comandos loadrt y loadusr. Estos comandos de carga acumulada se ejecutan al final de pass0. Esta acumulación permite líneas de carga que se especificarán más de una vez para un componente dado (siempre que los nombres names= utilizados sean únicos en cada uso). En el segundo pase (pase1), los HALFILES son releídos y todos los comandos excepto los comandos de carga ejecutados previamente son ejecutados. -
TWOPASS = nodelete verbose- TheTWOPASSfeature can be activated with any non-null string including the keywords verbose and nodelete. The verbose keyword causes printing of details to stdout. The nodelete keyword preserves temporary files in /tmp.
For more information see the HAL TWOPASS chapter.
-
HALCMD =command - Execute command as a single HAL command. IfHALCMDis specified multiple times, the commands are executed in the order they appear in the INI file.HALCMD-lines are executed after allHALFILE-lines. -
SHUTDOWN = shutdown.hal- Execute the file shutdown.hal when LinuxCNC is exiting. Depending on the hardware drivers used, this may make it possible to set outputs to defined values when LinuxCNC is exited normally. However, because there is no guarantee this file will be executed (for instance, in the case of a computer crash), it is not a replacement for a proper physical e-stop chain or other protections against software failure. -
POSTGUI_HALFILE = example2.hal- Ejecuta example2.hal después de que la GUI haya creado sus pines HAL. Algunas GUI crean pines HAL y admiten el uso de un halfile postgui para usarlos. Las GUI que admiten halfiles postgui incluyen Touchy, AXIS, Gscreen y GMOCAPPY.
Vea la sección PyVCP con AXIS para más información. -
HALUI = halui- agrega los pines de la interfaz de usuario de HAL.
Para mas información, ver el capítulo Interfaz de usuario HAL.
2.8. [HALUI] section
-
MDI_COMMAND = G53 G0 X0 Y0 Z0- Se puede ejecutar un comando MDI utilizandohalui.mdi-command-00. Incremente el número para cada comando que se enumera en la sección [HALUI]. También es posible iniciar subrutinas.MDI_COMMAND = o<tu-subrutina> CALL [#<tu-variable>]
2.9. [APPLICATIONS] Section
LinuxCNC can start other applications before the specified GUI is started. The applications can be started after a specified delay to allow for GUI-dependent actions (like creating GUI-specific HAL pins).
-
DELAY =value - seconds to wait before starting other applications. A delay may be needed if an application has dependencies on[HAL]POSTGUI_HALFILEactions or GUI-created HAL pins (defaultDELAY=0). -
‘APP =` appname [arg1 [arg2 …]]’ - Aplicación que se iniciará. Esta especificación se puede incluir varias veces. El nombre de la aplicación puede ser dado explícitamente como un nombre de archivo especificado absoluto o especificado con tilde (primer carácter es / o ~), un nombre de archivo relativo (los primeros caracteres del nombre de archivo son ./), o como un archivo en el directorio INI. Si no se encuentra ningún archivo ejecutable usando estos nombres, se utiliza la ruta de búsqueda del usuario para encontrar la aplicación.
Ejemplos:-
Simulate inputs to HAL pins for testing (using sim_pin — a simple GUI to set inputs to parameters, unconnected pins, or signals with no writers):
APP = sim_pin motion.probe-input halui.abort motion.analog-in-00
-
Invoke halshow with a previuosly saved watchlist. Since LinuxCNC sets the working directory to the directory for the INI file, you can refer to files in that directory (example: my.halshow):
APP = halshow my.halshow
-
Alternatively, a watchlist file identified with a full pathname could be specified:
APP = halshow ~/saved_shows/spindle.halshow
-
Open halscope using a previously saved configuration:
APP = halscope -i my.halscope
-
2.10. [TRAJ] Section
|
Aviso
|
El nuevo Planificador de trayectoria (TP) está activado de forma predeterminada. Si no tiene configuraciones TP en su sección [TRAJ] - LinuxCNC por defecto hace: |
The [TRAJ] section contains general parameters for the trajectory planning module in motion.
-
ARC_BLEND_ENABLE = 1- Turn on new TP. If set to 0 TP uses parabolic blending (1 segment look ahead) (Default: 1). -
ARC_BLEND_FALLBACK_ENABLE = 0- Optionally fall back to parabolic blends if the estimated speed is faster. However, this estimate is rough, and it seems that just disabling it gives better performance (Default: 0). -
ARC_BLEND_OPTIMIZATION_DEPTH = 50- Look ahead depth in number of segments.To expand on this a bit, you can choose this value somewhat arbitrarily. Here’s a formula to estimate how much depth you need for a particular config:
# n = v_max / (2.0 * a_max * t_c) # where: # n = optimization depth # v_max = max axis velocity (UU / sec) # a_max = max axis acceleration (UU / sec) # t_c = servo period (seconds)So, a machine with a maximum axis velocity of 10 IPS, a max acceleration of 100 IPS2, and a servo period of 0.001 s would need:
10 / (2.0 * 100 * 0.001) = 50 segments to always reach maximum velocity along the fastest axis.
In practice, this number isn’t that important to tune, since the look ahead rarely needs the full depth unless you have lots of very short segments. If during testing, you notice strange slowdowns and can’t figure out where they come from, first try increasing this depth using the formula above.
If you still see strange slowdowns, it may be because you have short segments in the program. If this is the case, try adding a small tolerance for Naive CAM detection. A good rule of thumb is this:
# min_length ~= v_req * t_c # where: # v_req = desired velocity in UU / sec # t_c = servo period (seconds)If you want to travel along a path at 1 IPS = 60 IPM, and your servo period is 0.001 s, then any segments shorter than min_length will slow the path down. If you set Naive CAM tolerance to around this min length, overly short segments will be combined together to eliminate this bottleneck. Of course, setting the tolerance too high means big path deviations, so you have to play with it a bit to find a good value. I’d start at 1/2 of the min_length, then work up as needed. *
ARC_BLEND_GAP_CYCLES = 4How short the previous segment must be before the trajectory planner consumes it.Often, a circular arc blend will leave short line segments in between the blends. Since the geometry has to be circular, we can’t blend over all of a line if the next one is a little shorter. Since the trajectory planner has to touch each segment at least once, it means that very tiny segments will slow things down significantly. My fix to this way to "consume" the short segment by making it a part of the blend arc. Since the line+blend is one segment, we don’t have to slow down to hit the very short segment. Likely, you won’t need to touch this setting. *
ARC_BLEND_RAMP_FREQ = 20- This is a cutoff frequency for using ramped velocity.Ramped velocity in this case just means constant acceleration over the whole segment. This is less optimal than a trapezoidal velocity profile, since the acceleration is not maximized. However, if the segment is short enough, there isn’t enough time to accelerate much before we hit the next segment. Recall the short line segments from the previous example. Since they’re lines, there’s no cornering acceleration, so we’re free to accelerate up to the requested speed. However, if this line is between two arcs, then it will have to quickly decelerate again to be within the maximum speed of the next segment. This means that we have a spike of acceleration, then a spike of deceleration, causing a large jerk, for very little performance gain. This setting is a way to eliminate this jerk for short segments.
Basically, if a segment will complete in less time than 1 / ARC_BLEND_RAMP_FREQ, we don’t bother with a trapezoidal velocity profile on that segment, and use constant acceleration. (Setting
ARC_BLEND_RAMP_FREQ = 1000is equivalent to always using trapezoidal acceleration, if the servo loop is 1 kHz).You can characterize the worst-case loss of performance by comparing the velocity that a trapezoidal profile reaches vs. the ramp:
# v_ripple = a_max / (4.0 * f) # where: # v_ripple = average velocity "loss" due to ramping # a_max = max axis acceleration # f = cutoff frequency from INIFor the aforementioned machine, the ripple for a 20 Hz cutoff frequency is 100 / (4 * 20) = 1.25 IPS. This seems high, but keep in mind that it is only a worst-case estimate. In reality, the trapezoidal motion profile is limited by other factors, such as normal acceleration or requested velocity, and so the actual performance loss should be much smaller. Increasing the cutoff frequency can squeeze out more performance, but make the motion rougher due to acceleration discontinuities. A value in the range 20 Hz to 200 Hz should be reasonable to start.
Finally, no amount of tweaking will speed up a tool path with lots of small, tight corners, since you’re limited by cornering acceleration.
-
SPINDLES = 3- The number of spindles to support. It is imperative that this number matches the "num_spindles" parameter passed to the motion module. -
COORDINATES = X Y Z- The names of the axes being controlled. Only X, Y, Z, A, B, C, U, V, W are valid. Only axes named inCOORDINATESare accepted in G-code. It is permitted to write an axis name more than once (e.g., X Y Y Z for a gantry machine). For the common trivkins kinematics, joint numbers are assigned in sequence according to the trivkins parameter coordinates=. So, for trivkins coordinates=xz, joint0 corresponds to X and joint1 corresponds to Z. See the kinematics man page ($ man kins) for information on trivkins and other kinematics modules. -
LINEAR_UNITS =<units>_ - Specifies the machine units for linear axes. Possible choices are mm or inch. This does not affect the linear units in NC code (the G20 and G21 words do this). -
ANGULAR_UNITS =<units> - Specifies the machine units for rotational axes. Possible choices are deg, degree (360 per circle), rad, radian (2*π per circle), grad, or gon (400 per circle). This does not affect the angular units of NC code. In RS274NGC, A-, B- and C- words are always expressed in degrees. -
DEFAULT_LINEAR_VELOCITY = 0.0167- The initial rate for jogs of linear axes, in machine units per second. The value shown in AXIS equals machine units per minute. -
DEFAULT_LINEAR_ACCELERATION = 2.0- In machines with nontrivial kinematics, the acceleration used for "teleop" (Cartesian space) jogs, in machine units per second per second. -
MAX_LINEAR_VELOCITY = 5.0- The maximum velocity for any axis or coordinated move, in machine units per second. The value shown equals 300 units per minute. -
MAX_LINEAR_ACCELERATION = 20.0- The maximum acceleration for any axis or coordinated axis move, in machine units per second per second. -
PLANNER_TYPE = 0- Selects the trajectory planner type: 0 = trapezoidal (default), 1 = S-curve with jerk limiting. S-curve planning is only active whenPLANNER_TYPE = 1ANDMAX_LINEAR_JERK > 0. -
MAX_LINEAR_JERK = 0.0- The maximum jerk (rate of change of acceleration) for coordinated moves, in machine units per second cubed. When set to 0 (default), jerk limiting is disabled. When greater than 0 andPLANNER_TYPE = 1, enables S-curve trajectory planning. -
DEFAULT_LINEAR_JERK = 0.0- The default jerk value for coordinated moves, in machine units per second cubed. When set to 0,MAX_LINEAR_JERKis used. -
POSITION_FILE =position.txt - If set to a non-empty value, the joint positions are stored between runs in this file. This allows the machine to start with the same coordinates it had on shutdown. This assumes there was no movement of the machine while powered off. If unset, joint positions are not stored and will begin at 0 each time LinuxCNC is started. This can help on smaller machines without home switches. If using the Mesa resolver interface this file can be used to emulate absolute encoders and eliminate the need for homing (with no loss of accuracy). See the hostmot2 manpage for more details. -
NO_FORCE_HOMING = 1- The default behavior is for LinuxCNC to force the user to home the machine before any MDI command or a program is run. Normally, only jogging is allowed before homing. For configurations using identity kinematics, settingNO_FORCE_HOMING = 1allows the user to make MDI moves and run programs without homing the machine first. Interfaces using identity kinematics without homing ability will need to have this option set to 1.
|
Aviso
|
LinuxCNC will not know your joint travel limits when using |
-
HOME = 0 0 0 0 0 0 0 0 0- World home position needed for kinematics modules that compute world coordinates using kinematicsForward() when switching from joint to teleop mode. Up to nine coordinate values (X Y Z A B C U V W) may be specified, unused trailing items may be omitted. This value is only used for machines with nontrivial kinematics. On machines with trivial kinematics (mill, lathe, gantry types) this value is ignored. Note: The sim hexapod config requires a non-zero value for the Z coordinate. -
TPMOD =alternate_trajectory_planning module [tp_parms=value]
La variableTPMODes opcional. Si se especifica, usa un módulo especificado (construido por el usuario) en lugar del predeterminado (tpmod). Los parámetros del módulo (tp_parms) pueden incluirse si los soporta el módulo especificado. La configuración puede anularse desde la línea de comandos usando la opción -t ($ linuxcnc -h). -
NO_PROBE_JOG_ERROR = 0- Allow to bypass probe tripped check when you jog manually. -
NO_PROBE_HOME_ERROR = 0- Allow to bypass probe tripped check when homing is in progress.
2.11. [KINS] Section
-
JOINTS = 3- Especifica el número de articulaciones (motores) en el sistema. Por ejemplo, una máquina trivkins XYZ con un solo motor para cada eje tiene 3 articulaciones. Una máquina de pórtico con un motor en cada uno de los dos ejes, y dos motores en el tercer eje, tiene 4 articulaciones. (Esta variable de configuración puede ser utilizada por una interfaz gráfica de usuario para establecer el número de articulaciones (num_joints) especificado en el módulo de movimiento (motmod).) -
KINEMATICS = trivkins- Especifica un módulo de cinemática para el módulo motion. Las GUIs pueden usar esta variable para especificar la línealoadrten archivos HAL para el módulo motmod. Para obtener más información sobre los módulos de cinemática, consulte la página de manual:$ man kins.
2.12. [AXIS_<letter>] Section
The <letter> specifies one of: X Y Z A B C U V W
-
TYPE = LINEAR- The type of this axis, eitherLINEARorANGULAR. Required if this axis is not a default axis type. The default axis types are X,Y,Z,U,V,W = LINEAR and A,B,C = ANGULAR. This setting is effective with the AXIS GUI but note that other GUI’s may handle things differently. -
MAX_VELOCITY = 1.2- Maximum velocity for this axis in machine units per second. -
MAX_ACCELERATION = 20.0- Aceleración máxima para este eje en unidades máquina por segundo al cuadrado. -
MAX_JERK = 0.0- Maximum jerk for this axis in machine units per second cubed. Used when S-curve trajectory planning is enabled. When set to 0 (default), no per-axis jerk limiting is applied. -
MIN_LIMIT = -1000- The minimum limit (soft limit) for axis motion, in machine units. When this limit is exceeded, the controller aborts axis motion. The axis must be homed beforeMIN_LIMITis in force. For a rotary axis (A,B,C typ) with unlimited rotation having noMIN_LIMITfor that axis in the[AXIS_<letter>]section a value of -1e99 is used. -
MAX_LIMIT = 1000- The maximum limit (soft limit) for axis motion, in machine units. When this limit is exceeded, the controller aborts axis motion. The axis must be homed before MAX_LIMIT is in force. For a rotary axis (A,B,C typ) with unlimited rotation having noMAX_LIMITfor that axis in the[AXIS_<letter>]section a value of 1e99 is used. -
WRAPPED_ROTARY = 1- When this is set to 1 for an ANGULAR axis the axis will move 0-359.999 degrees. Positive Numbers will move the axis in a positive direction and negative numbers will move the axis in the negative direction. -
LOCKING_INDEXER_JOINT = 4- This value selects a joint to use for a locking indexer for the specified axis <letter>. In this example, the joint is 4 which would correspond to the B axis for a XYZAB system with trivkins (identity) kinematics. When set, a G0 move for this axis will initiate an unlock with thejoint.4.unlock pinthen wait for thejoint.4.is-unlockedpin then move the joint at the rapid rate for that joint. After the move thejoint.4.unlockwill be false and motion will wait forjoint.4.is-unlockedto go false. Moving with other joints is not allowed when moving a locked rotary joint. To create the unlock pins, use the motmod parameter:unlock_joints_mask=jointmask
The jointmask bits are: (LSB)0:joint0, 1:joint1, 2:joint2, …
Ejemplo:
loadrt motmod ... unlock_joints_mask = 0x38crea pines de desbloqueo para articulaciones 3,4,5. -
OFFSET_AV_RATIO = 0.1- If nonzero, this item enables the use of HAL input pins for external axis offsets:axis.<letter>.eoffset-enable axis.<letter>.eoffset-count axis.<letter>.eoffset-scale
See the chapter: External Axis Offsets for usage information.
2.13. [JOINT_<num>] Sections
<num> especifica el número de articulación 0 … (num_joints-1) El valor de num_joints lo establece [KINS]JOINTS=.
The [JOINT_0], [JOINT_1], etc. sections contains general parameters for the individual components in the joint control module. The joint section names begin numbering at 0, and run through the number of joints specified in the [KINS]JOINTS entry minus 1.
Typically (for systems using trivkins kinematics, there is a 1:1 correspondence between a joint and an axis coordinate letter):
-
JOINT_0 = X
-
JOINT_1 = Y
-
JOINT_2 = Z
-
JOINT_3 = A
-
JOINT_4 = B
-
JOINT_5 = C
-
JOINT_6 = U
-
JOINT_7 = V
-
JOINT_8 = W
Other kinematics modules with identity kinematics are available to support configurations with partial sets of axes. For example, using trivkins with coordinates=XZ, the joint-axes relationships are:
-
JOINT_0 = X
-
JOINT_1 = Z
Para obtener mas información sobre los módulos cinemáticos, consulte la página de manual kins (en una terminal de UNIX teclee $ man kins).
-
TYPE = LINEAR- The type of joint, eitherLINEARorANGULAR. -
UNITS = INCH- Si se especifica, esta configuración anula la configuración relacionada[TRAJ] UNITS, por ejemplo,[TRAJ]LINEAR_UNITSsi elTYPEde esta articulación esLINEAR,[TRAJ]ANGULAR_UNITSsi elTYPEde esta articulación esANGULAR. -
MAX_VELOCITY = 1.2- Maximum velocity for this joint in machine units per second. -
MAX_ACCELERATION = 20.0- Aceleración máxima para esta articulación en unidades máquina por segundo al cuadrado. -
MAX_JERK = 0.0- Maximum jerk for this joint in machine units per second cubed. Used when S-curve trajectory planning is enabled. When set to 0 (default), no per-joint jerk limiting is applied. -
BACKLASH = 0.0000- Backlash in machine units. Backlash compensation value can be used to make up for small deficiencies in the hardware used to drive an joint. If backlash is added to an joint and you are using steppers theSTEPGEN_MAXACCELmust be increased to 1.5 to 2 times theMAX_ACCELERATIONfor the joint. Excessive backlash compensation can cause an joint to jerk as it changes direction. If a COMP_FILE is specified for a joint BACKLASH is not used. -
COMP_FILE =file.extension - The compensation file consists of map of position information for the joint. Compensation file values are in machine units. Each set of values are are on one line separated by a space. The first value is the nominal value (the commanded position). The second and third values depend on the setting ofCOMP_FILE_TYPE. Points in between nominal values are interpolated between the two nominals. Compensation files must start with the smallest nominal and be in ascending order to the largest value of nominals. File names are case sensitive and can contain letters and/or numbers. Currently the limit inside LinuxCNC is for 256 triplets per joint.If
COMP_FILEis specified for a joint,BACKLASHis not used. -
COMP_FILE_TYPE = 0o1' - Especifica el tipo de archivo de compensación. El primer valor es la posición nominal (ordenada) para ambos tipos. + Se debe especificar un `COMP_FILE_TYPEpara cadaCOMP_FILE.-
Type 0: The second value specifies the actual position as the joint is moving in the positive direction (increasing value). The third value specifies the actual position as the joint is moving in the negative direction (decreasing value).
Type 0 Example-1.000 -1.005 -0.995 0.000 0.002 -0.003 1.000 1.003 0.998 -
Type 1: The second value specifies positive offset from nominal while traveling in the positive direction. The third value specifies the negative offset from nominal while traveling in a negative direction.
Type 1 Example-1.000 0.005 -0.005 0.000 0.002 -0.003 1.000 0.003 -0.004
-
-
MIN_LIMIT = -1000- The minimum limit for joint motion, in machine units. When this limit is reached, the controller aborts joint motion. For a rotary joint with unlimited rotation having noMIN_LIMITfor that joint in the[JOINT_N]section a the value -1e99 is used. -
MAX_LIMIT = 1000- The maximum limit for joint motion, in machine units. When this limit is reached, the controller aborts joint motion. For a rotary joint with unlimited rotation having noMAX_LIMITfor that joint in the[JOINT_N]section a the value 1e99 is used.
|
Nota
|
For identity kinematics, the |
|
Nota
|
The |
-
MIN_FERROR = 0.010- This is the value in machine units by which the joint is permitted to deviate from commanded position at very low speeds. If MIN_FERROR is smaller than FERROR, the two produce a ramp of error trip points. You could think of this as a graph where one dimension is speed and the other is permitted following error. As speed increases the amount of following error also increases toward theFERRORvalue. -
FERROR = 1.0-FERRORis the maximum allowable following error, in machine units. If the difference between commanded and sensed position exceeds this amount, the controller disables servo calculations, sets all the outputs to 0.0, and disables the amplifiers. IfMIN_FERRORis present in the INI file, velocity-proportional following errors are used. Here, the maximum allowable following error is proportional to the speed, withFERRORapplying to the rapid rate set by[TRAJ]MAX_VELOCITY, and proportionally smaller following errors for slower speeds. The maximum allowable following error will always be greater thanMIN_FERROR. This prevents small following errors for stationary axes from inadvertently aborting motion. Small following errors will always be present due to vibration, etc. -
LOCKING_INDEXER = 1- Indicates the joint is used as a locking indexer.
2.13.1. Homing
These parameters are Homing related, for a better explanation read the Homing Configuration Chapter.
-
HOME = 0.0- The position that the joint will go to upon completion of the homing sequence. -
HOME_OFFSET = 0.0- The joint position of the home switch or index pulse, in machine units. When the home point is found during the homing process, this is the position that is assigned to that point. When sharing home and limit switches and using a home sequence that will leave the home/limit switch in the toggled state, the home offset can be used define the home switch position to be other than 0 if your HOME position is desired to be 0. -
HOME_SEARCH_VEL = 0.0- Initial homing velocity in machine units per second. Sign denotes direction of travel. A value of zero means assume that the current location is the home position for the machine. If your machine has no home switches you will want to leave this value at zero. -
HOME_LATCH_VEL = 0.0- Homing velocity in machine units per second to the home switch latch position. Sign denotes direction of travel. -
HOME_FINAL_VEL = 0.0- Velocity in machine units per second from home latch position to home position. If left at 0 or not included in the joint rapid velocity is used. Must be a positive number. -
HOME_USE_INDEX = NO- If the encoder used for this joint has an index pulse, and the motion card has provision for this signal you may set it to yes. When it is yes, it will affect the kind of home pattern used. Currently, you can’t home to index with steppers unless you’re using StepGen in velocity mode and PID. -
HOME_INDEX_NO_ENCODER_RESET = NO- Use YES if the encoder used for this joint does not reset its counter when an index pulse is detected after assertion of the jointindex_enableHAL pin. Applicable only forHOME_USE_INDEX = YES. -
HOME_IGNORE_LIMITS = NO- When you use the limit switch as a home switch and the limit switch this should be set to YES. When set to YES the limit switch for this joint is ignored when homing. You must configure your homing so that at the end of your home move the home/limit switch is not in the toggled state you will get a limit switch error after the home move. -
HOME_IS_SHARED =<n> - If the home input is shared by more than one joint set <n> to 1 to prevent homing from starting if the one of the shared switches is already closed. Set <n> to 0 to permit homing if a switch is closed. -
HOME_ABSOLUTE_ENCODER = 0|1|2- Used to indicate the joint uses an absolute encoder. At a request for homing, the current joint value is set to theHOME_OFFSETvalue. If theHOME_ABSOLUTE_ENCODERsetting is 1, the machine makes the usual final move to theHOMEvalue. If theHOME_ABSOLUTE_ENCODERsetting is 2, no final move is made. -
HOME_SEQUENCE =<n> - Se utiliza para definir la secuencia "Home Todo". <n> debe comenzar en0o1o-1. Se pueden especificar secuencias adicionales con números crecientes de 1 en 1 (en valor absoluto). No se permite brincar números de secuencia. Si se omite unaHOME_SEQUENCE, la articulación no será homeada por la función "Home All". Se puede homear mas de una articulación al mismo tiempo especificando el mismo número de secuencia para más de una articulación. Se utiliza un número de secuencia negativa para diferir el movimiento final para todas las articulaciones que tienen ese número de secuencia (negativo o positivo). Para obtener información adicional, consulte: SECUENCIA HOME. -
VOLATILE_HOME = 0- When enabled (set to1) this joint will be unhomed if the Machine Power is off or if E-Stop is on. This is useful if your machine has home switches and does not have position feedback such as a step and direction driven machine.
2.13.2. Servos
These parameters are relevant to joints controlled by servos.
|
Aviso
|
The following are custom INI file entries that you may find in a sample INI file or a wizard generated file. These are not used by the LinuxCNC software. They are only there to put all the settings in one place. For more information on custom INI file entries see the Custom Sections and Variables subsection. |
The following items might be used by a PID component and the assumption is that the output is volts.
-
DEADBAND = 0.000015- How close is close enough to consider the motor in position, in machine units.This is often set to a distance equivalent to 1, 1.5, 2, or 3 encoder counts, but there are no strict rules. Looser (larger) settings allow less servo hunting at the expense of lower accuracy. Tighter (smaller) settings attempt higher accuracy at the expense of more servo hunting. Is it really more accurate if it’s also more uncertain? As a general rule, it’s good to avoid, or at least limit, servo hunting if you can.
Be careful about going below 1 encoder count, since you may create a condition where there is no place that your servo is happy. This can go beyond hunting (slow) to nervous (rapid), and even to squealing which is easy to confuse with oscillation caused by improper tuning. Better to be a count or two loose here at first, until you’ve been through gross tuning at least.
Example of calculating machine units per encoder pulse to use in deciding
DEADBANDvalue:
-
BIAS = 0.000- This is used by hm2-servo and some others. Bias is a constant amount that is added to the output. In most cases it should be left at zero. However, it can sometimes be useful to compensate for offsets in servo amplifiers, or to balance the weight of an object that moves vertically. Bias is turned off when the PID loop is disabled, just like all other components of the output. -
P = 50- The proportional gain for the joint servo. This value multiplies the error between commanded and actual position in machine units, resulting in a contribution to the computed voltage for the motor amplifier. The units on the P gain are volts per machine unit, e.g.,
-
I = 0- The integral gain for the joint servo. The value multiplies the cumulative error between commanded and actual position in machine units, resulting in a contribution to the computed voltage for the motor amplifier. The units on the I gain are volts per machine unit second, e.g.,
-
D = 0- The derivative gain for the joint servo. The value multiplies the difference between the current and previous errors, resulting in a contribution to the computed voltage for the motor amplifier. The units on the D gain are volts per machine unit per second, e.g.,
-
FF0 = 0- The 0th order feed forward gain. This number is multiplied by the commanded position, resulting in a contribution to the computed voltage for the motor amplifier. The units on the FF0 gain are volts per machine unit, e.g.,
-
FF1 = 0- The 1st order feed forward gain. This number is multiplied by the change in commanded position per second, resulting in a contribution to the computed voltage for the motor amplifier. The units on the FF1 gain are volts per machine unit per second, e.g.,
-
FF2 = 0- The 2nd order feed forward gain. This number is multiplied by the change in commanded position per second per second, resulting in a contribution to the computed voltage for the motor amplifier. The units on the FF2 gain are volts per machine unit per second per second, e.g.,
-
OUTPUT_SCALE = 1.000 -
OUTPUT_OFFSET = 0.000These two values are the scale and offset factors for the joint output to the motor amplifiers.
The second value (offset) is subtracted from the computed output (in volts), and divided by the first value (scale factor), before being written to the D/A converters. The units on the scale value are in true volts per DAC output volts. The units on the offset value are in volts. These can be used to linearize a DAC. Specifically, when writing outputs, the LinuxCNC first converts the desired output in quasi-SI units to raw actuator values, e.g., Volts for an amplifier DAC. This scaling looks like:
The value for scale can be obtained analytically by doing a unit analysis, i.e., units are [output SI units]/[actuator units]. For example, on a machine with a velocity mode amplifier such that 1 V results in 250 mm/s velocity.
Note that the units of the offset are in machine units, e.g. mm/s, and they are pre-subtracted from the sensor readings. The value for this offset is obtained by finding the value of your output which yields 0.0 for the actuator output. If the DAC is linearized, this offset is normally 0.0.
The scale and offset can be used to linearize the DAC as well, resulting in values that reflect the combined effects of amplifier gain, DAC non-linearity, DAC units, etc.
To do this, follow this procedure.
-
Build a calibration table for the output, driving the DAC with a desired voltage and measuring the result.
-
Do a least-squares linear fit to get coefficients a, b such that
-
Tenga en cuenta que queremos una salida en bruto de modo que nuestro resultado medido sea idéntico a la salida ordenada. Esto significa
-
-
Como resultado, los coeficientes a y b del ajuste lineal pueden ser utilizado como la escala y el offset para el controlador directamente.
See the following table for an example of voltage measurements.
Tabla 1. Mediciones del voltaje de salida Bruto Medido -10
-9.93
-9
-8.83
0
-0.03
1
0.96
9
9.87
10
10.87
-
-
MAX_OUTPUT = 10- El valor máximo para la salida de la compensación PID que se escribe en el amplificador del motor, en voltios. El valor calculado de salida está sujeto a este límite. El límite se aplica antes de escalar a unidades de salida en bruto. El valor se aplica simétricamente tanto al lado positivo como al negativo. -
INPUT_SCALE = 20000- en configuraciones de muestra -
ENCODER_SCALE = 20000- en configuraciones construidas con PNCconf
Specifies the number of pulses that corresponds to a move of one machine unit as set in the [TRAJ] section. For a linear joint one machine unit will be equal to the setting of LINEAR_UNITS. For an angular joint one unit is equal to the setting in ANGULAR_UNITS. A second number, if specified, is ignored. For example, on a 2000 counts per rev encoder, and 10 revs/inch gearing, and desired units of inch, we have:
2.13.3. Stepper
These parameters are relevant to joints controlled by steppers.
|
Aviso
|
The following are custom INI file entries that you may find in a sample INI file or a wizard generated file. These are not used by the LinuxCNC software and meant only to put all the settings in one place. For more information on custom INI file entries see the Custom Sections and Variables subsection. |
The following items might be used by a StepGen component.
-
SCALE = 4000- in Sample configs -
STEP_SCALE = 4000- in PnCconf built configs
Specifies the number of pulses that corresponds to a move of one machine unit as set in the [TRAJ] section. For stepper systems, this is the number of step pulses issued per machine unit. For a linear joint one machine unit will be equal to the setting of LINEAR_UNITS. For an angular joint one unit is equal to the setting in ANGULAR_UNITS. For servo systems, this is the number of feedback pulses per machine unit. A second number, if specified, is ignored.
For example, on a 1.8 degree stepper motor with half-stepping, and 10 revs/inch gearing, and desired machine units of inch, we have:
|
Nota
|
Old INI and HAL files used INPUT_SCALE for this value. |
-
ENCODER_SCALE = 20000(Optionally used in PnCconf built configs) - Specifies the number of pulses that corresponds to a move of one machine unit as set in the[TRAJ]section. For a linear joint one machine unit will be equal to the setting ofLINEAR_UNITS. For an angular joint one unit is equal to the setting inANGULAR_UNITS. A second number, if specified, is ignored. For example, on a 2000 counts per rev encoder, and 10 revs/inch gearing, and desired units of inch, we have:
-
STEPGEN_MAXACCEL = 21.0- Acceleration limit for the step generator. This should be 1% to 10% larger than the jointMAX_ACCELERATION. This value improves the tuning of StepGen’s "position loop". If you have added backlash compensation to an joint then this should be 1.5 to 2 times greater thanMAX_ACCELERATION. -
STEPGEN_MAXVEL = 1.4- Older configuration files have a velocity limit for the step generator as well. If specified, it should also be 1% to 10% larger than the jointMAX_VELOCITY. Subsequent testing has shown that use ofSTEPGEN_MAXVELdoes not improve the tuning of StepGen’s position loop.
2.14. [SPINDLE_<num>] Section(s))
The <num> specifies the spindle number 0 … (num_spindles-1)
The value of num_spindles is set by [TRAJ]SPINDLES= .
By default maximum velocity of the spindle in forward and reverse is approximately 2147483000 RPM.
By default minimum velocity of the spindle in forward and reverse is 0 RPM.
By default the increment is 100 RPM.
You change these default by setting the following INI variables:
|
Nota
|
These settings are for the motion controller component. Control screens can limit these settings further. |
-
MAX_FORWARD_VELOCITY = 20000The maximum spindle speed (in rpm) for the specified spindle. Optional. This will also set MAX_REVERSE_VELOCITY to the negative value unless overridden. -
MIN_FORWARD_VELOCITY = 3000The minimum spindle speed (in rpm) for the specified spindle. Optional. Many spindles have a minimum speed below which they should not be run. Any spindle speed command below this limit will be /increased/ to this limit. -
MAX_REVERSE_VELOCITY = 20000This setting will default toMAX_FORWARD_VELOCITYif omitted. It can be used in cases where the spindle speed is limited in reverse. Set to zero for spindles which must not be run in reverse. In this context "max" refers to the absolute magnitude of the spindle speed. -
MIN_REVERSE_VELOCITY = 3000`This setting is equivalent toMIN_FORWARD_VELOCITYbut for reverse spindle rotation. It will default to the MIN_FORWARD_VELOCITY if omitted. -
INCREMENT = 200Sets the step size for spindle speed increment / decrement commands. This can have a different value for each spindle. This setting is effective with AXIS and Touchy but note that some control screens may handle things differently. -
HOME_SEARCH_VELOCITY = 100- FIXME: Spindle homing not yet working. Sets the homing speed (rpm) for the spindle. The spindle will rotate at this velocity during the homing sequence until the spindle index is located, at which point the spindle position will be set to zero. Note that it makes no sense for the spindle home position to be any value other than zero, and so there is no provision to do so. -
HOME_SEQUENCE = 0- FIXME: Homing del husillo aún sin funcionar controla donde en una secuencia de homing general ocurren las rotaciones de homing del husillo. Asigne cero aHOME_SEARCH_VELOCITYpara evitar rotación del husillo durante la secuencia de homing.
2.15. [EMCIO] Section
-
TOOL_TABLE = tool.tbl- The file which contains tool information, described in the User Manual. -
DB_PROGRAM = db_program. Ruta a un programa ejecutable que maneja información de la herramienta. Cuando se especifica un DB_PROGRAM, se ignora una entrada TOOL_TABLE. -
TOOL_CHANGE_POSITION = 0 0 2- Specifies the XYZ location to move to when performing a tool change if three digits are used. Specifies the XYZABC location when 6 digits are used. Specifies the XYZABCUVW location when 9 digits are used. Tool Changes can be combined. For example if you combine the quill up with change position you can move the Z first then the X and Y. -
TOOL_CHANGE_WITH_SPINDLE_ON = 1- The spindle will be left on during the tool change when the value is 1. Useful for lathes or machines where the material is in the spindle, not the tool. -
TOOL_CHANGE_QUILL_UP = 1- The Z axis will be moved to machine zero prior to the tool change when the value is 1. This is the same as issuing aG0 G53 Z0. -
TOOL_CHANGE_AT_G30 = 1- The machine is moved to reference point defined by parameters 5181-5186 for G30 if the value is 1. For more information see G-code Parameters and G-code G30-G30.1. -
RANDOM_TOOLCHANGER = 1- This is for machines that cannot place the tool back into the pocket it came from. For example, machines that exchange the tool in the active pocket with the tool in the spindle.