Servo Tuning

More
23 Mar 2019 20:22 #129392 by Roland2161
Replied by Roland2161 on topic Servo Tuning

Backlash compensation is set in the ini file in the sections for each axis/joint
look for a line that says BACKLASH = n. To turn off the backlash compensation simply place a # in front of that line with a text editor and save it. If your ini file does not have any BACKLASH entries or they are already commented out (with the #), then you are not using it.


Finally got out to the garage to take a video and pics. I have also attached my lathe.ini file. I do not see anything about backlash so i will assume it is not in use.

File Attachment:

File Name: lathe_2019...23-2.ini
File Size:4 KB


I have changed the scale to -20320 and lowered the acceleration from 37.5 to 19 and this helped my issue. It is still off about .007" over an inch and changes a small amount every .100" step I take. In the video you will notice after every move it over shoots a small amount and comes back sometimes to where it should be, alot of the times it's .001" off per move. In this video it comes back to 0, but most of the time it's off .001". Running a long program it will shift the zero over .100" by the time it is done. The faster the machine moves the more pronounced the issue. When the accleration is lowered, the issue is more pronounced at lower jog speeds as well.

Short example of the issue I am having
. Notice the over shoot and return.

The last issue I am having is I can not save the calibration page. When I make the change to -20320, when I close emc2 it will reset back to the original problematic numbers. Thanks in advance.
Attachments:

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

More
23 Mar 2019 20:34 #129393 by PCW
Replied by PCW on topic Servo Tuning
This looks like it was done with a quite old version of pncconf

At the minimum, in the ini file I would:

1. Change the servo period to 1000000
2. Set all P terms to 1000
3. Set all step times to 5000
4 Set all dir setup and hold times to 20000

then in the hal file

1. Delete all pid maxerror lines

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

More
24 Mar 2019 19:22 #129505 by Roland2161
Replied by Roland2161 on topic Servo Tuning

This looks like it was done with a quite old version of pncconf

At the minimum, in the ini file I would:

1. Change the servo period to 1000000
2. Set all P terms to 1000
3. Set all step times to 5000
4 Set all dir setup and hold times to 20000

then in the hal file

1. Delete all pid maxerror lines


In the .ini file is this the section I am concerned with for each axis?

What are the step times?

#********************
# Axis X
#********************
[AXIS_0]
TYPE = LINEAR
HOME = 0.0
FERROR = 0.5
MIN_FERROR = 0.05
MAX_VELOCITY = 0.6
MAX_ACCELERATION = 30
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
STEPGEN_MAXVEL = 1.25
STEPGEN_MAXACCEL = 37.5
P = 1000.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 1.25
# these are in nanoseconds
DIRSETUP = 1000
DIRHOLD = 1000
STEPLEN = 1000
STEPSPACE = 1000
STEP_SCALE = -20360
MIN_LIMIT = -4.0
MAX_LIMIT = 0.5
#MAX_LIMIT = 0.001
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.150000
HOME_LATCH_VEL = 0.016667
HOME_FINAL_VEL = 0.000000
HOME_USE_INDEX = NO
HOME_SEQUENCE = 1

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

More
24 Mar 2019 19:32 #129509 by PCW
Replied by PCW on topic Servo Tuning
Yes thats the correct section
step time = STEPLEN

so something like

DIRSETUP = 20000
DIRHOLD = 20000
STEPLEN = 5000
STEPSPACE = 5000

is a much better place to start...

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

More
24 Mar 2019 21:44 #129523 by Roland2161
Replied by Roland2161 on topic Servo Tuning

Yes thats the correct section
step time = STEPLEN

so something like

DIRSETUP = 20000
DIRHOLD = 20000
STEPLEN = 5000
STEPSPACE = 5000

is a much better place to start...


So I have made all the changes you have suggested, including the servo period and the hal file deletion. And I am now .004" off over an inch at .100 per move. I had to turn the acceleration back up to 37.5, because if I didn't the machine would jitter like crazy every move. Video shows the stepscale at -20160, but I changed it back to -20320 with the same results. If i put the scale at -20000, then it will be off in the OTHER direction about .007" so I am pretty sure -20320 would be the correct number. I feel like I am getting closer.

video

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

More
24 Mar 2019 23:04 #129532 by tommylight
Replied by tommylight on topic Servo Tuning
20320 implies that you have 1000CPR encoders and 5 turns per inch ball screws, or 5.08mm per turn.
If you have metric ball screws with 5mm per turn, try 20480.
Just a thought. Did a lot of calculations and all points to it being correct at 20320.

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

More
24 Mar 2019 23:59 #129538 by Roland2161
Replied by Roland2161 on topic Servo Tuning
This is the stepper motor, bad picture but its 200 sr 3v

www.ebay.com/i/113693882984?chn=ps

The motor is directly connected to the ball screw.
Attachments:

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

More
25 Mar 2019 01:31 #129548 by Roland2161
Replied by Roland2161 on topic Servo Tuning

20320 implies that you have 1000CPR encoders and 5 turns per inch ball screws, or 5.08mm per turn.
If you have metric ball screws with 5mm per turn, try 20480.
Just a thought. Did a lot of calculations and all points to it being correct at 20320.



So this is where I'm at currently.


-20220 is what this is set to currently and it's close. Maybe some backlash compensation? How would I insert that into the .ini file?
Attachments:

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

More
25 Mar 2019 04:18 #129554 by tommylight
Replied by tommylight on topic Servo Tuning
??? What microstepping are you using on the drives ?
I thought it was a servo system, as the title says servo tuning. Now i recalled that you mentioned it was a stepper system.

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

More
25 Mar 2019 13:11 - 25 Mar 2019 13:11 #129566 by Roland2161
Replied by Roland2161 on topic Servo Tuning

??? What microstepping are you using on the drives ?
I thought it was a servo system, as the title says servo tuning. Now i recalled that you mentioned it was a stepper system.


yes I made a mistake I edited what I could to say stepper motors.

What is microstepping, where do I set that or find out what it uses ?
Last edit: 25 Mar 2019 13:11 by Roland2161.

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

Time to create page: 0.204 seconds
Powered by Kunena Forum