Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: theshed on October 09, 2010, 09:54:30 AM

Title: Still being driven mad by arcs
Post by: theshed on October 09, 2010, 09:54:30 AM
My problem is that my lathe loses position when I use any code with either a G2 or G3 command. I think that there is something in the pulse train in curves that confuses the servo drive. I have tried the following tests. I have written a test program that runs an S shape (G2 then G3) 50 times in rapid. At the end there is an error on each axis +0.8mm Z and -1mm X. I can run a test on either axis running 200 rapid moves backwards and forwards  - no error. I can run 200 moves backwards and forwards with both axis moving together in a straight line - again no error.

The errors are repeatable. I do not think that it is noise, a weak port signal, or my rather old pc (although I could be wrong).

The servo drive needs the Dir pulse to lead the Step pulse. My problem is that I do not know what that means! I have step set in Mach3 at 3 and Dir as 10. I have tried loads of values but seen no change.

Is the Dir signal pulsed in the same way as the step or does it only change between 0 and 1 on a direction change?

As far as I can measure (which is good enough for me) I have no problems with any moves other than curves. I have been working at this for 2 months now and may just burn down the shed!

I have servos 2000 line encoders, 16x multiplier, 200/250 steps per mm and a dual axis servo drive.
Title: Re: Still being driven mad by arcs
Post by: Tweakie.CNC on October 10, 2010, 05:46:34 AM
I can answer a couple of your questions but not all, sorry.

Quote
The servo drive needs the Dir pulse to lead the Step pulse. My problem is that I do not know what that means! I have step set in Mach3 at 3 and Dir as 10. I have tried loads of values but seen no change.

This means that the direction signal has to be established before the step signal is sent and Mach automatically does this.

Quote
Is the Dir signal pulsed in the same way as the step or does it only change between 0 and 1 on a direction change?

The direction signal is either low or high (0 or 1) and remains at its last setting until a direction change, for that axis, occurs.

Tweakie.
Title: Re: Still being driven mad by arcs
Post by: RICH on October 10, 2010, 06:54:08 AM
Can you post your test file for the s curve?
RICH
Title: Re: Still being driven mad by arcs
Post by: theshed on October 10, 2010, 03:02:20 PM
Thanks all,

the code in the subroutine is

G90
G2 X0 Z-24 I0 K-12
G3 X0 Z-24 I0 K-12
G0 Z48

repeated 50 times. The problem is not unique to the code but to any program with G2 or G3 moves but strangely not to any code written with straight lines including where the axis move together. I had another play today and tried to run a G76 threading cycle - not a chance! the drive signaled an E-stop saying that there was a follower error. I wonder if there is a link? I think the servos are well tuned but am not sure.

I am getting a bit grumpy with my CNC lathe a I made some parts on my 1908 lathe as therapy!
Title: Re: Still being driven mad by arcs
Post by: RICH on October 11, 2010, 05:58:57 AM
What happens with the following since the G3 is just the reverse of the  G2?
try in CV and also exact stop. If you put a pause in between the arcs you may be able to check the positions
before the G3 code is implemented....

G90
G2 X0 Z-24 I0 K-12
(G4 P?  to check position )
G3 X0 Z0 I0 K-12 ( maybe add another g4 after the g3)
G48

Quote
the drive signaled an E-stop saying that there was a follower error
Did you allow say 3 to 5 diameters of Z movement before the start of threading?

RICH
Title: Re: Still being driven mad by arcs
Post by: theshed on October 11, 2010, 06:53:07 AM
Thanks for the help - I will try that this evening. I am however beginning to think that my servo tuning is off. At low speeds the motors click and the errors are much worse. The faster I run the machine the less the errors - almost the reverse of the usual difficulties I have seen posted.

As for the threading - you are right I did not allow anything like enough Z before cutting - I will try again.


Title: Re: Still being driven mad by arcs
Post by: Hood on October 11, 2010, 07:02:38 AM
What type servos/drives do you have? Whats your accel?
Hood
Title: Re: Still being driven mad by arcs
Post by: theshed on October 11, 2010, 07:19:20 AM
Hi

Servos are brushed DC SEM servos Max 140v (running at 100v) Encoders are 2000 line differential - The drive is a Granite Devices Dual drive. I have varies the accel from 50mm/s/s up to 400mm/s/s it is most comfortable at between 150 and 200 - changing the accel  has no noticable effect on the error - however changing the velocity does - slower is worse.

