Homing procedure

Here is where you can request new features or special features.

Re: Homing procedure

Postby RsX » Thu Mar 13, 2025 5:29 pm

Hello El Ventu, sorry I did not think of that issue with all the switches tied together :roll:
try this and please check carefully the direction of the back off moves

Code: Select all
exec.AddStatusmessage( "!!!Double Homing Started!!!" );
DoubleHoming(Config.Z);
exec.Code("G00 Z-20"); // Move Z away from proximity
while (exec.IsMoving()) { }
DoubleHoming(Config.X);
exec.Code("G00 X20"); // Move X away from proximity
while (exec.IsMoving()) { }
DoubleHoming(Config.Y);
exec.Code("G00 X0 Y0 Z0"); // Move all axis back to zero
while (exec.IsMoving()) { }
exec.AddStatusmessage( "!!!Double Homing Finished!!!" );
User avatar
RsX
 
Posts: 77
Joined: Fri Oct 25, 2024 9:22 pm

Re: Homing procedure

Postby El Ventu » Thu Mar 13, 2025 7:38 pm

cncdrive wrote:First: You can execute a movement after the homing finished with the exec.Code("G1 ... Fxxx"); in your macro to make the axis move back to whatever point you want.

Second: You have to save the screenset, there is a button for that in the screen editor window.


Thank you!
Today we tried and we solved the issue, modifying the macro adding a line to modify the back off distance and the zeroing point for every step.
Since we never programmed in C# we thought that it was more difficult.
Also we found the screenset saving lack in our process!

Today I did not have an USB stick or a cable to connect the phone to the PC to copy the macro and posting it here for potential future users, but tomorrow I try to remember that...
El Ventu
 
Posts: 19
Joined: Wed Mar 06, 2024 8:44 am

Re: Homing procedure

Postby El Ventu » Thu Mar 13, 2025 7:41 pm

RsX wrote:Hello El Ventu, sorry I did not think of that issue with all the switches tied together :roll:
try this and please check carefully the direction of the back off moves

Code: Select all
exec.AddStatusmessage( "!!!Double Homing Started!!!" );
DoubleHoming(Config.Z);
exec.Code("G00 Z-20"); // Move Z away from proximity
while (exec.IsMoving()) { }
DoubleHoming(Config.X);
exec.Code("G00 X20"); // Move X away from proximity
while (exec.IsMoving()) { }
DoubleHoming(Config.Y);
exec.Code("G00 X0 Y0 Z0"); // Move all axis back to zero
while (exec.IsMoving()) { }
exec.AddStatusmessage( "!!!Double Homing Finished!!!" );

Thank you!
We solved that modifying the back off distance in the macro for every step as I wrote in the last post!
You have no reason to be sorry at all, if you come in our area you have some beers paid! ;)
El Ventu
 
Posts: 19
Joined: Wed Mar 06, 2024 8:44 am

Re: Homing procedure

Postby El Ventu » Fri Mar 14, 2025 10:57 pm

RsX wrote:Hello El Ventu, sorry I did not think of that issue with all the switches tied together :roll:
try this and please check carefully the direction of the back off moves

Code: Select all
exec.AddStatusmessage( "!!!Double Homing Started!!!" );
DoubleHoming(Config.Z);
exec.Code("G00 Z-20"); // Move Z away from proximity
while (exec.IsMoving()) { }
DoubleHoming(Config.X);
exec.Code("G00 X20"); // Move X away from proximity
while (exec.IsMoving()) { }
DoubleHoming(Config.Y);
exec.Code("G00 X0 Y0 Z0"); // Move all axis back to zero
while (exec.IsMoving()) { }
exec.AddStatusmessage( "!!!Double Homing Finished!!!" );

Hello!
I found a potential dangerous issue.
When homing with this routine, if the proximity isn't functioning properly, the mechanical switch isn't taken in account.

A friend of mine (a very skilled programmer) that was here today suggested to ask for the homing routine (we can't find it, maybe it's embedded in the program?), since with that he can develop a correct macro.

