Machsupport Forum

Third party software and hardware support forums. => Galil => Topic started by: rforney on December 29, 2010, 11:56:41 AM

Title: Position or torque mode?
Post by: rforney on December 29, 2010, 11:56:41 AM
I am currently setting up a DMC 4080 to interface with Yaskawa sigma-5 servos.  I have the choice of Velocity, Torque, or position (step and dir) control.  I have been told that velocity control mode will be the worse, since the drives have features that will try to tune the servo as well.  I have hear that torque control should work, as many of the drives' features are disabled in this mode.  I do also have the capability of using position control.  This would allow some of the drives features to make the system better.
I have hooked up the drives using velocity and torque mode. The torque mode appeared to be the most stable, but remember, I have little experience with the galil and tuning in general.  This was also without any load applied.

So, what method of control do you guys think would have the most merit?

Thanks,

Rob
Title: Re: Position or torque mode?
Post by: kcrouch on December 29, 2010, 12:06:18 PM
I use the Galil with Yaskawa drives in torque mode. Just need to tune it well.
Kenny
Title: Re: Position or torque mode?
Post by: rforney on December 29, 2010, 12:53:13 PM
Kenny,

Do you have any videos of your machine running online?  I am still wondering if this control setup can handle what I want it to do (fast 3D carving, with rapid direction changes on the Z axis all the time).

Cheers!

Rob
Title: Re: Position or torque mode?
Post by: kcrouch on December 29, 2010, 12:58:27 PM
I don't have any video, but we use Galil and Mach for everything from sign carving to lathe turning. You should have no trouble at all with rapid Z moves.
Kenny
Title: Re: Position or torque mode?
Post by: rforney on December 29, 2010, 02:51:31 PM
Thank you for the info, Kenny.  I am finalizing the wiring right now.  Servo's sound good after autotuning, and galil can make them move nicely.  Once I get my network sorted out, I will let Mach have a shot at it.

Do you use contour mode (the galil plugin setting) on any of your machines? 

Once all of this is set up, I would like to post all my settings and wiring stuff to share with everyone.  Problem is, it is not right just yet...

Thanks,

Rob
Title: Re: Position or torque mode?
Post by: smurph 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.

Steve
Title: Re: Position or torque mode?
Post by: rforney on January 01, 2011, 05:00:50 PM
Wow.  Tuning servos does not accidentally happen. 

I managed to get a stable response, until I hood the gearboxes up to the rack.  What a nasty noise.  The autotuning button is pretty neat.  I wish it would tune the servos for me.

Seeing how I have no real experience tuning servos, I am going to attempt step and direction mode, and see how that goes.  This is what the Yaskawa dealer wanted me to do all along, and the drives have auto-tuning features that should make life easier.

Wish me luck!

Rob
Title: Re: Position or torque mode?
Post by: rforney on January 02, 2011, 04:01:17 PM
So,

In position mode, this machine can really move out!  Yaskawa sigma 5 drives do an excellent job of tuning the servos, just like the dealer said.

However...

When configured in stepper mode, some funny things happen.  I believe that mach is issuing a GA command to axis D.  This is fine, but it is gearing off of the main encoder input.  Because of the electronic gearing that I am using in the drives, this will not work.  The second X axis (axis D) is moving about 7 times as fast as the first one.  Is there a way I can program mach to tell the Galil to gear the D axis to the auxillary encoder input of A?  I must emphasize that Galil has no problems moving these individually, and accurately.

Attached is an image from galil tools after a jog was commanded from mach. I jogged both x axis' in mach (A and D), then opened up the terminal.  After dividing the D axis encoder position by the A axis encoder position, I came up with 6.8619436.  This is the distance traveled with one pinion revolution.  I have the drive's gearing set to 10000 pulses = 1 inch.  This is working great for the A axis, B axis, and C axis.  The D axis works fine when commanded from galil.  But when Mach tries to drive that axis, it runs a good bit faster.

I believe if I can gear the position of D to the aux encoder of A, all will be well.  Anyone know how to do this through mach?





Title: Re: Position or torque mode?
Post by: rforney on January 02, 2011, 04:14:30 PM
Well, correction to that.

GA,,,CA seems to fix the problem.  I would like to have the plugin input that for me.  How do I set that?

Rob
Title: Re: Position or torque mode?
Post by: smurph 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.

Steve
Title: Re: Position or torque mode?
Post by: rforney on January 02, 2011, 06:55:26 PM
I placed the txt file in the plugins directory, with the command GA,,,CA, but it did not change anything. V4.4.0.0 is the version of the plugin I am using.

Is there anything else I have to do to make that work?

