- Posts: 69
- Thank you received: 0
Home + Limit from just 1 input pin: HAL config explained
- fernandosf
- Topic Author
- Offline
- Senior Member
-
Less
More
5 years 3 months ago #214455
by fernandosf
Hey there, first post, still learning.
I have been configuring LinuxCNC 2.8 trying to understand what is happening so it wont bite me later...
When I set HOME+LIMITS on input pin 10 of parport, StepConf has put code like this in the HAL File:
I have edit to reflect my gantry y1 and y2 joints.
I now kind of understand what is happening in LUT5.
So far, I understand that:
1. LUT5 have 5 inputs and one output (IN4, IN3, IN2, IN1, IN0 and OUT) ;
2. IN4 receives the signal from the serial circuit of physical switches and is TRUE when the circuit is closed;
3. Homing operation doesn't depends upon LUT5 output, but Limit detection does;
4. IN3, IN2, IN1, IN0 are TRUE when joints 3,2,1,0 are homing, respectively;
5. LUT5 OUT is TRUE only when IN4 is FALSE and IN3, IN2, IN1, IN0 are TRUE
6. Only when LUT5 OUT is TRUE the joints limit switches input pins are TRUE (meaning a switch have been tripped)
My conclusion is that joint limit switches inputs are never TRUE because IN3, IN2, IN1, IN0 are never TRUE at the same time;
Where is my logic failing ?
Can someone explain the step-by-step events and states ocurring when a physical switch is tripped ?
Thanks guys,
I have been configuring LinuxCNC 2.8 trying to understand what is happening so it wont bite me later...
When I set HOME+LIMITS on input pin 10 of parport, StepConf has put code like this in the HAL File:
Code:
loadrt lut5
addf lut5.0 servo-thread
net all-limit-home <= parport.0.pin-10-in
setp lut5.0.function 0x10000
net all-limit-home => lut5.0.in-4
net all-limit <= lut5.0.out
net homing-x <= joint.0.homing => lut5.0.in-0
net homing-y1 <= joint.1.homing => lut5.0.in-1
net homing-y2 <= joint.2.homing => lut5.0.in-2
net homing-z <= joint.3.homing => lut5.0.in-3
net all-limit-home => joint.0.home-sw-in
net all-limit => joint.0.neg-lim-sw-in
net all-limit => joint.0.pos-lim-sw-in
net all-limit-home => joint.1.home-sw-in
net all-limit => joint.1.neg-lim-sw-in
net all-limit => joint.1.pos-lim-sw-in
net all-limit-home => joint.2.home-sw-in
net all-limit => joint.2.neg-lim-sw-in
net all-limit => joint.2.pos-lim-sw-in
net all-limit-home => joint.3.home-sw-in
net all-limit => joint.3.neg-lim-sw-in
net all-limit => joint.3.pos-lim-sw-in
I have edit to reflect my gantry y1 and y2 joints.
I now kind of understand what is happening in LUT5.
So far, I understand that:
1. LUT5 have 5 inputs and one output (IN4, IN3, IN2, IN1, IN0 and OUT) ;
2. IN4 receives the signal from the serial circuit of physical switches and is TRUE when the circuit is closed;
3. Homing operation doesn't depends upon LUT5 output, but Limit detection does;
4. IN3, IN2, IN1, IN0 are TRUE when joints 3,2,1,0 are homing, respectively;
5. LUT5 OUT is TRUE only when IN4 is FALSE and IN3, IN2, IN1, IN0 are TRUE
6. Only when LUT5 OUT is TRUE the joints limit switches input pins are TRUE (meaning a switch have been tripped)
My conclusion is that joint limit switches inputs are never TRUE because IN3, IN2, IN1, IN0 are never TRUE at the same time;
Where is my logic failing ?
Can someone explain the step-by-step events and states ocurring when a physical switch is tripped ?
Thanks guys,
Please Log in to join the conversation.
- fernandosf
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 69
- Thank you received: 0
5 years 3 months ago #214554
by fernandosf
Replied by fernandosf on topic Home + Limit from just 1 input pin: HAL config explained
Tried to edit the post and the forum editor is fighting me back, the harder I try, the worst it gets.
Please Log in to join the conversation.
- tommylight
-
- Offline
- Administrator
-
Less
More
- Posts: 22012
- Thank you received: 4
5 years 3 months ago #214558
by tommylight
Replied by tommylight on topic Home + Limit from just 1 input pin: HAL config explained
Click on the "source" in the upper left of the editor.
It will still mess up, but less.
It will still mess up, but less.
Please Log in to join the conversation.
5 years 3 months ago #214569
by BigJohnT
Replied by BigJohnT on topic Home + Limit from just 1 input pin: HAL config explained
Don't know if I can explain lut5 but here are some links that might help.
wiki.linuxcnc.org/cgi-bin/wiki.pl?Lut5
linuxcnc.org/docs/2.5/html/man/man9/lut5.9.html
linuxcnc.org/docs/2.8/html/hal/rtcomps.html#_lut5
trying to test it myself but running out of time this morning.
Hmm looks like setting the function to 0x1000000 is the output is never on.
JT
wiki.linuxcnc.org/cgi-bin/wiki.pl?Lut5
linuxcnc.org/docs/2.5/html/man/man9/lut5.9.html
linuxcnc.org/docs/2.8/html/hal/rtcomps.html#_lut5
trying to test it myself but running out of time this morning.
Hmm looks like setting the function to 0x1000000 is the output is never on.
JT
Please Log in to join the conversation.
- fernandosf
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 69
- Thank you received: 0
5 years 3 months ago #214571
by fernandosf
Replied by fernandosf on topic Home + Limit from just 1 input pin: HAL config explained
Hey John,
I understand LUT5.
if I have code like this:
I understand that LUT5 will only be TRUE when IN4=FALSE and IN3, IN2, IN1, IN0 are TRUE
Problem is what this logic represents in the wiring of HAL from the first post, it does not make sense to me.
I understand LUT5.
if I have code like this:
Code:
loadrt lut5
setp lut5.0.function 0x10000
Problem is what this logic represents in the wiring of HAL from the first post, it does not make sense to me.
Please Log in to join the conversation.
5 years 3 months ago #214573
by BigJohnT
Replied by BigJohnT on topic Home + Limit from just 1 input pin: HAL config explained
I just tested that with the axis sim and out is never on... gotta run to work now.
JT
JT
Please Log in to join the conversation.
5 years 3 months ago #214576
by BigJohnT
setp lut5.0.function 0x8000
This is the function for the above.
JT
Replied by BigJohnT on topic Home + Limit from just 1 input pin: HAL config explained
I understand that LUT5 will only be TRUE when IN4=FALSE and IN3, IN2, IN1, IN0 are TRUE
setp lut5.0.function 0x8000
This is the function for the above.
Attachment not found
JT
Please Log in to join the conversation.
- fernandosf
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 69
- Thank you received: 0
5 years 3 months ago #214588
by fernandosf
Replied by fernandosf on topic Home + Limit from just 1 input pin: HAL config explained
hum... maybe I've got LUT5 logic wrong.
I was expecting function 0x10000 to be:
but your debug shows LUT5 function to be 0x8000 for that situation.
in fact the difference between both in binary is this:
Could you explain how did you wired sim.axis to simulate this LUT5 output ?
I'm still learning HAL and could not reproduce your screen
I was expecting function 0x10000 to be:
Code:
IN4=FALSE IN3=TRUE IN2=TRUE IN1=TRUE IN0=TRUE
but your debug shows LUT5 function to be 0x8000 for that situation.
in fact the difference between both in binary is this:
Code:
0x8000:
1000 0000 0000 0000
0x10000:
1 0000 0000 0000 0000
Could you explain how did you wired sim.axis to simulate this LUT5 output ?
I'm still learning HAL and could not reproduce your screen
Please Log in to join the conversation.
5 years 3 months ago #214589
by BigJohnT
Replied by BigJohnT on topic Home + Limit from just 1 input pin: HAL config explained
Actually setp lut5.0.function 0x10000 is:
JT
Code:
lut5.0.in-0 Off
lut5.0.in-1 Off
lut5.0.in-2 Off
lut5.0.in-3 Off
lut5.0.in-4 On
lut5.0.out On
Attachment not found
Attachment not found
JT
Please Log in to join the conversation.
- fernandosf
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 69
- Thank you received: 0
5 years 3 months ago #214591
by fernandosf
Replied by fernandosf on topic Home + Limit from just 1 input pin: HAL config explained
I have done this comparison of HAL wiring in sim.axis homing and lut5 homing+limits:
but don't know how to translate to simulated env.
Attachment not found
but don't know how to translate to simulated env.
Please Log in to join the conversation.
Time to create page: 1.124 seconds
