Hello Guest it is March 29, 2024, 06:08:28 AM

Author Topic: How to create 4 Linaer Axis in Mach 3  (Read 10872 times)

0 Members and 1 Guest are viewing this topic.

Re: How to create 4 Linaer Axis in Mach 3
« Reply #10 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)

Re: How to create 4 Linaer Axis in Mach 3
« Reply #11 on: March 19, 2014, 01:21:49 PM »
Hood, how would the code look like, I'm not that strong in VBscript.
Re: How to create 4 Linaer Axis in Mach 3
« Reply #12 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().
« Last Edit: March 19, 2014, 03:01:19 PM by Overloaded »

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: How to create 4 Linaer Axis in Mach 3
« Reply #13 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
Re: How to create 4 Linaer Axis in Mach 3
« Reply #14 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.


Re: How to create 4 Linaer Axis in Mach 3
« Reply #16 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

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: How to create 4 Linaer Axis in Mach 3
« Reply #17 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

Offline Tweakie.CNC

*
  • *
  •  9,196 9,196
  • Super Kitty
    • View Profile
Re: How to create 4 Linaer Axis in Mach 3
« Reply #18 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.
PEACE
Re: How to create 4 Linaer Axis in Mach 3
« Reply #19 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.