Tuning with 7i77

More
11 Jan 2013 04:53 #28560 by spangledboy
Tuning with 7i77 was created by spangledboy
I starting to have a go at tuning the PID loop in LinuxCNC - I've connected my MESA 7i77 to the old Anilam analogue drives and the movement is looking ok so far - everything goes in the right direction and the speeds seem to be good.

However, when the drives are powered up but LinuxCNC is not controlling the position of the table there is very little "stray" movement. If I leave it for a few minutes the X axis might creep a millimetre or so - the movement on the handwheel is barely noticeable. However, when I activate LinuxCNC so that it's actively controlling the position I notice that the handwheels are continually hunting back and forth at a much faster rate (although by no means rapid). With the default tuning settings (P=1, everything else 0) this is a small back and forth movement of 0.01mm (the smallest increment of the linear scales).

What's causing this continual error movement and correction when control is enabled? I would've expected the analogue output of the 7i77 to be 0v when the position reads correctly.

Also, can someone point me in the direction of a definitive PID tuning tutorial/set of examples for LinuxCNC? I've found differing explanations in the Wiki and elsewhere in the documentation - some seem to use PID, others P, FF1 & FF2 and the halscope screen dumps seem to chop and change the parameters which they're using to determine how close they're getting to success.

From the forums I can see that the actual values needed vary wildly between different installations, so knowing what numbers others have come up with is of little use, but a decent tutorial would be really welcome! Once I've got mine working correctly I will write up what I did so that my experience can be added to the Wiki.

Please Log in or Create an account to join the conversation.

More
11 Jan 2013 05:53 #28563 by Todd Zuercher
Replied by Todd Zuercher on topic Tuning with 7i77
That is not unusual behavior for an untuned servo.

Servos are always moving, constantly correcting themselves. Ideally when it is properly tuned the constant corrections are so small as to be un-noticable. Usually the finer the resolution of your feedback the smaller you can tune the servo's dither.

Read, Read, Read. There are lots of information out there and a few different approches to tuning and the type of drive will make a difference in the approch that works best. (I am still learning)

Please Log in or Create an account to join the conversation.

More
11 Jan 2013 06:58 #28566 by BigJohnT
Replied by BigJohnT on topic Tuning with 7i77

I starting to have a go at tuning the PID loop in LinuxCNC - I've connected my MESA 7i77 to the old Anilam analogue drives and the movement is looking ok so far - everything goes in the right direction and the speeds seem to be good.

However, when the drives are powered up but LinuxCNC is not controlling the position of the table there is very little "stray" movement. If I leave it for a few minutes the X axis might creep a millimetre or so - the movement on the handwheel is barely noticeable. However, when I activate LinuxCNC so that it's actively controlling the position I notice that the handwheels are continually hunting back and forth at a much faster rate (although by no means rapid). With the default tuning settings (P=1, everything else 0) this is a small back and forth movement of 0.01mm (the smallest increment of the linear scales).

What's causing this continual error movement and correction when control is enabled? I would've expected the analogue output of the 7i77 to be 0v when the position reads correctly.

Also, can someone point me in the direction of a definitive PID tuning tutorial/set of examples for LinuxCNC? I've found differing explanations in the Wiki and elsewhere in the documentation - some seem to use PID, others P, FF1 & FF2 and the halscope screen dumps seem to chop and change the parameters which they're using to determine how close they're getting to success.

From the forums I can see that the actual values needed vary wildly between different installations, so knowing what numbers others have come up with is of little use, but a decent tutorial would be really welcome! Once I've got mine working correctly I will write up what I did so that my experience can be added to the Wiki.


A couple of things are you should not enable the drives until LinuxCNC is in control. The fact that they don't move much is good.

This tutorial is how I tuned my Anilam drives when I converted from the 1100M control. Not definitive but how I did it.

John

Please Log in or Create an account to join the conversation.

More
11 Jan 2013 07:00 #28567 by JR1050
Replied by JR1050 on topic Tuning with 7i77
Tuning a servo loop is rarely a lot of fun. Ive done alot of research and basicly,increase P until the servo starts to growl,then add D to smooth it out.Ive had very little luck using I in Emc2.Velocity drives are much easier to tune then current loop drives and need much less gain.The FFW is handy after you have a basic loop working,Ive had luck using FFW 1 and 2 on current mode amps to remove sluggishness.Use these sparingly!!

