[Emc-users] HNC Lathe Tuning

2007-10-14 Thread Kirk Wallace
In case anyone is interested, I have my latest tuning results at these
links:

http://www.wallacecompany.com/cnc_lathe/HNC/emc2/pid_x-1b.png

http://www.wallacecompany.com/cnc_lathe/HNC/emc2/pid_z-1b.png


-- 
Kirk Wallace (California, USA
http://www.wallacecompany.com/machine_shop/ 
Hardinge HNC lathe
Bridgeport mill conversion pending
Zubal lathe conversion pending)


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] HNC Lathe Tuning

2007-10-14 Thread Chris Radek
On Sun, Oct 14, 2007 at 05:39:02PM -0700, Kirk Wallace wrote:
 In case anyone is interested, I have my latest tuning results at these
 links:
 
 http://www.wallacecompany.com/cnc_lathe/HNC/emc2/pid_x-1b.png
 
 http://www.wallacecompany.com/cnc_lathe/HNC/emc2/pid_z-1b.png

Much better!  You should be able to add some I now to get rid of the
steady state errors.

Chris

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] HNC Lathe Tuning

2007-10-14 Thread Kirk Wallace
On Sun, 2007-10-14 at 19:42 -0500, Chris Radek wrote:
 On Sun, Oct 14, 2007 at 05:39:02PM -0700, Kirk Wallace wrote:
  In case anyone is interested, I have my latest tuning results at these
  links:
  
  http://www.wallacecompany.com/cnc_lathe/HNC/emc2/pid_x-1b.png
  
  http://www.wallacecompany.com/cnc_lathe/HNC/emc2/pid_z-1b.png
 
 Much better!  You should be able to add some I now to get rid of the
 steady state errors.
 
 Chris

I seem to recall putting in 1.0 for I and got an oscillation. Maybe I
should try some fractional settings.
-- 
Kirk Wallace (California, USA
http://www.wallacecompany.com/machine_shop/ 
Hardinge HNC lathe
Bridgeport mill conversion pending
Zubal lathe conversion pending)


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] HNC Lathe Tuning

2007-10-14 Thread Jon Elson
Kirk Wallace wrote:
 On Sun, 2007-10-14 at 19:42 -0500, Chris Radek wrote:
 
On Sun, Oct 14, 2007 at 05:39:02PM -0700, Kirk Wallace wrote:

In case anyone is interested, I have my latest tuning results at these
links:

http://www.wallacecompany.com/cnc_lathe/HNC/emc2/pid_x-1b.png

http://www.wallacecompany.com/cnc_lathe/HNC/emc2/pid_z-1b.png

Much better!  You should be able to add some I now to get rid of the
steady state errors.

Chris
 
 
 I seem to recall putting in 1.0 for I and got an oscillation. Maybe I
 should try some fractional settings.

A little I, and fractional values are often needed, can help. 
Otherwise, you can turn up (or down) FF1 to bring the 
steady-state error down right to zero.  Then, you can add just a 
tiny bit of FF2 (often something like 0.002) to bring the accel 
spikes down close to zero error, too.  Some of these parameters 
are VERY sensitive.

Jon

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] HNC Lathe Tuning

2007-10-12 Thread Kirk Wallace
On Thu, 2007-10-11 at 20:53 -0500, Jon Elson wrote:
 Kirk Wallace wrote:
  What is the status of PID_MAX_VEL and PWM_OUTPUT_SCALE? My understanding
  is that they were created to fix persistence issues. I am using EMC
  2.1.7 so should I still use them?
  
 Arrghhh!  I don't actually know.  PID_MAX_VEL is a standard part 
 of the modern ini file, and should still be used.  It is to 
 allow the servo algorithm to have a little extra headroom for 
 acceleration.

