Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: GeorgeIoak on December 11, 2015, 12:05:27 PM

Title: Z-Axis Not Always Positioned Correctly
Post by: GeorgeIoak on December 11, 2015, 12:05:27 PM
I have a newly built system based loosely on the ShapeOko unit. I don't have any limit or home switches currently installed but I wanted to run some initial tests first to check that everything was running correctly. I used Fusion 360 to create a 3" square and made the square 0.478" thick to match the plywood stock I have. Since I don't have home switches installed I manually move the spindle to my home position, then shut down Mach3 and restart it. I then move the spindle to the corner and top of my stock, zero the DROs, load the file and run.

When I'm done I end up with a square that is 3" x 3" but the thickness is less than 0.478", it's closer to 0.38". When the job is done and I tell the machine to go to zero it moves to the correct X and Y but Z is above the stock, probably by the amount that it didn't cut.

I've done this about 4 times and only once did I get the correct thickness cut. I made another test with a different file after my successful cut but it too wasn't cut deep enough (it was a different program).

I've searched and read posts and videos but can't seem to find the source of my mistake. Can someone help me determine what is wrong with my procedure that is causing this?

Thanks,
George

Here's the GCode generated by Fusion 360 that I'm using for the 3" square test.


Code: [Select]
(SQUARE-3IN_V2)
(3 SQUARE TEST CUT)
(T1  D=0.25 CR=0. - ZMIN=-0.478 - FLAT END MILL)
G90 G94 G91.1 G40 G49 G17
G20
G28 G91 Z0.
G90

(2D CONTOUR1)
M5
M9
T1 M6
S14000 M3
G54
M9
G0 X0.8 Y2.475
G43 Z0.6 H1
Z0.2
G1 Z0.1644 F240.
Z-0.1 F80.
G18 G2 X0.825 Z-0.125 R0.025
G1 X0.85 F240.
G17 G3 X0.875 Y2.5 R0.025
G1 Y4.
G2 X1. Y4.125 R0.125
G1 X4.
G2 X4.125 Y4. R0.125
G1 Y1.
G2 X4. Y0.875 R0.125
G1 X1.
G2 X0.875 Y1. R0.125
G1 Y2.5
G3 X0.85 Y2.525 R0.025
G1 X0.825
G18 G3 X0.8 Z-0.1 R0.025
G1 Y2.475
Z-0.225 F80.
G2 X0.825 Z-0.25 R0.025
G1 X0.85 F240.
G17 G3 X0.875 Y2.5 R0.025
G1 Y4.
G2 X1. Y4.125 R0.125
G1 X4.
G2 X4.125 Y4. R0.125
G1 Y1.
G2 X4. Y0.875 R0.125
G1 X1.
G2 X0.875 Y1. R0.125
G1 Y2.5
G3 X0.85 Y2.525 R0.025
G1 X0.825
G18 G3 X0.8 Z-0.225 R0.025
G1 Y2.475
Z-0.35 F80.
G2 X0.825 Z-0.375 R0.025
G1 X0.85 F240.
G17 G3 X0.875 Y2.5 R0.025
G1 Y4.
G2 X1. Y4.125 R0.125
G1 X4.
G2 X4.125 Y4. R0.125
G1 Y1.
G2 X4. Y0.875 R0.125
G1 X1.
G2 X0.875 Y1. R0.125
G1 Y2.5
G3 X0.85 Y2.525 R0.025
G1 X0.825
G18 G3 X0.8 Z-0.35 R0.025
G1 Y2.475
Z-0.453 F80.
G2 X0.825 Z-0.478 R0.025
G1 X0.85 F240.
G17 G3 X0.875 Y2.5 R0.025
G1 Y4.
G2 X1. Y4.125 R0.125
G1 X4.
G2 X4.125 Y4. R0.125
G1 Y1.
G2 X4. Y0.875 R0.125
G1 X1.
G2 X0.875 Y1. R0.125
G1 Y2.5
G3 X0.85 Y2.525 R0.025
G1 X0.825
G18 G3 X0.8 Z-0.453 R0.025
G0 Z0.6
G17

M9
G28 G91 Z0.
G28 X0. Y0.
M30
Title: Re: Z-Axis Not Always Positioned Correctly
Post by: Overloaded on December 11, 2015, 01:59:38 PM
I didn't run your code, but it sounds like you might be loosing steps while plunging or possibly the tool is slipping up into the holder.

