Which, BTW, will be exactly as accurate as setting the zero when the switch actually opens. The number of steps the machine takes after the switch opens will be exactly the same, as long as the home velocity and acceleration do not change.
Regards,
Ray L.
Hi Ray!
And here you see one point. I don't want to be fixed on the speed and acceleration settings while I may improve my machine. That's the one thing. And the second, if you are closer to the switch as needed for accel to full speed, you will get different results. That is simply not perfect but easy to change.
I got a very fast answer from Andrew. He will think about changing the code and if he does it may not stand at the top of his list.
He advised me to use a macro, and I'm going to write one but I first have to learn more VB and how it is working with Mach3.
Here is the structure I will follow:
struct x (homingDir,homingSpeed,maxSpeed,resolution,signal,homing button)
struct y (homingDir,homingSpeed,maxSpeed,resolution,signal,homing button)
struct z (homingDir,homingSpeed,maxSpeed,resolution,signal,homing button)
struct u (homingDir,homingSpeed,maxSpeed,resolution,signal,homing button) //universal
//reading the homing config
set the variables with the values in the config
//reading motor tuning config
set the variables with the values in the config
//reading ports and pins config
set the variables with the values in the config
x(homing button) =1022
y(homing button) =1023
z(homing button) =1024
u=z //copy the set of variables
do homing
reset coordinate
u=y
do homing
reset coordinate
u=x
do homing
reset coordinate
End program
subroutine homing
while u(signal)// make sure the switch is released
move axis inverted(u(homingDir) about u(resolution)
end while
dooembutton (u(homing button)) //to get fast to the switch or something to make the axis move til the switch is hit
while not u(signal)// closing the switch
move axis u(homingDir) about u(resolution)
end while
while u(signal)// release the switch
move axis inverted(u(homingDir) about u(resolution)
end while
move axis inverted(u(homingDir) about 1mm //clear jitter area
end subroutine
I don't know if the function struct is part of VB, and if it is possible to get the value of the switches.
With this macro the homingpoint will never change unless you change the resolution of your axes.
I even don't know if it is worth the time and power to write such a macro.
Burkhard