MPG - HAL Question(s)

More
08 Mar 2020 22:46 #159526 by mooser
Replied by mooser on topic MPG - HAL Question(s)
Crap, I was trying to add them again

Lower in the custom.hal I have

#--- MAPPING MPG ENCODER signals to jog counters
# using two different encoders for different axis (X,Z)
net x-jog-counter <= hm2_5i25.0.7i76.0.0.enc0.count
net z-jog-counter <= hm2_5i25.0.7i76.0.0.enc1.count

# --- MAPPING INPUT signals and modes to linux cnc signals / gui
net x-jog-counter => axis.0.jog-counts
net z-jog-counter => axis.2.jog-counts

which is almost doing something, I need to get it to use just the one MPG and even then it's not responding unless I crank the wheel fairly quick and many "clicks" but that could be a wiring issue

Thanks for sticking with me there
M

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

More
09 Mar 2020 00:45 - 09 Mar 2020 00:51 #159545 by mooser
Replied by mooser on topic MPG - HAL Question(s)
For Future Reference (for when I forget) This finally works with much guidance from Peter

# Include your custom HAL commands here
# This file will not be overwritten when you run PNCconf again

# Jog Pendant XYZ456 X1 X10 X100 With NC E-stop and Enabled button

loadrt mux4 count=1
loadrt and2 count=1
addf mux4.0 servo-thread
addf and2.0 servo-thread


# For position mode (the default), set to 0
# In position mode the axis will move exactly jog-scale
# units for each count, regardless of how long that might take,
setp axis.0.jog-vel-mode 0 # X AXIS
setp axis.2.jog-vel-mode 0 # Z AXIS


# This sets the increments that will be used based on the input to the mux4
setp mux4.0.in0 0.0001
setp mux4.0.in1 0.001
setp mux4.0.in2 0.01


# The inputs to the mux4 component, default is not required so Input 24 isn’t referenced
net scale1 mux4.0.sel0 <= hm2_5i25.0.7i76.0.0.input-25
net scale2 mux4.0.sel1 <= hm2_5i25.0.7i76.0.0.input-26


# The output from the mux4 is sent to each axis jog scale
net mpg-scale <= mux4.0.out
net mpg-scale => axis.0.jog-scale
net mpg-scale => axis.2.jog-scale


# The Axis select inputs
net axis-select-x <= hm2_5i25.0.7i76.0.0.input-20
net axis-select-z <= hm2_5i25.0.7i76.0.0.input-22


# --- ESTOP-EXT ---
net estop_jog <= hm2_5i25.0.7i76.0.0.input-00


# MAPPING MPG ENCODER signals to jog counters
# using one encoder for both axis (X,Z)
net jog-counter <= hm2_5i25.0.7i76.0.0.enc0.count


# MAPPING INPUT signals to linux cnc signals / gui
# Since there is only one encoder it is connected to both axis. Only the one that is selected # actually moves
net jog-counter => axis.0.jog-counts
net jog-counter => axis.2.jog-counts



# Send input signal to linux cnc action (enable axis selection)
net axis-select-x => axis.0.jog-enable
net axis-select-z => axis.2.jog-enable


# ESTOP button trigger GUI control
net estop_prog <= iocontrol.0.user-enable-out
net estop_prog => and2.0.in0
net estop_jog => and2.0.in1
net and2out <= and2.0.out => iocontrol.0.emc-enable-in


#net temp <= passthrough.in
Attachments:
Last edit: 09 Mar 2020 00:51 by mooser.
The following user(s) said Thank You: tommylight, Clive S, Thods1222

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

More
09 Mar 2020 10:16 #159569 by Clive S
Replied by Clive S on topic MPG - HAL Question(s)
Thanks for a good well written post.

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

More
25 Apr 2020 22:54 #165585 by Louis_V
Replied by Louis_V on topic MPG - HAL Question(s)
Hi! I am new to this forum. I need some help to configure my MPG. I upgraded my Bridgeport Interact Series 1 to Linus CNC. I have a 5i25 and 7i77 Mesa cards. All went well so far, thanks to all of you who for posting information on the forum! I ran PNCconf to configure the MPG. I am using the handwheel of the Bridgeport. It's connected to the 7i77 encoder connector 03 (jumpers placed for single-ended). I believe the connections are good as I can see the count in the Show Hal configuration, but the axis will not move when I rotate the wheel. I am looking for a simple configuration (just a hand wheel, without step size selection rotary switch). I looked at many examples shown on the forum, and despite that, I can't figure out what is wrong. Here's the section of the hal file for the MPG. I would like to keep the same structure and pin names if possible. Can someone help me? Thanks!

# ---jogwheel signals to mesa encoder - shared MPG---

net joint-selected-count <= hm2_5i25.0.encoder.03.count

# ---mpg signals---

# for axis x MPG
setp axis.0.jog-vel-mode 0
net selected-jog-incr => axis.0.jog-scale
net joint-select-a => axis.0.jog-enable
net joint-selected-count => axis.0.jog-counts

# for axis y MPG
setp axis.1.jog-vel-mode 0
net selected-jog-incr => axis.1.jog-scale
net joint-select-b => axis.1.jog-enable
net joint-selected-count => axis.1.jog-counts

# for axis z MPG
setp axis.2.jog-vel-mode 0
net selected-jog-incr => axis.2.jog-scale
net joint-select-c => axis.2.jog-enable
net joint-selected-count => axis.2.jog-counts


