[SOLVED] Rotary axis homin on index not working
- Aciera
- Topic Author
- Offline
- Administrator
- Posts: 4001
- Thank you received: 1729
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?
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
# --- 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
Attachments:
Please Log in or Create an account to join the conversation.
- Aciera
- Topic Author
- Offline
- Administrator
- Posts: 4001
- Thank you received: 1729
Attachments:
Please Log in or Create an account to join the conversation.
- Aciera
- Topic Author
- Offline
- Administrator
- Posts: 4001
- Thank you received: 1729
Please Log in or Create an account to join the conversation.
- chris@cnc
- Offline
- Platinum Member
- Posts: 529
- Thank you received: 139
net a-pos-fb <= hm2_7i76e.0.encoder.03.position
Please Log in or Create an account to join the conversation.
- Aciera
- Topic Author
- Offline
- Administrator
- Posts: 4001
- Thank you received: 1729
I was hoping to avoid that since that would mean two positional pids in the system.
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
- Posts: 17944
- Thank you received: 4812
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 or Create an account to join the conversation.
- chris@cnc
- Offline
- Platinum Member
- Posts: 529
- Thank you received: 139
Please Log in or Create an account to join the conversation.
- Aciera
- Topic Author
- Offline
- Administrator
- Posts: 4001
- Thank you received: 1729
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 or Create an account to join the conversation.
- PCW
- Away
- Moderator
- Posts: 17944
- Thank you received: 4812
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 or Create an account to join the conversation.
- Aciera
- Topic Author
- Offline
- Administrator
- Posts: 4001
- Thank you received: 1729
So far I have not found a solution for the homing offset issue I'm having with the encoder feedback.
Please Log in or Create an account to join the conversation.