Hello Guest it is April 19, 2024, 08:53:24 PM

Author Topic: Help with rapid home switch zeroing  (Read 5951 times)

0 Members and 1 Guest are viewing this topic.

Help with rapid home switch zeroing
« on: May 14, 2015, 06:48:58 PM »
Ok so I've been looking all night for an anser to this. It just hit me the other day that it "should" be very simple to have the CNC machine do a rapid move towards the homing switches and just stop like 10 mm shy of the switch. Then slowly do the homing and DRO zero of all axes. How ever, I cant get it to work.

Im using the 2010-screen set and Im editing the VB-script files for the homing buttons for X Y & Z.

So, this is what I've tried.

Code "G53 G0 Z-10"
DoButton(24)
Gode "G53 G0 Z-5"
While IsMoving()
Wend

One would thing that this code would first rapidly go to Z-10 and then rund the "DoButton(24) command. After that do a rapid move to Z-5. But NOOoooOOO!

Im guessing Ive missed something here, or I do not know how the "DoButton()" commands work. But as long as I have a "DoButton()" command anywhere in the code, it will FIRST rund that command. Then everything else.
What am I doing wrong?

Worth to mention, for this to work I have checked "PersistanceDRO" function.

What I want to do, in the end, is, when I push the "Ref all button", I want the CNC machine to do a rapid move to -10 mm from the homing switchen in all three axis, before doing the homing thingy :)

Is this possible? And if yes.. how do I make it so?

Regards
Magnus

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Help with rapid home switch zeroing
« Reply #1 on: May 14, 2015, 07:48:42 PM »
Code "G53 G0 Z-10"
While IsMoving()
Wend

DoButton(24)
While IsMoving()
Wend

Gode "G53 G0 Z-5"
While IsMoving()
Wend

Be careful, because before you home, your machine may not know where Z-10 is.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Help with rapid home switch zeroing
« Reply #2 on: May 14, 2015, 08:41:31 PM »
Just a thought, could you wrap the CODE in a do while loop, set full speed until 2 mm (.2") from 0 then set the rapid speed to 30% OR SO

x=SetOEMDRO(800)
Do While x>2
[place normal code here ]
Exit Do
SetOEMDRO(223)=((GetOEMDRO(223)/100)*30)
[place normal code here]
Loop

regards
Wes
Re: Help with rapid home switch zeroing
« Reply #3 on: May 15, 2015, 12:18:43 AM »
x=SetEOMDRO(800) should be x=GetOEMDRO(800)
 and have a look at my 1024.set page one mod. next to the FRO slider.
it uses * and / to plus and minus the Rapid.
Re: Help with rapid home switch zeroing
« Reply #4 on: May 15, 2015, 04:09:26 AM »
Gerry

Thank you very much for the clarification. And also, thanks for the screenset. It is a beutiful thing :)

I will be carefull. I'm well aware about what "can" happen. But as long as Mach3 dont forget its last possition (which I assume it wont) I think everything will work fine. I have had the CNC-machine for 1½ years now, so Im pretty comfortable in how it works

Thanks again Gerry. I will let you know of my success or failure ;)

Re: Help with rapid home switch zeroing
« Reply #5 on: May 15, 2015, 04:12:46 AM »
Just a thought, could you wrap the CODE in a do while loop, set full speed until 2 mm (.2") from 0 then set the rapid speed to 30% OR SO

x=SetOEMDRO(800)
Do While x>2
[place normal code here ]
Exit Do
SetOEMDRO(223)=((GetOEMDRO(223)/100)*30)
[place normal code here]
Loop

regards
Wes

Hi there Wes

Not sure what this do?  What would be the benifit of doing it this way?
As far as I know, when you call the "DoOEMButton()" command, the CNC machine will slow down to a set %-value in the settings (I do not recall where in the menu you find this).
Or is this code instead of the DoEOMButton command? :D (confused)

Thanks for the reply
Re: Help with rapid home switch zeroing
« Reply #6 on: May 15, 2015, 06:15:27 AM »
The DoButton(24) I assume does a home move, the while ismoving() Wend statement is simply the sequence stopping all other actions till it's finished moving.
So if we get the x DRO co-ordinents (x=GetOEMDRO(800)) then place the do function between a loop that keeps checking the x value (x=GetOEMDRO(800))until it gets to 2 then reduce the rapid to a slower value, place the While IsMoving() Wend statement at the end of the loop.
As I don't have a 2010.set file I'm not sure of the button function.
Have a look at the 1024m screen I put there to see how I have done the slow down. It might help.
Wes
Re: Help with rapid home switch zeroing
« Reply #7 on: May 15, 2015, 07:51:39 AM »
Wes

Ok I see what you mean. I ended up doing something similar but not "as advanced"

This is what I ended up with: (the modified file is for ref all axis M884.m1s)

Code "G53 G0 Z-20"
While IsMoving()
Wend
Code "G53 G1 F2000 Z-5"
While IsMoving()
Wend

Code "G53 G0 Y40 X40"
While IsMoving()
Wend
Code "G53 G1 F4000 Y5 X5"
While IsMoving()
Wend

DoButton(24)
While IsMoving()
Wend

Code "G53 G1 F9000 Z-5"
While IsMoving()
Wend

DoButton(23)
While IsMoving()
Wend

Code "G53 G1 F9000 Y5"
While IsMoving()
Wend

DoButton(22)
While IsMoving()
Wend

Code "G53 G1 F9000 X5"
While IsMoving()
Wend

         
As you can see, I do a rapid move to a "safe" distance from the home switches, then reduce the speed to 4000 mm/min on X & Y axis and to 2000 mm/min on the Z-axis.
It will also always start with Z, so that the machine wont collide with anything that might be laying around on the table.
And it works flawlessly!

Think of all the time I will save now everytime I have to ref my axis  >:D

Thanks again to both of you for your help and ideas :)

Cheers from Sweden


Re: Help with rapid home switch zeroing
« Reply #8 on: May 15, 2015, 08:06:31 AM »
Looks good. And if it works then that's a double winner

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Help with rapid home switch zeroing
« Reply #9 on: May 15, 2015, 03:03:38 PM »
Something to remember When Mach3 first starts up it has NO idea where it is at in 3d space(your machine). So it would be possible if you ran the routine it could slam into the stops at full speed.

I would and do suggest for people to  Refhome the machine at a reasonable safe speed then do a follow up at slow speed.  Besides you only refhome once per machine session right ?  No real time waisted compared to repairs.

Just a thought,

(;-) TP