Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Mike_DK on March 18, 2014, 02:52:33 PM

Title: How to create 4 Linaer Axis in Mach 3
Post by: Mike_DK on March 18, 2014, 02:52:33 PM
Hi

Is it possible to use A axis as a Linaer axis so that you can run with 2 tables with Y & A axis. I have a Alberti Format 90 cnc machine that I rebuild to mach 3, now I use A axis as a slave, but I want to run the two Tables separeat.
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Hood on March 18, 2014, 03:39:30 PM
If you are trying to work two pairs of axes individually at the same time then afraid it cant be done.
Hood
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Overloaded on March 18, 2014, 09:05:02 PM
If however you wanted to run the X and Y while A was at rest (loading parts?), then run X and A while unloading/loading Y,  I think you would be fine.
Just set up A as another linear axis and adjust the Gcode accordingly.

Just looked at one of these machines,(gougle) how is it originally intended to work with 2 tables ?
Looks like 1 common X and spindle with 2 (y,a)tables. ? ? What a beast !

Just guessing,
Russ
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Mike_DK on March 19, 2014, 03:48:58 AM
Russ, I all ready tried that, and it works, BUT only G0 and G1 when I use G2 or G3 with X - A axis I get Mach 3 radius Error and the machine stops.
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Hood on March 19, 2014, 03:52:16 AM
Is the A axis set as linear? (config menu, General Config, left side of page)

Hood
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Mike_DK on March 19, 2014, 04:29:23 AM
Yes the box is unchecked. Can it have any thing to do with G17 XY plane select ?
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Hood on March 19, 2014, 07:36:47 AM
That could well be the issue.
If it is then possibly the way to get round it would be to use SwapAxis(1,3) and that would tell Mach to swap the outputs for Y and A, thus any commands meant for Y would go to the A motor. To set it back your would have ResetAxisSwap()

To use that from code you could create two macros, one to swap the other to reset and you could have them inserted in your code.
The other option would be to have screen buttons to swap and ResetSwap.

Hood
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Overloaded on March 19, 2014, 08:20:28 AM
wow, I assumed arcs would work with all linear axis'.
Guess you could convert your code from G2/3 to all G1's .... like the Roadrunner ?

Get strange results when trying G2 x,a. Y moves also anyway.
May be a way to fake it ? Not sure.
Seems a bit lame.

Regards,
Russ
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Hood on March 19, 2014, 08:26:16 AM
Russ I suppose the problem with G2/3 is you are telling Mach that A is a linear axis but Mach has no idea of the orientation of that A axis, If it were a rotary then Mach would assume it as convention and should work fine.

Hood
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Hood on March 19, 2014, 08:35:24 AM
Just wondering if when you choose to have  A, B or C as rotary whether Mach assumes they are still in relation to their normal axis for rotation. What I mean is I wonder if Mach assumes A goes along with X, B with Y and C with Z.
Might be worth trying the axis set as B axis and Mach may assume it runs the same way as Y when set as linear.
Hood

Edit meant Linear in the first line, not rotary.
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Overloaded on March 19, 2014, 08:52:34 AM
Hood, that makes sense.
Mach knows internally that y and x are perpendicular to one another, no clue about a linear a,b or c.
It would seem that there would be an entry for that info.
6 axis controller ... would be nice to be able to do arcs with any combo.  :P

 I know, I know ..... all fixed up in 4  ;D

Thanks Hood,
Russ
 8)

Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Mike_DK on March 19, 2014, 01:21:49 PM
Hood, how would the code look like, I'm not that strong in VBscript.
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Overloaded on March 19, 2014, 02:58:40 PM
Here is something from the manual to keep in mind when using this function.

SwapAxis
Sub SwapAxis(FirstAxis As Integer, SecondAxis As Integer)
This function swaps the STEP and DIR pins for the two specified axes. This has precisely the same effect
as changing the pin settings in Config->Ports&Pins. Note that no other axis parameters or settings are
changed. If the two specified axes have different acceleration and velocity settings, unreliable operation
will likely result. Note also that if you exit Mach3 while the swap is in effect, the swapped pins will be
written to the XML configuration file, and the swap will still be in effect the next time you start Mach3.
It is illegal to perform two consecutive swaps, without first executing a ResetAxisSwap(). Doing so will
likely result in incorrect operation.

ResetAxisSwap
Sub ResetAxisSwap()
This function un-does the effect of a preceding SwapAxis(). Note that this is the only way to undo a
Swap, and it is illegal to perform two SwapAxis() calls without an intervening ResetAxisSwap().
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Hood on March 19, 2014, 03:07:52 PM
Mike, just exactly as I typed earlier.
One macro would have

SwapAxis(1,3)

the other

ResetAxisSwap()

