MPG reversing Y axis rotation to reflect manual mill

More
18 Mar 2018 18:49 #107505 by OT-CNC
I have a MPG jog wheel up and running and noticed that even though it's configured correctly the rotation of the y is incorrect when comparing it to a manual mill. I'd like to reverse the y axis only.

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

setp axis.x.jog-vel-mode 1
setp axis.y.jog-vel-mode 1
setp axis.z.jog-vel-mode 1

net scale1 mux4.0.sel0 <= hm2_5i25.0.7i77.0.0.input-22
net scale2 mux4.0.sel1 <= hm2_5i25.0.7i77.0.0.input-23

setp mux4.0.in0 0.0000001
setp mux4.0.in1 0.00001
setp mux4.0.in2 0.000001
setp mux4.0.in3 0.000015

net mpg-out ilowpass.0.in <= hm2_5i25.0.7i77.0.0.enc0.count

#### jog enable with 4 selctor sw, 2 inputs, 4 out logic ####

#a=00
#x=01
# y=10
# z=11

#loadrt and2 count=4
addf and2.4 servo-thread
addf and2.5 servo-thread
addf and2.6 servo-thread
addf and2.7 servo-thread

net input1-not <= hm2_5i25.0.7i77.0.0.input-20-not => and2.4.in0
net input2-not <= hm2_5i25.0.7i77.0.0.input-21-not => and2.4.in1
net mpg-a <= and2.4.out => axis.a.jog-enable

net input1-not => and2.5.in0
net input2 <= hm2_5i25.0.7i77.0.0.input-21 => and2.5.in1
net mpg-x <= and2.5.out => axis.x.jog-enable

net input1 <= hm2_5i25.0.7i77.0.0.input-20 => and2.6.in0
net input2-not => and2.6.in1
net mpg-y <= and2.6.out => axis.y.jog-enable

net input1 => and2.7.in0
net input2 => and2.7.in1
net mpg-z <= and2.7.out => axis.z.jog-enable

#### end of jog enable selector switch ######
###continuation of mpg jog wheel ####

net mpg-scale <= mux4.0.out
net mpg-scale => axis.x.jog-scale
net mpg-scale => axis.y.jog-scale
net mpg-scale => axis.z.jog-scale

net encoder-counts <= ilowpass.0.out
net encoder-counts => axis.x.jog-counts
net encoder-counts => axis.y.jog-counts
net encoder-counts => axis.z.jog-counts

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

More
18 Mar 2018 21:00 #107511 by Mike_Eitel
Not sure if that works , but would try to mutiply Y scale by -1.0
The following user(s) said Thank You: OT-CNC

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

More
19 Mar 2018 10:12 - 19 Mar 2018 10:12 #107539 by andypugh
linuxcnc.org/docs/2.7/html/man/man9/scale.9.html
loadrt scale names=y-invert
addf y-invert servo-thread
setp y-invert.gain -1

net mpg-scale <= mux4.0.out
net mpg-scale => axis.x.jog-scale
#net mpg-scale => axis.y.jog-scale
net mpg-scale y-invert.in
net mpg-scale-inverted y-invert.out => axis.y.jog-scale
net mpg-scale => axis.z.jog-scale
Last edit: 19 Mar 2018 10:12 by andypugh.
The following user(s) said Thank You: OT-CNC

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

More
21 Mar 2018 15:28 #107670 by OT-CNC
Thanks guys for the help! It's funny how long I can get hung up just increasing the count on a component to get it to work LOL.

I couldn't get the syntax correct when the names is listed. So I ditched it. How do you typically increase the count when the names is used?? In this case scale was used for the spindle.

I got this to work:

#loadrt scale count=1 names=scale.spindle
loadrt scale count=2

addf scale.0 servo-thread
addf scale.1 servo-thread

net mpg-scale <= mux4.0.out
net mpg-scale => axis.a.jog-scale
net mpg-scale => axis.x.jog-scale
#net mpg-scale => axis.y.jog-scale


##invert y mpg rotation ##

setp scale.1.gain -1

net mpg-scale scale.1.in
net mpg-scale-invert scale.1.out => axis.y.jog-scale
net mpg-scale => axis.z.jog-scale

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

More
21 Mar 2018 17:11 #107678 by andypugh

How do you typically increase the count when the names is used??


You can do it by using HAL TWOPASS:
linuxcnc.org/docs/2.7/html/hal/twopass.html#cha:hal-twopass

In your case, to keep things simple, one loadrt might need to mimic the pin name given if names is not used, ie

loadrt scale names=scale.0

Then in another HAL file you could use

loadrt scale names=y-scale

I suspect that you might not be allowed any spaces in a mutliple-loadrt line such as

loadrt scale names=scale.0,y-scale

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

Time to create page: 0.199 seconds
Powered by Kunena Forum