Initially starting out,set your you following errors very large,after you get some resemblance of stability you can start making them smaller.The jerking back and forth is called hunting. Those are probably old dc amps and the motors have tachs,I would tune the amp(using the trim pots) so it doesn't drift and it runs smooth with 1.5v from a battery as a command signal,then start with the PID stuff.

I tried tuning my amps using halscope and a step response with no luck(I dont find halscope real easy to use).Does any one know how to set up a real scope to measure a step response?

Please Log in or Create an account to join the conversation.

More
11 Jan 2013 07:06 #28568 by BigJohnT
Replied by BigJohnT on topic Tuning with 7i77
I should finish my halscope tutorial... it's really easy once you get the hang of it, maybe the screen shots from the velocity tuning tutorial will be self explanatory. BTW, you usually need to FF1 to eliminate the cruise error. Using my method I tune an axis in just a few minutes.

John

Please Log in or Create an account to join the conversation.

More
11 Jan 2013 07:43 #28570 by spangledboy
Replied by spangledboy on topic Tuning with 7i77
I spent another hour playing around this evening and following your velocity drive tutorial John. I've not had much luck with altering the values of I and D, but FF1 & FF2 do seem to have improved the following error as shown.

I think it's clear that the hunting I'm getting is due to the relatively low resolution of the linear encoders (0.01mm). I'm just wondering how it was done with the old controller as I've not removed any of the original feedback (linear scales & tachometers in the motor).



Attachments:

Please Log in or Create an account to join the conversation.

More
11 Jan 2013 08:05 - 11 Jan 2013 09:06 #28571 by PCW
Replied by PCW on topic Tuning with 7i77
Any velocity mode servo system with digital feedback is going to hunt back and forth
a minimum of one encoder count. You can probably lower the rate of this 'hunting'
by adjusting either the drive 0 speed potentiometer or the PID BIAS so when
LinuxCNC commands 0 velocity you get very close to 0 velocity.

Note that BIAS will be really small (+- .010 max I would say if the drives are adjusted)

Where you have resolution to spare a dead zone can be used to eliminate this hunting
but if you already have low resolution scales throwing away resolution is probably not a good thing
Last edit: 11 Jan 2013 09:06 by PCW. Reason: clarify

Please Log in or Create an account to join the conversation.

More
11 Jan 2013 20:46 #28586 by andypugh
Replied by andypugh on topic Tuning with 7i77

I think it's clear that the hunting I'm getting is due to the relatively low resolution of the linear encoders (0.01mm). I'm just wondering how it was done with the old controller as I've not removed any of the original feedback (linear scales & tachometers in the motor).

Are the tachs being used by the drives still? (I rather imagine they will be).
You could probably remove the hunting by setting a deadband of 0.01mm. That basically freezes the PID unless the position is off by more than one count. The question then is if you care that this probably doubles your position error.

As we have been discussing in another Anilam thread, it ought to be possible to integrate tach voltage to interpolate between scale counts. Whether this would work at all well is unknown.

Please Log in or Create an account to join the conversation.

More
12 Jan 2013 06:55 #28611 by spangledboy
Replied by spangledboy on topic Tuning with 7i77
Yes, I'm still using the original Anilam drives with the tach feedback to them. I do have some rotary encoders which I may be able to graft onto the end of the motor shaft - I'm sure they would provide me with much greater resolution - it would be interesting to combine the output of them with the linear scales in some way so as to eliminate the effect of any inaccuracies due to belts, ball screws etc as well as understanding how the motor itself is turning.

The plan at the moment is to get the hang of tuning using the Anilam drives before replacing them with essentially similar but more modern (and less screechy!) AMC drives which I'm in the process of buying from ebay. In fact the X axis drive is newer than the others and doesn't screech at all but I may well replace it to match the other axes anyway.

I didn't find any mention of what the bias is supposed to do in any of the documentation I've found so far. I'll have a go at adding a little when I start tweaking again tomorrow. If I can reduce the hunting and bring in the following error a bit further than I have so far I'll be reasonably satisfied until I can make some housings for the rotary encoders and install them.

Please Log in or Create an account to join the conversation.

More
12 Jan 2013 12:08 #28616 by PCW
Replied by PCW on topic Tuning with 7i77
bias is a PID component parameter so:

man pid

will tell you its function

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.163 seconds
Powered by Kunena Forum