Hello Guest it is May 09, 2024, 10:51:54 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - smurph

1231
Galil / Re: Galil + Mach3 slowly losing position
« 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

1232
Galil / Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
« on: December 01, 2013, 06:12:29 PM »
I just showed a sample of the output stream, not the whole stream.  The IT command is used for independent axis moves.  VT is used on vector moves on earlier controllers.  For later Accelera controllers, VT has been removed and IT provides the smoothing for both independent and vector moves.   That particular data stream came from a 2173 controller.  VT is correct for it.  This VT/IT parameter is a setting in the plugin.  You can make the machine act how you want with it.  The PID filters and VT/IT will smooth things out, or not.  Your choice.  I prefer to just run the profile as output by Mach.  It's granular enough as to not make huge "stair steps".  And besides, steppers use it all of the time.  That is the output you get out of Mach.  Mach sends data points, way points, dot plots, whatever you want to call them.  They describe the movement.  Mach does not send down CR, PR, or PA like information.  In the Galil plugin, we take the incremental way point information from Mach and stuff them into a LI command (or CD command for contour mode).

As for your pictures, you will never get the first curve as output from Mach (input to the controller).  There are no points to describe the spline!  There is a time period between each point in the dot plot and this is a parameter that is settable by the plugin.  This will determine the granularity of the system.  If I tell Mach that I want way points on 1ms intervals, then the resulting dot plot is going to be really smooth to begin with.  No smoothing required.  Conversely, if I told Mach to output 32ms interval way point, then the dot plot it is going to be a lot rougher.  A low granular system will benefit most from smoothing functions.  However, it can't be as accurate.  

With the smoothing functions, it may be possible to get the machine to move like the fist curve picture.  But again, the points in each picture are the same!  The data points simply do not adequately describe the curve in the first picture.  If that plot is say 4ms between the points, then decreasing the time interval to 1ms is going to describe the curve with 4 times the data points and result in smoother motion.

This has nothing to do with closing the motion loop.  It has everything to do with what kind of input the controller gets from Mach.  If the controller is in LI mode, sending more LI commands with data points for the same move will yield a smoother profile.  Generally, sending LI commands that represent 4ms of movement is sufficient.  You get nice round circles with that.  At least to the point where you really can't measure the faceting that all non linear moves have.  8ms is ok, but depending on the feed speed, faceting may be more than desired.

LI mode will "interpolate" between the points.  How it does that depends on the other settings (IT or VT and VD/VA).  Meaning, you can let the Galil motion profiler have some influence, if desired.  Those VT, VD, VA values in that stream sample effectively turn the Galil profiler off.  It is possible to smooth things too much and lose accuracy.  It is also possible to "tune" the system to get awesome results.  Leaving the default plugin parameters as they are yield very acceptable results.  But tweaking them may yield better results depending on your machine.

CD mode will follow the dot plot precisely with no smoothing between the points.  Accuracy is stellar.  This is basically position over time, or PT.  Like a stepper system.  No "tuning" required (PID still needs to be tuned though!).  This is the mode I would specify if the controller can do it and you have a fairly granular system as far as counts/unit and time interval is concerned and you don't want to play oscilloscope for hours on end searching for the "perfect" tune.  I have run this mode on a highly rigid motion system (gear drive instead of belt on my Matsuura) with 2ms time slices and 12700 counts/inch and it is just plain awesome.

Which mode you use is up to the controller you have and/or your preference.  

There is a new position and velocity over time (PVT) mode on the Accelera controllers that I will leverage for Mach4.

All of this is entirely dependent on the machine as a whole system.  If you have a wet noodle sloppy motion system, you are not going to have good results no matter what features of the Galil you use.  

If you still don't get it, then I would suggest getting a Galil and trying it out.  The Galil is a high quality motion controller.  The Acceleras are insanely fast (22MHz encoder inputs) which allows for insanely granular counts per unit on the encoders and still get high traverse speeds.  In my opinion, pair a Galil with a good machine and Mach and NOTHING will be better.  And it is the only motion controller that allows mixing of servos and steppers that I know of.

Steve