I have set the multiplier on the drives to 16x. Since doing that I notice that the servos click at very low speeds - sounds like the brushes on the armature but I am not sure - motors are fairly new (the machine had sat all its life unused in a college)

Any thoughts at all gratefully received. I tuned the motors quite carefully and got good response curves - I am starting to wonder whether there was a backlash or stiction issue.

I have shielded all cables and do not think noise is the issue - the errors are repeatable - same size same direction. I have reloaded the pc and changed the parallel port cable - no change at all. As I say all non curve moves appear to be accurate (I have tested that statement reasonably carefully).
Title: Re: Still being driven mad by arcs
Post by: Hood on October 11, 2010, 07:45:35 AM
Afraid I am not a fan of electronic gearing even on the industrial AC  drives I use, some people say its great but afraid I dont. Is there any way you can set it 1:1 and see if that helps, problem there I suppose would be you would effectively have to reduce the Velocity due to the pulses required (presuming you use the parallel port) and that will likely reduce the problem anyway.
What kernel are you running and have you tried it faster, if possible, so you can reduce the electronic gearing?
Hood
Title: Re: Still being driven mad by arcs
Post by: theshed on October 11, 2010, 07:56:25 AM
I can set the gearing to 1:1. I have not tried that. I started at 4x and moved upwards - no obvious change to the error. I am using 25kHz. My PC is only 1.1GHz with 256MB of Ram - it may not like running any faster. at 1:1 I would be up to 3200 steps per mm great resolution but maxed out at about 240mm/min! New PC?
Title: Re: Still being driven mad by arcs
Post by: Hood on October 11, 2010, 08:03:55 AM
Try the driver test are varying kernels to see how it looks, you may get a lot more than 25KHz.
Presume you are geared 2:1 mechanically with a 5mm pitch ballscrew? What size/make of lathe is it?
Hood
Title: Re: Still being driven mad by arcs
Post by: theshed on October 11, 2010, 08:10:36 AM
Hi Hood

Firstly many thanks for your help - I can see how much expertise you contribute to this forum.

You are almost right (and I got my maths wrong) mechanical gearing by toothed belts is 4:1. The lathe is a Harrison M250 professionally converted to CNC from new by Anilam for a college. I discovered that the anilam electronics and coolant did not mix well.....there is a snapped off boring bar in the roof of my shed just to prove it!

Title: Re: Still being driven mad by arcs
Post by: Hood on October 11, 2010, 08:13:19 AM
Ha ha, yes lathes can be dangerous, first time I tried CSS for facing a 19 inch dia hauler plate I forgot to limit the rpm and it got a bit frightening as it started spinning upwards of 1000rpm ::)

Hood
Title: Re: Still being driven mad by arcs
Post by: Kai on October 14, 2010, 11:56:54 AM
You know Hood I wish you were closer you may not as I could knock on your door and ask another stupid question each day lol I'm in Hull east ridding.
Title: Re: Still being driven mad by arcs
Post by: Hood on October 14, 2010, 02:03:24 PM
Small world, my Computurn 290 lathe came from Hull Uni.
Hood
Title: Re: Still being driven mad by arcs
Post by: Kai on October 14, 2010, 02:26:28 PM
wow that is a small world. I have to go to cardiff for mine lol
Title: Re: Still being driven mad by arcs
Post by: GytarrMann19 on December 29, 2011, 07:32:09 PM
Hi Guys,

I was searching the forum and found this topic. Did you ever make any progress? I am having the same issue with the same setup- two DC Servos running off one Granite DualDC drive. And the same results- never loses position during straight moves, but arcs will throw it off every time. A lot. Diagonal moves also seem to cause trouble, though not as severe.

Any ideas? I was thinking I may be better off going to separate drives.

Thanks,

Kevin
Title: Re: Still being driven mad by arcs
Post by: theshed on December 30, 2011, 04:26:48 AM
Hi

Well I found the answer and it was using the multiplier in the servo drive. Once I set that to a multiplier of 1 I get 100% accuracy. The only difficulty that gave me was that I needed to increase the kernal speed in Mach3 to get decent rapids... in the end I changed my computer for a more modern one and all works very well. I still keep my rapids to less than 1M/m just to (hopefully) avoid big crashes.