# connect selectable mpg jog increments

net jog-incr-a => jogincr.sel0
net jog-incr-b => jogincr.sel1
net jog-incr-c => jogincr.sel2
net jog-incr-d => jogincr.sel3
net selected-jog-incr <= jogincr.out-f
setp jogincr.debounce-time 0.200000
setp jogincr.use-graycode False
setp jogincr.suppress-no-input False
setp jogincr.in00 0.000000
setp jogincr.in01 0.000100
setp jogincr.in02 0.000500
setp jogincr.in03 0.001000
setp jogincr.in04 0.005000
setp jogincr.in05 0.010000
setp jogincr.in06 0.050000
setp jogincr.in07 0.100000
setp jogincr.in08 0.125000
setp jogincr.in09 0.125000
setp jogincr.in10 0.125000
setp jogincr.in11 0.125000
setp jogincr.in12 0.125000
setp jogincr.in13 0.125000
setp jogincr.in14 0.125000
setp jogincr.in15 0.125000

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

More
26 Apr 2020 01:53 #165610 by PCW
Replied by PCW on topic MPG - HAL Question(s)
What drives the signals:

joint-select-a
joint-select-b
joint-select-c

?

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

More
26 Apr 2020 04:10 #165619 by cmorley
Replied by cmorley on topic MPG - HAL Question(s)
Looks like you used Pncconf. Any reason you didn't set up MPGs with it?

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

More
26 Apr 2020 22:34 #165712 by Louis_V
Replied by Louis_V on topic MPG - HAL Question(s)
I used Pncconf to set-up the MPG, but I didn't know inputs were required to select an axis. My understanding was that once an axis was selected in the GUI, the rotation of the handwheel would make the axis move. Now that I connected a rotary switch to three pins of TB8 of my 7i77 card, the MPG works!. Thanks for you support!

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

More
26 Apr 2020 22:40 #165714 by Louis_V
Replied by Louis_V on topic MPG - HAL Question(s)
The joint-select-a, b, and c were not assigned to pins! Thanks PCW for asking, you put me in the right direction. I assigned three pins of TB8 of my Mesa 7i77 to the joint-select-a, -b, and -c, and in doing so the rotation of the MPG makes the axis move. Thanks a lot for your support!

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

More
30 Aug 2020 16:56 #180093 by nf1z
Replied by nf1z on topic MPG - HAL Question(s)
Hi,
Hopefully posting this here is appropriate. I am new to this forum, though I've been mining it for years. I finally have an issue i can't find the answer to after much googling, and it looked like this was going to be addressed in this topic. The author says "... it's not responding unless I crank the wheel ... many "clicks" ..." That's what I have, except it is exactly 4 clicks, so I am pretty sure it is the encoder x4-mode that is the issue. But can't work out how to fix it.

So I moved from home-brew controller with parallel port to a 7i76e when my "new" PC couldn't do real time. I got everything working, as before eventually, then added a pendant. The pendant is repurposed from a Mazak HMC, and the MPG is a 25 PPR unit with 100 clicks, so one click per change of AB code (if that's clear). The MPG is working perfectly and does move the axes, but not every click. I can see the clicks change the input bits 16 and 17 in Hal configuration as you would expect. The count, however, only goes up when AB goes from 00 to 10.

I found this issue addressed somewhere for MPGs using the standard encoder component:

# If your MPG outputs a quadrature signal per click set x4 to 1
# If your MPG puts out 1 pulse per click set x4 to 0
setp encoder.0.x4-mode 1

If I were using the encoder component, I would assume I would set this parameter to 1, though it isn't entirely clear to me that a "pulse" is a set of four changes in the AB code (?). Looking in Hal configuration, hm2_7i76e.0.7i76.0.0.enc0 only has two parameters, scale and counts-per-rev, which seem to default to 1 and 256 respectively. In the absence of documentation, I tried messing with these, to no avail, and I can't see how either would have any effect on an MPG function. There is nothing like an x4-mode parameter. I am of course assuming that Hal Configuration shows all the parameters, though I also noticed the 7i76e encoder component has no x4-mode parameter either.

I think that's all the relevant facts. I imagine someone out there has tried to use a 1 code per click MPG with a 7i76e, so I must be missing something simple. Thanks for any help.

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

More
30 Aug 2020 19:12 - 30 Aug 2020 19:13 #180097 by PCW
Replied by PCW on topic MPG - HAL Question(s)
Most MPG encoders have 100 clicks per turn and one quadrature cycle per click so the 1X mode is default (so 1 count per click)

To get 4X mode you would need to "setp hm2_7i76e.0.7i76.0.0.encmode0 4"
but there is a likely problem in that there was a bug in the 7I76 firmware previous to R15
that prevents you from changing this parameter. This was fixed quite recently so its likely
you have R14. (you can check by reading the hm2_7i76e.0.7i76.0.0.swrevision parameter)

Updating to R15 requires loading new firmware into the DSPIC chip on the 7I76E.
This is a bit fiddly but needs no special equipment.

First you download www.mesanet.com/software/parallel/sserial.tgz
unpack it cd to utils/linuxcnc and read the README file. For Ethernet cards
you would run the updatess-eth script rather than updatess mentioned in the readme file.

The script assumes the card is at IP address 10.10.10.10
Last edit: 30 Aug 2020 19:13 by PCW.
The following user(s) said Thank You: nf1z

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

Time to create page: 0.087 seconds
Powered by Kunena Forum