So PID_MAX_VEL is not unique to the UPC? 

 PWM_OUTPUT_SCALE is an anachronism, as you say above.  The best 
 way to find out if it is still active is to do the following, 
 after doing a cd to the configs directory you are using:
 
 grep PWM_OUTPUT_SCALE *.hal
 
 This will scan all the hal files for use of this parameter.  If 
 it doesn't show up at all, then it is not being used.
 
 Ahh, I have done it for you :
 # set output scaling from ini file
 # note that these are using PWM_OUTPUT_SCALE - they should
 # use OUTPUT_SCALE, but right now EMC2 re-writes that to
 # 1 on shutdown for some reason.  Once that is fixed, this
 # should be changed
 setp ppmc.0.pwm.00.scale [AXIS_0]PWM_OUTPUT_SCALE
 setp ppmc.0.pwm.01.scale [AXIS_1]PWM_OUTPUT_SCALE
 setp ppmc.0.pwm.02.scale [AXIS_2]PWM_OUTPUT_SCALE
 
 You can just change these lines in hnc_motion-3a.hal
 
 and remove the PWM_ from the 3 lines above.  Then, remove the 
 now redundant lines with PWM_OUTPUT_SCALE from your ini file. 

For some reason that I can't recall, the above did not work for me right
away, so I put PWM_OUTPUT_SCALE back the way it was, set it to -1,
zeroed out the pid/ff settings and started over. Now I have P set to ~50
and FF1 set to .25 and everything else set to 0. My FERROR is now .0050
and MIN_FERROR is .0013. Typically, I am getting .0005 difference
between the commanded position and the actual position, which is better
than a couple of days ago, but I am hoping to do better. I just need to
put in more effort.

 But, then, I think you will find that if you turn OUTPUT_SCALE
 back down to -1, you will get MORE voltage out of the servo amp.
 OUTPUT_SCALE (which is just an ini parameter for the hal 
 parameter ppmc.0.pwm.xx.scale is a DIVIDER, not a multiplier  
... snip
 
 There's really no reason to mess with output scale, other than 
 making the sign correct to close the loop, as P does the same 
 thing (although it IS a multiplier).
 
 Jon

-- 
Kirk Wallace
(Hardinge HNC lathe, California, USA
http://www.wallacecompany.com/machine_shop/ )



-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] HNC Lathe Tuning

2007-10-12 Thread Jon Elson
Kirk,

Just to add a data point on my minimill system, it has 128000 
encoder counts per inch.  I can get the following error down to 
about 200 uInch peak, up to 50 IPM or more.  But, it takes some
effort to tune it to that level.

On my Bridgeport, I have 2 counts per inch on X and Y, and I 
usually get down to .0005 following error on that machine.  At 
standstill, the error is usually +/- .0001 or less.

Jon

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] HNC Lathe Tuning

2007-10-12 Thread Jon Elson
Kirk Wallace wrote:
 On Thu, 2007-10-11 at 20:53 -0500, Jon Elson wrote:
 
Kirk Wallace wrote:

What is the status of PID_MAX_VEL and PWM_OUTPUT_SCALE? My understanding
is that they were created to fix persistence issues. I am using EMC
2.1.7 so should I still use them?


Arrghhh!  I don't actually know.  PID_MAX_VEL is a standard part 
of the modern ini file, and should still be used.  It is to 
allow the servo algorithm to have a little extra headroom for 
acceleration.
 
 
 So PID_MAX_VEL is not unique to the UPC? 
No, any version that uses the servo mode of operation will have 
it.  Only setups that use stepgen don't use PID, I think.
 

You can just change these lines in hnc_motion-3a.hal

and remove the PWM_ from the 3 lines above.  Then, remove the 
now redundant lines with PWM_OUTPUT_SCALE from your ini file. 
 
 
 For some reason that I can't recall, the above did not work for me right
 away, so I put PWM_OUTPUT_SCALE back the way it was, set it to -1,
 zeroed out the pid/ff settings and started over. Now I have P set to ~50
 and FF1 set to .25 and everything else set to 0. My FERROR is now .0050
 and MIN_FERROR is .0013. Typically, I am getting .0005 difference
 between the commanded position and the actual position, which is better
 than a couple of days ago, but I am hoping to do better. I just need to
 put in more effort.
 
Hmm, I don't know why that didn't work.  (I see I still have it 
this way on my downloadable configs directories on my web page, 
too!)  But, I have definitely done it on my development systems.
Anyway, to get the error down, you want to have the P gain as 
high as possible.  You need to add a small amount of D to keep 
it stable as you raise P.  You might have P set somewhere 
between 80 and 250, depending on all the other factors (motor, 
supply voltage, friction, etc.)  As the encoder resolution 
rises, then the linear dimension of each encoder count is 
smaller.  So, with a high res encoder, the P term and all others 
needs to be larger.