Also, any suggestions to avoid the issue?

Thanks!
Davide
El Ventu
 
Posts: 19
Joined: Wed Mar 06, 2024 8:44 am

Re: Homing procedure

Postby El Ventu » Sat Mar 15, 2025 10:03 am

Thinking about how to solve that, I'm wondering if it is possible to, during the approaching routine to the proximities, to check both the proximities and the mechanical ones status.
And maybe if the proximity isn't triggered before of the mechanical one, to stop the routine with an alarm who ask to check the proximity.
El Ventu
 
Posts: 19
Joined: Wed Mar 06, 2024 8:44 am

Re: Homing procedure

Postby RsX » Sun Mar 16, 2025 10:04 am

Hello, glad to hear it is working.
I think I might have a solution for taking into account both switches, but I need more info about them.
What kind of proximity switches are you using? NPN, PNP? Voltage?
What kind of micro switches are you using? NO, NC?

The homing procedure is built into the AXBB-E, same as the probing procedure.
So we have to be clever in connecting the switches to the AXBB-E and try to solve the issue on hardware level.
User avatar
RsX
 
Posts: 77
Joined: Fri Oct 25, 2024 9:22 pm

Re: Homing procedure

Postby El Ventu » Sun Mar 16, 2025 10:43 am

RsX wrote:Hello, glad to hear it is working.
I think I might have a solution for taking into account both switches, but I need more info about them.
What kind of proximity switches are you using? NPN, PNP? Voltage?
What kind of micro switches are you using? NO, NC?

The homing procedure is built into the AXBB-E, same as the probing procedure.
So we have to be clever in connecting the switches to the AXBB-E and try to solve the issue on hardware level.
RsX wrote:Hello, glad to hear it is working.
I think I might have a solution for taking into account both switches, but I need more info about them.
What kind of proximity switches are you using? NPN, PNP? Voltage?
What kind of micro switches are you using? NO, NC?

The homing procedure is built into the AXBB-E, same as the probing procedure.
So we have to be clever in connecting the switches to the AXBB-E and try to solve the issue on hardware level.

Hello!
Since I'm dumb, I bought too many three wires NPN NC switches to think to buy other PNP ones.
All of them are 10~30VDC.

So my trusted retired electronic/electrician solved the issue with a tailor made circuit board with some optoisolators and a relay who open the contact when one or more of the proximity is activated... :roll:
Since it isn't a precision thing, the relay is ok.

I saw that the homing procedure is embedded, that's why my friend asked for some code to be worked with.

Adding hardware to solve the issue...?

Well, it can be a matter of adding another relay to put the proximity relay circuit in series with the microswitch until the proximity relay is activated...?
El Ventu
 
Posts: 19
Joined: Wed Mar 06, 2024 8:44 am

Re: Homing procedure

Postby RsX » Sun Mar 16, 2025 11:43 am

El Ventu wrote:So my trusted retired electronic/electrician solved the issue with a tailor made circuit board with some optoisolators and a relay who open the contact when one or more of the proximity is activated... :roll:

None of this is really needed :?

El Ventu wrote:Well, it can be a matter of adding another relay to put the proximity relay circuit in series with the microswitch until the proximity relay is activated...?

Yes, something like this :D

Here is the schematic for a NPN NC proximity switch and a NC microswitch

schematic.png


The idea is to have the micro switch always connected and acting as a safety during the proximity homing.
During the proximity homing we deactivate the relay so we have both switches in series.
If the proximity isn't triggered, the micro will be and the machine will stop from crashing.

During the precision homing the relay is activated, by-passing the proximity and effectively excluding it from the circuit.
Now if the micro works everything will be fine. But if it won't there is nothing the proximity can do to save the machine from crashing, because the proximity comes before the micro during the travel and will be triggered all the time while we are searching for the micro.
To solve this maybe you can use 2 micros in series adding redundancy.
User avatar
RsX
 
