Hello Guest it is July 18, 2024, 11:32:34 AM

### Author Topic: how to go to z without traveling dagonally  (Read 19212 times)

0 Members and 1 Guest are viewing this topic.

#### Hood

• 25,835
• Carnoustie, Scotland
##### Re: how to go to z without traveling dagonally
« Reply #10 on: April 26, 2009, 09:34:04 AM »
Please explain to me how your previous example is what you are asking for. What you said was you wanted the A Axis to run continuously, ie like a spindle. What you have in your example is an A move combined with a X move, when the A and X get to where the code has told them to go what happens?
Well as far as I can see the A stops rotating so in no stretch of the imagination can that be classed as the A axis continually rotating.
Hood

#### simpson36

• 1,369
##### Re: how to go to z without traveling dagonally
« Reply #11 on: April 26, 2009, 10:10:16 AM »
Did they ever have Abbott and Costello on TV or movies in Scotland?  This is just like their famous "Who's on First" routine      LOL!!

I know this is confsusing, but I am at a disadvantage because the conventional terminology does not cover what we are discussing, and I think we are interpreting differently my awkward attempt at selecting the closest reasonable description.

Please note how I wrote the word thus: 'continuously' meaning this is as close as I can come to the description because of the symantics issue.

Obviously, unless I am just amazed by shiny objects and can't dress myself without help, I have no desire or need to just have the A axis sitting there spining madly away while nothing else is happening . . .

OK, seriously, in practictice I use feed per rev, so all I need to do is start the spindle and command an x move and Mach calculated the required motion for the axis based on the speed of the spindle. No such facility exists between two axis, that I know of in Mach.

It seems obvious to this observer that the A axis is not indended to be a 'spindle' and cannot be 'turned on' with Mach calcing the needed axis move to accomplish the feed rate based on the A 'spindle speed'. I'm sorry I can't help but trip over terminology here because there is overlap in definitions, I suppose.

Given that there is no way currently to accomplish the above described scenario, the only practical work-around that I came up with for 'continuous' revolution of the A axis to accomplish the desired cut is to use what is available which is huge azimuth numbers. Fortunately, so far I have not hit the wall with what Mach will put up with in this devious trickery . . .

Feel free to pick a term for "rotation of the A axis in one smooth continuous movement sufficient to accomplish the desired cut using whatever toolls we actually have to do so" . . and I'll be happy to use that term so that we both know "Who's on first" at the same time.

#### vmax549

##### Re: how to go to z without traveling dagonally
« Reply #12 on: April 26, 2009, 12:34:13 PM »
SIMPSON, what Hood is trying to explain IS you cannot do what you want in the conventional sense.  AND he offered you a work around. The only options you have is

Do all the motion using Gcode as you are currently doing or

Use swap axis to make the A axis a spindle temporarily then switch back as needed, BUT you cannot have everthing as you wanted this way. As soon as you swap axis you loose the interpolation of the A axis to xyz and the loose the conventional spindle. IF you wanted to use the convential spindle at the same time it would be a problem as MACH does not support live spindles other than Z and then only as a free spindle not a live spindle .( live spindle can turn as rpm or turn as deg)

Now it would be very simple to create an A drive that could be switched VIA a macro that could run the Axis as a free spindle when needed then be swtiched back as required. You would just have to resync A (home the Axis) as it came back online

You just have to think outtside the box. (;-) TP

« Last Edit: April 26, 2009, 12:46:41 PM by vmax549 »

#### SteinarN

• 155
##### Re: how to go to z without traveling dagonally
« Reply #13 on: April 26, 2009, 12:55:34 PM »
I'm a totally newbie to practical machining with cnc machines and G-codes but I nevertheless give a try on a solution

I have a couple suggestion to how to accomplish "continuous" rotation of the A-axis to do some specific machining operation.

First example: Milling a radial slot 360 degrees in 4 pass with gradual plunge of the tool. One final rotation of the work piece with the tool not plunging further.
The last example have only 120 degree final cut due to the plunge taking place in the first 60 degree move

(Tool in place Z0)
G1Z-1A(CW)360
Z-2A360
Z-3A360
Z-4A360
A360
G0Z0

The same operation making a zigzag slot:

(tool in place Z0Y0)
G1Z-1A(CW)60Y10
A60Y0
A60Y10
A60Y0
A60Y10
A60Y0
Z-2A60Y10
A60Y0
A60Y10
A60Y0
A60Y10
A60Y0
Z-3A60Y10
A60Y0
A60Y10
A60Y0
A60Y10
A60Y0
Z-4A60Y10
A60Y0
A60Y10
A60Y0
A60Y10
A60Y0
A60Y10
A60Y0
G0Z0

Edited the G-code. Some lines were duplicated.
« Last Edit: April 26, 2009, 01:13:49 PM by SteinarN »

#### SteinarN

• 155
##### Re: how to go to z without traveling dagonally
« Reply #14 on: April 26, 2009, 02:22:52 PM »
I see my previous post probably was an answer to a question nobody have asked......

Back to the continuous run question.

I don't know how fast an indexing board type axis can spin, probably not that fast due to the gear ratio. If so, not well suited to turning small diameter pieces.

But here is what I'm thinking on. Maybe a complicated system.....

Setup:
A turn spindle with a 3-phase motor and an encoder connected to a board receiving position signal from Mach3 and controlling the VFD with say a Hz signal. A Hz signal is probably the most accurate type of signal due to its precisely controlled frequency. Another encoder connected to Mach3 for visual control of the rotational position with high accuracy.