(assuming steppers)

Russ
Title: Re: Z-Axis Not Always Positioned Correctly
Post by: GeorgeIoak on December 11, 2015, 04:37:29 PM
Yes, I am running steppers. I'm running a 1/4" bit and taking 4 passes to get down to ~3/4" depth so I would suspect I'd be loosing steps. The Z-Axis is on a lead screw while the X & Y are on belts. The Z-Axis is running on a different motor controller though. I'm not in front of the machine but I think it is set to 4800 steps per unit while the X/Y are 508. I have the frequency set at 35kHz and when I check it it seems pretty solid.
Title: Re: Z-Axis Not Always Positioned Correctly
Post by: GeorgeIoak on December 11, 2015, 06:54:30 PM
I ran the circular pattern wizard and set the depth to 0.5" and 6 holes. I ran this test twice and all 6 holes both times were only 0.49" deep. About the only thing this tells me is that it's not something with the 3" square code I created in Fusion 360. Every time I measure the Z Axis movement it checks out perfectly (move 1", measure 1").

I'm continuing to look online but have yet to find something which would cause this so I'm crossing my fingers someone has a solution or at least something else to double check.
Title: Re: Z-Axis Not Always Positioned Correctly
Post by: garyhlucas on December 11, 2015, 07:09:25 PM
So if you move the tool to Z=0 is the tip of your tool right on the surface?  Did you use 0.010" feeler gauge to set the tool and forget to compensate for it?  I like using a 1/2" precision roll pin to set tools.  Keeps the tool away from my part far enough that an oops jog won't hit.  You roll it back and forth under the tool as you jog and it finds the lowest point on the cutter, not the lowest point where the block or feeler gauge is.
Title: Re: Z-Axis Not Always Positioned Correctly
Post by: GeorgeIoak on December 11, 2015, 07:57:28 PM
Well if I hit the "GOTO ZERO" button in the DRO section the tool does go back to just on top of the material. At least that's what seems to be happening when I run the GCode produced by the hole pattern wizard. When I was checking after the GCode posted above (made by Fusion 360) it seemed to return to a position above the stock (even though I zeroed on top of the stock).

No, I have not introduced a feeler gauge or tool setup gauge. I have one but I thought I would walk before I ran but it seems I can't even walk yet. I'm really at a loss here but it seems like it has to be something simple I've overlooked.
Title: Re: Z-Axis Not Always Positioned Correctly
Post by: Overloaded on December 11, 2015, 09:45:05 PM
Reduce the accel and vel for the Z in Motor Tuning and run it some more.
Might also incr3ease the pulse widths for the Z too.
.010" might be difficult to measure accurately with plywood.

You might also skim cut the surface and set Z0 at that actual level, then test the depth of cut.

Still sounds like missed steps. You mention a different driver for the Z too .... how different ?

Russ
Title: Re: Z-Axis Not Always Positioned Correctly
Post by: GeorgeIoak on December 11, 2015, 10:18:24 PM
No, this isn't 0.01" difference, it's 0.1" and it's always not cutting deep enough by ~0.1". I ran through some of the wizards and 1 out of ~4 times I was able to get a depth of 0.5". I did slow the feed rate down to 1 and that didn't seem to make a difference in the depth.

There is 1 controller board using Sanken SLA7078MPR driver chips which drives the Y, Z, and a slaved A axis to the Z (dual motors on the gantry). The Z-Axis is being driven by a TI DRV8825 on a different board.

Right now I have Z Axis motor tuning set with 4800 steps, velocity of 100, and acceleration of 10. I did have those lower the other day but today I went through the tuning again and played with the settings and the motor seemed to be running just fine at these levels. I used a feed rate of 5 and 1 in the wizards and that didn't seem to make a difference.

I'm actually cutting MDF (1 test I used plywood) so I would think that's about the easiest of materials to cut (short of foam and thin plastics). It's a 1/4" bit and most of the DOC are at 0.2" so I wouldn't think I'm stressing .

