[SOLVED] Rotary axis homin on index not working
- PCW
- Away
- Moderator
Less
More
- Posts: 17944
- Thank you received: 4812
21 May 2023 16:36 #271849
by PCW
and not the stepgen and you still have an issue?
Replied by PCW on topic Rotary axis homin on index not working
So you are saying you made the change so that feedback on the rotary axis is coming from the encoderSo far I have not found a solution for the homing offset issue I'm having with the encoder feedback.
and not the stepgen and you still have an issue?
Please Log in or Create an account to join the conversation.
- Aciera
- Topic Author
- Offline
- Administrator
Less
More
- Posts: 4001
- Thank you received: 1729
21 May 2023 18:35 #271860
by Aciera
Replied by Aciera on topic Rotary axis homin on index not working
Yes, the problem with encoder feedback is that after homing the DRO (absolute and relative ) position is not zero but a value proportional to the homing-latch-velocity. Somewhere around 1.0 for a really slow latch-velocity.
I'll recheck that tomorrow and will post the current state of affairs.
I'll recheck that tomorrow and will post the current state of affairs.
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17944
- Thank you received: 4812
21 May 2023 18:39 #271864
by PCW
Replied by PCW on topic Rotary axis homin on index not working
Sounds like you are not actually using encoder feedback as the encoder position
is zeroed at index
is zeroed at index
Please Log in or Create an account to join the conversation.
- Aciera
- Topic Author
- Offline
- Administrator
Less
More
- Posts: 4001
- Thank you received: 1729
22 May 2023 08:57 - 22 May 2023 09:07 #271908
by Aciera
Replied by Aciera on topic Rotary axis homin on index not working
So, i tried with changing the pid values in the ini but the offset is unaffected. The offset value increases proportionally with the homing latch velocity. What I did notice is that the encoder position does not seem to reset to zero:
ini-section:
Hal-section
Thanks for the help.
ini-section:
Warning: Spoiler!
[JOINT_3]
TYPE = ANGULAR
MAX_VELOCITY = 250.0
MAX_ACCELERATION = 1000.0
STEPGEN_MAXVEL = 300
STEPGEN_MAXACCEL = 1400
P = 50
I = 10
D = 0
FF0 = 0
FF1 = 1
FF2 = 0
BIAS = 0
DEADBAND = 0.01
MAX_OUTPUT = 0
FERROR = 999
MIN_FERROR = 99
ENCODER_SCALE = 100
# these are in nanoseconds
DIRSETUP = 2500
DIRHOLD = 1000
STEPLEN = 1000
STEPSPACE = 1000
STEP_SCALE = 1000
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 50
HOME_USE_INDEX = YES
HOME_SEQUENCE = 1
TYPE = ANGULAR
MAX_VELOCITY = 250.0
MAX_ACCELERATION = 1000.0
STEPGEN_MAXVEL = 300
STEPGEN_MAXACCEL = 1400
P = 50
I = 10
D = 0
FF0 = 0
FF1 = 1
FF2 = 0
BIAS = 0
DEADBAND = 0.01
MAX_OUTPUT = 0
FERROR = 999
MIN_FERROR = 99
ENCODER_SCALE = 100
# these are in nanoseconds
DIRSETUP = 2500
DIRHOLD = 1000
STEPLEN = 1000
STEPSPACE = 1000
STEP_SCALE = 1000
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 50
HOME_USE_INDEX = YES
HOME_SEQUENCE = 1
Hal-section
Warning: Spoiler!
#******************************************************************************************************
# --- PID SETUP ---
setp pid.a.Pgain [JOINT_3]P
setp pid.a.Igain [JOINT_3]I
setp pid.a.Dgain [JOINT_3]D
setp pid.a.bias [JOINT_3]BIAS
setp pid.a.FF0 [JOINT_3]FF0
setp pid.a.FF1 [JOINT_3]FF1
setp pid.a.FF2 [JOINT_3]FF2
setp pid.a.deadband [JOINT_3]DEADBAND
setp pid.a.maxoutput [JOINT_3]MAX_OUTPUT
setp pid.a.error-previous-target TRUE
setp pid.a.maxerror .01
# --- STEPGEN SETUP ---
setp hm2_7i76e.0.stepgen.04.dirsetup [JOINT_3]DIRSETUP
setp hm2_7i76e.0.stepgen.04.dirhold [JOINT_3]DIRHOLD
setp hm2_7i76e.0.stepgen.04.steplen [JOINT_3]STEPLEN
setp hm2_7i76e.0.stepgen.04.stepspace [JOINT_3]STEPSPACE
setp hm2_7i76e.0.stepgen.04.position-scale [JOINT_3]STEP_SCALE
setp hm2_7i76e.0.stepgen.04.step_type 0
setp hm2_7i76e.0.stepgen.04.control-type 1
setp hm2_7i76e.0.stepgen.04.maxaccel [JOINT_3]STEPGEN_MAXACCEL
setp hm2_7i76e.0.stepgen.04.maxvel [JOINT_3]STEPGEN_MAXVEL
# --- ENCODER SETUP ---
setp hm2_7i76e.0.encoder.03.counter-mode 0
setp hm2_7i76e.0.encoder.03.filter 1
setp hm2_7i76e.0.encoder.03.index-invert 0
setp hm2_7i76e.0.encoder.03.index-mask 0
setp hm2_7i76e.0.encoder.03.index-mask-invert 0
setp hm2_7i76e.0.encoder.03.scale [JOINT_3]ENCODER_SCALE
# --- CLOSED LOOP STEPPER SIGNALS ---
net a-index-enable <=> pid.a.index-enable <=> joint.3.index-enable <=> hm2_7i76e.0.encoder.03.index-enable
net a-enable <= joint.3.amp-enable-out => pid.a.enable => hm2_7i76e.0.stepgen.04.enable
net a-pos-cmd <= joint.3.motor-pos-cmd => pid.a.command
net a-output <= pid.a.output => hm2_7i76e.0.stepgen.04.velocity-cmd
net a-pos-fb <= hm2_7i76e.0.encoder.03.position => pid.a.feedback => joint.3.motor-pos-fb
net a-vel-fb <= hm2_7i76e.0.encoder.03.velocity => pid.a.feedback-deriv
# --- PID SETUP ---
setp pid.a.Pgain [JOINT_3]P
setp pid.a.Igain [JOINT_3]I
setp pid.a.Dgain [JOINT_3]D
setp pid.a.bias [JOINT_3]BIAS
setp pid.a.FF0 [JOINT_3]FF0
setp pid.a.FF1 [JOINT_3]FF1
setp pid.a.FF2 [JOINT_3]FF2
setp pid.a.deadband [JOINT_3]DEADBAND
setp pid.a.maxoutput [JOINT_3]MAX_OUTPUT
setp pid.a.error-previous-target TRUE
setp pid.a.maxerror .01
# --- STEPGEN SETUP ---
setp hm2_7i76e.0.stepgen.04.dirsetup [JOINT_3]DIRSETUP
setp hm2_7i76e.0.stepgen.04.dirhold [JOINT_3]DIRHOLD
setp hm2_7i76e.0.stepgen.04.steplen [JOINT_3]STEPLEN
setp hm2_7i76e.0.stepgen.04.stepspace [JOINT_3]STEPSPACE
setp hm2_7i76e.0.stepgen.04.position-scale [JOINT_3]STEP_SCALE
setp hm2_7i76e.0.stepgen.04.step_type 0
setp hm2_7i76e.0.stepgen.04.control-type 1
setp hm2_7i76e.0.stepgen.04.maxaccel [JOINT_3]STEPGEN_MAXACCEL
setp hm2_7i76e.0.stepgen.04.maxvel [JOINT_3]STEPGEN_MAXVEL
# --- ENCODER SETUP ---
setp hm2_7i76e.0.encoder.03.counter-mode 0
setp hm2_7i76e.0.encoder.03.filter 1
setp hm2_7i76e.0.encoder.03.index-invert 0
setp hm2_7i76e.0.encoder.03.index-mask 0
setp hm2_7i76e.0.encoder.03.index-mask-invert 0
setp hm2_7i76e.0.encoder.03.scale [JOINT_3]ENCODER_SCALE
# --- CLOSED LOOP STEPPER SIGNALS ---
net a-index-enable <=> pid.a.index-enable <=> joint.3.index-enable <=> hm2_7i76e.0.encoder.03.index-enable
net a-enable <= joint.3.amp-enable-out => pid.a.enable => hm2_7i76e.0.stepgen.04.enable
net a-pos-cmd <= joint.3.motor-pos-cmd => pid.a.command
net a-output <= pid.a.output => hm2_7i76e.0.stepgen.04.velocity-cmd
net a-pos-fb <= hm2_7i76e.0.encoder.03.position => pid.a.feedback => joint.3.motor-pos-fb
net a-vel-fb <= hm2_7i76e.0.encoder.03.velocity => pid.a.feedback-deriv
Thanks for the help.
Attachments:
Last edit: 22 May 2023 09:07 by Aciera.
Please Log in or Create an account to join the conversation.
- Aciera
- Topic Author
- Offline
- Administrator
Less
More
- Posts: 4001
- Thank you received: 1729
22 May 2023 09:20 - 22 May 2023 09:40 #271914
by Aciera
Replied by Aciera on topic Rotary axis homin on index not working
Just to be clear, this offset does stay. If I do a G53 G0 A0 it does not go to zero. If I set the work offset to the current position the value does also not go to zero. All positional values for the rotary axis are offset by this amount. In the above example if I do G0 A100 it (the DRO) goes to 101.510.
I can see slight changes in the DRO value when I apply torque to the motor shaft, so it is indeed the encoder value.
[edit]
Another observation: Even with conservative following error setting like
FERROR = 10
MIN_FERROR = 1
I get a following error during homing as soon as the index signal is detected. Not sure if that may have something to do with this.
I can see slight changes in the DRO value when I apply torque to the motor shaft, so it is indeed the encoder value.
[edit]
Another observation: Even with conservative following error setting like
FERROR = 10
MIN_FERROR = 1
I get a following error during homing as soon as the index signal is detected. Not sure if that may have something to do with this.
Last edit: 22 May 2023 09:40 by Aciera.
Please Log in or Create an account to join the conversation.
- Aciera
- Topic Author
- Offline
- Administrator
Less
More
- Posts: 4001
- Thank you received: 1729
22 May 2023 11:54 #271925
by Aciera
Replied by Aciera on topic [SOLVED] Rotary axis homin on index not working
Turns out that the PID settings in the ini were the key to the solution.
Following error must be minimized properly using the pid settings in linuxcnc for homing to work correctly.
Seems obvious now. Thanks for all the support!
Following error must be minimized properly using the pid settings in linuxcnc for homing to work correctly.
Seems obvious now. Thanks for all the support!
Please Log in or Create an account to join the conversation.
- Aciera
- Topic Author
- Offline
- Administrator
Less
More
- Posts: 4001
- Thank you received: 1729
22 May 2023 18:03 - 22 May 2023 18:57 #271954
by Aciera
Replied by Aciera on topic [SOLVED] Rotary axis homin on index not working
A little update on this matter.
Just as a recap: The optimal P value in the ini would be 1 since we already have a pid in the servo controller that should bring the motor position to the commanded position set by the stepgen.
However, it seems that with a P value of 1 in the joint PID the overshoot of the stepgen count in the index homing process never gets corrected and just stays in the DRO. That is why the offset gets propotionally larger with higher homing latch speed. Hence a sufficiently larges P value is required to eliminate the offset. ie the larger the P value the faster the stepgen and the motor are brought back to the index position (ie encoder zero).
[edit]
Problem is that, after homing is complete this P value leads to overshoots in the position commands.
Just tried setting the p value to 1 after homing and that did not bring the solution to my following error. Not sure as to what to do here but I've got a f-error of 15 when the motor is jogging or en route to a commanded position. Controller - Servo are auto-tuned for a rigid machine. Manual tuning seems a daunting task ...
Just as a recap: The optimal P value in the ini would be 1 since we already have a pid in the servo controller that should bring the motor position to the commanded position set by the stepgen.
However, it seems that with a P value of 1 in the joint PID the overshoot of the stepgen count in the index homing process never gets corrected and just stays in the DRO. That is why the offset gets propotionally larger with higher homing latch speed. Hence a sufficiently larges P value is required to eliminate the offset. ie the larger the P value the faster the stepgen and the motor are brought back to the index position (ie encoder zero).
[edit]
Just tried setting the p value to 1 after homing and that did not bring the solution to my following error. Not sure as to what to do here but I've got a f-error of 15 when the motor is jogging or en route to a commanded position. Controller - Servo are auto-tuned for a rigid machine. Manual tuning seems a daunting task ...
Last edit: 22 May 2023 18:57 by Aciera.
Please Log in or Create an account to join the conversation.
Time to create page: 0.080 seconds