Other than that the Granite servo driver seem superb - I have not even opened the enclosure in 9 months.
Title: Re: Still being driven mad by arcs
Post by: Hood on December 30, 2011, 07:10:09 AM
Quite a lot of drives have these issues when using electronic gearing, thats why I suggested trying 1:1, the more Industrial ones seem fine but its not something I like using.
Hood
Title: Re: Still being driven mad by arcs
Post by: GytarrMann19 on December 31, 2011, 12:52:50 PM
I checked and my step multiplier was already set to 1. One other thing I tried was setting the X and Z axes accel and velocity to the same settings. That actually helped quite a bit, but I'm still losing position about .005" during a 1/32" radius corner round. As I said before straight line moves in both X and Z come out perfect every time.

Kevin
Title: Re: Still being driven mad by arcs
Post by: Hood on December 31, 2011, 05:45:53 PM
Is it easy to distinguish which axis it is?
If so then does it swap to the different axis if you swap motors on your drive?
If you swap pin assignments in Mach?

Hood
Title: Re: Still being driven mad by arcs
Post by: Cactus Pete on January 02, 2012, 12:38:37 PM
I have not tested this in Mach3, but in Mach1 there is a math algorithm issue when converting metric code to inch for the machine movement.  When running Mach1 with a metric gcode on an inch based machine with inch based lead screws,  I found several "poisoned" locations where a G2 or G3 command would be ignored or not executed.  When an arc command was given, followed by the next line of code to drop the Z for multilevel cuts to machine a post, the machine would remain stationary and only make one drop after another in Z while ignoring the arc commands in between, manifesting them as a pause.  The same set of code would work in some locations, but not others.  To prove this point, I changed the "poisoned" location by repositioning the location of X 0.01mm and the "I" arc center coordinate by the same amount so that the arc was still the same diameter.  This solved the problem.  I can only surmise that the issue resides in Mach1, and possibly Mach3, if the basic algorithms were not changed.  It must be an issue with rounding or conversion of metric to inch.  I ran into this with some other unrelated programs that also were metric and were arcs.  It was not until later that I was able to isolate the problem.  Rewriting the code by hand never had an effect.  This might also manifest as lost (or gained) steps when there are many G1 movements in a metric set of code.  I am doing all of my machining in inches until I can be sure.
Title: Re: Still being driven mad by arcs
Post by: GytarrMann19 on January 04, 2012, 07:04:46 PM
Hood,

The problem seems to exist in both axes, though most notable in the Z axis. I've been experimenting with different sizes of arcs and varying amounts of arc swing. The program that originally showed the problem was a .0315"r arc swinging 90deg. I've gone up to .5" arcs and the loss of position seems equal. The one exception being full circles, where the loss of position is very small (too small to measure in one cycle, it may go out .005" after 20 times.)

As I said, the single biggest thing to help so far was setting the axis accel rates the same. I also experimented with CV v. Exact Stop modes to no noticeable effect.

Pete,

I'm doing all my work in inch mode with inch programming on an inch machine, so I don't think there are any issues there.

How about a drive tuning issue or Mach motor tuning issue?

Kevin
Title: Re: Still being driven mad by arcs
Post by: Hood on January 05, 2012, 02:53:38 AM
Mach motor tuning of servos is straightforward, you  you max RPM so you can work out the max Velocity from that, the only thing you have to find is the acceleration and that is fairly straightforward as you just keep increasing until your axis faults. However this assumes that your drive/motor tuning is good and tight with a low following error set. I presume you can setthe following error in the drives? So first thing to get right is the motor/drive tuning. Can you monitor the axes position from drive software? What kind of following error do you have set? On my machines I usually aim for about 20 counts following error allowance with 8000 counts(2000 line) per rev encoders.
Hood
Title: Re: Still being driven mad by arcs
Post by: GytarrMann19 on January 05, 2012, 08:49:13 PM
I spent a couple hours tonight playing with the drive/motor tuning settings, i.e. PID values. This got my peak error down to under 10 counts with 1000 line encoders. I have the drive set to error at 15 counts. Not too shabby. With the new settings I'm getting much better results with my position loss. Not sure that its perfect yet, but much better.

I'm still not too pleased with the motor performance graphs, I seem to get a little more oscillation than what the book deems ideal. But I really have no idea what that PID stuff means.

Kevin