The X/A/Y Axis motors are NEMA 23 MotionKing 23HS8530-01A (3.0A, 1.8deg/step, 1 ohm, 1.8mH) while the Z Axis is a Nema 23 Sanyo Denki 103H7126-5040 (2.0A, 1.8 deg/step, can't seem to find the actual datasheet).

If you're still thinking it's missed steps should I lower the kernel speed to 25kHz and run 1 of the wizards with a feed rate of 1?
Title: Re: Z-Axis Not Always Positioned Correctly
Post by: Tweakie.CNC on December 12, 2015, 02:21:18 AM
Reducing the Feed-Rate and lowering the Velocity are two entirely different things as far as machine performance is concerned.

Try...
  
(as you have suggested) reducing the Kernel to 25kHz.
Reducing the Velocity for the Z axis to 60 (save the change).


Tweakie.
Title: Re: Z-Axis Not Always Positioned Correctly
Post by: GeorgeIoak on December 12, 2015, 11:12:11 AM
I'll be making the suggested changes later today and will report the findings but I have some questions.


Thanks again for helping me get through this.
Title: Re: Z-Axis Not Always Positioned Correctly
Post by: Overloaded on December 12, 2015, 08:58:40 PM
I ran the circular pattern wizard and set the depth to 0.5" and 6 holes. I ran this test twice and all 6 holes both times were only 0.49" deep.

...that's .010"

Run your 3" square file in air and see if it ends at the right Z level.
That's a strange lead in with a vertical arc that I've never seen before .... but I haven't seen much.  :)
Title: Re: Z-Axis Not Always Positioned Correctly
Post by: BR549 on December 12, 2015, 10:27:39 PM
That is what is called a blended plunge  move .

(;-) TP
Title: Re: Z-Axis Not Always Positioned Correctly
Post by: Tweakie.CNC on December 13, 2015, 01:38:38 AM
Quote
Do you think reducing the microstepping on the Z Axis driver so it takes less pulses to move 1" will have any impact on the results?

It should not make any difference unless you PC is just not up to the task.

Quote
The pulse width is set to 5us for step/dir on all axis. The TI driver has a minimum pulse width of 1.9us so this should be OK, right?

Try some experimentation here to get the smoothest motor motion (2uS gives me the best performance).

Quote
I was running the driver test and checking all frequencies. Even up to 100kHz it reports the system is OK. I noticed that up to 65kHz the CPU usage is less than 5% but 100kHz is ~50% but I don't see any reason to push it that high. When I look at Max Variation I see mostly repeatable spikes and values of 15us or 23us. This doesn't seem to change when I change the frequency but occasionally I see nice smooth line aith maybe variations of 5-8us. Is ~20us variation something to worry about? Should I break out the scope and see what the step pulses actually look like?

Unless you definitely need a higher kernel speed (to achieve the desired rapids) then use 25kHz.

Tweakie.
Title: Re: Z-Axis Not Always Positioned Correctly
Post by: GeorgeIoak on December 13, 2015, 04:57:23 PM
For completeness, the PC has Intel Core2 Duo, 1.66GHz, 2GB RAM, And running Win7 Ultimate 32-bit.

I reduced the kernel to 25kHz and the Z-Axis speed to 30in/min, Acceleration = 10 In/sec^2

You're right, my bad in saying the delta depth wasn't 0.01", it is.

I'm still not measuring a depth of 0.500". Using my Mitutoyo Calipers to measure the depth leaves a little margin of error if you don't get the plunger and caliper 90 degrees to the wood. But even allowing for a little error in the measurement technique I still don't get the results I think I should be getting with this machine.

I still need to play with the pulse width and just for completeness, change the micro stepping to reduce the number of steps. I really would have thought that the lead screw setup on the Z would have given better results than the belt and pulley setup for the X/Y but maybe not? I believe it has an Acme screw on the shaft (need to look up what I order a long time ago) so backlash should be very minimal.

The saga continues...
Title: Re: Z-Axis Not Always Positioned Correctly
Post by: GeorgeIoak on December 13, 2015, 09:25:04 PM
Well I experimented today by changing kernel speed, pulse widths, and micro stepping but I never found the magic solution. In fact now I'm consistently getting holes deeper rather than shallower like before. I'm consistently reading between 0.513-0.520" for the depths instead of 0.500". I guess I'll have to sleep on it and see if anything comes to mind.

The Z Axis in this video, https://www.youtube.com/watch?v=AfA-xQVCElg (https://www.youtube.com/watch?v=AfA-xQVCElg) looks t be identical to what I have except I'm using a Bosch Colt instead of a Dewault.