Using mechanical and ZRI/Proximity switches for homing a lathe

Moderator: cnckeith

martyscncgarage
Posts: 9912
Joined: Tue Mar 28, 2017 12:01 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Location: Mesa, AZ

Using mechanical and ZRI/Proximity switches for homing a lathe

Post by martyscncgarage »

To get very repeatable homing on a lathe using either DMM ZRI or a proximity or hall effect sensor on the leadscrew pulley, and mechanical switches on the homing end of the axis, here is the setup and the cnct.hom file I used:

Z mechanical limit is on input 1
X mechanical limit is on input 2
Z Prox/ZRI is on input 3 (DO NOT ASSIGN IN THE WIZARD)
X Prox/ZRI is on input 4 (DO NOT ASSIGN IN THE WIZARD)

M92 /X L1 ;Move to X+ home switch, back off until it clears.
M105 /X P-4 F3 ;Move X plus at 3ipm until input 4 closes
M26 /X ;Set X home here

M92 /Z L1 ;Move to Z+ home switch, back off until it clears.
M105 /Z P-3 F3 ;Move Z minus at 3ipm until input 3 closes
M26 /Z ;Set Z home here


Once the CNCT.hom file is created, make sure you set the Wizard to Custom Home file so it doesn't overwrite it.

Also, keep a copy your modified .hom file in its own directory so you can copy it into the CNCT directory should you need to, and always have a backup copy of it.
Reminder, for support please follow this post: viewtopic.php?f=20&t=383
We can't "SEE" what you see...
Mesa, AZ
Allin1Chris
Posts: 132
Joined: Wed Jul 31, 2019 12:53 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes

Re: Using mechanical and ZRI/Proximity switches for homing a lathe

Post by Allin1Chris »

In V4.60 Centroid has implemented a ZriHomingAll Input in the wizard that is assignable. This Input still requires the user to edit their home file however. Marty's example above is still a valid method. Multiple Inputs can still be used and is up to the user. Here is an example using ZriHomingAll (all 3 axes wired into single input) for a Mill.

I suggest first setup your settings and I/O in the wizard, and even select "Wizard Generate Home file" and Write settings. Before editing your cncm.hom file your self, you should then change this option to "I will create my own home program" option under Homing and Travel to prevent the wizard from overwriting your edits. This will give you a home sequence setup with you current I/O and will only need to add the Zri Input.

In this setup i used HomeAll on Input 1 and ZriHomeAll on Input 2. You will need to change the #50002 and M105/106 P values to the input you choose in the wizard for your Zri Inputs.

If you are interested in learning to do your own macros please check out Centroid's Introduction to Macros and Mill/Lathe Manuals for description of M and G Codes available to you.

Code: Select all

;Homing Example Using Home Switches and Zri Input.
;ZriHomeAll is Input 2

N100 ;Check for open home switch
IF !#[50000 + #9822] THEN M225 #100 "HomeAll switch tripped!!!\nPlease clear before Homing.\n\nPress Cycle Cancel to end Homing"
IF !#[50000 + #9822] THEN GOTO 100

N200 ;Check for Closed Zri (Zri is Input 2)
IF #50002 THEN M225 #100 "Axis Sitting on Index Pulse!!!\nJog Axis off Index Pulse.\n\nPress Cycle Cancel to End Homing"
IF #50002 THEN GOTO 200

;Disable all limits
M94 /101 /102 /103 /104

;Perform Homing commands
M92/Z L1			;Move Plus to Home Switch
M105/Z P-2 F5		;Move Minus Until Zri Input Closes at 5 in/min
M26/Z			;Set Z Home Position at Index Pulse
M106/Z P2 F5		;Move Plus to Clear Zri Input at 5 in/min

M92/Y L1			;Move Plus to Home Switch
M105/Y P-2 F5  		;Move Minus Until Zri Input Closes at 5 in/min
M26/Y				;Set Y Home Position at Index Pulse
M106/Y P2 F5		;Move Plus to Clear Zri Input at 5 in/min

M91/X L1			;Move Minus to Home Switch
M106/X P-2 F5		;Move Plus Until Zri Input Closes at 5 in/min
M26/X			;Set X Home Position at Index Pulse
M106/X P2 F5		;Move Minus to Clear Zri Input at 5 in/min

G53 X0Y0Z0		;Move Axes to Home Position

;Enable all limits
M95 /101 /102 /103 /104
When requesting support READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043

Please ALWAYS post a FRESH report. To make a report: https://www.youtube.com/watch?v=Ecvg0VJp1oQ.

(We pride ourselves on providing timely solid technical support but, without good information we may not be able to help and/or reply until such information is posted.)

Centroid PLC Tutorial Videos
martyscncgarage
Posts: 9912
Joined: Tue Mar 28, 2017 12:01 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Location: Mesa, AZ

Re: Using mechanical and ZRI/Proximity switches for homing a lathe

Post by martyscncgarage »

