Machsupport Forum

Third party software and hardware support forums. => Galil => Topic started by: heathmanc on April 14, 2012, 01:57:08 AM

Title: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
Post by: heathmanc on April 14, 2012, 01:57:08 AM
First time trying to set this up and not having a lot of luck.  I want to use torque mode.  I have the SON from the ICM-20105 set up sinking low enable.  This all works.  When testing the amp without the controller, upon power on, the amp gives a ready signal, but the servo is not locked, but when put in test mode, it locks up and I can jog.  There are RS1 and RS2 switch inputs on the amp (forward rotation start and reverse rotation start).  If I connect one of those to SG, then the motor locks.  I am inputting the motor command and ground from the galil to the TC-LG terminals.  If I don't connect the RS1 or RS2 and give an OF 5, I get 5v displayed on the mitsubishi.  If I connect RS1 or RS2, I get a 0V displayed on the amp..  Just looking for a place to start with all of this...
Title: Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
Post by: battwell on August 24, 2012, 03:29:05 PM
did you get this working? i have mr-j2s working with galil in torque mode
Title: Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
Post by: coolfox on November 18, 2013, 06:33:18 AM
battwell can you please comment is this path with Galil and Mitsu worth going? I'm using this J2 series Mitsu for a while now but in position control mode with step direction. All work but axis coordination in 3D milling not good. I was wonder if Galil will fix this as it has ability of coordinated multi-axis movements were it read encoders and correct the path all the time?
I don't fully understand how much control in this layout placed on Galil if there only servo control separate axis or with element of coordinated movement.
In my opinion this is Mash downside with servos luck of control loop on actual axis movement. Or I my misunderstand something?
Title: Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
Post by: smurph 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. 
Title: Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
Post by: coolfox on November 29, 2013, 04:04:10 AM
lets rephrase. Ok. Mach does all the trajectory and Galil PID control for motors my question- does Mach trajectory planing adapt to Galil real time PID work in some form of feedback analysys and look ahead logic adaptation?
Mach send time/control point coordinates over ethernet to Galil?
Title: Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
Post by: coolfox on November 29, 2013, 04:42:49 AM
Another Great benefit of Galil controllers in ancillary encoder inputs with can be connected to linear encoder on linear the axis and rotary directly in the spindle, this setup will eliminate mechanical and drive errors.  
Is there anyone manage to implement this closed loop control function with Mach?
And how this configuration look?
Title: Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
Post by: smurph 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
Title: Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
Post by: coolfox on November 29, 2013, 06:30:55 PM
Steve
Thanks for clearing air again.
Agree in single axis single Say move X axis 20.0 units (G01 X20.0 F20). trajectory need nothing but correct execution from servo and mechanics with is not simple ballscrew thermal and backlash compensation, with dynamic forses all mashine flex and bend under cutting and aceleration forces 50mk easy even for steady industrial mill ( hens idea of reading actual slide position with axilary encoder and live velocity to motor rotary encoder).
just for example G2 or G3 send to galil CR comand ?  In this case Galil coordinate ( plan) trajetory of two axis ?
Sorry for all this noncence just want to umderstand how this work better.
Ilia
Title: Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
Post by: smurph 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
Title: Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
Post by: coolfox on November 30, 2013, 05:48:22 AM
Steve
Thanks for explanations
I my be thick, still dont get it.
According to your code ( lathe) this is point coordinates in LI mode  were is smoothing performed no IT comands implemented.
Could you plese help little more look for sample curves attached and how would thi Mash Galil communication would be dealing with this ?
Many thanks in advance
ILia
Title: Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
Post by: coolfox on November 30, 2013, 03:49:18 PM
Steve sorry for juming to another topic. Using chance to have your attention. is tere way to connect ethernet controller say 2260 directly to PC ethernet port? At the moment connected over local net through router but want to install all in one box and router kinda look alien >:D in it.
Title: Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
Post by: smurph 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
Title: Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
Post by: coolfox on December 02, 2013, 05:13:08 AM
Steve
Thanks again I got all picture now :-)
At the moment (for last 5 years) been using Mach3 on my Baby ( picture below ) kinda wet noodle - metal case granite/polyfill L-frame THK KR33's Mitsu Servos in position mode (dynamic autotune PVT) from parallel ports.  Deflection on tool end (NSK 320) X- axis force @ 100N 0.05mm. Cutting wax for jewellery all code look like this   
(Rotate Table Operation)
Code: [Select]
(Rotate Table Operation)
Z36.0000
X0.0000 Y0.0000
A+90. F1200.
(Horizontal Roughing)
Z3.7561
X0.9967 Y-2.4577
G01 Z3.3150 F1000.0
Z2.6800 F500.0
X0.5038 Y-1.8557 F1000.0
X0.5040 Y-2.4696
X0.9967 Y-2.4577
X1.0027 Y-2.7077
X0.2541 Y-2.7257
X0.2532 Y-0.0293
X0.6727 Y-1.6674
X1.5144 Y-2.6954
X1.0027 Y-2.7077
X1.0087 Y-2.9576
X2.0447 Y-2.9327
X0.9149 Y-1.6054

