Limits override on start up.

More
07 Oct 2020 15:56 - 07 Oct 2020 16:07 #185264 by ajsinfotech
Thanks Mike for joining!

1. Are your switches independend or dasy chained?

Daisy chained. Limit/home shared.

2. Can you confirm that each switch shows his value reliable in hal?

I can confirm the switch is working ok in halshow.

3. Do all of them react the same way, means signal gets f.x. true when triggered?

I have just one switch connected to test right now. I have 3 axis (x-y-z) and I will use just 3 limit/home shared switchs daisy chained (series connection).
When limit switch trips, led halshow lit.

4. Is your hal written to accept the signals non inverted.?

I didn't need to use any inverted signal in the HAL at all. I always try to avoid this kind of inverted signals whenever is possible.

5. Are your switches ate the end of your movement, or can your machine be outside?

I am testing the whole electronic box separately. It is not installed in the machine yet. I simply press the limit switch by hand to test.


linuxcnc.org/docs/2.8/html/config/ini-homing.html
I am using scheme 4. Shared Limit/Home Switch Example Layout

I try to discriminate the all-limit-home signals by axis as Aciera recommends:

Those need to be separate like "all-limit-home-x", "all-limit-home-y", "all-limit-home-z".


In my last try I even discriminate just home signals this way:
#------------------------------------------------------------------------------
# Digital IO's
#------------------------------------------------------------------------------
# IO Pin 003 (P1-04): IOPort
net		all-limit-home			<=	hm2_7c81.0.gpio.003.in
.
.
.
# Setup home/limit switch signals
net		all-limit-home		=>	and2.0.in0		
net		homing0-x1		=>	and2.0.in1	<=	joint.0.homing	
net		limit-home-x		<=	and2.0.out	
net		limit-home-x		=>	joint.0.home-sw-in
net		limit-home-x		=>	joint.0.pos-lim-sw-in

And it works as I expected (tested in halshow), but I don't know if it is the way the linuxcnc expect.

My tests:

Test 1:
- Limit switch not pressed.
- Click home-x button
- Axis x starts to run from left to right (to the center of the machine, not to the origin).
- When I press the limit switch the tool comes back to the origin and sits about 10mm right from zero and I get: Home switch inactive before start of latch move j=0.

Test 2:
- Limit switch pressed before I click home-x button.
- The axis does not move at all.
- When I hit the switch I get: Hit limit in home state 5

Test 3:
- I did the same as Test 1 but changing speed signs in HOME_SEARCH_VEL and HOME_LATCH_VEL parameters:
#HOME_IGNORE_LIMITS = NO
#HOME_USE_INDEX = NO
#HOME_OFFSET = -1.0
#HOME = 3.0
#HOME_SEARCH_VEL = 30.0
#HOME_LATCH_VEL = -10.0
#HOME_SEQUENCE = 0

HOME_IGNORE_LIMITS = NO
HOME_USE_INDEX = NO
HOME_OFFSET = -1.0
HOME = 3.0
HOME_SEARCH_VEL = -30.0
HOME_LATCH_VEL = 10.0
HOME_SEQUENCE = 0

- Same behavior and error like Test 1, just opposite direction movement.

I tried to post some photos/video but I have some technical issues.

If you need any other test just tell me.

Thanks
Last edit: 07 Oct 2020 16:07 by ajsinfotech.

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

More
07 Oct 2020 16:13 - 07 Oct 2020 16:21 #185269 by Aciera
Replied by Aciera on topic Limits override on start up.
OK.

I try to discriminate the all-limit-home signals by axis as Aciera recommends:

Those need to be separate like "all-limit-home-x", "all-limit-home-y", "all-limit-home-z".

I did not realize you had your home/limit switches daisy chained, I am sorry.

I don't have much time right now but here is an old thread about homing with shared homing/limit switches:

forum.linuxcnc.org/38-general-linuxcnc-q...it-switches?start=20
Last edit: 07 Oct 2020 16:21 by Aciera.

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

More
07 Oct 2020 16:16 #185272 by ajsinfotech
Test 4:

I also comment this line and test it as case Test 1:
#net		limit-home-x		=>	joint.0.pos-lim-sw-in

Exactly same behavior like Test 1.

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

More
07 Oct 2020 16:23 #185274 by Aciera
Replied by Aciera on topic Limits override on start up.
See my edit above. Also be aware that trying to simulate the home/limit button by hand my be tricky.

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

More
07 Oct 2020 16:29 #185275 by Mike_Eitel
I do not understand your and2 constrution. What do you want to archive? In opinion you should just use the input.

I would use very low speeds as you are slower than a machine driven switch

If your construction foresees the switch go true when reached: You must invert home_search_vel direction by changing sign. When you ask for homing, an axis must move towards switch.Test 1 shows your error, test 2 is the proof.

When you jog the axis, does it move correct direction. Means when commanding positive x it is usual that x axis table moves to the left. I'm old fashioned and personaly run in positive scale values as i dislike double - thinking. If it runs wrong i change two wires of the motor, or if that is not so easy i invert the dir signal of the driver.

So adapt and redo with test 1. If it moves right, d3cide wisched behavior according figure 3

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

