4th axis G-code question, maybe not UCCNC

Post anything you want to discuss with others about the software.

4th axis G-code question, maybe not UCCNC

Postby spumco » Sun Apr 30, 2017 8:25 pm

So I'm starting to use my 4th axis and have figured out how to enable the axis and so forth in my Fusion 360 post processor. Got the 4th axis enabled and calibrated in UCCNC.

Everything seems to be fine, location-wise, but I almost crashed the tool during an A-axis rotation.

What I noticed was that the Z-plunge from clearance to feed plane happened while the A-axis was still rotating - i.e. catching up to the commanded position. Program is a simple series of holes drilled in a round part at 90 increments, but the holes are just about in between the chuck jaws.

Here's the section of code in question, ignoring previous stuff and setup:

G61
G54
G0 A0.
M8
G43 H1
G0 X-2.4155 Y0.
Z3.1225 [clearance plane]
Z2.1225 [feed plane]
G81 X-2.4155 Y0. Z1.5725 R1.7225 F39
Z3.1225
G80

G0 A90
Z2.1225 [Yikes!]
G81 X-2.4155 Y0. Z1.5725 R1.7225 F39
Z3.1225
G80

The issue came when the G0 A90 was executed and then the Z2.1225. The A axis started moving, but because my 4th's rapid speed is only about 15RPM the Z2.1225 was executed at 150IPM while the A-axis was still lazily rotating to 90 degrees. The tool got to Z2.1225 well before the A-axis was finished, and the tool tip missed the chuck by about 0.050." After changing my underwear, I decided to call it quits until sorting it out.

Setting the feed plane higher would obviously fix this particular problem. However, I'd like to understand how to do this properly, whether it's a UCCNC setting or simple G-code thing.

How do I force the machine to wait until one move is finished before starting another? I could program a G4 Pxx dwell - but I don't want to have to time the 4th axis and program a specific dwell for each angular distance.

Does G4 P0 force the controller to finish the previous move before a '0' time dwell and then move to the next command?
Or is there a setting - perhaps exact stop mode - in UCCNC I'm overlooking? I thought the G61 at the beginning would have taken care of waiting for each move to complete.

I don't really want to program a 5-10 second delay after each rotational move - that'd be painful to watch with a spot-drill-chamfer-tap process...

Thanks,
Spumco
spumco
 
Posts: 306
Joined: Mon Oct 03, 2016 10:10 pm

Re: 4th axis G-code question, maybe not UCCNC

Postby cncdrive » Sun Apr 30, 2017 11:42 pm

Terry is right. The A axis is CV controlled just like all the other axes when in G64 mode (default on startup).
So, for example you make movements:

X0A0
X1
A1

Then when the X axis is moving from 0 to 1 then it is not sure that X will reach 1 before A starts moving from 0 to 1,
because the axis is CV controlled, so the controller will keep your CV parameters in mind and in this example case it can make the path shorter and faster to execute if it will round the corner.
So, it will run off the path creating a corner on the XA plane and which will cause the path to finish faster than if it would fully go to the edge creting a sharp corner, but this rounding also means what you've described, that X1 will not be reached before A will already start moving.
How much earlier (the worst case scenario) the A may start moving depends on your CV tolerance setting, the corner and linear error parameter, because the controller will not create more path error than what you have setup with those parameters.

So, you have 2 solutions:

1.) To lower the CV tolerance. However this will also cause other movements to follow the path closely which can result an unwanted long path and slower path execution. If and when this is a problem depends on the particular application.
2.) To switch to G61 exact stop mode when it is nessessary and switch back to G64 on the other paths.

In G61 exact stop mode the programmed endpoint of the code line is always guaranteed to be reached before the next movement command starts, so in the example code X will reach the position 1 and A starts moving to 1 only after that happened.
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: 4th axis G-code question, maybe not UCCNC

Postby ger21 » Sun Apr 30, 2017 11:55 pm

He is using G61 mode.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2663
Joined: Sat Sep 03, 2016 2:17 am

Re: 4th axis G-code question, maybe not UCCNC

Postby spumco » Mon May 01, 2017 12:18 am

ger21 wrote:He is using G61 mode.


At least I think I am.

Is G61 not modal in UCCNC? Is it more like a G09 in other controllers (one line/move only exact stop)

The Fusion post switches to G61 for all drilling cycles and then switches back to G64. I thought this would work, but I'm not sure what's going on.
spumco
 
Posts: 306
Joined: Mon Oct 03, 2016 10:10 pm

Re: 4th axis G-code question, maybe not UCCNC

Postby cncdrive » Mon May 01, 2017 12:35 am

I've missed to see you are in G61 mode.
Then please send me your profile file and we will make a scope measurement on the step/dir signals to see what is going on.
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: 4th axis G-code question, maybe not UCCNC

Postby spumco » Mon May 01, 2017 12:59 am

Vmax549 wrote:Well to start with the code is poorly constructed. G98/99 is not defined and on each drill cycle it does another drill cycle at a HIGHER z than the originate hole

Teh Z Call on teh line after each G81 drill cycle IS another drill cycle before teh cycle is cancelled with G80. Teh way it is it is going to do a strange Z jig drilling upwards

I tested teh code here and it runs in proper order it just has some strange moves that are programmed.

(;-) TP


That was me trying to force it to retract to clearance after the drilling cycle. I should have the G80 before the retract to clearance?

As for the G98/99 stuff, I left out the setup lines with the S-xxxx and so forth to try and trim down the forum post. What I posted wasn't the whole program.

Profile attached, Balazs. Thanks for taking the time to look at it.

-S
Attachments
Mikini_2017_Screen.pro
(31.74 KiB) Downloaded 829 times
spumco
 
Posts: 306
Joined: Mon Oct 03, 2016 10:10 pm

Re: 4th axis G-code question, maybe not UCCNC

Postby spumco » Mon May 01, 2017 1:09 pm

Terry,

Thanks, and I'll do it when I get home tonight - but did you mean to have the feed rate different for the two moves?

G81 X-2.4155 Y0. Z1.5725 R2.1225 F10
G80
G0 A90
G81 X-2.4155 Y0. Z1.5725 R2.1225 F39

Thx,
S
spumco
 
Posts: 306
Joined: Mon Oct 03, 2016 10:10 pm

Re: 4th axis G-code question, maybe not UCCNC

Postby spumco » Mon May 01, 2017 8:57 pm

Well I'm schooled. That code worked like a champ.

I'll try it again with a peck drill cycle, but I think that's the ticket.

In order to understand this better, I should program a G80 immediately after the drilling is done and before any other moves? Assuming of course I'm not drilling a series of holes at the same plane at various X-Y locations...

-S
spumco
 
Posts: 306
Joined: Mon Oct 03, 2016 10:10 pm

Re: 4th axis G-code question, maybe not UCCNC

Postby cncdrive » Tue May 02, 2017 12:35 pm

Hi Spumco,

We've managed to debug your code and we do not see any issues.
I'm attaching the logic analyser capture of the full code you've posted.
We ran it using your profile file.
The step and direction signals of the different axes are attached to the logic analyser channels and you can see that non of the axis starts too early,
all starts the movements only when the previous movement is finished.
Attachments
A1.png
A1.png (5.1 KiB) Viewed 21672 times
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: 4th axis G-code question, maybe not UCCNC

Postby cncdrive » Tue May 02, 2017 12:37 pm

Here the Z finishes the movement and A starts to G0 A90.
Attachments
A3.png
A3.png (3.54 KiB) Viewed 21671 times
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Next

Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: No registered users and 18 guests