Hello Guest it is April 19, 2024, 12:10:40 PM

Author Topic: Galil + Mach3 slowly losing position  (Read 8917 times)

0 Members and 1 Guest are viewing this topic.

Galil + Mach3 slowly losing position
« on: November 30, 2013, 08:46:21 PM »
Some time ago I purchased a used Wells-Index NC that had been converted to CNC with a Galil controller.  After much assistance from Ken I got it converted to Mach3 and have been very happy with it.  However, I noticed recently that it seems to be slowly losing it's 'place' in the X-axis.  When I first got it running I noticed the "DRO's" in Mach3 didn't always go back to 0.000 when I zero'd the machine out, did some machining, then gave it a G1 X0 Y0 manually.  It will be off sometimes by as much as a thousandths or two.  My tolerances aren't that finicky so a couple thou here and there isn't that big of a deal typically.  The Mach3 DRO's read to the tenths.  First question is; shouldn't Mach3 at least zero out to the thousandths?

Bigger problem:
Recently I was doing some 1/16" round overs and noticed that after cutting out a part and going straight to the round over bit I'd end up with a "lip" on one side where the cutter obviously didn't maintain the correct offset.  I started documenting the X and Y dials and have found the X axis seems to be creeping.  So far my solution has been to zero the machine out then mill a bit.  Between MOPS I do a G1 X0 Y0 and then give it manual moves until the dial is back at the documented location.  Then I zero it out again.  Preliminary information seems to show the X creep gets worse with longer, more time consuming runs but resetting it occasionally 'fixes' the problem. 

The machine has balls screws and seems pretty tight.  I've noticed that if I use it for a few hours I'm putting in a -.001 to -.0025 about once every 30-45 minutes.  If my understanding of everything is correct it can't be a mechanical problem because, over time, I'm adding as much as 10-15 thou in one direction only.  Seems if it was mechanical slop I'd be adding it to either side depending on the direction I approached 0 from.  And, by doing this I'm getting finish passes that are taking material off all sides consistently and symmetric parts I can cut, round over with a 1/16" round over then flip and round over with a nice outcome.

I'm not even sure where to begin looking into this.  It would seem that with encoders the system would either work or wouldn't work.

Thanks for any advice/assistance,

Mark


Offline smurph

*
  • *
  •  1,546 1,546
  • "That there... that's an RV."
    • View Profile
Re: Galil + Mach3 slowly losing position
« Reply #1 on: December 01, 2013, 07:02:22 PM »
At best, it sounds like your PID may need a bit of tweaking.  IF there are no mechanical issues.  

The encoder is on the motor, right?  Well what if the shaft is slipping in the gear/coupler a bit?  That will lead to a table/position mismatch.  So the first thing I would do is verify the mechanical parts.  I took apart a machine (not a mill, but a second op special purpose machine) from work that was having position problems that no one seemed to be able to find.  Every time they started the machine up, they would have to change an offset value in the program to make it work.  They just accepted it as that was the way it is and dealt with it.  Eventually, they decommissioned the machine and I bought it for scrap price.  I wanted the servos and ball screws for my mill project at home.  As I took the machine apart, I found the problem.  Way deep inside the guts in a location that was very inaccessible, there was a shaft coupler that was designed to be used with a key way.  Well...  someone neglected to put the key in!  So all that was holding the shaft was the friction of the coupler.  It would slip just a bit every now and then and this caused the offset issue.  It was insidious because just looking at the shaft coupler, you would never find it.  Lesson learned!