I am posting a copy of my debug file.  It appears that mach is issuing a GA,,,X after my command.  How do I stop that?

Title: Re: Position or torque mode?
Post by: kcrouch on January 02, 2011, 09:44:47 PM
You may have an interference between Mach3's slaving and the Plugin. Be sure that slaving is disabled. Also you will have trouble when using MPG functions which make use of the Galil gearing command. It is quits possibly the MPG that is overwriting your gearing command.
Kenny
Title: Re: Position or torque mode?
Post by: rforney on January 02, 2011, 10:03:24 PM
Kenny,

That worked perfectly. as far as the GA,,,CA command goes.  However, now it is only moving the one drive (A axis).  I may have to figure out how to write a brain to make sure that mode gets turned on, and revert to how I had it.

MPG is disabled currently.

Thanks,

Rob
Title: Re: Position or torque mode?
Post by: smurph 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.

Steve
Title: Re: Position or torque mode?
Post by: rforney on January 02, 2011, 11:39:39 PM
Steve,

I appreciate your efforts to set me straight.  This does indeed make it "work".  However, the movement of the second x axis is very choppy, with mid-move stutters on the slaved axis.  Also, the drive is turning on and off (baseblock on the drive) under mach control.  Not an issue when driven straight from galil.

I do wish I had the knowledge and experience to tune these in Torque mode.  I do have the full version of galil tools, but the autotune feature doesn't quite get me there.  The noise coming from the gantry was horrendous. 

Maybe some more reading, and experimentation.  I do look forward to that plugin, though.  The Y and Z axis are running sweet!

Thanks,

Rob
Title: Re: Position or torque mode?
Post by: smurph on January 03, 2011, 02:24:36 AM
You have mid-move stutters when the Galil is doing the slaving?  If so, then there is a mechanical problem.  Mach should be driving the X axis and the slaved axis should just follow it.

PM me your email address.  I have a new plugin for you to try.  MPG may be buggy in this plugin, as I just re-vamped the MPG code.  But it should do the right thing for slaving if the master axis is configured as a stepper axis.

Steve
Title: Re: Position or torque mode?
Post by: rforney on January 03, 2011, 03:13:23 AM
Steve,

No mechanical problems, pinions are not touching the rack.  Under pure galil control, all is very smooth, even very rapid moves.  I have ditched the mpg for now, I am hoping a line driver will fix that.  If not, I will just shorten the cord.

PM sent.

Thanks!

Rob
Title: Re: Position or torque mode?
Post by: rforney on January 04, 2011, 07:29:08 PM
Galil helped me tune the servos with acceptable performance.  

I am now trying to use velocity mode through the mach-galil plugin.

The x axis is doing what it is told, but the motion is very jerky, in contrast to the motions generated by galiltools with mach not running.  It is as if the gearing or gantry mode is being switched on and off.

On a reboot, I received no motion at all on the x axis, so I turned it off.

I read the debug file, and I think there are some commas missing after the SP command.

Any ideas?

Title: Re: Position or torque mode?
Post by: smurph on January 04, 2011, 09:34:40 PM
Which plugin is this?  The one I sent you or the release from the download site?  There is definitely something wrong with the commas.  On almost every command sent!

Steve
Title: Re: Position or torque mode?
Post by: smurph on January 04, 2011, 10:32:50 PM
Ah ha!!!  You have slaving enabled in Mach and you don't have all of the axes mapped in the plugin config.  Only the first 3 are mapped but mach thinks you are using 4.

Steve
Title: Re: Position or torque mode?
Post by: smurph on January 04, 2011, 10:45:02 PM
From your debug file:
SH ABCA
MO ABCA

Or more precisely, you have Mach axis X mapped to Galil axis A AND you have Max axis A mapped to Galil A.  That is what is trowing the commas off.

Steve
Title: Re: Position or torque mode?
Post by: rforney on January 05, 2011, 07:41:40 AM
Thank you for catching that.  I did have that setting wrong.  A is now mapped to D.  I looked at my older galildegbug.txt file from position mode, and it was set correct then.

This was the old plugin that I was trying.  Still no luck with the new one, it would not recognize the motion card.

Thanks!

Rob
Title: Re: Position or torque mode?
Post by: rforney on January 05, 2011, 08:05:39 AM
I just tried running the machine under mach again, and results are strange.

The Y and Z move as told, although not quite as smooth as from galil smart tools.

The X axis sounds like a jackhammer when mach tries to move it.  I think this is because mach plugin is telling the galil to GA,,,A rather than GA,,,CX.  not quite sure yet, will try again after work.

Cheers!

Rob