Machsupport Forum

Third party software and hardware support forums. => dspMC/IP Motion Controller => Topic started by: peter81 on March 31, 2010, 01:43:59 PM

Title: AxisWorks tuning
Post by: peter81 on March 31, 2010, 01:43:59 PM
Hello, can someone please tell me how can I tune in axisworks If I'm using two motors on X axis driven by rack and pinion?

Peter
Title: Re: AxisWorks tuning
Post by: Chestermarine on April 01, 2010, 04:04:05 AM
Hello Peter81:

Could you clarify the motor setup? Are you using two motors with 2 separate drives?

As far as I have experience with Axisworks, it will drive a single axis motor, and allow you to set the best timing parameters based upon your visual feedback from the graphical screen. The dspmc manual gives the basic starting settings for the inputs, and then you can play with different numbers, and find the maximum accleration, and smoothest response. The motor will also sound quite different at different settings. The sound itself is a good indicator that you are getting bettor or worse with the numbers. At some settings the motor will sound bad, and other settings it will default, and stop suddenly. You can set the motor to drive the table for a given distance and stop, or reverse each time you give the go command. You can check the exact distance traveled vs. your input command distance. It is a great program to arrive at that mysterious mix of timing numbers, and acceleration rates. You will find what is the absolute limit in acceleration and speed, because when you set too high, the motor will start to accelerate, and just quit.  Once the best numbers are deduced by trial and error, you can save them to the controller memory. Those parameters will remain the outputs that will be used for that particular axis servo amplifier.

If your two motors are driving a common load through a solid connection, yet using separate amplifiers, you could just save the same settings to the second amplifier. However, Axisworks must have an axis designation, i.e., X,Y, Z, A, B,C, to save the tuning parameters to.

If so, you can disconnect the power leads to one motor, and tune one axis at a time. Then, disconnect that axis motor power, and connect the other one, setting the same parameters, try it out, and  save to  A, B, or C, whatever axis name is slaved to the X axis.

I do not believe Axisworks can read two motors powered from one amp. The dspmc controller is not at all like stepping motors, using pulses from the PC.  The dspmc receives direction, distance to go, and feedrate from the PC, and drives the motor based on the internal PID settings stored in the dspmc memory, and the feedback from the motor encoder.
Each axis has it's own PID settings in memory, saved from Axisworks.

The maximum speed possible with the dspmc is only limited (within common sense reason) by the power, and quality of the motors and servo amplifiers used. Unlike the pulse train output for stepper type drives, which are tied to the pulse output from Mach3. There are some very superb motors now available, that will give fantastic machine speed using the dspmc, but at a cost.

Regards,

John

   
Title: Re: AxisWorks tuning
Post by: peter81 on April 01, 2010, 09:54:46 AM
Hello Chestermarine,

thank you for your reply. Yes I'm using two servos with separate drives and slave function. I was tuning with one servo removed from the gantry. I thought there was another way to tune with both motors connected to the gantry.
When I tune with just one motor connected the speed and acceleration is lower because of the weight of the gantry (350lbs). So when I connect the other motor to the gantry, what settings I need to put in? Two times higher or less? Thanks.

Peter
Title: Re: AxisWorks tuning
Post by: Chestermarine on April 01, 2010, 12:03:13 PM
Hello Peter81:

If the two motors are identical, and driving the same load at the same time, they should have the identical settings.

The numbers (parameter settings) are the PID coefficients you find by trial and error to produce "best motion". These numbers are part of a very complex mathematical algorithm, and are not by any means "linear" with respect to the motor behavior. It would be educational to read some of the explanations in Wiki, regarding PID calculations. There are several excellent tutorials on that subject, with great graphs, to help understand what PID is. "P" means Proportional; "I" means Integral; and "D" means Derivative. These are mathematical terms.   

When the two motors are driving the gantry, the load is less for each motor, than when one motor had to drive the entire load by itself. However, that does not mean the motor cannot operate under a smaller load.

When a single motor axis is tuned for its best capability with Axisworks, it often will be used at a low speed, and be producing less horsepower.

