Hello Guest it is March 28, 2024, 09:46:39 AM

Author Topic: 2 mill profiles - swaped Y and A axis - share offsets etc.  (Read 4048 times)

0 Members and 2 Guests are viewing this topic.

Offline birdbrain

*
  •  41 41
  • Stupidity, beyond belief!
    • View Profile
2 mill profiles - swaped Y and A axis - share offsets etc.
« on: December 21, 2009, 10:49:51 PM »
I have made a new mach3 mill profile (called Mill_XAZ) as a clone of my original profile (caled Mill_XYZ). The new profile is so that I can mill easily on tube surfaces. The profiles are both for the same mill and nothing is changed on the mill.
The main difference betwen the 2 profiles is that in Mill_XAZ, I have swaped the motor outputs betwen Y and A axis. There will also be scaling of A axis when I have calculated it.
With the new profile, I can now run g-code written for XYZ with the machine using the rotary axis in place of the Y axis.
How can I get both profiles to share the same offset and tool tables? This is important because if I change a work offset or a tool, I need the change to be exactly the same in both profiles.
Re: 2 mill profiles - swaped Y and A axis - share offsets etc.
« Reply #1 on: December 21, 2009, 11:10:51 PM »
There is a VB call, SwapAxis(Axis1, Axis2), that will do essentially that.  The one "gotcha" is that it literally swaps the pin assignments, without swapping the motor tuning parameters.  So, it will work fine if the two axes have identical characteristics (velocity, acceleration, etc).  But, if they're very different, you'll have problems with lost steps or stalling on one or both axes.

The axes are specified using X=0, Y=1, Z=2, A=3, B=4, C=5.  So, in your case, you'd want to use SwapAxis(1,3) to swap Y and A.  You must then use ResetAxisSwap() to "undo" the swap.  Do NOT do two Swaps in a row....

Regards,
Ray L.
Regards,
Ray L.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: 2 mill profiles - swaped Y and A axis - share offsets etc.
« Reply #2 on: December 22, 2009, 02:20:18 AM »
For the work offsets or tool offsets you can only copy over the tables each time you change something in one, they are located in the macro profile of your profile concerned.

As Ray says you could use the swap axis in one profile and that would save you swapping profiles and changing out the tool and work offset tables, you could have two buttons on screen, one to swap and one to reset. Then again maybe paying the $20 for the wrap software would be even easier ;D
Hood

Offline birdbrain

*
  •  41 41
  • Stupidity, beyond belief!
    • View Profile
Re: 2 mill profiles - swaped Y and A axis - share offsets etc.
« Reply #3 on: December 22, 2009, 07:21:33 AM »
Thanks guys, that's a big help.  :)

The VB codes work just fine. All I need to do is put a SwapAxis macro at the start of the g-code file and a ResetAxisSwap macro at the end of the same file. This is really great as it saves me a lot of time.
If I wanted to add some scaling factor to the rotary axis (after the "SwapAxis(1,3)" line in the macro) what would I add to the macro?

Oh yeah... I have a copy of CNCwrapper but it doesn't like my G-code files. They are generated by CamBam and have lots of G2/G3 movements. CNCwrapper can't handle G2/G3. I also had an issue with CNCwrapper where I couldn't get it to run on my WinXP French PC and needed to run it in a Windows XP English emulator  ???.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: 2 mill profiles - swaped Y and A axis - share offsets etc.
« Reply #4 on: December 22, 2009, 07:35:40 AM »
Not sure if there is a call for scaling in VB, Ray will know he wrote the manual and I cant read ;D
If not a custom macro could be used to do it.
Hood

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: 2 mill profiles - swaped Y and A axis - share offsets etc.
« Reply #5 on: December 22, 2009, 08:35:06 AM »
Then again maybe paying the $20 for the wrap software would be even easier ;D

He's a card that Hood ain't he  ;D

Well as I seem to have got you into this against better advice  >:D I'll risk showing my head above the parapet...

wack these 3 lines into your macro after the axis switch

L=?? 'set to the lead for one rev of your X motor to nominally set aspect 1:1 between A and X
D=Question ("What diameter tube")
SetOEMDRO (60, L / (3.1415926535897932384626433832795 * D) ) 'probably a better way of doing PI

(OEM DRO 60 is the Y axis scale)

This assumes your microsteps per rev are the same for the X and the "rotary" motor. Adjust to taste if not.

If this doesn't do it - I'd suggest getting that wrap software ;D

Cheers

Ian