7i76e: MPG and Analog inputs with pncconf?

11 Jan 2019 09:02 #123960 by trilobyte
is it possible to set up the two MPG and the 4 Analog inputs of a 7i76e withe pncconf?

i wired my machine as shown in norberts connection sheet:

id like to use one mpg for the x axis and the other for the z axis of my cnc lathe.
The potentiometers should be connected with feed and spindle override etc.

is this possible with pncconf?

11 Jan 2019 10:47 #123964 by rodw
I don't think so.

pncconf is just to get you going. The Mesa ecosystem is so rich, it simply can't do everything. Its time to get your hands dirty and learn how to hand edit hal files.

If yo have a look on my spaceship plasma build, forum.linuxcnc.org/show-your-stuff/32029...-plasma-cutter-build there is a complete worked example on how to use a MPG on a 7i76e.

As far as the analog inputs go, I have only had a quick play but the pin value is the voltage on the pin. Just patch it to your 24 volt power and use halshow to view the results and you will get your head around it pretty quickly.
11 Jan 2019 11:27 #123966 by cmorley
pncconf can configure 7i76e in mode 2 which allows two MPGs and analog inputs.
Select mode 2 on the I/O connector 1.

There is no way to configure the analog inputs in pncconf.
You can do that manually in one of the HAL files.

Chris M
11 Jan 2019 18:21 #123983 by pl7i92
You may use a USB XHC-HB04 MPG gives You alot of options
11 Jan 2019 21:17 - 11 Jan 2019 21:43 #123990 by trilobyte
>pncconf can configure 7i76e in mode 2 which allows two MPGs and analog inputs.
>Select mode 2 on the I/O connector 1.

if i select this mode 2 pncconf crashes when i try to safe and quit:

Last edit: 11 Jan 2019 21:43 by trilobyte. Reason: screenshot added
11 Jan 2019 21:44 #123993 by rodw
Try changing to
11 Jan 2019 22:47 #123997 by cmorley

trilobyte wrote: >pncconf can configure 7i76e in mode 2 which allows two MPGs and analog inputs.
>Select mode 2 on the I/O connector 1.

if i select this mode 2 pncconf crashes when i try to safe and quit:

I tried this in the latest version of pncconf in the 2.7 branch - what version of linuxcnc are you using?
it has to do with the selection of external MPG, on the external controls page. What option did you select and what di you select for the MPG encoder in the mesa page?

Chris M
12 Jan 2019 07:57 - 12 Jan 2019 08:41 #124017 by trilobyte
i'm using the latest master 2.8xxx
i tryed different options in the external controls page. if i set the mode 2 in the I/O connector 1will crash if i try to finish the pnccconf.

i get 3 potentiometers running. i found some code from a 2.7 installation. the first 3 blocks are running after smal changes.
but for the jog speed this looks different. can someone help me with the fourth block of code? the one vor the jog speed.


loadrt conv_float_s32 names=conv_float_s32.feed,conv_float_s32.spindel,conv_float_s32.maxvel,conv_float_s32.maxjog
addf conv_float_s32.feed servo-thread
addf conv_float_s32.spindel servo-thread
addf conv_float_s32.maxvel servo-thread
addf conv_float_s32.maxjog servo-thread

setp halui.feed-override.scale 0.01277777777777
setp halui.feed-override.direct-value true
setp hm2_7i76e.0.7i76.0.0.analogin0-scalemax 200
net halui.feedanalog <= hm2_7i76e.0.7i76.0.0.analogin0 => conv_float_s32.feed.in
net feedanalog conv_float_s32.feed.out => halui.feed-override.counts

setp halui.spindle.0.override.scale 0.01277777777777
setp halui.spindle.0.override.direct-value true
setp hm2_7i76e.0.7i76.0.0.analogin1-scalemax 180
net halui.spindelanalog <= hm2_7i76e.0.7i76.0.0.analogin1 => conv_float_s32.spindel.in
net spindelanalog conv_float_s32.spindel.out => halui.spindle.0.override.counts

