/ docs / src / gui / tklinuxcnc.txt
tklinuxcnc.txt
  1  [[cha:tklinuxcnc-gui]]
  2  
  3  = TkLinuxCNC GUI
  4  
  5  == Introduction
  6  
  7  TkLinuxCNC is one of the first graphical front-ends
  8  for LinuxCNC. It is written in Tcl and uses the Tk toolkit
  9  for the display. Being written in Tcl makes it very portable (it runs on a
 10  multitude of platforms). A separate backplot window can be displayed as
 11  shown.
 12  
 13  .TkLinuxCNC Window
 14  
 15  image::images/tkemc.png[align="center", alt="TkLinuxCNC Window"]
 16  
 17  == Getting Started
 18  
 19  To select TkLinuxCNC as the front-end for LinuxCNC, edit the .ini file. In the
 20  section '[DISPLAY]' change the 'DISPLAY' line to read
 21  
 22  ----
 23  DISPLAY = tklinuxcnc
 24  ----
 25  
 26  Then, start LinuxCNC and select that ini file. The sample configuration
 27  'sim/tklinuxcnc/tklinuxcnc.ini' is already configured to use TkLinuxCNC as its front-end.
 28  
 29  === A typical session with TkLinuxCNC
 30  
 31  . Start LinuxCNC and select a configuration file.
 32  . Clear the 'E-STOP' condition and turn the machine on (by
 33   pressing F1 then F2).
 34  . 'Home' each axis.
 35  . Load the file to be milled.
 36  . Put the stock to be milled on the table.
 37  . Set the proper offsets for each axis by jogging and either homing
 38   again or right-clicking an axis name and entering an offset value.
 39   footnote:[For some of these actions it might be necessary to change the
 40   mode LinuxCNC is currently running in.]
 41  . Run the program.
 42  . To mill the same file again, return to step 6. To mill a different
 43   file, return to step 4. When you're done, exit LinuxCNC.
 44  
 45  == Elements of the TkLinuxCNC window
 46  
 47  The TkLinuxCNC window contains the following elements:
 48  
 49  * A menubar that allows you to perform various actions
 50  * A set of buttons that allow you to change the current working mode,
 51    start/stop spindle and other relevant I/O
 52  * Status bar for various offset related displays
 53  * Coordinate display area
 54  * A set of sliders which control 'Jogging speed', 'Feed Override' 
 55    , and 'Spindle speed Override' which allow you to increase or
 56    decrease those settings
 57  * Manual data input text box 'MDI'
 58  * Status bar display with active G-codes, M-codes, F- and S-words
 59  * Interpreter related buttons
 60  * A text display area that shows the G-code source of the loaded file
 61  
 62  === Main buttons
 63  
 64  From left to right, the buttons are:
 65  
 66  * Machine enable: 'ESTOP' > 'ESTOP RESET' > 'ON' 
 67  * Toggle mist coolant
 68  * Decrease spindle speed
 69  *  Set spindle direction 'SPINDLE OFF' > 'SPINDLE FORWARD' .
 70   'SPINDLE REVERSE'
 71  * Increase spindle speed
 72  * Abort
 73  
 74  then on the second line:
 75  
 76  * Operation mode: 'MANUAL' > 'MDI' > 'AUTO'
 77  * Toggle flood coolant
 78  * Toggle spindle brake control
 79  
 80  === Offset display status bar
 81  
 82  The Offset display status bar displays the currently selected tool
 83  (selected with Txx M6), the tool length offset (if active), and the
 84  work offsets (set by right-clicking the coordinates).
 85  
 86  === Coordinate Display Area
 87  
 88  The main part of the display shows the current position of the tool.
 89  The color of the position readout depends on the state of the axis. If
 90  the axis is unhomed the axis will be displayed in yellow letters. Once
 91  homed it will be displayed in green letters. If there is an error with
 92  the current axis TkLinuxCNC will use red letter to show that. (for example
 93  if an hardware limit switch is tripped).
 94  
 95  To properly interpret these numbers, refer to the radio boxes on the
 96  right. If the position is 'Machine', then the displayed number is in
 97  the machine coordinate system. If it is 'Relative', then the displayed
 98  number is in the offset coordinate system. Further down the choices can
 99  be 'actual' or 'commanded'. Actual refers to the feedback coming from
