background image background image background image
to DeskProto home page
Contact  
looking glass icon
to DeskProto Facebook page
to DeskProto Youtube page
to DeskProto Instagram page

Forum menu:

DeskProto user forum

Forum: communicate with other users


Forum home page main
Forum:
Thread:
Resetting A-Axis to zero when chaining
You’re logged in as:guest
Online users:0
Online guests:8
 

page 1 of 2


Olly
2022-01-13
23:53 CET
I ran into an issue whilst chaining multiple part operations together that when chaining a rotary geometry path to the next part which was not a rotary operation but a vector operation the code would finish the rotary operation at say 65000 degrees in the a axis and the next operation would send the A-axis to 0 for the vector operation.

This was taking a long time to unwind all of those rotary helix rotations back to 0. I tried a few things but other than separating the operations out and manually calculating and re-zeroing the a-axis before starting the vector operation nothing worked.

Sooo i use Mach3 for my control software which enables me to write my own macros to be utilized as "M" commands in the code.

I wrote a macro that can be called via the code which will calculate from any given stopping point of the a axis a way to return to the originally set A0 position within 1 (or part) rotation and then reset the work co-ordinates for the A-axis to Zero.

I can use the "Extra NC Commands in the advanced tab of the tool path to input the code to call the Macro before the vector file. which allows me to chain the operations together without having to wait for the a-axis to fully unwind from the previous rotary operation.

If anyone is interested in unitizing this then i am happy to post the code and how i implement it. Just ask and i will post it up.

Cheers
Olly

Lex
2022-01-14
10:30 CET
Hi Olly,

That is an interesting macro, as more users have ran into these long waiting times for rewinding the rotary axis to A=0. Also without using the chaining feature. The annoying detail of course is that such slow rewind is unneeded.

A Macro to calculate an A-value between 0 and 360 for the current A position and then set to that value will indeed be a great help. If you could post that we can show the page to users who will ask about this.

Lex.

gangster
2022-01-14
11:43 CET
Hi Olly might be barking up the wrong tree but take a look at this it might help .from the part tree right click go to operation paramenter then go to advanced then extra nc commands use the right side after operation commands move a axis to 0 and lift your z to its max this might help Dave.

Lex
2022-01-14
15:41 CET
Hi Dave,

Thanks for posting a possible fix for this problem. I am afraid that this (entering a command to rotate to A=0) in this case will not help.

The issue is (if I understood correctly) that for a helix toolpath the cutter keeps rotating in the same direction. Which leads to very high A-values (after 100 rotations A will be at 360000 degrees). When you then enter a command to travel to A=0 some machines will start rotating backwards (for the example 100 times), which takes a lot of time. These machines do not have the intelligence to know that the position for 36000 degrees is identical to the position for 0 degrees.

In that case a macro to recalculate and reset the A-value will help.

Lex.

Olly
2022-01-14
18:28 CET

Here is a comparison of to old and new code files.
The one on the left is the original where after a helix tool path the A-Axis finishes at an A rotation value of 64800 which is actually the same as A0.

But below in the vector operation the code commands the axis back to A0 which means having to unwind 180 revolutions.

On the right is the code with the new macro added "M952" which should auto reset the A-axis work offset to zero within one full rotation.

Olly
2022-01-14
18:32 CET

To add the Macro to the code you have to add it to the operation that come as after a helix operation, (or any operation that creates a large number of a-axis rotation in one direction).

Add it at the beginning using the Start/end commands as shown here.

Olly
2022-01-14
18:55 CET

Here is a picture of the code for any that are interested. I tried to notate it so you could see the thought process and make any adjustments to suit your machine or setup.

Points of note:

I wrote this for my machine which in machine coordinates has the z-axis all the way up at Z0 and then uses -Z values for the tool going down. The code sends the tool to 5mm from the top of my travel. If your machine has +Z values then you will need to adjust this to suit your machine.

After moving the Z-axis up it return to the work Coordinate G54 which i assume most would be running their machine in.

I in fact use G55 for my rotary setup so have to change this for my machine. If you have a custom work offset setup for your rotary tool then you will need to adjust this to your particular setup otherwise it will reset A axis to zero but in G54 not in your work offset.

I may tweak this to see if i can get it to recognize the offset it was in previously and return it to that, which may mean you don't have to manually do it but i figure for most they wont be changing offsets once setup very often.

Again if people have issues with the Z height then i may tweak it to try and resolve that issue.

As a V1 of this code i have manually tested it and it appears to be operating as intended but i have not extensively tested it. SOOO....

Use at your own risk and do test before committing it it a files code.

I test mine using the MDI screen.

Send A to some random degree value that's not an exact division of 360. e.g G0 A1234

Manually jog the Z axis down off its stop a little

Then type in M952 in the MDI line and it seems to work ok for me.

I named the File M952 as that was available on my setup. You can rename the file to any number you like just make sure it is in the format:

M(whatever number you like, no spaces or text)

If you do change the name then that is what you need to call it by when entering it into your code or the MDI Screen.

You will need to add it to your macro list before it will work which should be found in your computer
C:Mach3macros, then pick the profile you are using, Mach3mill for most i would assume. Copy and paste it in here and then you can call it from the MDI screen or from within code.

Olly
2022-01-14
18:58 CET
Finally here is the code file attached or copy and paste.

'M952
'RESET A TO 0 WITHOUT FULLY UNWINDING
'
CODE "(RESETTING A TO ZERO)" 'Message to display in status bar


Dir CURRENTA
Dir CURRENTAROTATIONS
Dir NEWAROTATIONS
Dir NEWA
Dir NEWDEGREES


CURRENTA = GETOEMDRO(803) 'get current A-axis degrees
CURRENTAROTATIONS = CURRENTA / 360 'convert current a-axis degree to rotations
NEWAROTATIONS = Round(CURRENTAROTATIONS,0) 'apply rounding to the rotaions to get a whole number
NEWA = NEWAROTATIONS * 360 'tunrn the new whole number of rotaions back to degrees
NEWDEGREES = CURRENTA - NEWA 'subtract the original A-axis degrees from the new calculated degrees to give a partial rotaion in degres
Call SETOEMDRO (803, NEWDEGREES) 'set the a Axis work co-ordinates to the new partial rotation degrees value

CODE "G53 Z-5" 'Move z axis in Machine co-ordinates to a high z to avoid collision on rotation.
CODE "G54" 'Return to G54 work co-rdinates
CODE "G0 A0" 'Send A axis to Newly calcuated 0 degrees

While IsMoving() 'Wait for axis to move
Wend

CODE "G92 A0" 'Zero out A Axis for current Work Co-ordinate

Olly
2022-01-14
19:04 CET
Above it doesn't seem to have kept the formatting when adding the code into the post. Just make sure it looks like the screen shot of the code in the above post. Any editing is easily done in notepad or equivalent program.

Any questions feel free to ask

Olly

Lex
2022-01-15
11:20 CET
Thanks for sharing !


page 1 of 2