Control:
When requiring continuous rotation for turning, make a button in Mach3 sending a 5V signal via a BOB to the VFD. This VFD input is configured in the VFD to place it in "Continuous rotation mode" regulating the spindle speed from a spindle speed signal from Mach3. That should be easy to configure Mach3 to do.

Shifting back to "Rotational position control" is done by manually by hand or by manually driving the VFD to a position where the encoder in Mach3 is ending at 20, 40, 60 or 80.0000 degrees. A mark on the spindle indicates which of these rotational position is the original "zero" position. When this position is accurately achieved then zero the A position and switch off the button sending the "Continuous rotation mode" signal to the VFD. These two operations should be done by one single button with a VB script.

Edit:
It is also necessary to reset the encoder board controlling the VFD when shifting from Continous rotation to Rotational position control. Or possibly better remove the power from the board when shifting to Continous rotating mode and reconect the power when entering Rotational position mode.

In this way it is possible to run in "Rotational position control", shifting to "Continuous rotation mode" and back to "Rotational position control" without missing steps or position.
Say first milling some keyways, then do some turning and then do some more milling while retaining the exact same rotational position as when milling the first keyways.

The only thing is I don't know if it exists a board with an encoder input and a Hz or PWM output.
« Last Edit: April 26, 2009, 02:54:46 PM by SteinarN »

#### Hood

• 25,835
• Carnoustie, Scotland
##### Re: how to go to z without traveling dagonally
« Reply #15 on: April 26, 2009, 02:57:56 PM »
Quote
Given that there is no way currently to accomplish the above described scenario, the only practical work-around that I came up with for 'continuous' revolution of the A axis to accomplish the desired cut is to use what is available which is huge azimuth numbers. Fortunately, so far I have not hit the wall with what Mach will put up with in this devious trickery . . .

Is that all you are wanting? ie a means to stop the axis reaching the magic number?

Hood

#### MachineMaster

• 150
##### Re: how to go to z without traveling dagonally
« Reply #16 on: April 26, 2009, 03:10:29 PM »
To set the A axis to machine zero all you have to do is put

SetMachZero(3)

in a macro and any time it is called A axis will be set to machine zero.

#### SteinarN

• 155
##### Re: how to go to z without traveling dagonally
« Reply #17 on: April 26, 2009, 03:24:48 PM »
If there is an additional index slot (one slot per revolution) on the spindle it should be possible to make a macro doing the "homing" to Rotational position mode automatically. It should be possible to make a macro shifting to Continuous rotation mode also.

In this way it should be possible to do some milling with Rotational position control, call a macro in the G-code shifting to Continuous rotation mode for turning and calling a new macro in the G-codes shifting automatically back to Rotational position mode for more milling without loosing the exact rotational position.

#### SteinarN

• 155
##### Re: how to go to z without traveling dagonally
« Reply #18 on: April 26, 2009, 03:42:52 PM »
One thing I forgot to consider is the max speed of the encoder pulses. For any degree of accuracy it is necessary with a high count encoder, possibly via a gear system to achieve the required resolution, say 3600 pulses per turn. 2000 rpm gives 120,000 pulses per second. I suppose this is way beyond the capabilities to Mach3 and the parallel port?

#### simpson36

• 1,369
##### Re: how to go to z without traveling dagonally
« Reply #19 on: April 26, 2009, 07:01:17 PM »
Wow, awesome replies this time!

I must have finally explained it clearly enough becuse some of you are getting it now. It can be frustating when one askes how to paint their car red and the replies are not how to do it, but that red sucks and you should not want red.

SetMachZero(3) is the magic pill I was looking for. That should allow a program of any length to run.

Someone mentioned I could make a macro to create a 'continuous' run mode. That is exactly what I have been wanting some help with, as I am no Mach guru by any means. Until such time as Mach impliments such a feature, I have to go with work-rounds. I don't know how I can be more clear that swap axis is NOT an acceptable solution for my needs, so I am not going to discuss that any further.

Speed and the mechanics of the 4th axis is not part of the question. That is already worked out, tested and functioning fine. Mach seems to have homing for the A axis, so if that is functional (I have not tried it), then that is a non issue. I would be happy to answer any questions about the mechanical aspects of the existing (currently up for sale) or planned new 4th axis rigs, but I don't want to distract right now from what is at issue, which is the programming.

So, I feel that there is understanding of the objective now. Just down to discussing the best actual macro code. I am very familiar with programming and the concept of scripts, but I am a novice at G-code and Mach3, so that's where I would appreciate some guidance and assistance.

Actualy I now have enough pieces of the puzzle to complete what I need, but I wuld still welcome some more detailed discussion about the specifics and options if anyone feels so inclined.

One specific that was presented was code that repeated A360 over and over, but while that is valid, it would only work in incremental mode and it does not solve the problem of accumulation of machine coords for the A axis. The function SetMachZero(3) would theoretically solve that. That is the key piece of the puzzle.

So, for the scripting gurus out there, what needs to happen is to create a new command that reads the system variable that stores the feedrate in dist per rev. Then take the commanded X move and do the very simple math to calulate the number of degrees the A axis must turn to accomplish that feed rate over that distance and aseemble and pass the appropriate command to Mach.

The machine coord of the A axis could be zeroed after each move or the accumulation monitored by a brain (I think) and reset to zero upon reaching a specific number.

More sophisticated features would be to distinguish between a turning pass and a threading pass and force multiples of 360 for threading passes.