Vectrac CNC Knee mill refit from Fanuc 0M to Camsoft

Karl_T

H-M Supporter - Sustaining Member
H-M Platinum Supporter
Joined
Oct 14, 2014
Messages
1,323
Jim,


This is an open letter to you. Sorry about the length. Take your time to respond.

I have unacceptable acceleration on my mill. Got to fix before putting it to work. other than this, I think its ready to go. As you well know, I've had a HORRIBLE time with DMM setup. I find the manual **** poor and flat out misleading at times for torque servo setup. (looks to be pretty good for pulse direction)

I want to go through each setting to find the problems. First, look at DMM settings.jpg for my X axis. I want to go through each one.

First, I got Main, speed and integral gain by running the DMM auto servo tune. I am real tempted to only set a main gain, with speed and integral at 0. Then tune in WSDK. I think we got two smart controls fighting each other. your opinion?

Torque filter constant is set at 100. Do not know why I set it this high and don't completely understand its use. Is it the about the same as galil PL? Where should it be set? Again, I am tempted to set it real low and then tune in Galil - two controls fighting.

I have max acceleration set at a very low value - 4. Real likely to be a problem. look at the snip from the manual on max accel. I find it totally confusing on what setting is right.

max speed is set at 60. Learned the HARD WAY, this is actually servo dead band. i am pretty sure 60 is correct.

Also learned the HARD WAY that OnPosrange is dead zone center value, and the setting of 65 should be correct.

Gear number documentation is confusing to me. Some sections imply it does not apply to torque servo. I know better, the machine will not run with a setting of 500 - BTDT. other sections say it max motor RPM at 10 volt input in analog modes, that is why I tried 500 RPM to give a max speed of 100 IPM on the machine. Know what this really does???

Line Number is currently set at 2048. this could be part of the accel problem as it just gives too many pulses per inch of 40960. then its up against the max accel parameter in Camsoft of 99999. I see minimum value in torque servo of 500. This would give 10000 pulses per inch. I plan to make this change.

SO, WHAT ELSE AM I MISSING???

I clipped every manual section of interest.
 

Attachments

JimDawson

Global Moderator
Staff member
H-M Platinum Supporter
Joined
Feb 8, 2014
Messages
9,223
Karl, you are making me get out of my chair and actually go out to the machine and get the numbers I'm using. :grin: I'll do that later.

It looks like you have an updated manual. The descriptions are a bit less confusing than the one I have, also looks like the DMMDRV software has been updated from my version. Maybe Michael took my advice and worked on the descriptions in the manual. I'll download the latest versions.

I had to bump up the KP value in the Galil to ~100 to get the acceleration up, and I'm pretty sure I have the acceleration set to > 1,000,000.

After running the DMM auto tune, then I tuned the Galil. I have yet to figure out how to take all of the control away from the DMM and give it 100% to the Galil. I need to get another DMM servo in here to play with.

Here is a Galil routine that I use for tuning, I have never used the WSDK
#TEST
'PUT START UP STUFF HERE. ENABLE, SPEED, ETC.
WT (as needed)
#A
IPX=100000 'ENOUGH PULSES TO MOVE THE TABLE 4 OR 5 INCHES
WT 1000 'WAIT 1 SECOND
IPX=-100000 'MOVE THE TABLE BACK TO THE START POSITION
WT 1000 'WAIT 1 SECOND
JP#A 'LOOP

While this is running I am manually changing the KP, KD, SP, AC, and DC parameters, from the terminal screen. Note: the DC parameter can only be changed while WAITING. Once I'm happy, then I just note the parameter values and put them into my parameter file.


I'll get the actual numbers after I've had enough coffee. o_O
 

JimDawson

Global Moderator
Staff member
H-M Platinum Supporter
Joined
Feb 8, 2014
Messages
9,223
OK, here are the numbers for my lathe, we are almost comparing apples and oranges here. DMM 1.8KW servos on the X and Z axis. My lead screws are metric so the pulses/inch is 25400, 10mm lead maybe? I can't get to them without removing covers and that is a big job. I am using the internal DMM encoder output, so Line Num = 2000, should be 8000 pulses per revolution. I don't have linear scales on this machine.