The "best fit" PID settings will allow the motor to perform in its most efficient format, in real time. The servo motor is capable of working at low through high speed ranges, and the current draw will vary depending upon the demands at the moment. The greater the "load", the higher the current. This factor is the Kilowatt rating of the motor.

Any servo motor has a Kilowatt rating by design. This means it is capable of doing a measurable amount of "work."

Work or the term "Horsepower" is mathematically a function of.....force per unit of time. The mathematical equivalent of 1 horsepower, it "raising 550 pounds 1 foot in 1 second."  In Kilowatts, 746 watts equals 1 horsepower, or about 3/4 of a Kilowatt.

When Axisworks produces a graph, it is measuring a complex series of factors; amps, velocity, time, all at once, and showing you in graphical format, in REAL time, this action. Not a trivial problem, to say the least.

At initial start-up, the the motor cannot achieve the programmed speed instantly, thus the acceleration/deceleration "curves generated by the PID algorithm, and finally stored into the memory of the dspmc controller. It is this complex series of outputs, that make the PID servo motor motion so superior to other kinds of motion systems.

Hope this helps.

Regards,

John

   

   
Title: Re: AxisWorks tuning
Post by: Chestermarine on April 01, 2010, 04:08:21 PM
Hello Peter81:

I have not heard of any video for Axisworks, although that would be a great addition for getting through the learning curve. You might drop Rufi at Vital Systems a note, and ask him if he would have time to produce one. I know he is always busy writing better software, but it's worth a try.

Some further thoughts on tuning, after my last message:

The "S" curve you see on the screen is the acceleration of the motor, in graphical format. From the beginning of the S curve, to the end of the curve, just as it becomes a straight horizontal line is, "Time," in the horizontal axis of the graph.

The vertical height of the "S" curve is the motor acceleration from standstill, to full programmed velocity.

It is that acceleration within the "S" curve, that requires the most motor amps. So, the motor can only move so much mass (weight of gantry or table), to a given velocity, in a given amount of time. Remember, horsepower (or Watts) is "work per unit of time."

That "S" curve time period is in fractions of a second, or a few hundred milliseconds. This is far to little time to visually see what is going on. However, with Axisworks, you can now "see" what is taking place. When the velocity is set too high, for a given time, the motor servo "faults out" and never goes to it's programmed distance.

By playing around with the numbers, you can learn the motor maximum acceleration and velocity for a given mass.

Since you are using two motors to move the gantry, the velocity that can be achieved with one motor observed in Axisworks, will be less than what is achievable in real use, when the two motors are working in unison, moving the same mass.

So, if your single motor faults out at 100 i.p.m. (inches per minute), you can probably achieve 130, or 140 i.p.m. when using the machine with the two motors in unison. This limit can only be known by trial and error.  The maximum velocity will not be double, since all these relationships are NOT linear, but it will be somewhere above the single motor velocity for sure.

You cannot put the higher velocity factor into the Axisworks test cycle, since the motor will immediately fault out. You could try putting a slightly the higher velocity setting in the Axisworks program, and not giving it the run command. Save the parameters into the dspmc controller, for each motor individually, and then try it out in a simple test program, i.e., go 10.0" at feedrate X, stop, go to 0.000 at feedrate X, stop.

Alternately, you could just program higher and higher velocity feed rates in a program, and see where the motors fault out. The problem with this, is you might damage the gantry if one motor came to a full stop, with the other one going full power. Whatever you do, proceed in incremental steps, making one change at a time, going from the "known" to the "unknown."


Regards,

John
 
 
Title: Re: AxisWorks tuning
Post by: peter81 on April 04, 2010, 10:35:28 AM
I did get machine moving but always overshoots zero position. I can't get it stop exactly at zero or final position it always overshoots. When I add Integral gain it stops at zero but first overshoots and then zero out. I must set follow error at 2000 or higher so that machine don't fault out and I'm not using speed and acceleration anywhere near the capability of servos. Hope you understand me.

Peter
Title: Re: AxisWorks tuning
Post by: Vital System Support on April 06, 2010, 11:50:24 PM
hi Peter,

if you add integral term, you must also add max error I to eleiminate the oscillations.  can you post the dspmc.xml file?

thanks
Rufi

