Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Glaucius on December 05, 2014, 08:11:28 AM

Title: Dual head offsets.
Post by: Glaucius on December 05, 2014, 08:11:28 AM
Hi!...My name is Glaucius, this is my first post, i'm from Brazil, so sorry my bad english  ;D

My question is about programing dual head on mach3 mill, i will try to explain my case:

I build a head for a router, this head is for "screwing" a bolt on a wood and steel panel, is pneumatic and his base is bolted on the Z axis (on the plate of the Y axis), so they move only on the" Y" axis, they don't move on Z axis...

Well...i need to make a g-code to make a hole and after this the head put a screw on the hole, how a made the offsets on the more easy way?...I already made tool offsets on the Machturn and was "peace of cake", but in Mach Mill seens to be more complicated  :-\

BTW, i need to make this process (hole and screw) about 50 times on every panel, so i don't wanna be putting a lot of "G52" on the code, there is a way to make this simple like in Mach Turn?

Thanks in advance!!!

Regards!
Title: Re: Dual head offsets.
Post by: Glaucius on December 05, 2014, 08:13:34 AM
I read here this solution:

"tool = GetSelectedTool()
if tool=1 then
code"G52 x0 y0 z0"
end if
if tool=2 then
code"G52 x10 y0 z0"
end if"

Whit this code i don't need to repeat on every hole?

PS: I use Rhinocam to make the g-code, i'm newbee on G-code "by hand".
Title: Re: Dual head offsets.
Post by: Glaucius on December 06, 2014, 05:09:26 PM
No one?   :'(

 ;D
Title: Re: Dual head offsets.
Post by: BR549 on December 06, 2014, 07:18:39 PM
How about just setting a fixture offset then call it as needed.

G54,G55,G56, etc

Works well here, (;-) TP
Title: Re: Dual head offsets.
Post by: Glaucius on December 06, 2014, 08:33:32 PM
Maybe this is the solution  :)

Another problem i was suffering is about "zero" the work offsets, is normal this dificulty to zero the work offset?.... I do it on the X and Y but on Z i can't zero, i try everything  >:(

Thanks!!

PS: This machine is in another town, so i can't test this here, i have only a Mill with small travel course...
Title: Re: Dual head offsets.
Post by: BR549 on December 06, 2014, 09:11:56 PM
IN your case you are only accounting for the offset of the heads. IF

G54 = X0 Y0
and
G55 = X12Y0

then when you programmed from a G54 to a G55 the ZERO just moves over 12" to center the 2nd head over the workpiece.

SO you Reference the part in G54 mode then everything else takes care of itself when you change to G55.

(;-) TP
Title: Re: Dual head offsets.
Post by: Glaucius on December 06, 2014, 09:23:03 PM
Ok...i will try this  ;)

I have to put this G-codes in every hole, rigth?....The code i posted here on my previous posts is not better?...I think with the another code i just have to put a tool change and the offset wil be automatically...

I have to program about 50 holes, so is a "pain in the a$$" to put this G54 and G55 on every hole  ::) hehehe

Thanks!!!  :)
Title: Re: Dual head offsets.
Post by: c30232 on December 06, 2014, 09:28:39 PM
I don't know if it is proper to "ask in" on another's post.  If yes, then I apologize in advance. G54 accounts for X and Y.  How do you call, assuming both heads are riding the same Z. the extend and retract of each head?  That is one must get out of the way and the other must get to work.
Title: Re: Dual head offsets.
Post by: c30232 on December 06, 2014, 09:36:09 PM
G54 requires just one call and remains untill the next call, say 55.
Title: Re: Dual head offsets.
Post by: c30232 on December 06, 2014, 09:38:28 PM
Your 50 holes would always be as originally written.   
Title: Re: Dual head offsets.
Post by: Ya-Nvr-No on December 06, 2014, 10:04:30 PM
Don't see any reason why you can't in mach3 call one head Z and the other A , B or C (or one A the other B) you just don't have some tool offset features but if you zero out each spindle to the tool tip its just numbers. Use linear setup option for the A,B or C axis, not rotary.