The mass of the X axis (cross slide) is maybe around 500KG and the Z axis is the X axis plus the carriage so maybe around 800 - 1000 KG total moving mass. These numbers are just an educated guess, but there is a lot of iron in there. The whole machine weighs around 4600 KG. (10,200 lbs)

These numbers give good performance without beating up the machine. The Z will hit 400 IPM in about 1.5 inches on a rapid move. I have it limited to 400 IPM, it will go faster. I only have about 9 inches of Z travel.

I have never had to set the KP and KD this high before. But it settles to +/- 1 encoder pulse.
ACX=1355840
DCX=1355840
KPX=60
KIX=0
KDX=160

ACZ=1016560
DCZ=1016560
KPZ=55
KIZ=0
KDZ=180

and the screen shot for the X axis, I didn't grab the Z But based on what you said above, my Max Speed could be set wrong. I

1570313364623.png

I'll be happy to try to answer any questions. I really need to set up a test bench for the DMM servos so I can really understand how to set them up. They are the most difficult servos to set up that I have ever worked with, and I have hung Galil cards on a lot of different servos. But they are inexpensive and seem to work very well. Just going to have to buy another 1.8KW setup I guess.
 

Karl_T

H-M Supporter - Sustaining Member
H-M Platinum Supporter
Joined
Oct 14, 2014
Messages
1,323
OK, lets break the big problem into smaller steps. first verify what are the best settings for the DMM servo setup.

Below is all the info I can find on Max acceleration. The jist is it provides a soft start, something I do NOT want. But i do not see how to set it. Does this text mean anything to you?

<EDIT> on third+ reading I see max accel is in the denominator so a larger value will give quicker response??


next is torque filter. We both have it at 100. If I understand correctly, consideration should be to go even higher - 127. Do you agree?

Your lathe has far less steps per inch and 10X the acceleration. I am up against the Camsoft upper accel limit and cannot go higher. So, I am pretty sure i should go to the min setting on line number. I read 500 SOMEPLACE, cannot find it again. Agree?

I am thinking make these changes then run DMM servo tune.
 

Attachments

Last edited:

JimDawson

Global Moderator
Staff member
H-M Platinum Supporter
Joined
Feb 8, 2014
Messages
9,223
OK, lets break the big problem into smaller steps. first verify what are the best settings for the DMM servo setup.
Below is all the info I can find on Max acceleration. The jist is it provides a soft start, something I do NOT want. But i do not see how to set it. Does this text mean anything to you?

<EDIT> on third+ reading I see max accel is in the denominator so a larger value will give quicker response??
next is torque filter. We both have it at 100. If I understand correctly, consideration should be to go even higher - 127. Do you agree?
I read it as 1 is the fastest acceleration, but it could be 127. I guess I would try both. Note that mine is set to 12. When using the Galil you would want the acceleration setting on the drive to be set as near to 0 (instant response) as possible, that way the Galil handles the accel/decel curve and the drive just does what it's told to do.

It is also possible that the Torque Filter Constant is fighting with the KP and KD values in the Galil, maybe this is why the values have to be set so high.

Your lathe has far less steps per inch and 10X the acceleration. I am up against the Camsoft upper accel limit and cannot go higher. So, I am pretty sure i should go to the min setting on line number. I read 500 SOMEPLACE, cannot find it again. Agree?

I am thinking make these changes then run DMM servo tune.
Yes, the minimum line setting is 500, that is equal to 2000 encoder pulses/rev. Setting to 500 should increase both speed and acceleration by about factor of about 4 over the 2048 that you currently have set. This is assuming you are using the DMM encoder output as the Galil encoder input.

What is the actual acceleration set in the Galil? Is it maybe different than the CamSoft setting, like a multiplier in there? Read this with ACX=? from the Galil terminal. Is there a way to read the initialization string sent to the Galil from CamSoft and look at the actual values being sent?

