Custom homing procedure

More
29 Aug 2021 09:04 #219077 by mariusl
I am upgrading an old Mach3 installation with a 7i92 and Linuxcnc using Gmoccapy as GUI.
There is a special procedure that is followed when the machine is homed. This was done in the Mach3 screen. Below is the code that is executed when home all is pressed. 
The rotation axis has n pin that is engaged when the homing cycle begins. This will keep the axis in a known place and is used as the zero. The axis is then moved by some amount to calibrate the position to a true zero.

How would I approach this in Gmoccapy?
Code "G54"
Code "F4000" 

SetFeedRate(2000 /60)

DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
While ismoving()
Wend
DoButton( 8 ) 
DoButton( 9 )
      
Code "G1 A0 F2000"
While ismoving()
Sleep(100)
Wend

ActivateSignal(Output2) 'set the pin
Sleep(500) 

Code "G1 A-180"  ' turn the knife anti-clockwise for a half turn
While ismoving()
Sleep(100)
Wend

DoButton(11)  ' clear the DRO

Code "G1 A-180"  'turn the knife again to make sure of one full turn and lock-up
While ismoving()
Sleep(100)
Wend

DoButton( 11 )  ' do the mach referencing

SetDro(3,270) ' to head the knife in th eright direction
DeActivateSignal(Output2) ' unlock the pin
Code "G1 A0"
Code "G1 X-12"
Code "G1 Y87"
While ismoving()
Sleep(100)
Wend
DoButton( 8 ) 
DoButton( 9 )
Code "G55"
DoButton( 11 )
Code "G54"  

   

Regards
Marius


www.bluearccnc.com

Please Log in or Create an account to join the conversation.

More
29 Aug 2021 20:05 #219120 by cmorley
Replied by cmorley on topic Custom homing procedure
linuxcnc's homing procedure is in fact quite configurable but not customizable.
but is it enough to detect homing is happening, and move the pin with HAL ?

Please Log in or Create an account to join the conversation.

More
30 Aug 2021 04:26 - 30 Aug 2021 04:28 #219143 by nkp
Replied by nkp on topic Custom homing procedure
INI
all axis

HOME_OFFSET = 0
HOME = 0
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_FINAL_VEL = 0
HOME_USE_INDEX = NO
HOME_SEQUENCE = 0



MDI_COMMAND = o<yourcode>call


HAL
net homed axis.2.homed halui.mdi-command-00
(here probably the ladder needs to be used rising edge )




NGC
yourcode.ngc

o<yourcode> sub

...
...

o<yourcode> endsub
Last edit: 30 Aug 2021 04:28 by nkp.

Please Log in or Create an account to join the conversation.

More
30 Aug 2021 06:45 #219146 by mariusl
Replied by mariusl on topic Custom homing procedure

linuxcnc's homing procedure is in fact quite configurable but not customizable.
but is it enough to detect homing is happening, and move the pin with HAL ?

The problem with this approach is that the pin must be released before the homing is done in order for the axis to be set to the offset value. It cannot turn with the pin activated

Regards
Marius


www.bluearccnc.com

Please Log in or Create an account to join the conversation.

More
30 Aug 2021 07:22 #219148 by cmorley
Replied by cmorley on topic Custom homing procedure
There are pins such as joint.N.homing that indicate when homing starts.
Could you use that to move the pin?

Please Log in or Create an account to join the conversation.

More
30 Aug 2021 07:30 #219149 by mariusl
Replied by mariusl on topic Custom homing procedure

There are pins such as joint.N.homing that indicate when homing starts.
Could you use that to move the pin?

I could if it does not stay active during the homing procedure. The problem is that the pin must be released before the axis does the last move to the programmed offset of the home switch. There is no home switch on the rotary axis so they used a pin to lock the turret in a known position and then apply an offset to a calibrated position.

Regards
Marius


www.bluearccnc.com

Please Log in or Create an account to join the conversation.

More
30 Aug 2021 08:48 - 30 Aug 2021 09:04 #219152 by Aciera
Replied by Aciera on topic Custom homing procedure

I could if it does not stay active during the homing procedure.

Maybe feeding the homing pin signal through a TIMEDELAY component would solve that.
linuxcnc.org/docs/2.8/html/man/man9/timedelay.9.html

[edit]
When you say 'turret' is this a tool changer? If so, it might be worth trying to not run it as an actual axis.
Last edit: 30 Aug 2021 09:04 by Aciera.

Please Log in or Create an account to join the conversation.

More
30 Aug 2021 11:39 #219159 by mariusl
Replied by mariusl on topic Custom homing procedure
No it's not a tool changer but a rotary knife that is mounted on a rotating axis. The little collar that holds the knife holder I call the turret.

Regards
Marius


www.bluearccnc.com

Please Log in or Create an account to join the conversation.

More
31 Aug 2021 05:05 #219216 by cmorley
Replied by cmorley on topic Custom homing procedure

There are pins such as joint.N.homing that indicate when homing starts.
Could you use that to move the pin?
I could if it does not stay active during the homing procedure. The problem is that the pin must be released before the axis does the last move to the programmed offset of the home switch. There is no home switch on the rotary axis so they used a pin to lock the turret in a known position and then apply an offset to a calibrated position.
 

From the motion man page:
joint.N.home-state OUT S32 (DEBUG)
              homing state machine state

       joint.N.home-sw-in IN BIT
              Should be driven TRUE if the home switch for this joint is closed

       joint.N.homed OUT BIT (DEBUG)
              TRUE if the joint has been homed

       joint.N.homing OUT BIT
              TRUE if the joint is currently homing

Should be something usable there.
 
The following user(s) said Thank You: nkp

Please Log in or Create an account to join the conversation.

More
31 Aug 2021 07:11 #219225 by mariusl
Replied by mariusl on topic Custom homing procedure

 

From the motion man page:
joint.N.home-state OUT S32 (DEBUG)
              homing state machine state

       joint.N.home-sw-in IN BIT
              Should be driven TRUE if the home switch for this joint is closed

       joint.N.homed OUT BIT (DEBUG)
              TRUE if the joint has been homed

       joint.N.homing OUT BIT
              TRUE if the joint is currently homing

Should be something usable there.
 

Thanks Chris, I missed that one. I think that will be just what I need. I will try and incorporate that into a component that will look at the is_homing signal and apply the pin. After some delay I will set the switch pin to true and remove the pin signal. That should fake the homing cycle, I think??

Regards
Marius


www.bluearccnc.com

Please Log in or Create an account to join the conversation.

Moderators: newbynobiHansU
Time to create page: 0.166 seconds
Powered by Kunena Forum