Hello Guest it is April 19, 2024, 12:09:51 PM

Author Topic: 5 axis B/C head custom homing script, need help.  (Read 3134 times)

0 Members and 1 Guest are viewing this topic.

5 axis B/C head custom homing script, need help.
« on: October 14, 2013, 10:37:55 AM »
Hi All,

I am building a mini 5 axis gantry mill (my third machine, previous 2 were straight forward 3 axis routers) I will use for making moulds. I am currently trying to figure out how to set up homing for b/c axis. I am thinking of using a hall affect magnetic switch sensors.

I have never done any vb script so I was wandering would it be possible to actually write a homing script for mach3 that would do something like this:

1. rotate axis until it trips the switch on
2. keep rotating until switch is off
3. count the steps between on and off position and divide by 2
4. move this number of steps back
5. set home

Since I am working with a b/c head and not a rotary table set up it is important that the homing routing places b axis parallel to z axis and c axis parallel to y axis. I can machine fixtures for the sensors and targets quite accurately in to actual structure of the head, however sensors have a field over which the target would activate the switch. This script would allow me to measure an arc of movement for the target inside the sensors field. Dividing number of steps it takes for the target to move through the sensors field and having it move this amount of steps back would allow me to place the target precisely over the center of the sensor.

Thanks in advance,

Fedor
Re: 5 axis B/C head custom homing script, need help.
« Reply #1 on: October 17, 2013, 01:44:28 AM »
This is my working homing script for 5 axis table/table machine. It works at head/rotary 5axis too.
This homing Z then Y then X then C then B.
Then scritp return axis to Rotare Zero Position.
Then makes all coordinates = 0.
All u need - just change my numbers to yours.  8)



Code: [Select]
DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
DoButton( 26 )
DoButton( 27 )
While IsMoving ()
Wend
Code "x75.741 f1000"
While IsMoving ()
Wend
Code "y91.0765 f1000"
While IsMoving ()
Wend
Code "c60.05 f500"
While IsMoving ()
Wend
Code "c-89.490 f500"
While IsMoving ()
Wend
DoButton( 7 )