Maybe auto tuning the DMM is not the proper thing to do, and the values should all be set to 1 or 127? I'll play with this tomorrow, I can turn my live tool drive without danger, it can free run and has low mass. As you suggested above, it could be a battle between an intelligent controller and an intelligent drive. We just need to dumb down the drive to give all control to the controller.
 

Karl_T

H-M Supporter - Sustaining Member
H-M Platinum Supporter
Joined
Oct 14, 2014
Messages
1,323
Ok, I will hold off on any trials. See what you can learn. I totally agree, need to turn the DMM into a dumb servo amp.

Camsoft reports that AC and DC is 99328 vs the 99999 set. that's a rounding thing Galil does.

I will spend my time today making Camsoft output position to a file every 100 ms. Then look at the data in excel to measure position, velocity, and acceleration vs time. Then changes can be measured.

Is there a way to report Galil following error? I could add that to the above. That would be VERY INFORMATIVE.

I am thinking of adding galil TT to the report with a eye on playing with Galil FA to boost acceleration. have you ever done this?
 

JimDawson

Global Moderator
Staff member
H-M Platinum Supporter
Joined
Feb 8, 2014
Messages
9,223
_TEX gives you the position error. As long as the following error is not excessive, some is needed to keep the system stable. A following error of 0 would not make for a very stable system.

I've never used the FA command, not sure how that works.
 

Karl_T

H-M Supporter - Sustaining Member
H-M Platinum Supporter
Joined
Oct 14, 2014
Messages
1,323
OK, it pays to be an anal engineer. I collected time in milliseconds, RP,TP, and TT for a ten inch move in G0.

My conclusion is the machine is doing EXACTLY what I'm telling it to do. Just not what I want it to do. :)

The text is the actual data. Velocity is 1000*(RP1-RP0)/(T1-T0). Acceleration is (V1-V0)/(T1-T0) where the 1 means current number and the 0 means the previous reading.

Acceleration is peaking at 100,000 vs Camsoft max of 99,999
max velocity is set at 100,000 right now
TT never goes over 2 volt. These could accel WAY WAY faster

Please look the data over. Any comments or anything else I should look at?
 

Attachments

JimDawson

Global Moderator
Staff member
H-M Platinum Supporter
Joined
Feb 8, 2014
Messages
9,223
Is that accel limitation hard coded into CamSoft? Is there a parameter file that can be changed? I can't imagine limiting the Galil to 99,999 on accel. Makes no sense. That is way on the low end of the range, the default setting from Galil is 256K. I normally run stuff in the >250K range. Maybe time for a deep dive into the CamSoft documentation.
 

JimDawson

Global Moderator
Staff member
H-M Platinum Supporter
Joined
Feb 8, 2014
Messages
9,223
I went out and played with my lathe a bit. Changing any of the DMM parameters seem to have no effect on anything, I went full range on both the Torque Filter, and Max Acceleration.

It is difficult to do too much because of the way the system is configured, and I can't connect with Galil Tools while my program is running. I'm going to write a module for my software that will allow me to have terminal control like the Galil Tools software. That way I can do everything from my software.

I really need a test bench.
 

Karl_T

H-M Supporter - Sustaining Member
H-M Platinum Supporter
Joined
Oct 14, 2014
Messages
1,323
Jim, I sent a letter to DMM, copied you. Go back and look at my graphs, following error is HUGE. Got to be able to do better. I will wait to do tuning again until we can determine optimum settings in DMM
 

JimDawson

Global Moderator
Staff member
H-M Platinum Supporter
Joined
Feb 8, 2014
Messages
9,223
The PID is definitely not right somewhere. I don't know if this is a function of the DMM settings or if the Galil PID needs to be tweaked.

EDIT: I looked at the raw data, and the TT voltage is going over 2 V, so not limited. Must be a function of the accel that is the limitation.
 
Last edited:

Karl_T

H-M Supporter - Sustaining Member
H-M Platinum Supporter
Joined
Oct 14, 2014
Messages
1,323
TL ? gives 9.9987. I see you suggested TE for following error. is this any different than TP - RP that I did?

I totally agree these servos need a much better tuning than I got with the current DMM setting and just using WSDK.
 