It's up to you how you write your programs and setup your machine. The fixture offset still can be used and all you would have to do is edit the second spindle name in a text file. Or use a creative post process.
Title: Re: Dual head offsets.
Post by: c30232 on December 06, 2014, 10:14:12 PM
That would work if each head had its own drive and mechanical assembly.  The call I am looking for is for both heads riding on the same axis.  That is, a Z axis with two heads.
Title: Re: Dual head offsets.
Post by: Glaucius on December 06, 2014, 10:17:43 PM
I don't know if it is proper to "ask in" on another's post.  If yes, then I apologize in advance. G54 accounts for X and Y.  How do you call, assuming both heads are riding the same Z. the extend and retract of each head?  That is one must get out of the way and the other must get to work.

To me there's no problem to make another question here, your question maybe help me too ;)

In my case i'm using a "pneumatic extend" so i use a M8 comand (i know that's for coolant, but i'm using to active the solenoid for the actuator, but the answer posted by "Ya-nvr-no" make sense to me :)
Title: Re: Dual head offsets.
Post by: Glaucius on December 06, 2014, 10:20:11 PM
That would work if each head had its own drive and mechanical assembly.  The call I am looking for is for both heads riding on the same axis.  That is, a Z axis with two heads.

I don't understand your case,  is not like mine?....my case is a router with spindle and on the same "plate" a pneumatic actuator, but this pneumatic assembly don't move on the Z axis with the spindle.
Title: Re: Dual head offsets.
Post by: BR549 on December 06, 2014, 10:21:17 PM
NO you do not program G54/55 for EVERY hole you program it ONLY when you need to change heads(;-)

You would use G54 to do all the primary work required of that head THEN shift over to G55 (that shifts the 2nd head over to the work) then finish what work head#2 does.

Just a thought, (;-) TP
Title: Re: Dual head offsets.
Post by: Glaucius on December 06, 2014, 10:25:23 PM
NO you do not program G54/55 for EVERY hole you program it ONLY when you need to change heads(;-)

You would use G54 to do all the primary work required of that head THEN shift over to G55 (that shifts the 2nd head over to the work) then finish what work head#2 does.

Just a thought, (;-) TP

Well...my thinking is to make a hole and "call" the screw head, on every hole.....i mean, "hole, screw...hole, screw, hole, screw...and goes on.."....but maybe is more easy to make all the holes and after all the screws, but in my head this will make a longer machining time :/
Title: Re: Dual head offsets.
Post by: Glaucius on December 06, 2014, 10:31:07 PM
Its a big panel, about 8 x 7 feets and 50 holes with screw distributed on this panel, so machining time is crucial, it's for an industry, big production...
Title: Re: Dual head offsets.
Post by: Ya-Nvr-No on December 06, 2014, 10:44:00 PM
Not that id do this way,  ;)  but it would work if the cylinder stroke did what you wanted and you just set the delay to what you need

g54 x1 y1 (move to the hole for drill)
g1 z-2 f20 (feed down)
g0 z1

g55 x1 y1 (move to the hole for screw insert)
m08 (cylinder down)
g4 p2 (delay)
m09 (cylinder up)

g54 x10 y10
g1 z-2 f20
g0 z1

g55 x10 y10
m08
g4 p2
m09
Title: Re: Dual head offsets.
Post by: TPS on December 07, 2014, 04:54:33 AM
if you can get your drill coordinates in a text file,
write a little VB-script with reads the file and
executes the movements.

Thomas
Title: Re: Dual head offsets.
Post by: Glaucius on December 07, 2014, 06:38:20 AM
Ya-Nvr-No

All the cylinder system is already setted, the return is automatic whem the screw is flat on the panel... i was thinking on using dwell to make the delay, but i found on configuration a delay on M8, that is perfect for this "screw" head  ;) My only problem is with offset  :(

You put the offset on the mach3 config, right?....Them you only put the G54 and G55 with the coordinates of the holes?

Title: Re: Dual head offsets.
Post by: Glaucius on December 07, 2014, 06:40:54 AM
if you can get your drill coordinates in a text file,
write a little VB-script with reads the file and
executes the movements.

Thomas

Its easy to write this VB-Script?....I'm noob on codes and programing, i use rhinocam to make the g-codes and a little bit of codes "by hand"....my biggest experience on writing code is on MachTurn.
Title: Re: Dual head offsets.
Post by: Ya-Nvr-No on December 07, 2014, 07:33:13 AM
Ya-Nvr-No

All the cylinder system is already setted, the return is automatic whem the screw is flat on the panel... i was thinking on using dwell to make the delay, but i found on configuration a delay on M8, that is perfect for this "screw" head  ;) My only problem is with offset  :(

You put the offset on the mach3 config, right?....Them you only put the G54 and G55 with the coordinates of the holes?

Return stroke of your cylinder on a M08 might happen but what turns off the model command M08 other than a M09 or M30? (you have to reset it to use it again) will work but its not industrial robust or efficient. Good luck and have fun.  :)

