[Emc-users] Spindle Servo Soft Start

2009-05-06 Thread Frank Tkalcevic
I've just configured my first emc project, a 9x20 lathe conversion.  I'm
using a large servo for the spindle - I'm hoping to be able to use it as a
4th axis for some light engraving down the track.

My problem - I've set up the servo for the spindle, but like a servo, it
responds imediately to change requests.  I haven't put a chuck on it yet,
but it I'm sure it will break the belt when it tries to stop from 1000rpm to
0, instantly.

Any ideas on how I can soft start and stop it?

At the moment, my configuration is to take the motion.spindle-speed-out,
into pid.command, and let it work itself out.  I'm thinking if I reduce the
Pgain that might do it, but then it would make it mushy under load.

Any ideas?


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Spindle Servo Soft Start

2009-05-06 Thread Jeff Epler
On Wed, May 06, 2009 at 04:37:07PM +1000, Frank Tkalcevic wrote:
 I've just configured my first emc project, a 9x20 lathe conversion.  I'm
 using a large servo for the spindle - I'm hoping to be able to use it as a
 4th axis for some light engraving down the track.
 
 My problem - I've set up the servo for the spindle, but like a servo, it
 responds imediately to change requests.  I haven't put a chuck on it yet,
 but it I'm sure it will break the belt when it tries to stop from 1000rpm to
 0, instantly.
 
 Any ideas on how I can soft start and stop it?

Send the commanded spindle speed through a limiter before pid, so that
the pid 'command' value varies slowly.

limit2, limit3, and lowpass are three built-in components that
limit a signal:

limit2 limits the range and first derivative of a signal.

limit3 limits the range, first and second derivatives of a signal.

lowpass uses an exponentially-weighted moving average to track an
input signal.

Here's a standalone hal setup I wrote to show the behavior of each of
these limiters when fed a step signal:


loadrt threads period1=100 name1=thread

loadrt siggen
loadrt lowpass
loadrt limit2
loadrt limit3

net square  siggen.0.square = lowpass.0.in limit2.0.in limit3.0.in
net lowpass = lowpass.0.out
net limit2  = limit2.0.out
net limit3  = limit3.0.out

setp siggen.0.frequency .1

setp lowpass.0.gain .9

setp limit2.0.maxv 2

setp limit3.0.maxv 2
setp limit3.0.maxa 10

addf siggen.0.update thread
addf lowpass.0 thread
addf limit2.0 thread
addf limit3.0 thread

start

loadusr halscope


.. run it with 'halrun -I limiters.hal' at the terminal.  In halscope, I
selected the signals 'square', 'limit2', 'limit3' and 'lowpass' and
captured a trace: http://emergent.unpy.net/files/sandbox/limiters.png

Jeff

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Spindle Servo Soft Start

2009-05-06 Thread Jon Elson
Frank Tkalcevic wrote:
 I've just configured my first emc project, a 9x20 lathe conversion.  I'm
 using a large servo for the spindle - I'm hoping to be able to use it as a
 4th axis for some light engraving down the track.

 My problem - I've set up the servo for the spindle, but like a servo, it
 responds imediately to change requests.  I haven't put a chuck on it yet,
 but it I'm sure it will break the belt when it tries to stop from 1000rpm to
 0, instantly.

 Any ideas on how I can soft start and stop it?

 At the moment, my configuration is to take the motion.spindle-speed-out,
 into pid.command, and let it work itself out.  I'm thinking if I reduce the
 Pgain that might do it, but then it would make it mushy under load.

   
What you need to do is put motion.spindle-speed-out through a filter to 
round off the sharp edges before feeding it to whatever is trying to 
follow it.  Since spindle-speed-out is already velocity, I send it 
directly to the servo drive without PID.  That won't work for a 
positioning axis, but is OK for a velocity-only axis, ie. a spindle.  
The constant .0009018 is the speed calibration factor.  This is using my 
Universal PWM Controller and PWM servo amps to drive the axes as well as 
the spindle in this system.  Here's the relevant code :

# set up 4th PWM generator as a spindle speed control
newsig spindle-speed float
newsig spindle-pwm-cmd float
newsig spindle-pwm-filt float
linkps motion.spindle-speed-out = spindle-speed
linksp spindle-speed = mult2.1.in0
setp   mult2.1.in1 0.0009018
linkps mult2.1.out = spindle-pwm-cmd
linksp spindle-pwm-cmd = lowpass.0.in
linkps lowpass.0.out = spindle-pwm-filt
linksp spindle-pwm-filt = ppmc.0.pwm.03.value
setp lowpass.0.gain 0.01


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users