Karl_T

H-M Supporter - Sustaining Member
H-M Platinum Supporter
Joined
Oct 14, 2014
Messages
1,323
I asked Camsoft again about Accel and got a better answer. Accel can be set up to the Galil card's max. Decel needs to be 99999 max but can be increased with an initialization setting change. they will send info on how to do this.

My 'REAL JOB' has me swamped right now. I'll make these changes and run the mill a bit. Still think improvements for better performance are needed here.
 

JimDawson

Global Moderator
Staff member
H-M Platinum Supporter
Joined
Feb 8, 2014
Messages
9,223
Now we're getting somewhere. :) That makes more sense.
 

Karl_T

H-M Supporter - Sustaining Member
H-M Platinum Supporter
Joined
Oct 14, 2014
Messages
1,323
Jim has been invaluable with setup on the DMM servo system. lately, he exchanged several emails with the vendor on my behalf, then spent a day testing DMM settings and tuning a servo. His letter, below, is super informative for anyone considering this product on a +/- 10 volt analog control.

OK, I completed my testing.



The goal is two fold, 1) Maximize performance and 2) determine what effect the various DMM parameters have on performance.



Conditions:

DYN4

1.8KW

240V 3Ph input

Torque Mode

Analog Input

Galil DMC-1846 controller

Only tested the ‘’D’’ axis, Live Tooling. This axis can run free without limitation.

Reasonably low mass system.



I tried making minor adjustments to the drive parameters to gauge the effect on performance with out changing my Galil parameters, and noted no changes. So being of the school of; If a small change does nothing then make a big change and see what happens.



Starting Parameters:

DMM Parameters

Main Gain 127

Speed Gain 127

Integration Gain 1

Torque Filter 127

Max Speed 65

Max Acceleration 127

On Position Range 127

GEAR_NUM 4096

LINE_NUM 2000

Driver Status Servo OnPos

Driver ID 0



Then played around with the Galil parameters while watching the following error and stopped position error. I ran these tests in incremental mode using the IP (increment position) command turning the motor about 20 revolutions per increment.



Galil Parameters

SPD=30000

KPD=20

KID=0.0000

KDD=60

ACD=199680

DCD=199680

Using the above settings, the following error was in the range of ~100 pulses, and the stopped position error was ~40




So I adjusted the Galil parameters until the system was stable and very stiff, making changes as I was incrementing the axis.

These are the parameters I ended with. Ignore the speed since it is of course variable, but needed to make sure that the performance was stable at higher speeds.

Ending parameters:

SPD=120000

KPD=120

KID=0.0049

KDD=160

ACD=499712

DCD=499712

Using the above settings, the following error was in the range of -20 pulses, just about perfect, and the stopped position error was +/- 1, 0 is perfect.



Once I was happy with the system performance, I started testing each DMM parameter one at a time, since I started at 127 on all but the Integration Gain (1), I set each of the other parameters to 1, one at a time, and checked the result.



The final test DMM settings were:

Main Gain 1

Speed Gain 1

Integration Gain 1

Torque Filter Constant 1

Max Speed 1

Max Acceleration 1

On Position Range 1

GEAR_NUM 16384

LINE_NUM 2000

Driver Status Servo OnPos

Driver ID 0



There was no difference in the performance with changes to any setting, including Gear Number. I tried setting the Gear Number at 500 and at 16384, no difference noted.



So now we know how to make this system run with a Galil controller in Torque Mode, and how the DMM drive reacts to different settings. The bottom line seems to be that putting the DYN4 into Analog Torque mode makes it a simple transconductance amplifier, in other words, turns it into a complete zombie with no control at all. All of the control is done in the Galil.



Note: The Galil settings above are specific to the dynamics of my Live Tooling drive, and will be different for other controllers and systems. The PID parameters would be way high for older generation (Optima) Galil controllers.



Jim Dawson
James Dawson Controls LLC
 

Karl_T

H-M Supporter - Sustaining Member
H-M Platinum Supporter
Joined
Oct 14, 2014
Messages
1,323
Ok, several hours of servo tuning to report on...