1233
Galil / Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
« on: November 29, 2013, 10:58:57 PM »
No, we don't use the Galil CR command.  Mach plans the trajectory for the circle and sends it down via LI or CD commands, depending on what the user has chosen to use in the Galil plugin (Linear Interpolation or Contour mode).  Whether it is a straight line with a single axis or a circle with multiple axes, it does not matter.  The same thing is happening.  The Galil gets the trajectory data from Mach and then the Galil is in charge of following it.  No matter what plans the trajectory, it NEVER gets planned more than once.  NEVER.  I don't know of any machine controller on the planet that does this.  Fanuc, Fidia, EMC, etc...  Why would they?  The trajectory is computed and then it has to be followed.  If the machine cannot follow the trajectory and it has to have the trajectory re-planned, that is a bit like having the tail wag the dog.  That is one messed up dog!  :)

Here is a sample of what we are sending to the Galil (A lathe in this case).  The moves are incremental and it is using Linear Interpolation in this example.  Mach plans the LI data points.  The BG S command tells the Galil to start executing the trajectory:

LM AC
VT 1.000
VD 30000000
VA 30000000
LI -170,,-57<11206
LI -341,,-114<22470
LI -204,,-68<13438
LI -1,,-1<88
BG S  
LE

If the movement is complete and the table is not at the correct position, then the PID parameters need to be looked at.  The real-time component in a servo motion system is used to look at the incoming position data and adjust the servo drive command inputs (via the PID filter) to maintain an acceptable following error.  The target positions and target velocities have not changed.  If the following error is too great, then the PID loop may specify more voltage on the command inputs of the drive.  (Stepping on the gas).  If it gets too aggressive, then the PID loop may specify less voltage on the command inputs of the drive.  (Stepping on the brakes).  

The car/driver analogy fits very well.  Say you plan your route to get to the hardware store.  This route includes a lot of starts and stops and some curves.  This route planning is what Mach does.  Accel to slew, slew (Speed limit), and decel to stop.  Turn right, accel to slew, slew, and decel to stop, etc...  You, as the driver of the car, are responsible for following the route.  You are the motion controller!  If you accell too much, you may get a speeding ticket.  Also, if you fail to decel, you make get a ticket for failing to stop.  You manage all of this by looking at the speedometer and visual judgements (encoders) and adjusting how much gas or brakes (PID loop) it takes to command the car.  This is the real-time component.  What happens if you hit the brakes too much and you don't reach the stop sign at the intersection?  Do you re-plan your route?  No.  Because the route has not changed.  The road has not gotten any longer and the target stop sign hasn't moved.  You just failed to command the car correctly.  In this case you need to go back to driving school (update your PID values).  :)

With the Mach/Galil combo, Mach is the HMI, G code interpreter, and trajectory planner.  The Galil controls the motion to follow that trajectory.  That system will make beautiful parts with high accuracy and repeatability if the machine hardware is up to it.  In fact, it puts the original YASNAC controller on my Matsuura mill to shame.

Steve

1234
Galil / Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
« on: November 29, 2013, 02:44:11 PM »
Mach does the trajectory planning once.  Say move X axis 20.0 units (G01 X20.0 F20).  Why would Mach ever have to re-plan that trajectory?  That part never changes!  The over all goal is to move the X axis 20.0 units.  The planner calculates the proper accel/slew/decel profile to get there and that is a constant!  I don't know why people get stuck on trajectories ever having to be re-planed.  This is NEVER the case no matter what control is being used.  Mach can send these trajectories to the Galil in a variety ways;  Linear Interpolation mode, Contour mode, and (in the future) position with velocity over time (PVT) mode on the newer controllers.

What I think people get confused with is what the PID loop is actually doing.  It is not controlling the planner or modifying it.  It is controlling the servo drive by looking at the following error.  If the drive is not able to follow the planned trajectory and the following error increases, the PID loop makes adjustments to the servo drive inputs (command velocity/torque) to correct that situation.

Mach feeds the Galil with a trajectory.  The Galil then does what it takes to follow that trajectory.  If the Galil can't make the servos follow the trajectory, then no re-planning is ever done.  Mach told the Galil to move X 20.0 units and it just didn't get it done.  Is this a reason to re-plan the trajectory?  No!  It is a symptom of an incorrectly tuned servo/control loop!  The Galil KP, KI, and KD parameters need to be tuned.

