setting up output while homing

More
9 years 11 months ago #82930 by Jake
I have limit switches that go directly to the servo drives and a seperate set going directly to the controller.

I need to have a high output while homing to bypass the servo limits.

I thought i found it in the manual for a homing output
Code:
# connect limit/home switch outputs to motion controller newsig Xminlim bit newsig Xmaxlim bit newsig Xhome bit net Xmaxlim axis.0.pos-lim-sw-in ppmc.0.din.01.in-not net Xminlim axis.0.neg-lim-sw-in ppmc.0.din.02.in-not net Xmaxlim axis.0.home-sw-in net Xhome axis.0.homing ppmc.0.dout.00.out newsig Yminlim bit newsig Ymaxlim bit newsig Yhome bit net Ymaxlim axis.1.pos-lim-sw-in ppmc.0.din.03.in-not net Yminlim axis.1.neg-lim-sw-in ppmc.0.din.04.in-not net Ymaxlim axis.1.home-sw-in #net Yhome axis.1.homing ppmc.0.dout.00.out newsig Zminlim bit newsig Zmaxlim bit newsig Zhome bit net Zmaxlim axis.2.pos-lim-sw-in ppmc.0.din.06.in-not net Zminlim axis.2.neg-lim-sw-in ppmc.0.din.05.in-not net Zmaxlim axis.2.home-sw-in #net Zhome axis.2.homing ppmc.0.dout.00.out

I get the error that ppmc.0.dout.00.out is already linked to home. I need this same output when I am homing each axis. It says the error is on line #26 which is the Yhome...homing..... line. But I need all three to do this with the same output. Is there another way to approach this?

Thanks!

Please Log in to join the conversation.

More
9 years 11 months ago #82933 by Todd Zuercher
Use a couple of or2s to connect them all to one pin. (or try a different hal component like linuxcnc.org/docs/2.5/html/man/man9/logic.9.html )
Code:
loadrt or2 count=2 addf or2.0 servothread addf or2.1 servothread # connect limit/home switch outputs to motion controller net limitoverrideor2 <= or2.0.out => or2.1.in0 #newsig Xminlim bit (these are unnecessary) #newsig Xmaxlim bit #newsig Xhome bit net Xmaxlim axis.0.pos-lim-sw-in ppmc.0.din.01.in-not net Xminlim axis.0.neg-lim-sw-in ppmc.0.din.02.in-not net Xmaxlim axis.0.home-sw-in net Xhome <= axis.0.homing => or2.0.in0 net limitoverride <= or2.1.out => ppmc.0.dout.00.out net Ymaxlim axis.1.pos-lim-sw-in ppmc.0.din.03.in-not net Yminlim axis.1.neg-lim-sw-in ppmc.0.din.04.in-not net Ymaxlim axis.1.home-sw-in net Yhome <= axis.1.homing => or2.1.in1 net Zmaxlim axis.2.pos-lim-sw-in ppmc.0.din.06.in-not net Zminlim axis.2.neg-lim-sw-in ppmc.0.din.05.in-not net Zmaxlim axis.2.home-sw-in net Zhome <= axis.2.homing => or2.1.in1

Please Log in to join the conversation.

More
9 years 11 months ago #82937 by Jake
Replied by Jake on topic setting up output while homing
Thanks Todd,

Once I added "-" to servo-thread it got past that but I still have the Pin 'or2.1.in1' was already linked to signal Yhome, should the Zhome be

or2.1.in2?

Ill keep trying some things

Thanks again!
Code:
loadrt or2 count=2 addf or2.0 servo-thread addf or2.1 servo-thread net limitoverrideor2 <= or2.0.out => or2.1.in0 net Xmaxlim axis.0.pos-lim-sw-in ppmc.0.din.01.in-not net Xminlim axis.0.neg-lim-sw-in ppmc.0.din.02.in-not net Xmaxlim axis.0.home-sw-in net Xhome <= axis.0.homing => or2.0.in0 net limitoverride <= or2.1.out => ppmc.0.dout.00.out net Ymaxlim axis.1.pos-lim-sw-in ppmc.0.din.03.in-not net Yminlim axis.1.neg-lim-sw-in ppmc.0.din.04.in-not net Ymaxlim axis.1.home-sw-in net Yhome <= axis.1.homing => or2.1.in0 net Zmaxlim axis.2.pos-lim-sw-in ppmc.0.din.06.in-not net Zminlim axis.2.neg-lim-sw-in ppmc.0.din.05.in-not net Zmaxlim axis.2.home-sw-in net Zhome <= axis.2.homing => or2.1.in1

Thanks again

Please Log in to join the conversation.

More
9 years 11 months ago #82946 by Todd Zuercher
No, the or2 inputs (there are only 2) are or2.n.in0 and or2.n.in1. There is no in2.

I think I see my mistake, (at least one of them)
net Yhome <= axis.1.homing => or2.1.in0
should have been
net Yhome <= axis.1.homing => or2.0.in1

To be honest, I rarely get significant hal code re-writes perfectly correct the first try. Too many subtle details to get wrong like the above.

Please Log in to join the conversation.

More
9 years 11 months ago #82947 by Jake
Replied by Jake on topic setting up output while homing
Thanks again Todd I'll try it in the morning! I kept trying little things, ran out of time and had to run the kids to gymnastics. It does make it a challenge when one character can derail the train.

Please Log in to join the conversation.

More
9 years 11 months ago #82957 by andypugh
I think the "logic" component would be neater. Change "0x203" to "0x206" if you expand the machine to 6 axes.
Code:
loadrt logic personality=0x203 addf logic.0 servo-thread net x-homing axis.0.homing => logic.0.in-00 net y-homing axis.1.homing => logic.0.in-01 net z-homing axis.2.homing => logic.0.in-02 net any-homing logic.0.or => ppmc.0.dout.00.out

As a general note, it is no longer necessary to ever use "newsig" in HAL.

Please Log in to join the conversation.

More
9 years 11 months ago #82965 by Jake
Replied by Jake on topic setting up output while homing

andypugh wrote: I think the "logic" component would be neater. Change "0x203" to "0x206" if you expand the machine to 6 axes.

Code:
loadrt logic personality=0x203 addf logic.0 servo-thread net x-homing axis.0.homing => logic.0.in-00 net y-homing axis.1.homing => logic.0.in-01 net z-homing axis.2.homing => logic.0.in-02 net any-homing logic.0.or => ppmc.0.dout.00.out

As a general note, it is no longer necessary to ever use "newsig" in HAL.


Up and running! Thanks guys!

I have been meaning to go remove the rest of the "newsig"

Getting closer!

Please Log in to join the conversation.

Time to create page: 0.128 seconds
Powered by Kunena Forum