Set DMM per your letter with line_num of 500.

First, did general tuning with WSDK, got the same type results as before that will give huge following errors. Tried the other methods and cannot get them to run. I think its trying such a low PID, that the servo is not moving at all. see Pic. The software won't let me change start PIDs. Manual tuning is way beyond my abilities.

So, then I tried general tuning with a 1000 pulse step and AC and speed typical for my control. Got WAY HIGHER PIDs. Also ran each axis twice and got huge variability in results. (first run had max KI of 40 and all four runs hit 40) The way this auto tune works, it finds KP and KD, then looks for best KI.

Comments?
 

Attachments

JimDawson

Global Moderator
Staff member
H-M Platinum Supporter
Joined
Feb 8, 2014
Messages
9,223
That's a lot of under/over shoot. I have never seen PID numbers that high before. Normally with 5KW to 20KW Lenze or SEW drives the KP is about 6, the KD is about 20, and KI is always 0, as are the DC drive settings on my mill. The DMM drives do seem to require higher values, you saw mine, 120, 0.0049, and 160 and the system is fiddle string tight.

The ''P'' tightens the system, the ''I'' reduces the following error, and the ''D'' smooths it all out by damping the rate of change. Normally I start with ''P'' at 6, I at 0, and D at 24 (4xP), then just keep bumping P up until the system gets tight. Too much ''P'' and the system will go unstable and oscillate, same with too much ''I''. Add ''D'' as needed.

Is that tuning software part of the CamSoft program? Something is seriously wrong here, I don't know if this is a limitation of your tuning software or what, but what you are showing me makes no sense. I see the accel/decel is still way low, were you not able to adjust that higher?

You may have to load up Galil Tools or one of the other Galil terminal programs to do the tuning, depending on your operating system. Galil Tools will run on Win7/10, Galil Smart Terminal will run on WinXP or Win2000. But as I said, doing that may require reinstalling CamSoft or you may have to uninstall CamSoft before installing the Galil drivers. I don't know anything about CamSoft, and can find no documentation for it.
 
Last edited:

Karl_T

H-M Supporter - Sustaining Member
H-M Platinum Supporter
Joined
Oct 14, 2014
Messages
1,323
I have a separate hard disk with W7 32 bit, Galil WSDK installed. Pull cable on disk 1 with camsoft and move it to disk 2 with WSDK. I can do a disk 3 and install Tools, cheap version. But my WSDK is the best version, so this is likely a step back.

Camsoft has a max decel of 99999 on 18x0 cards. They suggest the same accel. With a 500 line encoder, I agree that is plenty. There documentation states you should run with as low an accel as you can. That said, AC can be turned up as high as galil allows. The run speed I selected for the test is still 300 IPM, way higher than any cutting speed.

ANYWAY, how do you change PID to get less overshoot???

Servo tuning is a TOTAL MYSTERY to me.
 

JimDawson

Global Moderator
Staff member
H-M Platinum Supporter
Joined
Feb 8, 2014
Messages
9,223
Ahhh, I found the WSDK software, that is a really old software. It runs on Win7? It does have a terminal built in so you can use that, never used it before, but is should be able to give you all of the same data that any of the other terminal software give you.

In the case of a mill I just write a little program to continuously move the table back & forth (see a few posts back) while I'm manually changing parameters from the keyboard. Watching mainly _TE to see what it's doing. In a perfect world, _TE should always read 0, but the world is not perfect. You always want a small amount of following error, never lead error, for a stable system, with no overshoot. Feel the machine while testing, that will tell you a lot about the way it's running.

The ''P'' tightens the system, the ''I'' reduces the following error, and the ''D'' smooths it all out by damping the rate of change. Normally I start with ''P'' at 6, ''I'' at 0, and ''D'' at 24 (4xP), then just keep bumping ''P'' up until the system gets tight. Too much ''P'' and the system will go unstable and oscillate, same with too much ''I'', too much ''I'' causes overshoot also. Add ''D'' as needed, ''D'' should always be greater than ''P''.
 
Last edited:

