**RESOLVED** Tuning Servos

All things related to Centroid Oak, Allin1DC, MPU11 and Legacy products

Moderator: cnckeith

PaulIngram
Posts: 25
Joined: Wed Jun 02, 2010 6:25 am
Allin1DC CNC Controller: Yes
CNC Control System Serial Number: Multiple
DC3IOB: Yes
CNC11: Yes
CPU10 or CPU7: No
Location: UK

**RESOLVED** Tuning Servos

Post by PaulIngram »

Hi

I have now got everything installed and more or less working on my BP clone milling machine and am trying to tune the servo motors.

The Trace attached shows a big spike in position error at the start and end of movement and at changes in acceleration and velocity.

KP = 0.475
KD = 1.5

command = G1 x1 f120
X axis trace
X axis trace
I can reduce the spikes by pushing KP waay up but I'm not sure that this is the right thing to do.

Any suggestions

Also the instructions show 2 bad versions for each scenario, can you show example traces for what am I trying to achieve and some idea at what point does it become unacceptable?

Thanks

Paul
rppman
Posts: 84
Joined: Mon Mar 22, 2010 6:56 am

Re: Tuning Servos

Post by rppman »

Paul, I am having the same issue as you except my spikes are a bit smaller but I have more of them. The middle of my run looks ok like yours but my spikes are also at the beginning and end of the run. My KD is around 0.7. And my motor is singing pretty good in the hold possition. I can't imagine going much higher on the kd because I don't want to damage the motor with so much holding power. I will be watching this thread to see if we can get ant inlight from the experts. I was wandering what voltage motors are you using? And do you use a dedicated transformer or variac? Thanks Scott
skyg
Posts: 42
Joined: Mon Jun 07, 2010 7:16 pm

Re: Tuning Servos

Post by skyg »

I'm in the same boat as you guys, I'll be interested to see what comes of this thread.

-Sky
PaulIngram
Posts: 25
Joined: Wed Jun 02, 2010 6:25 am
Allin1DC CNC Controller: Yes
CNC Control System Serial Number: Multiple
DC3IOB: Yes
CNC11: Yes
CPU10 or CPU7: No
Location: UK

Re: Tuning Servos

Post by PaulIngram »

Hi

I am using a dedicated 2KVA torroidal transformer with a fairly hefty thermistor to avoid blowing the fuses on startup.

I eventually tweaked things on this axis to give an error spike of between 10 and 20.

I may be wrong here, but I think the error scale is in encoder pulses so in my case with around 5000 pulses per turn of the ball screw and a 5 tpi screw, this seems to imply an error of 0.0008 ish just at the start and end of moves.

I'm going to try cutting some chips and see how this translates into real world results. Of course, if I'm wrong and the error is 20 thou of movement then this could be messy.

I think I'll try some wax cutting first.

Paul
skyg
Posts: 42
Joined: Mon Jun 07, 2010 7:16 pm

Re: Tuning Servos

Post by skyg »

I was wondering the same thing - is the error readout in encoder counts? I'm guessing like you that it is, but it would be good for Scott to confirm.
diycncscott

Re: Tuning Servos

Post by diycncscott »

You are correct. The absolute error is reported in encoder counts.

Keep in mind that the error will scale with velocity and that the error you are seeing is more of an acceleration error/following error -it doesn't necessarily translate to a "positioning error" that you would ever see in a cut or the dimensions of your part. In fact, for straight line moves along any axis - the error you see on the graph won't translate to any measurable error in part dimension.

For interpolated moves at cutting speeds using motors with similiar acceleration characteristics, not only will the errors on individual axes scale with velocity but the error on one axis will effectively offset the error on the other axis (or axes).
diycncscott

Re: Tuning Servos

Post by diycncscott »

Just to be clear - this thread is discussing tuning in both velocity mode and torque mode. The PID term values do NOT in any way translate between velocity and torque modes.

PaulIngram is running a DC3IOB system that is running in torque mode

Sky is running a GPIO4D system in velocity mode

RPMAN Is running a DC3IOB system in torque mode.
skyg
Posts: 42
Joined: Mon Jun 07, 2010 7:16 pm

Re: Tuning Servos

Post by skyg »

Scott -

Did you get my PM? I'm under the impression that I'm running in torque mode. The Baldor drives are configured as such. Is this correct?

-Sky
CNCguy
Posts: 28
Joined: Tue Mar 23, 2010 8:54 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: Pennsylvania

Re: Tuning Servos

Post by CNCguy »

Use Velocity Mode wherever you can :!: .
MPU11/GPIO4D supports velocity mode very well.
Velocity mode has fewer tuning parameters.
Velocity mode parameters are less sensitive (easier to tune).
The starting default suggested parameters will often work out of the box.

Every manufacturer or model 3rd party drive maybe slightly different.
Using Velocity mode allows the drive to handle these differences for you.
Modern (produced in the last 10 years)Third Party (non Centroid) AC brushless servo drives perform better in velocity mode.
This is a fact.

The reasons may be:
Development of control algorithms contained in the AC brushless servo drives focused on Velocity mode for high volume non-cnc applications, like general industrial point to point automation, conveyor lines, pick and place, etc.
Velocity mode was the traditional mode of operation since the early days of tachometers.
Modern drives just kept on developing the general velocity mode method, although most eliminated the expensive tachometer years ago, and now "derive" a tach signal (internally) from the encoder. As encoder resolution increased, the justification for the tach (stability at low speed and holding ) faded. Many modern servo drives have advanced features such as notch filters which are normally not needed but can rescue a difficult machine suffering from mechanical oscillations. Modern drives often have built in self tuning or "motor on the machine" autotune that only works in velocity mode.

Use velocity mode if you can.

See also:
Re: oscillation

Postby ajaxscott » Mon Jul 12, 2010 9:37 am
Hello Riley,

While I have some experience tuning the Copely Xenus series, I have not had the opportunity to tune the drives you are using. That said, you may find the PID values I used to be of some help. Please note that I used CNC11 for tuning and I suggest you (and everyone else) use it as well. The real-time O'scope mode is by far the best way to tune. Once you have the PID values optimized for your machine, you can copy the values into the Ajax Plugin Config in Mach.

First thing - Set the Copley drives to velocity mode and SET Kd to ZERO

I followed this process in tuning the Xenus:

1. Backup your CNC11 files by creating a report in CNC11 (F7 -Utilities, F7- Report)
2. Download and install the latest CNC11 software here:
http://ajaxcnc.com/tech/downloads/softw ... /index.php
3. As mentioned, I set the drives to operate in velocity mode
4. In CNC11 I set: Kp = .03, Ki = .001, Kd = 0 and Kv1 = 50
skyg
Posts: 42
Joined: Mon Jun 07, 2010 7:16 pm

Re: Tuning Servos

Post by skyg »

Okay, that's good info for sure. I'm using circa 1995 Baldor TSD DC Brushed servo drives, and Baldor brushed DC motors. They have a tach, but when I redid all the wiring for the Ajax board (none of the old stuff was terminated correctly and it was a rat's nest) I didn't wire up the tach, since I didn't think I needed it. But you're saying I would get better performance running in velocity mode than I am in torque mode. Now, I know how to wire up the tach outputs, and I know how to change the Baldor into velocity mode as well. What, if anything, do I need to do on the Ajax side of things to switch to velocity mode?

-Sky
Locked