When Mach plans a trajectory to move the X axis 20.0 units, it is very much analogous to using the Galil PR command.  Say the encoder is 10000 counts per unit so PRX=200000 would be equivalent to the G code G01 X20.0.  If you issued that PRX=200000 command on the Galil terminal, the Galil would plan the trajectory and then execute it.  It will never re-plan that trajectory if the servos didn't hit the numbers.  It does not come back and issue an extra PRX=1000 if the servos ended up 1000 counts short.  What it does do is look at the following error and see that it is 1000 counts short of it's planned trajectory and then it increases the command voltage to the servo drive to get it there.  If the PID parameters are correct, then the goal will be obtained.

All of the features of the Galil still work when used with Mach.  You can still use the dual encoder feedback.  Why?  Because the loop is closed on the Galil.  Mach doesn't have to close the loop.  Mach will never close the servo/control loop on Windows because Windows is not a real-time operating system.  Mach depends on controllers like the Galil, Vital Systems DSPMC, and Mesa (future) to do this.  Closing the servo loop NEVER involves re-planning the trajectory.  Closing the loop is always about correcting the following error while executing the planned trajectory. 

I have run the dual encoder feedback on the Galil.  It does work but it has its limits.  Galil fully explains these limits.  And it should be used as a last resort!  It is always best to fix mechanical errors with hardware rather than fixing them in software.  Galil also offers special firmware that can map screw variances and account for backlash.

Steve

1235
Contec / Re: Which Contec cards work with the plugin and which don't
« on: November 22, 2013, 01:00:46 PM »
It depends on the current capacity of the card and the specs of the relay coils.  I have no idea what the specs of the card is.  The Contec website probably has that information.

1236
Galil / Re: Galil Plug In
« on: November 21, 2013, 02:39:42 AM »
The documentation is on the plugin download page.

1237
Galil / Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
« on: November 21, 2013, 02:38:49 AM »
The Galil has the servo/PID (control) loop.  With the Mach/Galil combo, Mach is the HMI and trajectory planner.  The Galil does all of the real-time PID loop stuff.  The combination works really well. 

1238
Galil / Re: Galil controller compatability (what works with the plugin)
« on: October 30, 2013, 06:53:09 PM »
Nothing is downloaded to the controller in the normal case.  The plguin is a Windows DLL that drives the Galil controller.  So yes, Mach3 is all Windows. 

Mach4 will have a Galil plugin eventually.  However, it will not be at the time of the Mach4 release.  I actually have a semi-working Mach4 plugin.  But it will take a while to get it as fully functional as it is under Mach3.  But I can say with certainty that the Mach3/Galil combination is a good one for a 3 axis mill.  It blows away the old YASNAC controller that was on my machine.  Puts it to shame.  The Galil plugin supports gantry type machines.  But I don't have a gantry machine so the code may not be the best for gantry systems.

Steve

1239
Galil / Re: Galil controller compatability (what works with the plugin)
« on: October 30, 2013, 01:07:58 PM »
Does the DMC-40X0 controller work with Mach 3? Any restrictions?

At the time I wrote that compatibility synopsis, the 40x0 and 41x3 controllers were not here yet.  But to answer your question, the 40x0 and 41x3 controllers work fine with no restrictions.  In fact, I run my Matsuura mill on a 4080.  It is poetry in motion.

Steve

1240
Galil / Re: Updated PCI driver, Mach can't connect
« on: October 27, 2013, 03:29:01 PM »
It is rather difficult to use the Galil Tools or Galil Suite API and libraries.  They are C++ and as such, It needs library that is compatible with VS2003, among other things.  Galil Tools dropped support for the ISA and USB (20x0) controllers and they have not come back in Galil Suites.  So is it just a matter of time that PCI goes as well?  I think so. 

The 4.5 plugin has code that works with SmartTerm or Galil Tools PCI device drivers.  This was unbelievably hard to do.  It totally bypasses the Galil API and only the device drivers need be installed.  I have no idea if Galil changed the device drivers for Galil Suites, so your mileage may vary.

Unfortunately, we can't write one plugin that works with SmartTerm, Galil Tools, and Galil Suites APIs all at the same time. 

Steve