How to control a NC-Drill?

More
29 Jul 2016 08:08 #78128 by bkiepke
Hi all,

I've managed to build a CNC-coordinate table using a BeagleBoneBlack with machinekit-image and a Proxxon KT70. The machine only has x- and y-axis. So far everything runs. The goal of this is to have a "nc-drill". Currently I can't implement a third axis (z-axis), so I want to move the drill down and up manually. I'm an absolute beginner to this topic and I'm not quite sure what I'm looking for (so no search done, because I just have no clue what to search for).

My goal to achieve:
The machine just should position the workpiece, executing one line of G-Code and wait for user input to execute next movement or go back to last position. The user would have some kind of buttons for input. One button to go to "next" position and one button to go to "previous" position.

I guess I can use "M66 P0 L1" after every line of G-Code, assuming the physical "button" is linked to "motion.digital-in-00" for "moving" forward. But how can I move a g-code line backwards? Also the example below should work (forward only), it seems "complicated" to insert "M66 P0 L1" (and possibly more code for backwards) after every line of code, when the described is the only mode of operation of the machine.

Example:
// just position the workpiece
N100 G00 X100 Y50
N110 M66 P0 L1
N120 G00 X100 Y48
N130 M66 P0 L1
...

...
M30

My configuration for this in NCDrill.hal looks like this:
...
# create internal variable
newsig next-gcode-line bit
# link to physical input
net next-gcode-line <= bb_gpio.p8.in-09
# link variable to M66
net next-gcode-line => motion.digital-in-00
...

I also read about user defined commands. So maybe this would be achievable with a M100 command, where I could insert a macro? But how would that look like? How would I link the physical button to some "variable"?

best regards
Benjamin Kiepke

Please Log in or Create an account to join the conversation.

More
29 Jul 2016 09:20 #78131 by andypugh
Replied by andypugh on topic How to control a NC-Drill?

I guess I can use "M66 P0 L1" after every line of G-Code, assuming the physical "button" is linked to "motion.digital-in-00" for "moving" forward. But how can I move a g-code line backwards?


You can't, really. G-code implicitly runs forwards.

There is a development version of LinuxCNC that allows negative adaptive feed, and that will retrace a path, but it not quite what you want.

Note that I am talking about LinuxCNC here. Machinekit may be different, and you should ask there.

You don't need real-time motion control for your machine. So I suggest that you could consider not running G-code at all. You could have a simple Python GUI program that loads an Excellon drill file (or whatever you fancy) and which creates X/Y output HAL pins for connecting directly to stepper motor position commands in HAL.

linuxcnc.org/docs/2.7/html/hal/halmodule.html
#!/usr/bin/python
import hal, time
h = hal.component("passthrough")
h.newpin("FWD", hal.HAL_FLOAT, hal.HAL_IN)
h.newpin("BACK", hal.HAL_FLOAT, hal.HAL_IN)
h.newpin("x-pos-cmd", hal.HAL_FLOAT, hal.HAL_OUT)
h.newpin("y-pos-cmd", hal.HAL_FLOAT, hal.HAL_OUT)
h.ready()
...
....

Please Log in or Create an account to join the conversation.

More
30 Jul 2016 07:26 - 30 Jul 2016 07:27 #78155 by Rick G
Replied by Rick G on topic How to control a NC-Drill?
With linuxcnc you could start with position.ngc which is a ngcgui program.
linuxcnc.org/docs/2.5/html/gui/ngcgui.html
If you are not using ngcgui you can try it from one of the sample configurations included with linuxcnc.

With it you enter the coordinates you want to work at and when run the machine will go to the first set of coordinates and pause, then you can drill, then the machine will go to the second set of coordinates, pause, etc.

Rick G
Attachments:
Last edit: 30 Jul 2016 07:27 by Rick G.

Please Log in or Create an account to join the conversation.

Time to create page: 0.351 seconds
Powered by Kunena Forum