How to use the velocity encoder signal as position feedback for the 7i77 board?

  • programador
  • programador's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
14 Jan 2025 17:58 #318969 by programador
Good afternoon, dear friends.

Please, how should I make the connections in the HAL file so that the 7i77 electronic board accepts the frequency generated by the THCAD2 electronic board as feedback from the Z axis?

Below is the basic code generated by PNCConf from LinuxCNC:
# ---Encoder feedback signals/setup---

#setp hm2_7i96s.0.encoder.00.counter-mode 0 #Default PNCConf Wizard
setp hm2_7i96s.0.encoder.00.counter-mode 1 #change to accept signal from THCAD2 board as Z axis feedback
#setp hm2_7i96s.0.encoder.00.filter 1 #Default PNCConf Wizard
setp hm2_7i96s.0.encoder.00.filter 0
setp hm2_7i96s.0.encoder.00.index-invert 0
setp hm2_7i96s.0.encoder.00.index-mask 0
setp hm2_7i96s.0.encoder.00.index-mask-invert 0
setp hm2_7i96s.0.encoder.00.scale [JOINT_1]ENCODER_SCALE

net z-pos-fb <= hm2_7i96s.0.encoder.00.position

net z-vel-fb <= hm2_7i96s.0.encoder.00.velocity
net z-pos-fb => joint.1.motor-pos-fb
net z-index-enable joint.1.index-enable <=> hm2_7i96s.0.encoder.00.index-enable
net z-pos-rawcounts <= hm2_7i96s.0.encoder.00.rawcounts

Note:

The TCHAD2 electronic board receives the analog voltage from the Z-axis movement which is a magnetic sensor with repeatability accuracy of 10µm (MICRA, micron or micron), with a recordable speed of 10m/s (meters per second) and IP67 classification (dust protection and water and oil resistance).
This sensor provides 0 volts at the output when the Z axis is lowered and 8 volts at the output when the Z axis is raised. The TCHAD2 electronic board converts this voltage into a frequency of 100kHz to 1Mhz (according to the chosen jumper). Then the 7i77 electronic board receives this frequency on encoder channel 0. It displays the position results counting to infinity, with only velocity being usable as position, with the low Z axis having a low frequency and the high Z axis having a high frequency.
Please, any basic example helps or suggestions. I appreciate your collaboration. Attached is a video showing how the values ​​from the TCHAD2 electronic board are being received by LinuxCNC.

*MICRA: The symbol (µm) and correspond to the microscopic unit of measurement, where 1 micron is the same as dividing 1 millimeter by 1000


 

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

More
14 Jan 2025 18:09 #318970 by PCW
Try this:

# ---Encoder feedback signals/setup---

#setp hm2_7i96s.0.encoder.00.counter-mode 0 #Default PNCConf Wizard
setp hm2_7i96s.0.encoder.00.counter-mode 1 #change to accept signal from THCAD2 board as Z axis feedback
#setp hm2_7i96s.0.encoder.00.filter 1 #Default PNCConf Wizard
setp hm2_7i96s.0.encoder.00.filter 0
setp hm2_7i96s.0.encoder.00.index-invert 0
setp hm2_7i96s.0.encoder.00.index-mask 0
setp hm2_7i96s.0.encoder.00.index-mask-invert 0
setp hm2_7i96s.0.encoder.00.scale [JOINT_1]ENCODER_SCALE

net z-pos-fb <= hm2_7i96s.0.encoder.00.velocity

#net z-vel-fb <= hm2_7i96s.0.encoder.00.velocity
net z-pos-fb => joint.1.motor-pos-fb
net z-index-enable joint.1.index-enable <=> hm2_7i96s.0.encoder.00.index-enable
net z-pos-rawcounts <= hm2_7i96s.0.encoder.00.rawcounts
The following user(s) said Thank You: programador

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

  • programador
  • programador's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
14 Jan 2025 19:01 #318973 by programador
Thank you, it solved the problem, the screen is showing the correct display.

 

But when I try to start the machine, the message "error calculating movement on axis 1" appears. I tried to change the max_limit and min_limit values ​​in the INI file, but without success.

When this error message appears, is it possible to see in more detail which configuration is still wrong?

Do you have any tips or examples of how I should configure axis 1 so that the error does not appear?


Below are the HAL and INI files for your consideration.

 

File Attachment:

File Name: Z3_2025-01-14.hal
File Size:8 KB
 

File Attachment:

File Name: Z3_2025-01-14.ini
File Size:3 KB

 
Attachments:

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

More
14 Jan 2025 19:11 #318975 by PCW
As a start, I would set the encoder scale so the position is approximately correct.
You will likely need to add an offset component to zero the position as well.
The following user(s) said Thank You: programador

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

  • programador
  • programador's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
15 Jan 2025 14:32 #319029 by programador
Good morning
Thank you for your attention, but unfortunately I was not successful, even trying several attempts to find scale values, I posted in a new topic if you can help me, I appreciate it

forum.linuxcnc.org/10-advanced-configura...g-output-of-the-7i77

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

Time to create page: 0.070 seconds
Powered by Kunena Forum