Joint homing offset and following error - HELP

More
04 Oct 2024 02:40 #311262 by dreBird
Hello LinuxCNC

This is my first post and I am a novice with LCNC. I bought this machine already converted with DC brush servos and incremental encoders and have been diagnosing the following issue. Thank you in advance I'm really stuck on this one.

Each axis will not move to the full commanded position, read on the DRO. If I do G01 X2 the DRO will move to 1.9980. If I do another absolute move to X3 the DRO will then read 2.9980. This 2 thou offset drops to 1 thou if I increase Proportional gain from 50 to 80. Going higher than 100 or 200 makes the joint rapidly accelerate and terminate with a joint following error. Also, when I home the machine it goes to X -0.0018 Y 0.0017 z 0.0006 .

Encoder counts are coming in fine at 50,000/inch, and table movement matches one inch.

Similar on the A axis, it stops roughly 1 degree short of command.

Could these be PID issues? The servo drives are in torque mode I believe (Copley 4122). Now, is LCNC in velocity mode if I only have one PID loop per axis? Does torque mode require 2 PID loops? and how would that be set up in LCNC? 

Is there anything else that would cause this? I'm hoping the answer isn't to buy tachometers and velocity drives.

I've attached the ini and hal files as a start, but if you need anything else please let me know. 

Thank you,

Benchman XT CNC Mill
Litton Clifton Precision C23-L servos
Copley 4122 drives
Attachments:

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

More
04 Oct 2024 03:11 - 04 Oct 2024 03:17 #311263 by PCW
Yes, best performance would be from cascaded PID loops (and inner velocity loop and outer position loop)
but its probably possible to improve the performance considerable with tuning..

1. To reduce the static error you can add more I term

2. To improve overall performance of a torque mode loop, I would decrease the servo thread period
to say 500 or even 250 usec (2x or 4x higher rates) This will allow higher stable P and D term gain
and correspondingly lower following error.



 
Last edit: 04 Oct 2024 03:17 by PCW.

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

More
06 Oct 2024 23:37 #311454 by dreBird
Thank you PCW for the suggestions. I tried a few things and saw some interesting behavior.

I gain over 10 causes a burn out where the axis rapidly accelerates and stops with a following error.

Increasing I gain to 5 did lessen the x axis offset from home to 0.006, but then it slowly drifted to 0.0001 over the next minute. I then tried the y axis with I gain 5, and it zeroed to 0.0011 then drifted to -0.0002 over the next minute, and then back to -0.0001 over another minute. Not really sure what that indicates, but seems I cant get rid of the offset with P or I gains.

Is this the servo thread period you were referring to (ini file)?
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
SERVO_PERIOD = 1000000

I tried a few values:
servo_period = 1 000, LCNC has an error upon opening and will not open.
servo_period = 10 000, LCNC opens but then freezes the whole computer.
servo_period = 100 000, LCNC opens.

So I've left it at 1000000 for now.

Is this something the 2 PID loops will take care of? How does one go about setting up the nested loops?

Thanks again

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

More
07 Oct 2024 00:24 - 07 Oct 2024 15:26 #311458 by PCW
I gain over 10 causes a burn out where the axis rapidly accelerates and stops with a following error.

This makes no sense at all to me and needs more investigation
(the fact that it drifts slowly means the I term is _WAY_ too low)

Your changed servo periods cannot work as they are all too fast
(1 usec, 10 usec and 100 usec)

I would try 500000, 333333 or 250000 if you can do that low
(500 usec, 333 usec, 250 usec)
Last edit: 07 Oct 2024 15:26 by PCW.

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

More
07 Oct 2024 14:06 - 07 Oct 2024 14:26 #311488 by Todd Zuercher
I see in your ini file that you have a deadband=0.0001 for each axis. Try setting it to 0.00002 or 0.00004 (one or two encoder counts). Having it set to 0.0001 will cause the PID to accept +/-0.0001 as close enough.
Last edit: 07 Oct 2024 14:26 by Todd Zuercher. Reason: Typed too many zeros

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

More
07 Oct 2024 14:24 #311492 by Todd Zuercher
One way to determine if the drives are in torque or velocity mode. With the drive enabled but no command signal (All PID terms zero), can the motor be turned easily by hand, or does it resist being turned? If the servo resists being turned (fights back) then it is in velocity mode. If the motor can easily be turned (like when the drive is turned off or disabled), then it is in torque mode.
The following user(s) said Thank You: tommylight

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

More
08 Oct 2024 02:53 #311538 by dreBird
That's a good and easy test, thanks Todd.

I went to try the new settings for SERVO_PERIOD, but now the computer bogs down as LCNC tries to open (automatically opens on start up) and the computer has very limited ability. For example, I cannot open the file explorer, any programs, and the mouse cursor lags way behind. Has anyone seen this before? rebooting several times does not fix it. Strange part is I changed it back to 1000000 and saved before shutting down after trying the first set of numbers.

Is there some kind of safe mode to stop LCNC launching on startup? assuming that's the problem...

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

More
08 Oct 2024 14:09 #311572 by Todd Zuercher
Setting the servo period too short, will often result in a sluggish unresponsive computer. The reason is that the computer uses all of it's available resources for servicing the real time threads and there are not enough free cycles to run anything else. It is unlikely you will be able to run a servo-thread faster than about 250us even on a very fast PC, and if you are using a Mesa Ethernet card 500us might even be optimistic.

What thread rate were you trying last when the PC was locking up? 500000? What computer are you using? What Mesa Card? What Linux real time kernel are you using and what Linux Distro?

I'm not exactly sure how to tell you to start the PC without starting Linuxcnc (I've never configured Linux to start Linuxcnc automatically.)

Starting the PC in recovery mode would surely do it, but I'm not sure how much help that will give you, because that doesn't even give you a desktop, just a terminal with the barest of essentials. It might be easier to start the pc using a Linux installation disk and run a live session from there to edit your config. If your PC has a none real time kernel installed (beside the real time one) you could use Grub to select and boot it instead. That would force Linuxcnc into simulation mode without the real time threads to slow it down.

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

More
08 Oct 2024 23:17 #311617 by dreBird
The thread rate I last tried was 100 000, but I then saved the ini file back with 1000000 and didn't test it. I'm using a HP Compaq 6000 Pro with Mesa 7I77D. I think I'm running Debian, but that's because I remember a swirl on the desktop. I do not know which real time kernel it has. 

I did get into recovery mode, but you're right it's a terminal window. I still have to look into the installation disk and Grub, but those will take some time. 

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

More
09 Oct 2024 15:19 #311654 by Todd Zuercher
100000 is going to be much too fast. I'm surprised Linuxcnc was even able to start. Try the speeds that Peter suggested, and check your PC's latency with those thread speeds to see what kind of results you get. Having reasonably good latency is just as important as thread speed when tuning a torque mode servo.

Run the latency test using this command from a terminal window (for testing a 250us servo-thread) or change the thread speed to what ever servo-thread speed you'd like to test.
latency-histogram --nobase --servo 250000

What Mesa card do you have your 7i77D connected to?

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

Time to create page: 0.159 seconds
Powered by Kunena Forum