Encoder on 7i95t
- Z3rni3
- Offline
- New Member
-
Less
More
- Posts: 10
- Thank you received: 3
28 Mar 2025 09:30 - 28 Mar 2025 09:36 #325148
by Z3rni3
Encoder on 7i95t was created by Z3rni3
Hello everyone,I’m currently working with LinuxCNC on a Pi5 with a Mesa 7i95T. After getting the configuration for the motors and limit switches working, I’m now trying to set up the encoders (currently just for the X-axis). Unfortunately, I’m still relatively new to this, and I find the .hal configuration a bit overwhelming.
I’m getting the following error when starting up:
Debug file information:
Note: Using POSIX realtime
./main.hal:121: Pin 'joint.0.motor-pos-fb' was already linked to signal 'joint-0-pos-fb'
19234
I’ve attached my .ini and .hal files. Could someone please help me understand which inputs need to be connected where?Thanks in advance for your time and assistance
I’m getting the following error when starting up:
Debug file information:
Note: Using POSIX realtime
./main.hal:121: Pin 'joint.0.motor-pos-fb' was already linked to signal 'joint-0-pos-fb'
19234
I’ve attached my .ini and .hal files. Could someone please help me understand which inputs need to be connected where?Thanks in advance for your time and assistance
Last edit: 28 Mar 2025 09:36 by Z3rni3.
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18379
- Thank you received: 5017
28 Mar 2025 14:20 #325162
by PCW
Replied by PCW on topic Encoder on 7i95t
delete the red text
and change lines like
net joint-0-pos-fb <= hm2_[MESA](BOARD).0.stepgen.00.position-fb
to net joint-0-pos-fb <= hm2_[MESA](BOARD).0.encoder.00.position
If you want encoder feedback (closed loop) rather than stepgen feedback (open loop)
# position command and feedback
net joint-0-pos-cmd <= joint.0.motor-pos-cmd
net joint-0-pos-cmd => pid.x.command
net joint-0-pos-fb <= hm2_[MESA](BOARD).0.stepgen.00.position-fb
net joint-0-pos-fb => joint.0.motor-pos-fb
net joint-0-pos-fb => pid.x.feedback
# PID Output
net joint.0.output <= pid.x.output
net joint.0.output => hm2_[MESA](BOARD).0.stepgen.00.velocity-cmd
# ENOCODER
setp hm2_[MESA](BOARD).0.encoder.00.counter-mode 0
setp hm2_[MESA](BOARD).0.encoder.00.filter 1
setp hm2_[MESA](BOARD).0.encoder.00.index-invert 0
setp hm2_[MESA](BOARD).0.encoder.00.index-mask 0
setp hm2_[MESA](BOARD).0.encoder.00.index-mask-invert 0
setp hm2_[MESA](BOARD).0.encoder.00.scale [JOINT_0](ENCODER_SCALE)
net x-pos-fb <= hm2_[MESA](BOARD).0.encoder.00.position
net x-vel-fb <= hm2_[MESA](BOARD).0.encoder.00.velocity
net x-pos-fb => joint.0.motor-pos-fb
net x-index-enable joint.0.index-enable <=> hm2_[MESA](BOARD).0.encoder.00.in
net x-pos-rawcounts <= hm2_[MESA](BOARD).0.encoder.00.rawcounts
# Home
net home-x => joint.0.home-sw-in
net x-neg-limit => joint.0.neg-lim-sw-in
net x-pos-limit => joint.0.pos-lim-sw-in
and change lines like
net joint-0-pos-fb <= hm2_[MESA](BOARD).0.stepgen.00.position-fb
to net joint-0-pos-fb <= hm2_[MESA](BOARD).0.encoder.00.position
If you want encoder feedback (closed loop) rather than stepgen feedback (open loop)
# position command and feedback
net joint-0-pos-cmd <= joint.0.motor-pos-cmd
net joint-0-pos-cmd => pid.x.command
net joint-0-pos-fb <= hm2_[MESA](BOARD).0.stepgen.00.position-fb
net joint-0-pos-fb => joint.0.motor-pos-fb
net joint-0-pos-fb => pid.x.feedback
# PID Output
net joint.0.output <= pid.x.output
net joint.0.output => hm2_[MESA](BOARD).0.stepgen.00.velocity-cmd
# ENOCODER
setp hm2_[MESA](BOARD).0.encoder.00.counter-mode 0
setp hm2_[MESA](BOARD).0.encoder.00.filter 1
setp hm2_[MESA](BOARD).0.encoder.00.index-invert 0
setp hm2_[MESA](BOARD).0.encoder.00.index-mask 0
setp hm2_[MESA](BOARD).0.encoder.00.index-mask-invert 0
setp hm2_[MESA](BOARD).0.encoder.00.scale [JOINT_0](ENCODER_SCALE)
net x-pos-fb <= hm2_[MESA](BOARD).0.encoder.00.position
net x-vel-fb <= hm2_[MESA](BOARD).0.encoder.00.velocity
net x-pos-fb => joint.0.motor-pos-fb
net x-index-enable joint.0.index-enable <=> hm2_[MESA](BOARD).0.encoder.00.in
net x-pos-rawcounts <= hm2_[MESA](BOARD).0.encoder.00.rawcounts
# Home
net home-x => joint.0.home-sw-in
net x-neg-limit => joint.0.neg-lim-sw-in
net x-pos-limit => joint.0.pos-lim-sw-in
Please Log in or Create an account to join the conversation.
Time to create page: 0.061 seconds