Posts: 77
Joined: Fri Oct 25, 2024 9:22 pm

Re: Homing procedure

Postby El Ventu » Tue Mar 18, 2025 11:48 pm

RsX wrote:
El Ventu wrote:So my trusted retired electronic/electrician solved the issue with a tailor made circuit board with some optoisolators and a relay who open the contact when one or more of the proximity is activated... :roll:

None of this is really needed :?

El Ventu wrote:Well, it can be a matter of adding another relay to put the proximity relay circuit in series with the microswitch until the proximity relay is activated...?

Yes, something like this :D

Here is the schematic for a NPN NC proximity switch and a NC microswitch

schematic.png


The idea is to have the micro switch always connected and acting as a safety during the proximity homing.
During the proximity homing we deactivate the relay so we have both switches in series.
If the proximity isn't triggered, the micro will be and the machine will stop from crashing.

During the precision homing the relay is activated, by-passing the proximity and effectively excluding it from the circuit.
Now if the micro works everything will be fine. But if it won't there is nothing the proximity can do to save the machine from crashing, because the proximity comes before the micro during the travel and will be triggered all the time while we are searching for the micro.
To solve this maybe you can use 2 micros in series adding redundancy.


It seems that we solved the issue in this way.
If the proximity doesn't work, the precise microswitch becomes an E-Stop.
Code: Select all
Config_ Config = new Config_{
 //X Axis
 X = new AxisConfig{ AxisName = "X",
      //Inputs
      ProximityPin = new Setting{ Value = 1, ScreenField = 5},
      ProximityPort = new Setting{ Value = 2, ScreenField = 245},
      MicroPin = new Setting{ Value = 2, ScreenField = 5},
      MicroPort = new Setting{ Value = 2, ScreenField = 245},
      EstopPin = new Setting{ Value = 2, ScreenField = 91},
      EstopPort = new Setting{ Value = 2, ScreenField = 271},
      HomePin = new Setting{ Value = 0, ScreenField = 91},
      HomePort = new Setting{ Value = 0, ScreenField = 271},
      //Feedrates
      FastHomingUp = new Setting{ Value = 1000, ScreenField = 6},
      FastHomingDown = new Setting{ Value = 250, ScreenField = 15},
      FastHomingBack = new Setting{ Value = 0, ScreenField = 2621},
      SlowHomingUp =  new Setting{ Value = 50, ScreenField = 6},
      SlowHomingDown = new Setting{ Value = 10, ScreenField = 15},
      SlowHomingBack = new Setting{ Value = 5, ScreenField = 2621},
      //Buttons
      HomingButton = 107
 },
 //Y Axis
 Y = new AxisConfig{ AxisName = "Y",
      //Inputs
      ProximityPin = new Setting{ Value = 1, ScreenField = 20},
      ProximityPort = new Setting{ Value = 2, ScreenField = 250},
      MicroPin = new Setting{ Value = 2, ScreenField = 20},
      MicroPort = new Setting{ Value = 2, ScreenField = 250},
      EstopPin = new Setting{ Value = 2, ScreenField = 91},
      EstopPort = new Setting{ Value = 2, ScreenField = 271},
      HomePin = new Setting{ Value = 0, ScreenField = 91},
      HomePort = new Setting{ Value = 0, ScreenField = 271},
      //Feedrates
      FastHomingUp = new Setting{ Value = 1000, ScreenField = 21},
      FastHomingDown = new Setting{ Value = 250, ScreenField = 30},
      FastHomingBack = new Setting{ Value = 0, ScreenField = 2622},
      SlowHomingUp =  new Setting{ Value = 50, ScreenField = 21},
      SlowHomingDown = new Setting{ Value = 10, ScreenField = 30},
      SlowHomingBack = new Setting{ Value = 3, ScreenField = 2622},
      //Buttons
      HomingButton = 108
 },
 //Z Axis
 Z = new AxisConfig{ AxisName = "Z",
      //Inputs
      ProximityPin = new Setting{ Value = 1, ScreenField = 35},
      ProximityPort = new Setting{ Value = 2, ScreenField = 255},
      MicroPin = new Setting{ Value = 2, ScreenField = 35},
      MicroPort = new Setting{ Value = 2, ScreenField = 255},
      EstopPin = new Setting{ Value = 2, ScreenField = 91},
      EstopPort = new Setting{ Value = 2, ScreenField = 271},
      HomePin = new Setting{ Value = 0, ScreenField = 91},
      HomePort = new Setting{ Value = 0, ScreenField = 271},
      //Feedrates
      FastHomingUp = new Setting{ Value = 500, ScreenField = 36},
      FastHomingDown = new Setting{ Value = 250, ScreenField = 45},
      FastHomingBack = new Setting{ Value = 0, ScreenField = 2623},
      SlowHomingUp =  new Setting{ Value = 50, ScreenField = 36},
      SlowHomingDown = new Setting{ Value = 10, ScreenField = 45},
      SlowHomingBack = new Setting{ Value = -3, ScreenField = 2623},
      //Buttons
      HomingButton = 109
 }
};