...
As you would know this will give choppy sort of cutting pattern (machine bolted to the table) intelligent smoothing with analysis were small axis direction change will apply max smoothing and 45 degree or sharper will take smoothing to min and ramp down velocity proportionally on approach - would be kinda nice to have. 
Saying this I have tried to make NC code with this kinda behavior it work really good but configuring CAM post processor to this pattern sometime mess things up! 
This was reason I start  looking for more intelligent motion controller 
I do have GALIL DMC-2260 (Acellera's expensive) to play with and putting wiring together at the moment to see how is gonna perform on similar setup.
Thanks for help again I found important to know how this thigs work before building new system.
It be helpfill to have Mach  NC to galil code library this would show how you implement plugin translation. Thanks
Ilia
Title: Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
Post by: smurph on December 02, 2013, 02:19:48 PM
The DMC-2260 is a good controller.  It has 100 Mb Ethernet and can probably do 2ms in LI mode pretty well.  Tweaking the VA, VD, and VT params via the plugin will smooth things out even more.  I have never tried the position control (step/dir) input servo drives, as there is really no reason to use a Galil with them.  So for your machine, I would suggest 200w analog command servos.  A bit overkill, but you can soften them up with the PID parameters.  You will most likely want to drive the screw with a reduction belt drive to the servo.  No direct drive as often used with steppers.  Most servos will do 3K RPM so gear reduction is the norm. The more encoder counts per unit you can get is going to help all things out.  The Galil will handle 50,000 counts per inch easily.  So use 5:1/4:1 reduction or so on the servo to the screw and then calc in the screw pitch to get in the 30,000 to 50,000 counts per inch ball park, assuming 1024 counts per rev or more encoders on the servos.  Adjust accordingly for metric.

I like the little Yaskawa SDG/A servo drives and the matching SGM motors.  Bullet proof.  And you can find them pretty cheap on eBay.  SDGA-02BS is the 100v (110v mains) drive and the SDGA-02AS is the 200v (220v mains) drive.  The motors have to match the drive voltage.  For smaller 100 watt system, SDGA-01BS or SDGA-01AS.  Big thing here is getting the cables control cables with the drives.  Or at least the stubs.  Otherwise, you will have to order some expensive cables!

The 200 watt motors are not much bigger than NEMA 23 steppers.  The 100 watt motors are even smaller.

Tuning the servo system is a royal pain.  But once done, it is well worth it, IMHO.  Quiet and smooth.  Less stress while operating the machine.  The sound is rather nice on the ears.

Be careful though...  Once you go servo, you never go back!  :)
Title: Re: Mitsubishi J2S-40A and Galil DMC-2183 with ICM-20105
Post by: coolfox on December 10, 2013, 10:17:26 AM
Steve Thanks for help one moore.  (actually were two but one kinda hidden :-)
One careful question from warned man - Im not to sure about gearing motor to ball screw as pitch 6mm per turn THL LM slides and ballscrew allow speeds upto 500mm/sec (this is fast) motor should do 5000rpm then but with encoder count 131072pulce/revolution we getting a lot of pulses per Inch 554,871 pulses in straight 1;1 and 1;4 = 2,219,485 per Inch do you think is kinda feasible?

Then I connect Mitsu's in my maschine (photo above) in position mode I used electronic gearing in Mitsus drive in order to compensate missing frequency from Mach.

Don know how to deal with this issue with Galil + Mach combo??  ( Galil DMC-2260 can handle twice as manypulses @ given speed but how many Mach can comand? )

Ilia

P.S. How you add time delay on AMP ENeble  is were WT somere but I dont see? 
( For safe Mitsu need like 2 sec after powerON WT 2000. )