setp halui.max-velocity.scale 1
setp halui.max-velocity.direct-value true
setp hm2_7i76e.0.7i76.0.0.analogin2-scalemax 100
net halui.maxvelanalog <= hm2_7i76e.0.7i76.0.0.analogin2 => conv_float_s32.maxvel.in
net maxvelanalog conv_float_s32.maxvel.out => halui.max-velocity.counts

#setp halui.jog-vel.scale 1
#setp halui.jog-speed.direct-value true
setp hm2_7i76e.0.7i76.0.0.analogin3-scalemax 100
net halui.maxjoganalog <= hm2_7i76e.0.7i76.0.0.analogin3 => conv_float_s32.maxjog.in
#net maxjoganalog conv_float_s32.maxjog.out => jog-speed
Last edit: 12 Jan 2019 08:41 by trilobyte.
12 Jan 2019 09:41 #124020 by rodw
This assumes that you use 1 MPG for all axes and you use a binary coded selection switch so you only use two inputs to set 4 sale settings one of them is 0 or OFF. The order of the mux4.in's is dependent on my hardware but it is a metric machine so in mm.
loadrt mux4 count=1
addf mux4.0                   servo-thread

# Scale Select
setp mux4.0.in0 0.0
setp mux4.0.in1 1.0
setp mux4.0.in2 0.01
setp mux4.0.in3 0.1

net mux4-sel1 <= hm2_7i76e.0.7i76.0.0.input-22
net mux4-sel0 <= hm2_7i76e.0.7i76.0.0.input-21
net mux4-sel1 => mux4.0.sel1
net mux4-sel0 => mux4.0.sel0

net jog-scale <= mux4.0.out
net jog-scale => axis.x.jog-scale
net jog-scale => axis.y.jog-scale
net jog-scale => axis.z.jog-scale
12 Jan 2019 09:58 - 12 Jan 2019 10:02 #124021 by rodw
For completeness, I will add my axis selct code here. Normally you would use another mux4 component but in my case I have a 6 axis selection knob on my pendant so I've used a mux8 paired with a select8. This lets me add another 3 controls. eg. I could use the Axis 4 selection setting to control reverse run to step back and forth in the g code. (maybe....).

Also note you need to convert the data type to keep select8 happy.
loadrt mux8 count=1
loadrt select8 count=1
loadrt conv_float_s32 count=1

addf mux8.0                   servo-thread
addf select8.0                servo-thread
addf conv-float-s32.0         servo-thread 

#Axis Select (0=off, 1=x, 2=z, 3=y, na, 5=6, 6=4, 7=5) 
setp mux8.0.in0 0
setp mux8.0.in1 1
setp mux8.0.in2 2
setp mux8.0.in3 3
setp mux8.0.in4 4
setp mux8.0.in5 5
setp mux8.0.in6 6
setp mux8.0.in7 7
net mux8-sel0 <= hm2_7i76e.0.7i76.0.0.input-23
net mux8-sel1 <= hm2_7i76e.0.7i76.0.0.input-24
net mux8-sel2 <= hm2_7i76e.0.7i76.0.0.input-25
net mux8-sel0 => mux8.0.sel0
net mux8-sel1 => mux8.0.sel1
net mux8-sel2 => mux8.0.sel2

net mux-float conv-float-s32.0.in <= mux8.0.out

net mux-s32   <= conv-float-s32.0.out
net mux-s32   => select8.0.sel
net axis-select-x <= select8.0.out1
net axis-select-y <= select8.0.out3
net axis-select-z <= select8.0.out2
net axis-select-4 <= select8.0.out6
net axis-select-5 <= select8.0.out7
net axis-select-6 <= select8.0.out5

net axis-select-x => axis.x.jog-enable
net axis-select-y => axis.y.jog-enable
net axis-select-z => axis.z.jog-enable

# Encoder counts
net jog-counter <=  hm2_7i76e.0.7i76.0.0.enc0.count
net jog-counter => axis.x.jog-counts
net jog-counter => axis.y.jog-counts
net jog-counter => axis.z.jog-counts

Hope I've copied accross everything you need....
Last edit: 12 Jan 2019 10:02 by rodw.
Moderators: cmorley
Time to create page: 0.139 seconds
Powered by Kunena Forum