linear scale and AC servo set up - sanity check

More
03 Oct 2022 19:20 #253371 by chienMouille
Hi,

I'm attempting to convert a rather standard milling machine. I have an AC servo as well as a 5um linear glass scale. I have a really hard time setting the feedback PID of the scale. I am coming to you all for a sanity check.

I haven't connected the servo feedback to the 7i95 mesa card, but have tuned it as best as I could to have it react fast and be stiff. The TTL signal of the scale is connected to the first encoder input of the 7i95. The servo is commanded by a dir/pulse position output. Any type of tuning I'm attempting with the scale seems to make things much worst than without the scale feedback at all. 

Am I wrong with the basic set up, e.g. the fact that the servo encoder is not feedbacking to the mesa card messes it all up?

Thanks a lot in advance

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

More
03 Oct 2022 20:04 - 03 Oct 2022 20:10 #253376 by Todd Zuercher
What are the problems your having? Exactly what is worse with the tune when you have the linear scales feedback connected?

Start by testing the servo's movements with the linear scale and the normal Mesa open loop stepper configuration, except connect the feedback from the linear scale to "joint.N.motor-pos-fb" (keep the stepgen's position feedback connected to the PID loop). Then compare the joint position feedback and following error with the stepgen position feedback and PID error with Halscope. You may be surprised with how much they may disagree and when. Doing this is going to show you two things, the state of tune of your servo drive's position loop, and how much lost motion you have.

This will also be a sort of a baseline, you won't be able to expect to achieve better stability than the drive's current state of tune.

You will also find that the P settings when using real position feedback will need to be significantly lower than the P setting for the openloop stepgen system (in other words P will need to be a lot less than 1000.)

You need to remember that any lost motion (aka backlash) in the system between the servo, it's feedback and the linear scale will result in either reduced response performance, cause instability or both. Adding a linear scale does not eliminate the problems caused by backlash. Adding linear scale the can reduce and change the effects of the backlash but won't remove them. Best to fix your mechanical problems rather than try to band-aid them.

PS, No, the fact that the servo's rotary encoder isn't feeding back to Linuxcnc, should not be causing any problems.
Last edit: 03 Oct 2022 20:10 by Todd Zuercher. Reason: add PS
The following user(s) said Thank You: chienMouille

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

More
03 Oct 2022 20:33 - 03 Oct 2022 20:35 #253380 by chienMouille
Thank you so much!

The problem mainly is that however I try and tune it (following guides on the forum) it quickly ends up oscillating a lot on the target or moving to it in slow motion. And the following error is huge.

Indeed I have a couple of tenths of backlash as I haven't yet changed the leads crew and totally being carried away at trying to tune this motor on the current setup.

I will post pictures of the scopes tomorrow, I'd be very curious of your analysis in reading them, if you don't mind.

I will reduce the Hal configuration to your suggestion too. If you could point me to a guide or example of stepgen-encoder Hal configurations it would be super useful for later as well. I'm having a hard time understanding the feedback and pid Hal setup. I have so far made a dummy encoder configuration in pncconf and copied what seemed relevant to my Hal file.

I could post the state of the Hal and ini files tomorrow too if useful.

Thanks a lot!
Last edit: 03 Oct 2022 20:35 by chienMouille.

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

More
03 Oct 2022 20:47 #253382 by Todd Zuercher
The biggest work is adding all the configuration to set up reading the encoder and it's scaling. Are you sure you have the encoders scaling, and directions correct? Do that first, Also it might be helpful to post copies of your hal and ini files.

Switching from the usual PNCconfig open loop stepgen configuration to an encoder feedback closed loop one is relatively simple and only requires changing and or adding a few lines of halcode to disconnect the pid feedback from the stepgen's feedback and replacing it with the encoders. Then you have to tune the PID.
The following user(s) said Thank You: chienMouille

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

More
03 Oct 2022 20:50 #253383 by Todd Zuercher
There are example configs posted on the forums with step/dir servos using encoder feedback to close the position loop in Linuxcnc. I know I've posted some myself. Try using the forum's search funcion (being sure to not limit the date of the search results.)
The following user(s) said Thank You: chienMouille

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

More
03 Oct 2022 21:09 #253385 by tommylight
step dir encoder site:linuxcnc.org
In google will return every post on this site containing those words:
www.google.com/search?q=step+dir+encoder...ABAQ&sclient=gws-wiz
The following user(s) said Thank You: chienMouille

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

More
04 Oct 2022 09:23 #253427 by chienMouille

 Start by testing the servo's movements with the linear scale and the normal Mesa open loop stepper configuration, except connect the feedback from the linear scale to "joint.N.motor-pos-fb" (keep the stepgen's position feedback connected to the PID loop). Then compare the joint position feedback and following error with the stepgen position feedback and PID error with Halscope. You may be surprised with how much they may disagree and when. Doing this is going to show you two things, the state of tune of your servo drive's position loop, and how much lost motion you have.
 

Hi, I have changed the Hal file to run the test you described here as best as I could. I'm attaching a screenshot of the scopes, as well as the INI and HAL files.
Would you be kind to have a look and help me make sense of it?

thanks a lot 

 

File Attachment:

File Name: cncmilltes...der1.ini
File Size:4 KB
 

File Attachment:

File Name: cncmilltes...der1.hal
File Size:13 KB
Attachments:

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

More
04 Oct 2022 13:08 - 04 Oct 2022 13:13 #253443 by RotarySMP
Since you still have the original acme or trapazoid thread leads screws and brass nuts, have you measured the actual backlash? It may be much more than the estimated couple of tenths of mm.

I would recommend leaving the linear scales off at first, run Step/dir open loop to the drivers, tune the drivers as well as possible, and then set up LinuxCNC's open loop backlash compensation as best you can. Once you have that set up working, use it to machine the parts for a ground ballscrew conversion. I wouldnt try closing the position loop to linear scales without a mechanically stiff system.
Mark
Last edit: 04 Oct 2022 13:13 by RotarySMP.

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

More
04 Oct 2022 13:44 #253444 by Todd Zuercher
So Halscope plot was taken with the above hal and ini settings?
With those settings Linuxcnc is running open loop, so all of the oscillation you see there is all just from your servo drive's tuning (or lack of). This indicates you need to work on the tuning in your drive some more. It looks like it has too much P and or not enough D, but we don't know for sure not knowing your drive or being familiar with it's tuning software. (They aren't all the same or use standard PID loops.)

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

More
04 Oct 2022 14:09 #253447 by Todd Zuercher
PS, one little thing, while running open loop I think FF1 should =1 (not 0) That will help a little with the stepgen's feedback f-error but has little to do with your real F-error's large error spike and oscillation.

Plotting the commanded velocity and velocity feedback (from the encoder) might also prove enlightening. For example if your commanded acceleration is exceeding the drive's acceleration capabilities, might contribute the above results.

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

Time to create page: 0.107 seconds
Powered by Kunena Forum