Title: Re: AxisWorks tuning
Post by: peter81 on April 08, 2010, 04:26:16 PM
Hi Rufi,

Attached is the dspmc file. Thank you.

Peter
Title: Re: AxisWorks tuning
Post by: Vital System Support on April 09, 2010, 01:40:12 AM
hi Peter,

I think the best way is to have axisWorks allow tuning of master/slave axis setup.  I will try to add this feature in the next few days, hopefuly. 

are you using axis3 (a) as slave off x axis?

thanks
Rufi
 

Title: Re: AxisWorks tuning
Post by: peter81 on April 09, 2010, 08:41:18 AM
Hi,

yes. I'm using axis0 as master and axis3 as slave. It would be great if you add this feature.

Peter
Title: Re: AxisWorks tuning
Post by: peter81 on April 15, 2010, 02:18:37 PM
Hello Rufi,

were you able to write new firmware so I can tune slave axis in axisworks?

Peter
Title: Re: AxisWorks tuning
Post by: Vital System Support on April 16, 2010, 03:12:42 PM
hi Peter,

I just sent you email with new AxisWorks software and firmware.

copy the exe files to c:\program files\dspmc folder.  also read the readme.txt file.
 
update the firmware with new version before running mach3 or axisworks.
 
you load the xml file in AxisWorks to tell it which axis is master and which is slave.  you select master axis when connecting to dspmc.   the new axisWorks will ARM pid for both master and slave.  when you download pid settings, it will download same pid values to both master and slave axis.  and when you save pid settings, they will be saved for both master and slave axis.

Let me know how it works.

thanks
Rufi

Title: Re: AxisWorks tuning
Post by: peter81 on April 20, 2010, 12:36:00 PM
hi Peter,

I just sent you email with new AxisWorks software and firmware.

copy the exe files to c:\program files\dspmc folder.  also read the readme.txt file.
 
update the firmware with new version before running mach3 or axisworks.
 
you load the xml file in AxisWorks to tell it which axis is master and which is slave.  you select master axis when connecting to dspmc.   the new axisWorks will ARM pid for both master and slave.  when you download pid settings, it will download same pid values to both master and slave axis.  and when you save pid settings, they will be saved for both master and slave axis.

Let me know how it works.

thanks
Rufi



Hello,

I recieved new firmware for slave axis tuning. It's working. I can download pid setting for both axes and tune with both axes exept there is a problem with direction of rotation for slave axis motor. I'm drivig my machine with rack and pinion and I need slave motor to rotate in other direction. I've recieved new firmware from Rufi to solve this problem. I will try it out tomorrow and report how it works. Thanks.

Peter
Title: Re: AxisWorks tuning
Post by: peter81 on April 26, 2010, 07:18:34 AM
Hello, sorry for late answer. I was away for few days. The new firmware is working perfectly and I can change the direction of rotation for slave motor in axisworks tuning with trajectory generator and with PC host software to change direction for slave axis to work with mach3. Now all I need to do is fine tune all axes. Can someone please post a picture how perfect graph should look like. Thanks.

Peter
Title: Re: AxisWorks tuning
Post by: Vital System Support on May 01, 2010, 01:10:04 AM

see the graphs in this post http://www.machsupport.com/forum/index.php/topic,14603.msg98200.html#msg98200 (http://www.machsupport.com/forum/index.php/topic,14603.msg98200.html#msg98200).  very nice servo step responce.

regards,
Rufi

Title: Re: AxisWorks tuning
Post by: peter81 on August 31, 2010, 12:58:24 PM
Hello,
 
I have not been doing anything on my machine for a few months. Now I'm back in my workshop and I have some questions. I think my tuning graph in axisworks looks ok, but when I try to run g-code in mach3 the accelerations in the sharp corners are very rough. It sounds very rough in change direction in high speeds. Is that because mach3 outputs trpezoidal motion? In mach3 settings I have to set accelarations and speeds ~4 times slower to achive more smooth motion. I'v tried to use tempest planner in mach3 which puts out s-curve motion and it was smoother, but tempest planner is not fully supported. Is there any way to achieve smoother motion in higher speeds?
 
