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

Galil / Re: Position or torque mode?
« on: January 02, 2011, 11:04:59 PM »
I took a look at the debug file.  I didn't see any MPG commands in it.  It does show that you are using Mach to slave your Galil D axis to your Galil A axis.

The Galil plugin was developed primarily to enable the use of analog servos in Mach.  You are using your servos like steppers.  That being said, there is support for stepper motors in the Galil.  However, support for stepper motors is very lacking in the plugin, as none of the developers of the plugin have any stepper motors.  Stepper motors seem to work fine with a basic config.  But slaving is not the same command with steppers, as you have discovered.  

If you enable slaving in Mach, then the galil plugin is going to send a GA,,,X, as this is the proper thing to do with servos.  This basically negates your previous command of GA,,,CA.  So...  you need to disable slaving in Mach and do it all on the Galil.  These commands are what you will be needing in the GalilInit.txt file.  Remember, no slaving in Mach!

GA,,,CA  // slave axis D to master axis
GR,,,1    // gear ratio 1:1
GM,,,1   // gantry mode

(Leave the comments out of the file.)

This way, Mach only controls axes A, B, and C.  The Galil does all of the slaving.  But...  you will have to make sure that the gantry axis is square before Initializing the Galil from the plugin.  When Mach homes the gantry axis, it will think it is only homing 1 axis.  Mach will have no notion what so ever that there is a slave configuration.  This is fine, as long as you realize that none of the Mach slaving controls will be useful.

I updated the plugin code to take a look at the master axis motor type and do the right thing if it is a stepper motor.  However, that will not be available until the next release.  (I don't know when that will be at the moment.)  Maybe this will get you going until then.


Galil / Re: Position or torque mode?
« on: January 02, 2011, 06:03:26 PM »
Make a file called GalilInit.txt, put your GA,,,CA command in it, and place the file in the plugins directory.  When the plugin initializes the Galil, it will send the contents of that file to the controller.  You can put more than one command in that file if needed.  One command per line.

BTW, if you think position mode is fast, try velocity or torque mode.  The full version of Galil Tools provides a tuning function for the servos.  It will get you in the ball park.  Well worth the price of admission if you have never tuned servos before.


Mach SDK plugin questions and answers. / Re: PLUG IN WRITERS
« on: January 01, 2011, 07:07:02 PM »
Sorry...  I didn't get the notifications that people had responded.  They got caught up in my spam filter.  I have sent the plugin to all that have provided email addresses.


Galil / Re: Crazy @$$ MPG
« on: December 31, 2010, 06:54:55 PM »

It is not strange at all that the error comes when the amps are enabled.  Amps will introduce noise!  I would check your shielding.  Shielded wire does nothing if it is not properly implemented.  You may have to do some shielding on the amp and motor wires too.

This sort of thing is a nice big pain in the rear, isn't it?  :(


Galil / Re: Home switch set up
« on: December 30, 2010, 02:06:38 AM »
-X low and X home enabled with the same pin config is not a good idea.  They are two separate signals in Mach.  So keep them separate.  Map Mach X-- to port 1, pin 9.  Then map Mach X home to port 1, pin 17.  If you use a limit switch also for a home switch, jumper the switch to both the -X and X home on the Galil ICM.  Limits switch signals are disabled when homing!  This is to allow using a limit switch also as a home switch. (Which I really don't know why anyone would want to do, but people asked for it.  Me?  I'm buying a $8.00 switch to do the job...)

The Galil plugin is looking for the Mach home signal to become activated.  It basically does a jog towards the home switch using the Galil JG command.  Say 2000 counts per second.  That would be JGX=2000 to move the X axis in a positive direction as 2000 is a positive number.  If you hit the home switch and then move off before Mach catches the signal (1/10th of a second), then you might have a problem.  If this is the case, you need to rig your switch to stay activated longer.

When Mach sees the home signal get activated, the galil plugin stops the axis.  It then reverses the axis by taking the initial jog velocity and multiplying it times -0.1  So 2000 becomes -200.  So JGX=-200 is sent to the controller.

When Mach sees the home switch go to the inactive state, the galil plugin stops the axis withing 1/10th of a second.  Homing is done at this point unless you have specified the use of the index pulse.  

If using the index pulse, the galil plugin issues the same JGX=-200 jog command until it finds the index pulse from the encoder.

That's the sequence anyway.  If you are blowing past your switch and your are seeing the signal light up in Mach, then there might be an error in the commands going to the controller.  Enable the debug output in the plugin configuration.  This creates a GalilDebug.txt file with the commands sent to the controller and the controller's response to them.  Then repeat your home operation and exit Mach.  This will fill the GalilDebug.txt file with the information from your home operation.  Then find the GalilDebug file (usually in c:\mach3 or c:\mach3\plugins) and send it to either Kenny or Myself.  Our email addresses are in the plugin PDF manual.


Galil / Re: Mach3 & Galil using stepper motor and encoder feedback
« on: December 30, 2010, 12:36:32 AM »
That's Stepper Position Maintenance (SPM).  You have to set up code to catch position errors.  Where the position error is "caught", the motor stopped, and then a POSERR subroutine is called to correct the error.  Unfortunately, this is nowhere near a closed PID loop.  :(  

Also, this "mode" of correction is not suited to the way we stream data to the controller.  We don't download a Galil script to the controller at all.  If you run the plugin and enable debug output, then you can see what we are doing by looking at the GalilDebug.txt file.  

So, unfortunately, all that the plugin supports is open loop control for stepper motors on the Galil.  :(


Galil / Re: Problem in Motor Tuning
« on: December 29, 2010, 08:25:10 PM »
I'm not sure on this one.  Some parameter is not right.  You might post this question to the General section and get more responses.


Galil / Re: Bulletproof ethernet settings
« on: December 29, 2010, 08:16:00 PM »
You will want to connect the PC to the Galil via it's own network.  Meaning, that you really don't want a whole lot of other computers on the same network.  If you already have an Ethernet card in the PC and it's connected to say the internet or an internal network, you really need to install another Ethernet card to talk only to the Galil.  This way, other network traffic will never interfere with the communication to the Galil.

Choose an intranet number range such as  This is a class C network (netmask of that can contain 254 hosts.  You will only need 2 host addresses.  One for the PC

For the PC, set the IP address to, netmask, no default gateway, no DNS server.  The default gateway is not needed as you will not be routing packets to any other network.  DNS is not needed as you can address the Galil using it's IP address, no names required.

For the Galil, set the IP address to and nothing else is required for it.


Galil / Re: Position or torque mode?
« on: December 29, 2010, 06:57:15 PM »
You can try Contour mode. It was specifically designed for the Accelera controllers.  But it has not been tested as much as the Linear Interpolation mode.  LI will work fine.


Galil / Re: Spindle Control Through Galil Digital Output
« on: December 28, 2010, 12:24:43 PM »
Simply map the Mach 'S' axis to the Galil axis you want to use for the spindle control.  The click the "Spindle has encoder" check box and give the counts per revolution of the encoder and set the acceleration values.  The Galil will then drive that axis with a JG command.