If you named one as m101.m1s and the other m102.m1s and saved them to the macro folder of the profile you used then you could call from code with m101 and m102.

As mentioned you could also put a couple of VB buttons on your screen and have the above code in them.

Just wondering however if you have tried setting it as a B axis rather than A? it was just a thought but it may be the way Mach sees the A,B and C when set as linear.
Hood
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Mike_DK on March 19, 2014, 05:45:57 PM
Yes I tried to swap A and B axis, it was the same. then I made 2 M codes, one with the SwapAxis and one with ResetAxisSwap. That Works. I'm very happy with
your guys help. Thanks a lot.


Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Mike_DK on March 19, 2014, 06:49:51 PM
https://www.youtube.com/watch?v=PzP2rmhQgcs&feature=youtu.be
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Overloaded on March 19, 2014, 07:00:02 PM
Great job Mike ! Thanks for the video !

I tried the swap on a simulation pc.
Question:
When your Y axis has shifted to A, does the A dro reflect the movements ? ? or does the movement continue to show in the Y dro ?

Good work Hood !

Thanks,
Russ
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Hood on March 20, 2014, 03:52:20 AM
Russ, its been a long time but I would imagine the DRO that would show the motion would be the DRO for the axis you are commanding. In other words if you swap Y and A and command the Y it would be the Y DRO showing the motion.
Hood
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Tweakie.CNC on March 20, 2014, 03:58:41 AM
Excellent video Mike - thanks for sharing.

Just one observation - that air line, running along the floor like that, looks like an accident just waiting to happen.  ;)

Tweakie.
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Mike_DK on March 20, 2014, 12:13:52 PM
Russ it's only the Y axis DRO that moves.
Is it possible to get the g code to run in a loop from one line number to another with out make a sub program. ? I don't want it to start from line 0 because of the tool change that i have.
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Overloaded on March 20, 2014, 01:14:58 PM
Thanks for the DRO info Mike, appreciated.

Not sure if that can be done or not .... without a sub.

Russ
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Hood on March 20, 2014, 03:32:14 PM
Dont know what the issue is with the tool change or how your changer works but maybe you can add to your M6start.m1s something like the following

If GetSelectedTool()=GetCurrentTool Then
 End
 End if

Hood
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Mike_DK on March 20, 2014, 03:56:27 PM
no no my tool change is only controled by outputs, it is a pretty simple code :-D but it Works
My tool change is 3 spindles on air cylinders so I have a offset on each spindle G54 G55 G56.

so every time it starts a program it have to activate the cylinder, speed up the spindle and that take time.
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Hood on March 20, 2014, 06:31:32 PM
Maybe Block Delete would do as you want then.
Hood
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Mike_DK on March 22, 2014, 02:35:16 PM
Okay, got it to Work the way I want but with Subprograms, I Didn't think it would be that easy :-D Here is my sample.

( Profile 1 )
( File created: fredag, marts 21, 2014 - 05:41 )
( for Mach2/3 from Vectric )
( Material Size)
( X= 500.000, Y= 500.000 ,Z= 30.000)
()
(Toolpaths used in this file:)
(Profile 1)
(Tools used in this file: )
(1 = End Mill {3 mm})
N100G00G21G17G90G40G49G80
N110G71G91.1
N120T1M06
N130 (End Mill {3 mm})
N140G00G43Z20.000H1
N150S12000M03
N160(Toolpath:- Profile 1)
N162M98P1234L10
M30



(O1234)
N179M0
N180G94
N190X0.000Y0.000F3600.0
N200G00X-1.500Y0.000Z6.000
N210G1X-1.500Y0.000Z-1.000F1200.0
N220G3X0.000Y-1.500I1.500J0.000F3600.0
N230G1X12.817Y-1.500Z-1.000
N240G3X14.317Y0.000I0.000J1.500
N250G1X14.317Y13.860Z-1.000
N260G3X12.817Y15.360I-1.500J0.000
N270G1X0.000Y15.360Z-1.000
N280G3X-1.500Y13.860I0.000J-1.500
N290G1X-1.500Y0.000Z-1.000
N300G00X-1.500Y0.000Z6.000
N310G00Z20.000
N320G00X0.000Y0.000
N330M09
N340M99
%


/Mike
Title: Re: How to create 4 Linaer Axis in Mach 3
Post by: Victor_Abraham on August 26, 2014, 02:47:01 AM
Hi Dear Mike DK;
I have also Alberti machine with CNC90 TF36 CONTROLLER, so i want to rebuild to MACH3. as you know all servo drives in Alberti machine are analog from "ELMO". could you please tell me how you did it and what motion controller i should use?
if it is possible i dont want to replace ELMO servo drives with new pulse/dir servo drives (because of high cost of new digital drives) please lead me.