Your rounding "lip" problem smells distinctly like the stench of mechanical problems.  :(  It is very possible to slip in only one direction.  I would advise taking the X axis apart and looking at everything.  Just turning things by hand measuring might not immediately show where the problem lies.  

If all is well mechanically, tighten up the PID so that commanding the servo to a position makes it hit the numbers.  If you get into a situation where you say G01 X1 and your encoders don't read 1.0000 (assuming your encoder resolution will actually let you read to the tenth), then you need a bit more gain (or less dampening) in the PID.  This sounds like the problem you described in your first paragraph.  If you find yourself over shooting, then you need more dampening/less gain.  There is also sticktion.  If the gain and dampening are generally good but on very slow moves to the target you find yourself not hitting the numbers, you may want to throw just a tiny bit of KI in there.  Be careful with adding too much I because it will cause the system to get unstable!  Your KP and KD parameters need to be pretty much on target before you go messing with KI.

Also, check for noise issues.  This might make the encoder "count" even if it is not moving!  It is best if the encoder signals are differential and not single ended.  And it is also best if the encoder cables are not run along a path that take them near any noise sources.  VFDs, power supplies, etc...

Steve
Re: Galil + Mach3 slowly losing position
« Reply #2 on: December 01, 2013, 11:46:16 PM »
"Also, check for noise issues."

Hmmm.....do you suppose having a 3 HP rotary phase converter about 2 feet from the X encoder/servo might be a problem?

Mark

Offline smurph

*
  • *
  •  1,546 1,546
  • "That there... that's an RV."
    • View Profile
Re: Galil + Mach3 slowly losing position
« Reply #3 on: December 02, 2013, 03:13:40 AM »
I guess it is possible.  But I was talking about noise sources such as switch mode power supplies or VFDs that use switching transistors.  They are terrible!  

Try this test that will take Mach and the Galil plugin out of the equation.

What happens in the Galil terminal if you do this:
1.  ACX=5000 ' set accel to something your machine can deal with.  5000 is just a number I thought up.
2.  DCX=5000 ' set deccel to something your machine can deal with.
3.  SHX  'servo here to turn on drive.
4.  DPX=0 ' set the X axis encoder count to zero.
5.  PAX=10000  'move the X axis pos 10000 counts (or something that makes you machine move about an inch or two)
6.  PAX=0 ' Move X back to pos 0.

Do you get back to 0?  If not, PID or mechanical.  

Also, the motor should hold position at zero after the last test step.  If it does not, then there is something really wrong somewhere.  It should really not ever creep after SH has been issued.  If you try and turn the screw by hand, the servo should fight you and try to keep the encoder at zero.  This is really a good test because you will see if you PID values are good.  If it fights back and tries to return to zero and it just never makes it back after you let your hand off, there is a sign that the PID values need tweaking.  It should go back to 0 and stay there.  It may dither back and forth a couple of counts, but not much!

After MO (motor off), the servo loop is disabled and the motor can creep if there is a bias on the analog command input of the servo drive.  In this case, you can adjust the voltage bias with OF (offset) to get a no creep setting.  Use BN to burn the OF value to the controller.  

Oh, and it goes without saying but I will say it anyway...  Be careful!  :)

Steve
Re: Galil + Mach3 slowly losing position
« Reply #4 on: December 02, 2013, 07:13:42 AM »
Thanks, I'll try the things you suggest.
If you don't hear back from me for a bit it's not because I'm not taking your suggestions.  I just don't have a Galil background.  I've got the books but when I got the mill I learned just enough to get it working and, as it was a one time effort, have forgotten most of it.  I guess I'd rather be writing G&M code and making parts than mucking with the machine :)

However, I'll dust the books off, do some reading and testing, and report back with my findings....it just might be awhile.

Thanks for your assistance,

Mark
Re: Galil + Mach3 slowly losing position
« Reply #5 on: January 19, 2014, 01:42:19 PM »
Finally got back to this.  Well, actually found the problem and then got busy making parts and forgot I owed a response back to the forum.

It was a very simple fix.  I tightened the servo attachment on the X-axis and the problem magically went away.  Looks like it was slipping but only when driven one direction.

Maybe next time I won't procrastinate so long before troubleshooting or asking for help. :)

Thanks for the advice,

Mark

Offline smurph

*
  • *
  •  1,546 1,546
  • "That there... that's an RV."
    • View Profile
Re: Galil + Mach3 slowly losing position
« Reply #6 on: January 19, 2014, 02:13:28 PM »
Glad to see you got it sorted!!

Steve