Lost Step Causing Servo Walking After Step Losses Add Over Several Moves

More
24 Oct 2022 02:53 - 24 Oct 2022 03:03 #254877 by 2brostudio
Problem: After every move there is an error in the position of the servo. That error is also there when using a closed loop stepper. The error increment changes based on the step scale. Most of the time the error seems to increment by 1 step, however sometimes there is 2 steps worth of error, or rarely no error between position moves and most rarely 1 or 2 times the error went in the opposite direction when testing this with the closed loop stepper I had on hand. 
This loss of a step or 2 each position move causes quite a buildup of error leading to problems. 

The attached ferror plots represent the error in each 1mm increment as I have no PID terms and FF1 = 1 (no feedback). 

Specs: 5i25 7i76 7i77
firmware: 5i25_7i76_7i77.bit
open loop position control (step/dir via the 7i76 and encoder feedback via the 7i77. Couldn't use analog speed control with closing the position loop in LinuxCNC due to a 30ms delay in analog output and received encoder information due delay in servo drive outputting encoder data)

Step/Dir wiring configurations attempted (left is 7i76 pin and right is servo drive pin)
1) differential? pul/dir out
pul-> pul,
-pul->-pul,
dir ->dir ,
dir-->dir-,gnd-Dgnd
step type 0 and step type 2
2) single ended? pul/dir out
5V-> pul, 
-pul->-pul,
dir-> dir,
GND->-dir
step type 0 and step type 2
Using shielded cable grounded at one end. 
Tried inverting the step pulse only, step pulse and dir pulse, dir pulse only, and started off with no inversion at all. Inverting/no inversion made no difference. 

Encoder scale is verified (updates in Axis gui with the correct scale/direction. 1 rotation does equal 5mm which is correct as I am using 5mm/rev ballscrews). 

Drive starts to work with the following step and dir lengths
DIRSETUP   = 200
DIRHOLD    = 200
STEPLEN    = 2000
STEPSPACE  = 1000
Increased the step/dir lengths from these values to the following with no difference in step error. 
DIRSETUP   = 10000
DIRHOLD    = 10000
STEPLEN    = 10000
STEPSPACE  = 10000

HAL and INI files posted for reference. 
For the 7i76-7i77_Encoder HAL and INI the X axis is the only relevant axis (stepgen out 0 on the 7i76 and encoder 1 on the 7i77).
For the 7i76-7i77_Closed_Loop_Stepper HAL and INI files the Y axis is the only relevant axis (stepgen out 1 on the 7i76 and encoder 2 on the 7i77). 

I am currently out of options on how to prevent this step loss. As far as I am aware, it isnt the servo drive since it happens on the spare closed loop stepper drive I have. It doesnt appear to be a wiring issue. Doesnt appear to be a HAL or INI configuration issue. I've looked all over to find an answer and cant seem to find it. Is there anything left to test? I am desperate for an answer and cant move forward with my CNC build without figuring out this issue. 
Last edit: 24 Oct 2022 03:03 by 2brostudio.

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

More
24 Oct 2022 09:41 #254888 by tommylight
For open loop stepper systems, P must be 1000 for a servo period of 1000000, the rest is 0 except FF0=1.
First set up open loop by setting the above values and having feedback in LinuxCNC set from stepgen.
You can do this with encoders wired, so no need to mess with wiring.
After you get that working properly, change the feedback to encoders, check functionality, and if required proceed to tuning as a servo system.

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

More
24 Oct 2022 18:08 #254929 by andypugh
I am amazed that this is working even as well as it is.

Add a P-gain of 1000 (as suggested above) and it should all work a lot better.

With only FF1 you are running purely in velocity control mode with no feedback or PID correction.

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

More
25 Oct 2022 04:03 #254988 by 2brostudio
This worked except with FF1 = 1 instead of FF0 = 1 (I think because I am in velocity mode instead of position mode?). Thank you so much for pointing this out, I didnt realize these specific PID terms were necessary when using stepgen open loop control. 

Ive probably seen hundreds of you and andypugh's posts that have helped me through so many hiccups before this one got me, so I just gotta say thank you to both of you for past and present help. 
The following user(s) said Thank You: tommylight

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

Time to create page: 0.059 seconds
Powered by Kunena Forum