You put the offset values in "fixture offsets" you just have to know the difference between the spindle and your cylinder center lines.
Title: Re: Dual head offsets.
Post by: Glaucius on December 07, 2014, 08:00:39 AM
I used a limit switch to return the cylinder, i just need a pulse to activate the system, the rest is made by an arduino with some basic program  ;D

I don't remeber my last tests, but if my memory is right the delay ou M8 activate the relay and after a few seconds they "reset" the comand, i think i have the code here of my tests...

Thanks!!!

And Thanks to everyone who posted here helping me with this problem!  :) :) :)
Title: Re: Dual head offsets.
Post by: Glaucius on December 07, 2014, 08:06:24 AM
I found here one of the codes i was testing there, i'm using M9 to cancel the M8, but i think this code is before i found the delay on M8, this week i will test again:

"%
N1 G17 G21
N2 G00
N3 T1 M6
N4 G90 G00 X200. Y0. S4851 M3
N5 Z6.
N6 G81 X200. Y0. Z-10.866 F1000. R2.5
N7 G80
     G55 G0X-170Y-83Z0 M8
N8 M9
N9 G00 Z6.
N10 G81 X150. Y0. Z-10.866 F1000. R2.5
N11 G80
     T2 X150. Y0. Z0. M8
N12 M9
N13 G00 Z6.
N14 G81 X100. Y0. Z-10.866 F1000. R2.5
N15 G80 M8
         M9
N16 G00 Z6.
N17 G81 X50. Y0. Z-10.866 F1000. R2.5
N18 G80 M8
         M9
N19 G00 Z6.
N20 G81 X0. Y0. Z-10.866 F1000. R2.5
N21 G80 M8
         M9
N22 G00 Z6.
N23 M5
N24 M30
%"
Title: Re: Dual head offsets.
Post by: TPS on December 08, 2014, 04:30:53 AM
if you can get your drill coordinates in a text file,
write a little VB-script with reads the file and
executes the movements.

Thomas

Its easy to write this VB-Script?....I'm noob on codes and programing, i use rhinocam to make the g-codes and a little bit of codes "by hand"....my biggest experience on writing code is on MachTurn.

if you need some help to do this VB-script just let me know.

Thomas

Title: Re: Dual head offsets.
Post by: Glaucius on December 08, 2014, 05:31:59 AM
Thanks TPS!  :)

This week i will test all the sugestions here  ;)
Title: Re: Dual head offsets.
Post by: Glaucius on December 12, 2014, 09:08:52 PM
Hi guys,

I tried your sugestions but the machine goes crazy, i go on fixtures offset on the "config" menu, put G54 X0 Y0 Z0, on the G55 i put X150 Y50 and Z0 (my mach3 is in millimeter), then i put the G54 and them G55 on the second step, and the machine goes to the center of the machine, goes to X3000 Y1200 or something like that, them i go to the "fixtures offsets" screen and the values change to this crazy numbers...i'm not understanding what's happening  :-\

Fixtures offsets is the only way to do that?....I have to make this work fast and simple...

This is the code i tried:

"%
N1 G17 G21
N2 G00
N3 T1 M6

G54

N4 G90 G00 X200. Y0. S4851 M3
N5 Z6.
N6 G81 X200. Y0. Z-10.866 F1000. R2.5
N7 G80
    G0X-170Y-83Z0 M8
N8 M9
G55
N9 X200. Y0. Z-10.866 F1000. R2.5
N7 G80
   G0X-170Y-83Z0 M8"
Title: Re: Dual head offsets.
Post by: Ya-Nvr-No on December 12, 2014, 09:54:21 PM
Still not sure what your trying to do as your using the same Z move to do two things? Wont one of the heads run into something while they are both going up and down at the same time?