More
07 Oct 2020 20:59 - 07 Oct 2020 20:59 #185304 by newbynobi
As I mentioned in a previous post, pressing the button by hand may result in race conditions between machine and human reactions.

Try following:
PRESS HOME X
While the motor is moving, press the limit switch,
As soon as the motor change direction leave the limit switch free, so stop pressing it.

Is the axis now homed?

Norbert
Last edit: 07 Oct 2020 20:59 by newbynobi.

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

More
22 Oct 2020 23:46 - 22 Oct 2020 23:58 #186943 by ajsinfotech
Hi everybody!

Sorry I'm late but I was doing my last mechanical tunes.

Aciera

See my edit above. Also be aware that trying to simulate the home/limit button by hand my be tricky handle

Yes, maybe the tricky part are all the signals that motion module handle and sample at the same time.

Mike_Eitel

I do not understand your and2 constrution

It is to discriminate limit/home switches just to home when homing.

If your construction foresees the switch go true when reached: You must invert home_search_vel direction by changing sign.

Yes, you are right. But in this case does not matter. To test is the same.

newbynobi

As I mentioned in a previous post, pressing the button by hand may result in race conditions between machine and human reactions.

Well... IMHO it is not a "race condition" I think. But one can easily get confused with that.
The tricky part is that motion module appears to be sampling/driving signals at the same time (probably multi-threading). And the problem is when motion detects the home switch tripped, at the same time is checking the limit switches (and it is still pressed, no matter if you do it by hand or not). Remember I am sharing all the limits/homes. That's why I was trying to use the and2 construction, just to discriminate the home event from the limit switch event.

Another thing that can add lots of confusion is a slower CPU. Events get delayed are almost impossible to follow.

I was a bit wandering around but finally I made it :woohoo:

Now my script:
.
.
.
net		logic-out			<=	logic.0.or => not.0.in
net		no-homing			<=	not.0.out
.
.
.
# Setup home/limit switch signals
net		all-limit-home		=>	and2.0.in0		
net		homing-0			=>	and2.0.in1	<=	joint.0.homing	
net		home-x				<=	and2.0.out	
net		home-x				=>	joint.0.home-sw-in

net		homing-0			=>	logic.0.in-00

net		all-limit-home		=>	and2.3.in0
net		no-homing			=>	and2.3.in1
net		limit-x				<=	and2.3.out	
net		limit-x				=>	joint.0.pos-lim-sw-in
.
.
.
# Setup home/limit switch signals
net		all-limit-home		=>	and2.1.in0		
net		homing-1			=>	and2.1.in1	<=	joint.1.homing	
net		home-y				<=	and2.1.out	
net		home-y				=>	joint.1.home-sw-in

net		homing-1			=>	logic.0.in-01

net		all-limit-home		=>	and2.4.in0
net		no-homing			=>	and2.4.in1
net		limit-y				<=	and2.4.out	
net		limit-y				=>	joint.1.pos-lim-sw-in
.
.
.
# Setup home/limit switch signals
net		all-limit-home		=>	and2.2.in0		
net		homing-2			=>	and2.2.in1	<=	joint.2.homing	
net		home-z				<=	and2.2.out	
net		home-z				=>	joint.2.home-sw-in

net		homing-2			=>	logic.0.in-02

net		all-limit-home		=>	and2.5.in0
net		no-homing			=>	and2.5.in1
net		limit-z				<=	and2.5.out	
net		limit-z				=>	joint.2.pos-lim-sw-in
.
.
.

And it perfectly works for me :)

Thanks to all of you for your support and patience!!!
Last edit: 22 Oct 2020 23:58 by ajsinfotech.

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

More
23 Oct 2020 17:54 - 23 Oct 2020 17:55 #187009 by ajsinfotech
Hi

It's me, again...

I was doing some housekeeping trying to get a clean environment but unfortunately I break something.
Everything works fine but when gmoccapy starts gave me this 2 annoying messages at startup:

- can't open None
- Unable to open file <None>

Here is my log:
**** arrange JOG button
less than 6 axis
/home/pi/linuxcnc/bin/gmoccapy:325: GtkWarning: Invalid icon size 48
  self.widgets.window1.show()
emc/task/emctask.cc 395: interp_error: Unable to open file <None>
Unable to open file <None>
can't open None
**** GMOCCAPY INFO ****
**** Invalid embedded tab configuration ****
**** No tabs will be added! ****
**** GMOCCAPY INFO ****
**** no audio available! ****
**** PYGST libray not installed? ****
**** is python-gstX.XX installed? ****


Thanks
Last edit: 23 Oct 2020 17:55 by ajsinfotech.

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

More
25 Oct 2020 14:38 #187190 by newbynobi
Open Settings page and check if there is selected a file to be loaded during start. If so, select none and restart GUI.

Norbert

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

More
25 Oct 2020 15:12 #187195 by ajsinfotech
Thanks Norbert!

I always set this option to None. I set it with a new file and then set it to None again to force a recycle but no luck.

I create a brand new gmoccapy configuration and then apply my scripts over it and runs like a charm! :)

Maybe I missed something while I had been doing the housekeeping, I don't know, but it is great you could do a fresh start, then copy the new files and the app starts ok. :)

Thanks Norbert

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

Moderators: newbynobiHansU
Time to create page: 0.138 seconds
Powered by Kunena Forum