When looking at Chris' example, these M code definitions are useful. You have edit his file based on how your machine homes.

M26 Set Axis Home
M91 Move to Minus Home
M92 Move to Plus Home
M94,M95 Output On/Off
M105 Move Minus to Switch
M106 Move Plus to Switch
Reminder, for support please follow this post: viewtopic.php?f=20&t=383
We can't "SEE" what you see...
Mesa, AZ
lavrgs
Posts: 481
Joined: Sat Aug 11, 2018 11:22 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: Yes
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Oregon

Re: Using mechanical and ZRI/Proximity switches for homing a lathe

Post by lavrgs »

Glad I found this, I have held off setting up ZRi because I only have two inputs open. If I can do everything with just one input I'm a happy camper
TCandee
Posts: 110
Joined: Sun Jun 17, 2018 2:42 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: C8FD19F6D5CF-0403180778
DC3IOB: No
CNC11: No
CPU10 or CPU7: Yes

Re: Using mechanical and ZRI/Proximity switches for homing a lathe

Post by TCandee »

Are the zri outputs from the dyn4 run in series like the limit switches on a homeall setup or run in parallel? Asking because I’m having no luck in series.
martyscncgarage
Posts: 9912
Joined: Tue Mar 28, 2017 12:01 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Location: Mesa, AZ

Re: Using mechanical and ZRI/Proximity switches for homing a lathe

Post by martyscncgarage »

TCandee wrote: Sat Nov 05, 2022 1:04 am Are the zri outputs from the dyn4 run in series like the limit switches on a homeall setup or run in parallel? Asking because I’m having no luck in series.
No.
You can run the mechanical limits in series, but ZRI needs its own in put. The control needs to see the individual Index marker pulses for accurate homing.

I would not chance putting the ZRI's in series.

Marty
Reminder, for support please follow this post: viewtopic.php?f=20&t=383
We can't "SEE" what you see...
Mesa, AZ
ShawnM
Posts: 2186
Joined: Fri May 24, 2019 8:34 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 7804734C6498-0401191832
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Clearwater, FL

Re: Using mechanical and ZRI/Proximity switches for homing a lathe

Post by ShawnM »

You wire all ZRI signals in parallel to the same input. Using Chris's example code, after the first axis trips the home switch it then moves away from the home switch in search of the marker pulse. When it hits the marker pulse and the ZRI input set in the wizard closes it sets home. Then that same axis moves off the marker pulse to open or clear the ZRI input. Then it moves on to the next axis to do the same thing. When all axis have homed to the ZRI marker pulse the code then uses G53 to move all axis back to the home position.

This code allows you to use ONE input with all the ZRI marker pulses in parallel.
martyscncgarage
Posts: 9912
Joined: Tue Mar 28, 2017 12:01 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Location: Mesa, AZ

Re: Using mechanical and ZRI/Proximity switches for homing a lathe

Post by martyscncgarage »

ShawnM wrote: Sat Nov 05, 2022 10:47 am You wire all ZRI signals in parallel to the same input. Using Chris's example code, after the first axis trips the home switch it then moves away from the home switch in search of the marker pulse. When it hits the marker pulse and the ZRI input set in the wizard closes it sets home. Then that same axis moves off the marker pulse to open or clear the ZRI input. Then it moves on to the next axis to do the same thing. When all axis have homed to the ZRI marker pulse the code then uses G53 to move all axis back to the home position.

This code allows you to use ONE input with all the ZRI marker pulses in parallel.
Nice!
Reminder, for support please follow this post: viewtopic.php?f=20&t=383
We can't "SEE" what you see...
Mesa, AZ
TCandee
Posts: 110
Joined: Sun Jun 17, 2018 2:42 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: C8FD19F6D5CF-0403180778
DC3IOB: No
CNC11: No
CPU10 or CPU7: Yes

Re: Using mechanical and ZRI/Proximity switches for homing a lathe

Post by TCandee »

Ok that’s what I figured. I did set it up in parallel and the z axis works great but I can’t get the x axis to even home with the mechanical limit using the code in this thread. Tried putting the x axis code first and that did not help. I am set up with home all on input 1 and zrihomeall on 2.

I am basically just a bit past a bench test at this point so I am manually triggering the limit. This is a 2 axis lathe. It goes through the z axis perfectly and moves on to x and triggering the limit doesn’t nothing. I am seeing that the input is triggering. I just get a message that it could not find home after about 5 seconds. I’ll send a report later. Not in the shop at the moment. I copied the code from here but deleted the y axis section.
TCandee
Posts: 110
Joined: Sun Jun 17, 2018 2:42 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: C8FD19F6D5CF-0403180778
DC3IOB: No
CNC11: No
CPU10 or CPU7: Yes

Re: Using mechanical and ZRI/Proximity switches for homing a lathe

Post by TCandee »

here is the report
Attachments
report_3484E41C151B-0601226279_2022-11-05_11-58-17.zip
(761.49 KiB) Downloaded 5 times
Post Reply