but as far as your numbers I would think your mixing imperial fixture offsets with metric gcode movements
150" * 25.4 = 3810mm and 50" * 25.4 = 1270mm ( that's why your seeing the huge movements)
you might want to make sure you setup units are in metric or use the equivalent value (just some more math).


Code: [Select]
%
N1 G17 G21
N3 T1 M6
G90
G54
G0 Z6.
S4851 M3
X200. Y0. M8
N6 G81 Z-10.866 F1000. R2.5
N7 G80
M9
G55
X200. Y0.
G1 Z-10.866 F1000.
G0 Z6.
G54
X200 Y0
m30
%
Title: Re: Dual head offsets.
Post by: BR549 on December 12, 2014, 10:31:07 PM
Set your G55 to X100 Y50 and save fixture

Move to the Point of Origin X0Y0 on your material. then Zero the xy axis(that will set the g54 to 0,0)  the example just drills 1 hole then offsets the head and drills another hole in the same spot to prove the offsetting works correctly.



N3 T1 M6

G54

G00 X200. Y0. S4851 M3
N5 Z6.
N6 G81 X200. Y0. Z-10.866 F1000. R2.5
N7 G80
 
(Switch to G55 to offset to the 2nd head)

G55

N9 G81 X200. Y0. Z-10.866 F1000. R2.5
N7 G80
   
G54 ( go back to the original fixture offset)

G0 X0 Y0  (Go back to the original Point of origin)

M5 M9
M30
%

NOW do not get confused by what you see in the toolpath as it does NOT exactly show what the machine is going to do. Just follow the machine tool as it does the job IT will be correct.

Title: Re: Dual head offsets.
Post by: BR549 on December 12, 2014, 10:33:44 PM
NOW as teh first test "I" would drill all the holes first THEN switch to the G55 and finish all the rest.

Then when you get a good grip on using fixture offsets you could try the flip flopping of fixtures at each hole.

Test each senario to SEE which one finishes in the least amount of time.

It may surprise you, (;-) TP
Title: Re: Dual head offsets.
Post by: Glaucius on December 13, 2014, 05:30:51 AM
Still not sure what your trying to do as your using the same Z move to do two things? Wont one of the heads run into something while they are both going up and down at the same time?

but as far as your numbers I would think your mixing imperial fixture offsets with metric gcode movements
150" * 25.4 = 3810mm and 50" * 25.4 = 1270mm ( that's why your seeing the huge movements)
you might want to make sure you setup units are in metric or use the equivalent value (just some more math).


Code: [Select]
%
N1 G17 G21
N3 T1 M6
G90
G54
G0 Z6.
S4851 M3
X200. Y0. M8
N6 G81 Z-10.866 F1000. R2.5
N7 G80
M9
G55
X200. Y0.
G1 Z-10.866 F1000.
G0 Z6.
G54
X200 Y0
m30
%

I think the same thing, my units on the mach is "MM", and i tried to convert to imperial (X6 Y2 Z0) and the mach do the same thing :/

BTW, The second head is activated by pneumatic actuator and another guide, that's why i dont need to use Z offsets.
Title: Re: Dual head offsets.
Post by: Glaucius on December 13, 2014, 05:35:07 AM
Set your G55 to X100 Y50 and save fixture

Move to the Point of Origin X0Y0 on your material. then Zero the xy axis(that will set the g54 to 0,0)  the example just drills 1 hole then offsets the head and drills another hole in the same spot to prove the offsetting works correctly.



N3 T1 M6

G54

G00 X200. Y0. S4851 M3
N5 Z6.
N6 G81 X200. Y0. Z-10.866 F1000. R2.5
N7 G80
 
(Switch to G55 to offset to the 2nd head)

G55

N9 G81 X200. Y0. Z-10.866 F1000. R2.5
N7 G80
   
G54 ( go back to the original fixture offset)

G0 X0 Y0  (Go back to the original Point of origin)

M5 M9
M30
%

NOW do not get confused by what you see in the toolpath as it does NOT exactly show what the machine is going to do. Just follow the machine tool as it does the job IT will be correct.



Thanks!....I will try that!

I wanna make "hole and screw" path because the OSB panel is loose on the table, so the screw will secure the panel...but i will test the 2 scenarios ;)
Title: Re: Dual head offsets.
Post by: engraversoflight on December 16, 2014, 01:55:02 PM
Is there a pic of this machine?
Title: Re: Dual head offsets.
Post by: Glaucius on December 16, 2014, 02:42:11 PM
I have a few pics, i just have to pass to my desktop, my smartphone is on repair so i can't pass the pics directly :/

When i get the pics i post here.