Mesa 7i95t, encoder assignment and configuration. - Resolved

More
17 Mar 2024 13:33 - 17 Mar 2024 13:34 #296136 by slowpoke
I have 5um magnetic scales that I would like to assign to a Mesa 7i95t board. The 7i95t has provision for up to 6 encoders, I have wired up the x-axis scale to encoder 0. I don't see anything in MesaCT for encoder channel assignment and configuration. In a perfect world it would be nice if I could initially get Axis to display the scale position based on the encoder input data so I can confirm that aspect is working before closing the servo loop with the scale data.

Presently the servos act much like open loop steppers (from LinuxCNC's perspective) with step and direction pulses from the Mesa board, and the servo rotary encoders feeding back to the servo drivers.

How would I go about assigning encoder 0 to the X axis and is there a way to see the scaled data independent of the commanded value on the preview screen, perhaps that's what the DRO tab is for?

Thanks in advance
Last edit: 17 Mar 2024 13:34 by slowpoke.

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
17 Mar 2024 14:20 #296141 by tommylight
Replied by tommylight on topic Mesa 7i95t, encoder assignment and configuration.
forum.linuxcnc.org/show-your-stuff/47357...sma-cutting-machines
Configs there attached, one has 7i95 in the name, have a look at it, it also uses servo drives with encoders.
The following user(s) said Thank You: slowpoke

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

More
22 Mar 2024 18:00 - 24 Mar 2024 23:03 #296554 by slowpoke

forum.linuxcnc.org/show-your-stuff/47357...sma-cutting-machines
Configs there attached, one has 7i95 in the name, have a look at it, it also uses servo drives with encoders.
 
tommylight,

 



Thanks for the link.

My challenge du jour is linking the x-axis linear encoder to LinuxCNC. I'm hoping you can clarify a few things, my questions are in Bold so they are easy to spot.

FYI,  I'm using a 7i95t board, I'm guessing you're using a 7i96 board?

IIRC from your video, you mentioned that you were sort of splitting the differential output signals from the encoders (essentially using them single ended), using one output to drive the Mesa board and I think the other to the servo drive or perhaps something else. In my case I'm driving the Mesa encoder inputs differentially but I don't think that's relevant as long as the Mesa board is jumpered to match.

Your 7i95_p folder linked contains 7i96_p_noarc.hal and in that file, I found the following section that looks like it is for the x axis encoders. MesaCT does not have a tab or any way of configuring the various encoders to a particular drive (I guess the encoder aspect is just not coded yet), except you can enter a value for encoder scale in the 7i95t|Drive(x)|encoder, however values entered here does not appear to do anything.
# ---Encoder feedback signals/setup---
setp    [HMOT](CARD0).encoder.00.counter-mode 0
setp    [HMOT](CARD0).encoder.00.filter 1
setp    [HMOT](CARD0).encoder.00.index-invert 0
setp    [HMOT](CARD0).encoder.00.index-mask 0
setp    [HMOT](CARD0).encoder.00.index-mask-invert 0
setp    [HMOT](CARD0).encoder.00.scale  [JOINT_0]ENCODER_SCALE
net x-pos-fb               <=  [HMOT](CARD0).encoder.00.position
net x-vel-fb               <=  [HMOT](CARD0).encoder.00.velocity
net x-pos-fb               =>  joint.0.motor-pos-fb
net x-index-enable    joint.0.index-enable  <=>  [HMOT](CARD0).encoder.00.index-enable
net x-pos-rawcounts        <=  [HMOT](CARD0).encoder.00.rawcounts


It's not clear what [hmot](CARD0) is I guess just a partial signal name identifying your mesa board?


I have connected my 5um = 0.00019685 inches, X axis scale to encoder 0, and for scale I initially tried:
1/ 0.00019685 = 5080.01016 for the encoder scale value.
I then used Hal show to view hm2_7i95.0.encoder.00.count and found that for 0.1" + moves, the count decreases by 509 counts for each move.
Changing the encoder scale in MesaCT from 5080 to 5080*5.095= 25883 had no impact on the reported count for a 0.1" move, still 509-510
I then tried changing hm2_7i95.0.encoder.00.scale )as seen in HalShow from 1 to 0.2, this also had no effect on the encoder count for a 0.1" move, still yields 509-510.

I suppose I could try blindly copying the section above into my postgui.hal file and see what happens, just seems hope is not a strategy.

Comments a suggestions are welcome.

Update:
I used the following Hal settings to close the loop for the x axis, these are near identical to those found in the tommylight and Hakan ZX45 examples posted earlier, salient points here in condensed form for future reference:
net x-pos-cmd <= joint.0.motor-pos-cmd
net x-pos-cmd => pid.x.command

net x-pos-fb <= hm2_7i95.0.encoder.00.position
net x-pos-fb => joint.0.motor-pos-fb
net x-pos-fb => pid.x.feedback

net x-output <= pid.x.output
net x-output <= hm2_7i95.0.stepgen.00.velocity-cmd

tnet x-vel-fb <= hm2_7i95.0.encoder.00.velocity

 
Last edit: 24 Mar 2024 23:03 by slowpoke.

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

More
22 Mar 2024 20:19 - 22 Mar 2024 21:41 #296556 by PCW
The count is a physical count and independent of scale
The actual number used for feedback is the encoder position

This encoder position number is scaled by the encoder scale value.
(and a negative scale value can reverse the direction)

 
Last edit: 22 Mar 2024 21:41 by PCW.
The following user(s) said Thank You: slowpoke

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

More
23 Mar 2024 00:18 #296562 by slowpoke

The count is a physical count and independent of scale
The actual number used for feedback is the encoder position

This encoder position number is scaled by the encoder scale value.
(and a negative scale value can reverse the direction)
 

Thank you, I now have LinuxCNC encoder position matching my external DRO (within 0.00001")  we can call that close enough!

Time to close the loop.

Getting close, I'm the Happy Linux camper.

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
23 Mar 2024 01:36 #296565 by tommylight
Replied by tommylight on topic Mesa 7i95t, encoder assignment and configuration.
It is for 7i95 without T, so it should work as is, granted you wire inputs and outputs the same.
See the hal or ini file, they refer to 7i95, not 7i96 despite the file name, the config just started as 7i96 as i had that ready for plasma and edited it for 7i95.
The following user(s) said Thank You: slowpoke

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

Time to create page: 0.075 seconds
Powered by Kunena Forum