Best regards,
Peter
Title: Re: AxisWorks tuning
Post by: alfaalfa on September 14, 2010, 07:14:10 PM
Hi.
Maybe a too late response but do you use the CV mode in Mach3 and have you tweaked it's parameters already?
Title: Re: AxisWorks tuning
Post by: peter81 on September 15, 2010, 12:52:39 PM
Hello alfaalfa,

thanks for reply. Yes I have CV turned on and I have played with CV parameters but couldn' get good results. Here are pictures of  my graph in axisworks for x and y axis
Title: Re: AxisWorks tuning
Post by: alfaalfa on September 15, 2010, 02:18:28 PM
Hi.

I'm not sure if there's one only way to do the adjusting but in the axis works I have not used the S-curve as you need to know how the motors work in step response ie. with sharp start and stop too.

I have done both servo amplifier adjustment and dspmc adjustment in Axisworks first and then used a simple G-code commands to check the combination finally with mach and recording the step response with servo driver adjustment program (Omron servo's).

If you use high speeds - remember to check that your system is making circular interpolations equally in all directions as different parameters in X and Y axises can lead to oval circles! If you keep it slow - you propably don't notice this.

BR.
Arto
Title: Re: AxisWorks tuning
Post by: peter81 on September 15, 2010, 02:48:50 PM
Hello,

I have done settings in axisworks also without s-curve with almost the same graph and still get bad resaults in mach3 when running g code. If I set accelerations 5 times lower the results are better but my machine is capable higher accelerations than I have set now. Now I'm running my servo drives in voltage mode but I will try running them in velocity mode to see if it would be better.
Title: Re: AxisWorks tuning
Post by: TOTALLYRC on September 15, 2010, 03:15:58 PM
Hi Peter,
Your PID looks like way too much I and not enough D.

I think the manual suggests as a starting point a ratio of  20:1 D to P. This means that if your P is 8000 your D should be 160,000/ I normally start with an I of 0 and then you can try slowly adding some in. I also run my amps in torque mode. IIRC velocity mode is better when running slow.

Mike
Title: Re: AxisWorks tuning
Post by: peter81 on September 15, 2010, 03:33:59 PM
Hi Mike,

If I set D in X-axis 25 times higher than P I instantly met follow error and must set max error to 5000 to execute motion without error and overshoots the final position for 30 to 40 counts.
Title: Re: AxisWorks tuning
Post by: TOTALLYRC on September 15, 2010, 04:31:38 PM
Hi Pete,
Set your scale at 100,
I at 0
P 5000
D 10000.
Set the following error at 1000.
accel at 20 IPS. Max  velocity of 100 IPM
Let me know what happens.

It looks like you are using MM not inches. Your accel is set at 1500mm per sec/sec. or 60 in/sec.
 I would try 500 mm/sec/sec or 20 in/sec/sec.

You will reach a point where you will sacrifice accel for speed or vise versa or you will have to keep opening up the following error to have high accel and high speed. Of course you will have high following error at max speed.

Mike


Title: Re: AxisWorks tuning
Post by: peter81 on September 15, 2010, 04:38:06 PM
ok thanks. I will try your settings and let you know what happens .
Title: Re: AxisWorks tuning
Post by: Vital System Support on September 16, 2010, 02:38:28 PM
hi Peter,

I just emailed a new firmware that implements IIR filter (low pass) for more smooth DAC output.  I tested here on my desktop mill and on the scope the output is very clean with no sudden (square wave) changes.

regards,
Rufi
Title: Re: AxisWorks tuning
Post by: peter81 on September 19, 2010, 04:56:47 AM
Hi TOTALLYRC,

I've tried the settings you posted. With scale of 100 the machine shakes real hard and trip follow error an also get error in the servo driver ( Over Current). Then I've tried with scale of 1000 with the same pid setting and get better motion.
Title: Re: AxisWorks tuning
Post by: TOTALLYRC on September 19, 2010, 07:02:12 AM
Hi Peter,
Every machine is different,
The settings I gave you are a starting point. Since your are getting good motion with the scale set at 1000, tune from there.

What count encoders are you using?

Mike
Title: Re: AxisWorks tuning
Post by: peter81 on September 19, 2010, 07:28:08 AM
I'm using 750W servo motors and 2500 quadrature encoders for X,Y and Z axis. So one revolution of the motor is 10.000 counts. I'm using planetary gearboxes with 10:1 reduction. This means one revolution of the pinion is 100.000 counts. One revolution of the pinion moves gantry 133,33mm.
Title: Re: AxisWorks tuning
Post by: TOTALLYRC on September 19, 2010, 07:45:47 AM
That should give pretty good resolution.

The only possible problem would be if you run up against the max encoder count rate of the DSPMC. It is 2 MHz for the V1 and 4 MHz if IIRC for V2.
Title: Re: AxisWorks tuning
Post by: peter81 on September 19, 2010, 07:57:35 AM
Is there any way to calculate this value?
Title: Re: AxisWorks tuning
Post by: peter81 on September 19, 2010, 09:58:57 AM
I'm using 2MHz dspmc and servos with 3000rpm so my max speed is 3000 devideed by 10 (planetary gearbox 10:1) is 300rpm of the pinion . So 300rpm * 133,33mm = 39999 mm/min max speed. 39999 mm/min devided by 60 is 666,65 mm/sec. 1mm is 750,018 counts. 750,018 * 666,65 mm/sec = 499999,5 counts per second (max). If my calculations are correct I'm using 4 times lower limit than max limit of dspmc. It looks like you have done calculations correct.
Title: Re: AxisWorks tuning
Post by: TOTALLYRC on September 19, 2010, 01:18:47 PM
I've devided the speed of the motor not counts. 100.000 counts per revolution of the pinion gives 750,018 counts per 1mm.

Hi pete, Let's try it this way.

If your motor was to spin 3000 rev/min (RPM) at 10,000 counts/rev = 30,000,000 counts/min div by 60 sec/min = 500,000counts/sec  or .5Mhz encoder speed. You should easily be able to spin the motors to their max rpm and still stay well within the max encoder frequency.

So my earlier math was incorrect. I came up with a max rpm of 1200 rpm with your encoder counts but it is really 12k rpm with a 2mhz freq and twice that with a 4Mhz freq.

You can either spin stupid fast or go with much higher resolution encoders to get up to the max limit. With your setup you should be just fine.

Mike
Title: Re: AxisWorks tuning
Post by: peter81 on September 30, 2010, 04:00:28 PM
Hello,

I've tried the new firmware from Rufi and it looks a lot better than before. CDFF gain is 0..15 for IIR filter setting to smooth the output. High value will smooth more but the PID response will become slower. I have settled in smooth level 5. It works a lot better in voltage, torque and velocity mode.  I'm now trying to tune servo drives in velocity mode in which was previously impossible. If i'm not using smooth level (cdff) i get follow error right away and can't tune out, but with smooth level 5 I can get tuning a lot better.
Can somebody please help me understand PN17 parameter on page 37 on the manual of my servo drives and how do you properly set it.

Peter
Title: Re: AxisWorks tuning
Post by: TOTALLYRC on October 01, 2010, 07:17:58 AM
Here is what the manual says.

Torque/Speed Scale
● In velocity control mode(MD=2), this parameter set the scale between analog input voltage and parameter VM.
● In voltage control mode(MD=3), this parameter set the scale between analog input voltage and output voltage of driver.
● In torque control mode (MD=4), this parameter set the scale between analog input voltage and output torque of motor.

Here is how I see it.

All it does is set the scale of the analog input voltage to one of the parameters that you have previously chosen.

Lets take torque mode as an example. I use +-10v and a scale factor of ten
All it really does is say that if your analog input is 10 volts, give me 10V Times the scale setting, 10 = 100% of the motors torque. So at a analog input of 5v we would get 50% of the motor torque.
If your max analog input was only 5v we could possibly set this to 20 and still get 100% motor torque at only 5v.

In voltage mode we would get analog input of 10 x 10TSC and we would get 100v . Set the scale to 20 and you would get 200v output.

In the velocity mode of operation you are setting the scale of the analog input voltage in regards to parameter VM.
HTH
Mike
Title: Re: AxisWorks tuning
Post by: peter81 on October 09, 2010, 07:57:32 AM
Ok thanks will try that and report.