Jon

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] HNC Lathe Tuning

2007-10-12 Thread John Kasunich
Kirk Wallace wrote:
 
 I was also thinking that it would be good to have EMC loop an axis move
 and have halscope update on the trigger, as it already does, and then be
 able to tweak the PID settings as EMC loops.

When I do PID tuning I usually skip EMC completely.  I just set
up a simple single axis HAL configuration using siggen as the
signal source.  Run the siggen square wave output through a
limit3 block and you get a classic trapezoidal velocity profile
of whatever length and repetition rate you want.

Then I use setp commands from the halcmd command line to tune.

Once I have values I like, show param pid displays them, I jot
them down, and enter them into the ini file or wherever they are
needed.

Regards,

John Kasunich

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] HNC Lathe Tuning

2007-10-12 Thread Kirk Wallace
On Fri, 2007-10-12 at 20:37 -0500, Jon Elson wrote:
... snip
  
  So at 5k cpi on my lathe, I should be able to get similar results, I
  hope. Thanks Jon.
  
 Well, 5000 is a lot less than 128,000, and 4 times coarser than 
 my 20,000 counts/inch.  So, it would be normal to expect the 
 best following error you could achieve may be worse.  One 
 encoder count is .0002 so you will never get better than that.
 
 Jon

Opps. It's really 50k cpi. I'm going to have to get a dog so I can blame
my mistakes on it.

I have a plot for X here:
http://www.wallacecompany.com/cnc_lathe/HNC/emc2/p95i4d3ff1_1.png

I started working on Z and totally missed it up. Hopefully, I'll be able
to fix it tomorrow.

-- 
Kirk Wallace
(Hardinge HNC lathe, California, USA
http://www.wallacecompany.com/machine_shop/ )



-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


[Emc-users] HNC Lathe Tuning

2007-10-11 Thread Kirk Wallace
What is the status of PID_MAX_VEL and PWM_OUTPUT_SCALE? My understanding
is that they were created to fix persistence issues. I am using EMC
2.1.7 so should I still use them?

From a previous thread and a desire to optimize my .ini file settings, I
decided to monitor the DC output from my UPC/PWM amp setup to my brushed
motors while doing some tuning. I ramped up my jog velocity until I got
following errors and noted that the voltage was 22 Volts. Considering
that my motor supply is 100 Volts, I concluded that I needed to increase
the output scale from 1 to whatever was needed to get the motor voltage
close to 100 Volts. (I thought that I read somewhere that OUTPUT_SCALE
should only be +1 or -1?) I got to a PWM_OUTPUT_SCALE of 35 and 32 Volts
before I started getting following errors again. I am a little surprised
that wasn't able to raise the scale to a voltage output close to 100 and
the increased voltage did not seem to help reduce my FERROR and
MIN_FERROR numbers. Does anyone have a guess at why I should get
following errors as I increase output voltage. Another strange thing is
that when I first tuned the lathe, I would get resonance at a P value
above 250, I now have it at 700 and still have not reach resonance.
Below is may current X axis setup.

(full document here:
http://www.wallacecompany.com/cnc_lathe/HNC/emc2/configs )
# First axis
[AXIS_0]
TYPE =  LINEAR
UNITS = 0.03937007874016
HOME =  0.000
MAX_VELOCITY =  2.0
MAX_ACCELERATION =  3.0
PID_MAX_VEL =   100
BACKLASH =  0.000
CYCLE_TIME =0.001000
INPUT_SCALE =   5
OUTPUT_SCALE =  -1
PWM_OUTPUT_SCALE =  -30
MIN_LIMIT = -12.0
MAX_LIMIT = 2.0
FERROR =0.0002
MIN_FERROR =0.0025

HOME_OFFSET =   0.0
HOME_SEARCH_VEL =   0.8
HOME_LATCH_VEL =-0.06
HOME_USE_INDEX =YES
HOME_IGNORE_LIMITS =NO

DEADBAND =  1e-06
P = 700
I = 0
D = 0
BIAS =  0
FF0 =   0
FF1 =   7.5
FF2 =   0

-- 
Kirk Wallace
(Hardinge HNC lathe, California, USA
http://www.wallacecompany.com/machine_shop/ )



-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users