- Posts: 4819
- Thank you received: 0
[SOLVED] Rotary axis homin on index not working
3 years 5 months ago #271811
by Aciera
Rotary axis homin on index not working was created by Aciera
I'm trying to get a rotary joint to home using an encoder index.
I would expect the motor to rotate (according to the 'HOME_LATCH_VEL' set in the ini and upon finding the index pulse stop and reset the absolute position to zero.
What I see is the motor starts turning finds the index and then returns to, what seems to me, the old absolute zero position.
This is on Version 2.9 from a recent bookworm install.
Any ideas?
I would expect the motor to rotate (according to the 'HOME_LATCH_VEL' set in the ini and upon finding the index pulse stop and reset the absolute position to zero.
What I see is the motor starts turning finds the index and then returns to, what seems to me, the old absolute zero position.
This is on Version 2.9 from a recent bookworm install.
Any ideas?
Attachment not found
Warning: Spoiler!
[JOINT_3]
TYPE = ANGULAR
MAX_VELOCITY = 240.0
MAX_ACCELERATION = 800.0
STEPGEN_MAXVEL = 300
STEPGEN_MAXACCEL = 1000
P = 1000
I = 0
D = 0
FF0 = 0
FF1 = 1
FF2 = 0
BIAS = 0
DEADBAND = 1
MAX_OUTPUT = 0
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 = 40
HOME_USE_INDEX = YES
HOME_SEQUENCE = 1
TYPE = ANGULAR
MAX_VELOCITY = 240.0
MAX_ACCELERATION = 800.0
STEPGEN_MAXVEL = 300
STEPGEN_MAXACCEL = 1000
P = 1000
I = 0
D = 0
FF0 = 0
FF1 = 1
FF2 = 0
BIAS = 0
DEADBAND = 1
MAX_OUTPUT = 0
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 = 40
HOME_USE_INDEX = YES
HOME_SEQUENCE = 1
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
#--- OPEN LOOP STEPPER SIGNALS ---
net a-index-enable <=> joint.3.index-enable <=> pid.a.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-vel-cmd <= joint.3.vel-cmd => pid.a.command-deriv
net a-output <= pid.a.output => hm2_7i76e.0.stepgen.04.velocity-cmd
net a-pos-fb <= hm2_7i76e.0.stepgen.04.position-fb => pid.a.feedback => joint.3.motor-pos-fb
# --- 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
#--- OPEN LOOP STEPPER SIGNALS ---
net a-index-enable <=> joint.3.index-enable <=> pid.a.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-vel-cmd <= joint.3.vel-cmd => pid.a.command-deriv
net a-output <= pid.a.output => hm2_7i76e.0.stepgen.04.velocity-cmd
net a-pos-fb <= hm2_7i76e.0.stepgen.04.position-fb => pid.a.feedback => joint.3.motor-pos-fb
Please Log in to join the conversation.
3 years 5 months ago #271817
by Aciera
Replied by Aciera on topic Rotary axis homin on index not working
Here is a HalScope shot with the encoder positions.
Rotary:
And my (linear) Y axis also using an index:
Rotary:
Attachment not found
And my (linear) Y axis also using an index:
Attachment not found
Please Log in to join the conversation.
3 years 5 months ago #271818
by Aciera
Replied by Aciera on topic Rotary axis homin on index not working
So it seems to me that with the rotary homing the joint position is not set to zero.
Please Log in to join the conversation.
3 years 5 months ago #271820
by chris@cnc
Replied by chris@cnc on topic Rotary axis homin on index not working
I seems your encoder feedback is missing?
net a-pos-fb <= hm2_7i76e.0.encoder.03.position
net a-pos-fb <= hm2_7i76e.0.encoder.03.position
Please Log in to join the conversation.
3 years 5 months ago #271826
by Aciera
Replied by Aciera on topic Rotary axis homin on index not working
Ah, yes the linear axis is indeed closed loop and the rotary is not since that runs on a servo controller. So does that mean that I have to fully close the loop for that rotary in linuxcnc to be able to use index homing?
I was hoping to avoid that since that would mean two positional pids in the system.
I was hoping to avoid that since that would mean two positional pids in the system.
Please Log in to join the conversation.
3 years 5 months ago #271830
by PCW
Replied by PCW on topic Rotary axis homin on index not working
It is possible to home open loop stepgen systems to index using
the right firmware (firmware with step/dir index support)
This firmware exports a stepgen index enable pin and has stepgen
hardware that emulates encoder behaviour on index. The stepgen index
input is normally shared with encoder index inputs of the same channel
so you might have to re-arrange stepgens for this to work.
the right firmware (firmware with step/dir index support)
This firmware exports a stepgen index enable pin and has stepgen
hardware that emulates encoder behaviour on index. The stepgen index
input is normally shared with encoder index inputs of the same channel
so you might have to re-arrange stepgens for this to work.
Please Log in to join the conversation.
3 years 5 months ago #271832
by chris@cnc
Replied by chris@cnc on topic Rotary axis homin on index not working
I set the linuxcnc PID to 1 and tune the servo controller. It works...
Please Log in to join the conversation.
3 years 5 months ago #271835
by Aciera
Replied by Aciera on topic Rotary axis homin on index not working
Thank you both.
On my 7i76e i use three stepgens using closed loop with index homing (stepper/glasscales), one stepgen with home switch and the one in question with a step/dir servo controller with index homing from the controller index feedback. Would that work?The stepgen index
input is normally shared with encoder index inputs of the same channel
so you might have to re-arrange stepgens for this to work.
Hm, if I do that I always get an 'offset' in the DRO after homing. The absolute value in the DRO is not 0 but say 1.5. This value decreases with the homing latch velocity but i'm already crawling.I set the linuxcnc PID to 1 and tune the servo controller. It works...
Please Log in to join the conversation.
3 years 5 months ago #271839
by PCW
Replied by PCW on topic Rotary axis homin on index not working
As chris@cnc suggested, using encoder feedback for the rotary axis
is probably the simplest solution.
Then all axis would be settup similarly
If you wanted to use stepgen index you would need to arrange
the stepgen channel using index to match the encoder channel
(they are mis-matched now)
is probably the simplest solution.
Then all axis would be settup similarly
If you wanted to use stepgen index you would need to arrange
the stepgen channel using index to match the encoder channel
(they are mis-matched now)
Please Log in to join the conversation.
3 years 5 months ago #271844
by Aciera
Replied by Aciera on topic Rotary axis homin on index not working
So the only thing I would have to switch around is to use stepgen.03 with encoder.03 instead of using stepgen.04 with encoder.03? That seems easy enough.
So far I have not found a solution for the homing offset issue I'm having with the encoder feedback.
So far I have not found a solution for the homing offset issue I'm having with the encoder feedback.
Please Log in to join the conversation.
Time to create page: 0.207 seconds
