Custom homing procedure
- mariusl
-
Topic Author
- Offline
- Platinum Member
-
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.
- cmorley
- Offline
- Moderator
-
- Posts: 7884
- Thank you received: 2131
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.
- nkp
- Offline
- Premium Member
-
- Posts: 147
- Thank you received: 39
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
Please Log in or Create an account to join the conversation.
- mariusl
-
Topic Author
- Offline
- Platinum Member
-
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 activatedlinuxcnc'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 ?
Regards
Marius
www.bluearccnc.com
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
-
- Posts: 7884
- Thank you received: 2131
Could you use that to move the pin?
Please Log in or Create an account to join the conversation.
- mariusl
-
Topic Author
- Offline
- Platinum Member
-
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.There are pins such as joint.N.homing that indicate when homing starts.
Could you use that to move the pin?
Regards
Marius
www.bluearccnc.com
Please Log in or Create an account to join the conversation.
- Aciera
-
- Away
- Administrator
-
- Posts: 4314
- Thank you received: 1912
Maybe feeding the homing pin signal through a TIMEDELAY component would solve that.I could if it does not stay active during the homing procedure.
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.
Please Log in or Create an account to join the conversation.
- mariusl
-
Topic Author
- Offline
- Platinum Member
-
Regards
Marius
www.bluearccnc.com
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
-
- Posts: 7884
- Thank you received: 2131
From the motion man page:
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.
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.
Please Log in or Create an account to join the conversation.
- mariusl
-
Topic Author
- Offline
- Platinum Member
-
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??
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.
Regards
Marius
www.bluearccnc.com
Please Log in or Create an account to join the conversation.