exec.AddStatusmessage( "!!!Double Homing Started!!!" );
DoubleHoming(Config.Z);
DoubleHoming(Config.X);
DoubleHoming(Config.Y);
exec.AddStatusmessage( "!!!Double Homing Finished!!!" );


#Events

int ApplysettingsButton = 168;

struct Setting {
 public double Value;
 public int ScreenField;
}

struct AxisConfig {
 public string AxisName;
 //Proximity Input
 public Setting ProximityPin;
 public Setting ProximityPort;
 public Setting EstopPin;
 public Setting EstopPort;
 public Setting MicroPin;
 public Setting MicroPort;
 public Setting HomePin;
 public Setting HomePort;
 //Feedrates
 public Setting FastHomingUp;
 public Setting FastHomingDown;
 public Setting FastHomingBack;
 public Setting SlowHomingUp;
 public Setting SlowHomingDown;
 public Setting SlowHomingBack;
 //Buttons
 public int HomingButton;
}

struct Config_{
 public AxisConfig X;
 public AxisConfig Y;
 public AxisConfig Z;
}

void DoubleHoming(AxisConfig AC)
{
 //Fast homing
 exec.AddStatusmessage( "- Fast Homing " + AC.AxisName + " Axis -");
 //set proximity as home sensor
 setFieldValue(AC.ProximityPin);
 setFieldValue(AC.ProximityPort);
 setFieldValue(AC.EstopPin);
 setFieldValue(AC.EstopPort);
 //set fast feedrates
 setFieldValue(AC.FastHomingUp);
 setFieldValue(AC.FastHomingDown);
 setFieldValue(AC.FastHomingBack);
 //Applysettings
 exec.Callbutton(ApplysettingsButton);
 //home axis
 exec.Callbutton(AC.HomingButton);
 while(exec.IsMoving()){}
 
 //Slow homing
 exec.AddStatusmessage( "- Slow Homing " + AC.AxisName + " Axis -");
 //set precision switch as home sensor
 setFieldValue(AC.MicroPin);
 setFieldValue(AC.MicroPort);
 setFieldValue(AC.HomePin);
 setFieldValue(AC.HomePort);
 //set slow feedrates
 setFieldValue(AC.SlowHomingUp);
 setFieldValue(AC.SlowHomingDown);
 setFieldValue(AC.SlowHomingBack);
 //Applysettings
 exec.Callbutton(ApplysettingsButton);
 //home axis
 exec.Callbutton(AC.HomingButton);
 while(exec.IsMoving()){}
}

void setFieldValue(Setting s){
 AS3.Setfield(s.Value, s.ScreenField);
 AS3.Validatefield(s.ScreenField);
}
El Ventu
 
Posts: 19
Joined: Wed Mar 06, 2024 8:44 am

Previous

Return to Feature Request

Who is online

Users browsing this forum: No registered users and 1 guest