100  encoders (if you have a servo machine), and the 'commanded' refers to
101  the position command send out to the motors. These values can differ
102  for several reasons: Following error, deadband, encoder resolution, or
103  step size. For instance, if you command a movement to X 0.0033 on your
104  mill, but one step of your stepper motor is 0.00125, then the
105  'Commanded' position will be 0.0033 but the 'Actual' position will be
106  0.0025 (2 steps) or 0.00375 (3 steps).
107  
108  Another set of radio buttons allows you to choose between 'joint' and
109  'world' view. These make little sense on a normal type of machine (e.g.
110  trivial kinematics), but help on machines with non-trivial kinematics
111  like robots or stewart platforms. (you can read more about kinematics
112  in the Integrator Manual).
113  
114  .Backplot
115  
116  When the machine moves, it leaves a trail called the backplot. You can
117  start the backplot window by selecting View→Backplot.
118  
119  === Automatic control
120  
121  .Buttons for control
122  
123  The buttons in the lower part of TkLinuxCNC are used to control the execution of a
124  program: 'Open' to load a program, 'Verify' to
125  check it for errors, 'Run' to start the actual cutting,
126  'Pause' to stop it while running, 'Resume' to
127  resume an already paused program, 'Step' to advance one line
128  in the program and 'Optional Stop' to toggle the
129  optional stop switch (if the button is green the program execution will
130  be stopped on any M1 encountered).
131  
132  .TkLinuxCNC Interpreter / program control
133  image::images/tkemc-interp.png[align="center", alt="TkLinuxCNC Interpreter / program control"]
134  
135  .Text Program Display Area
136  
137  When the program is running, the line currently being executed is
138  highlighted in white. The text display will automatically scroll to
139  show the current line.
140  
141  === Manual Control
142  
143  .Implicit keys
144  
145  TkLinuxCNC allows you to manually move the machine. This action is known as
146  'jogging'. First, select the axis to be moved by clicking it. Then,
147  click and hold the '+' or '-' button depending on the desired direction
148  of motion. The first four axes can also be moved by the keyboard arrow keys 
149  (X and Y), the PAGE UP and PAGE DOWN keys (Z) and the '[' and ']' keys (A/4th). 
150  
151  If 'Continuous' is selected, the motion will continue as long as the
152  button or key is pressed. If another value is selected, the machine
153  will move exactly the displayed distance each time the button is
154  clicked or the key is pressed. The available values are:
155  '1.0000, 0.1000, 0.0100, 0.0010, 0.0001'
156  
157  By pressing 'Home' or the HOME key, the selected axis will be homed.
158  Depending on your configuration, this may just set the axis value to be
159  the absolute position 0.0, or it may make the machine move to a
160  specific home location through use of 'home switches'. See the
161  <<cha:homing-configuration,Homing Chapter>> for more information.
162  
163  By pressing 'Override Limits', the machine will temporarily be
164  permitted to jog outside the limits defined in the .ini file. (Note: if
165  'Override Limits' is active the button will be displayed using a red
166  color).
167  
168  .TkLinuxCNC Override Limits & Jogging increments example
169  
170  image::images/tkemc-override-limits.png[align="center", alt="TkLinuxCNC Override Limits and Jogging increments example"]
171  
172  .The Spindle group
173  
174  The button on the first row selects the direction for the spindle to
175  rotate: Counterclockwise, Stopped, Clockwise. The buttons next to it
176  allow the user to increase or decrease the rotation speed. The button
177  on the second row allows the spindle brake to be engaged or released.
178  Depending on your machine configuration, not all the items in this
179  group may have an effect.
180  
181  .The Coolant group
182  
183  The two buttons allow the 'Mist' and 'Flood' coolants to be turned on
184  and off. Depending on your machine configuration, not all the items in
185  this group may appear.
186  
187  === Code Entry
188  
189  Manual Data Input (also called MDI), allows G-code programs to be
190  entered manually, one line at a time. When the machine is not turned
191  on, and not set to MDI mode, the code entry controls are unavailable.
192  
193  .The Code Entry tab
194  
195  image::images/tkemc-mdi.png[align="center", alt="The Code Entry tab"]
196  
197  .MDI:
198  
199  This allows you to enter a g-code command to be executed. Execute the
200  command by pressing Enter.
201  
202  .Active G-Codes
203  
204  This shows the 'modal codes' that are active in the interpreter. For
205  instance, 'G54' indicates that the 'G54 offset' is applied to all
206  coordinates that are entered.
207  
208  === Jog Speed 
209  
210  By moving this slider, the speed of jogs can be modified. The numbers
211  above refer to axis units / second. The text box with the number is
212  clickable. Once clicked a popup window will appear, allowing for a
213  number to be entered.
214  
215  === Feed Override
216  
217  By moving this slider, the programmed feed rate can be modified. For
218  instance, if a program requests 'F60'  and the slider is set to 120%,
219  then the resulting feed rate will be
220  72. The text box with the number is clickable. Once clicked a popup
221  window will appear, allowing for a number to be entered.
222  
223  === Spindle speed Override
224  
225  The spindle speed override slider works exactly like the feed override
226  slider, but it controls to the spindle speed. If a program requested
227  S500 (spindle speed 500 RPM), and the slider is set to 80%, then the
228  resulting spindle speed will be 400 RPM. This slider has a minimum and
229  maximum value defined in the ini file. If those are missing the slider
230  is stuck at 100%. The text box with the number is clickable. Once
231  clicked a popup window will appear, allowing for a number to be
232  entered.
233  
234  == Keyboard Controls
235  
236  Almost all actions in TkLinuxCNC can be accomplished with the keyboard.
237  Many of the shortcuts are unavailable when in MDI mode.
238  
239  The most frequently used keyboard shortcuts are shown in the
240  following table.
241  
242  .Most Common Keyboard Shortcuts
243  
244  [width="75%", options="header", cols="1^,3<"]
245  |========================================
246  |Keystroke | Action Taken
247  |F1 | Toggle Emergency Stop
248  |F2 | Turn machine on/off
249  |`, 1 .. 9, 0 | Set feed override from 0% to 100%
250  |X, ` | Activate first axis
251  |Y, 1 | Activate second axis
252  |Z, 2 | Activate third axis
253  |A, 3 | Activate fourth axis
254  |Home | Send active axis Home
255  |Left, Right | Jog first axis
256  |Up, Down | Jog second axis
257  |Pg Up, Pg Dn | Jog third axis
258  |[, ] | Jog fourth axis
259  |ESC | Stop execution
260  |========================================
261  
262