Hello Guest it is June 15, 2019, 07:24:49 PM

Author Topic: Running back to limit switches with G28  (Read 2761 times)

0 Members and 1 Guest are viewing this topic.

Offline SMA

*
  •  68 68
    • View Profile
Running back to limit switches with G28
« on: August 08, 2011, 09:14:55 PM »
Hey All,

So I chased my lost steps on Z around and around until I gave up and came up with a new solution.  Without getting into the problem to much I want to focus on the solution and it is a simple question.

What is the best approach to coding this manouver:

Z only moves back to limit switch touches off it

 It would be inserted at the midpoint of the file at the point we call the crossover.  I like it as it allows Z to find its home position again through touching off a limit switch.  This is due to the fact that home for Z is the position just off the limit switch or 0.

I have tried G28 Z0 but that did not work as I observed that the switch is not triggered.  Do I need to lose the 0 after Z?

I quick second question is this:  Would installing Mach in H: instead of C: cause lost steps?  My C: is partitioned for linux.

Thanks
Stefan

 

G28 is not doing it.  With G28 Z0 moves back to Zero position and that is it but does not trigger limit switch.  Maybe I should not have the zero in there?

Offline BR549

*
  •  6,871 6,871
    • View Profile
Re: Running back to limit switches with G28
« Reply #1 on: August 08, 2011, 09:23:33 PM »
G28 only "moves" to the Home position as defined in config. Usually Z0.0000 IF you want to RefHome (send it to the home switch and back off then reset Zhome) the Z then use G28.1.

You need to FIX the lost Z steps problem not try to MASK it . Masking will only work IF you know where the break even point will be in the Gcode before it gets out of hand. That in reality could be ANYWHERE. SO how would you know it is time to refhome again???

Just a thought, (;-)

Offline SMA

*
  •  68 68
    • View Profile
Re: Running back to limit switches with G28
« Reply #2 on: August 08, 2011, 09:36:40 PM »
Hey BR549,

Thanks for the reply.

I do agree that I would prefer to find out why I am losing steps but I have spent a ton of time slowing things down, speeding them up, swapping drives, hunting down binds, re-installing MACH, re-installing MACH on a different computer, checking all wires, etc etc etc..... 

This I believe will be a good solution.  I am making surfboards.  The problem is the machine cuts one half of the board, then goes through a crossover process which requires Z to return to Z0.00 which of course is it's home postion (which is about 9mm off the limit switch) then roll back out and cut the other half of the board.  Z never gets up to Z0.00 but rather comes up short by 3mm everytime.  This is the only time it seems to lose steps since at the end of the file Z is out only the 3mm.

The solution is to make home for Z just off the limit switch.  I was hoping for a command that would require Z to trigger the limit switch.  One half of the board will be cut, Z will return to limit switch touch off it and be at Z0.00.  It is a way of Z "finding" itself and I think it is acutually pretty conventional..no?

Bad Idea? 

Offline SMA

*
  •  68 68
    • View Profile
Re: Running back to limit switches with G28
« Reply #3 on: August 08, 2011, 09:38:49 PM »
So would it be

G28.1 Z0?  I only want Z to do this due to the fact it is the only axis losing steps.

S

Offline BR549

*
  •  6,871 6,871
    • View Profile
Re: Running back to limit switches with G28
« Reply #4 on: August 08, 2011, 09:58:51 PM »
First you set up the limited switch to be a Zhome as well as the Zlimit. Set the Zhome in pins and ports to the SAME pins and port as the Z+limit. Don't wory MACH will know the difference.

Now when you want to RefHome Z issue a G28.1 Z0.000.  The Z will Retract back to the switch then back off the switch and reset Zhome to Zero.  Make sure that you set up Zhome to Zero itself it is in the Setup section where you set teh pins and port.

NOW a note. IF you use the Zhome as a refernce you WILL have to Refhome when you first start up the machine. Tht way each time you rereference home it will allow the" WORK "home to be the Same point.

IF you do not refhome on start up AND set up the board to cut and set your Work home 0,0,0 to the part when you do the Zrefhome at midpoint your Work Z0 point may not be the same.

The refhome tells MACH where it is in 3d space in relation to your machine. IF you do not do a physical Refhome at startup then MACH will assume Machine Zero to be at the location where it currently sits.

You do NOT have to refhome MACH for it to work correctly ONLY to insure it knows where it is at a SET relation to the TABLE where your part is attached.  If Mach sets "itself" on startup up then YOU refhome at midpoint then MACH will NOT remember where your part was when you started. It will go to where it thinks it is NOW.

Clear as Mudd ??

IF you list what you have tried to fix the lost steps maybe someone here has the solution to the problem.

Does the value ALWAY stay the same no matter how big the program is?
Does it do it WITH the SPINDLE off and run the program?


 (;-) TP
« Last Edit: August 08, 2011, 10:03:07 PM by BR549 »

Offline SMA

*
  •  68 68
    • View Profile
Re: Running back to limit switches with G28
« Reply #5 on: August 08, 2011, 11:02:28 PM »
To answer your questions first although I am reluctant since I have been told not to start a new post but rather to continue with the old post which was in regards to lost steps (new to forums as well as CnC).

Yes it is the same value every time no matter the size of the file but only happens on the top cut of the board and not the bottom?

Yes I have run the file without the router running.  Actually most of the testing I did was with the router off so I didn't have to listen to it !

I understood much of what you explained (and thanks for taking the time).  I think that I have things set up a little different since I use the Load Material Button with code behind it that:

1. sends z to limit then x and y together.
2.  runs back out to offsets in diagnostics screen called Set Material Load Positions.(which Z is 0.000 now)

and this is called home for me. 

I tried G28.1 Z0 and it worked for my quick little test file (just wanted to be sure it was triggering the switch) now I will try it on a board file. 

I start the day by homing all axis and more often than not home after every board as it does this while I am dealing with the freshly cut board.

Sound reasonable... :-\

Offline BR549

*
  •  6,871 6,871
    • View Profile
Re: Running back to limit switches with G28
« Reply #6 on: August 09, 2011, 01:44:55 AM »
As long as it works for you(;-). 

IF the machine always loses the same amount independent of file size or whether the spindle is on or off then I don't think it is necessarily your machine. Normally the more you run it the more it looses. AND it should loose SOME on both sides Might want to check your Gcode carefully and make sure you don't have any strange offsets floating around in the machine setup.

Just a thought, (;-) TP