Karl_T

H-M Supporter - Sustaining Member
H-M Platinum Supporter
Joined
Oct 14, 2014
Messages
1,323
Ok, Had a difficult time getting a storage scope to run, but think I got it. see the program and several runs with a huge scattering of PID values. Have no real clue what I'm looking at but none of the runs felt jerky with my hand on the table.

Now, Its EASY to make a change and run a scope. Where would you go from here? The file name has the KP KD and KI values.

DARN MISTAKE AC is 49152 DC is 19456. I will re run one or two with 99999
 

Attachments

Last edited:

JimDawson

Global Moderator
Staff member
H-M Platinum Supporter
Joined
Feb 8, 2014
Messages
9,223
Looks like you have something to work with now, that is a good thing. :)

Let's talk about the mechanics of your system.
Belt drive or direct coupled?
If belt drive, ratio?
Ball screw lead?
Using the DMM encoder for position?

You want to set the encoder lines for about 1 micron/encoder pulse. (4 pulses/line)

While the commands seem to be working, I normally use this format ''KPX=1234'' and on a query ''KPX=?''
I still don't understand why the PID values need to be set so high, I have never seen this before.

I would remove the SP line from the test program, set this manually on the fly as needed, SPX=12345. You want to test at different speeds and this will allow easy setting between runs.

I would make these changes to the program
#A
PRX=20000
BGX;AMX
WT 1000
PRX=-20000
BGX;AMX
WT 1000
JP#A
EN

Try changing the ACX and DCX values between runs and see what happens. 250,000 to 1,000,000 range should be in the ballpark.

You're getting close, just need a little more practice tuning.
 

Karl_T

H-M Supporter - Sustaining Member
H-M Platinum Supporter
Joined
Oct 14, 2014
Messages
1,323
have a 1:1 belt drive to a 5/inch ball screw. so 500 lines*4 edges*5turns= 10,000 cts per inch from the DMM encoder. Following error of 11 cts for a few milliseconds in the 175 gain graph is PLENTY good. just would like to make the graph a bit smoother, if possible.

Look carefully at the last two runs vs. the first five - it is accelerating past the SP setting in the program - just doing 2 seconds of AC then level run.

I'll make a run with double the SP and see what happens. I chose this as its the highest cutting speed the machine with ever see. 10,000= 1 inch per second or 60 IPM. It will rapid at 300, but who cares about follow error then?

Same with AC and DC - double it, but please note it is only academic 99,999 is the max I will be using on the control.
 

JimDawson

Global Moderator
Staff member
H-M Platinum Supporter
Joined
Feb 8, 2014
Messages
9,223
Try setting the ''I'' a bit lower to see what happens. Overshoot is normally caused by too much ''I''
 

Karl_T

H-M Supporter - Sustaining Member
H-M Platinum Supporter
Joined
Oct 14, 2014
Messages
1,323
Ok, here's a couple more trials. took SP out of program.

T7 has AC and Dc at 200,000 speed at 20,000 kp 175 kd 2000 ki 2

T7p5 raised kd to 2500
T8 raised ki to 10 - feel a sharp stop with hand on table
T9 put speed back to 10,000, and ac dc back to 99,999

i will add a DP 0 to the program next run.
 

Attachments

JimDawson

Global Moderator
Staff member
H-M Platinum Supporter
Joined
Feb 8, 2014
Messages
9,223
Maybe try KD at 500 or so. That should stiffen things up a bit. Maybe try KI at 1.5
 

JimDawson

Global Moderator
Staff member
H-M Platinum Supporter
Joined
Feb 8, 2014
Messages
9,223
T13 and T14 look pretty good with the exception of the overshoot when it reaches speed and again on decel.

The lower KD looks the best.

T12 with the KD = 2500 the following error is taking a long time to recover. In a perfect world, the position error graph would be a straight line at 0 throughout the entire cycle. That would mean that the actual position is exactly following the commanded position, but in reality that is almost impossible.

Bumping up the KP might help a bit. At 6 seconds the error should come to 0, looks like it's good in T13, T14
 
[7]
Top