PID and Homing with index.

More
8 years 10 months ago - 8 years 10 months ago #102799 by UAVpilot
Hello,

I have this configuration:
5i25 or 7i92 -> 7i77 -> servo (fast)
At the end of the process homing, the servo drive jerks sharply and sometimes shuts down due to overload. I found out why this happens:
At the signal index-enable (falling to low), the encoder counter pid.x.feedback do reset. However, pid.x.command will only be reset in the next servocycle. As a result, in the current servocycle, pid.x.error becomes
equal pid.x.command and a very large value appears briefly at the output of PID (pid.x.output). A fast servo manages to do it.



The PID component has a pin pid.x.error-previous-target, which is TRUE by default. If change it to FALSE, the result is slightly improved, but the problem does not resolve.

Last edit: 8 years 10 months ago by UAVpilot.

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

More
8 years 10 months ago #102800 by UAVpilot
Replied by UAVpilot on topic PID and Homing with index.
I made a small patch for pid.c, which seems to completely solve this problem:
Code:
--- pid.c.orig 2017-11-25 04:26:15.000000000 +0300 +++ pid.c 2017-12-09 01:36:06.645777032 +0300 @@ -325,6 +325,8 @@ } else { tmp1 = command - feedback; } + if(pid->prev_ie && !*(pid->index_enable)) + tmp1 = 0; /* store error to error pin */ *(pid->error) = tmp1; /* apply error limits */

Results:



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

More
8 years 10 months ago #102801 by Todd Zuercher
Do you only have a servo thread?

I have this same problem on a machine that is running a servo thread and a floatingpoint base thread, For me the problem goes away If I run only a single thread. Also if I try to home the machine again after the error, it does not do it because the encoder offset was zeroed with the first failed attempt. (I only get the error after closing and restarting Linuxcnc.)

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

More
8 years 10 months ago - 8 years 10 months ago #102804 by UAVpilot
Replied by UAVpilot on topic PID and Homing with index.
Yes, only servo thread.

Stable way to reproduce the problem:
1. Move the axis (mechanically) to a distance of 30mm or more from the home switch.
2. Start LinuxCNC.
3. Start the homing procedure.
Last edit: 8 years 10 months ago by UAVpilot.

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

More
8 years 10 months ago #102807 by Todd Zuercher
Do you have pid.N.index-enable connected?

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

More
8 years 10 months ago #102808 by PCW
Replied by PCW on topic PID and Homing with index.
If pid.N.index-enable is connected and you still get this issue it may be a thread order problem

Can you post your hal/ini files?

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

Time to create page: 0.095 seconds
Powered by Kunena Forum