Hello Guest it is April 23, 2024, 09:03:40 AM

Author Topic: homing my rotational axis  (Read 20325 times)

0 Members and 1 Guest are viewing this topic.

homing my rotational axis
« on: June 20, 2008, 08:18:42 AM »
Hello all,
I have been working on my machine...
x axis is linear
a axis is rotational
b axis is irrelevant as it has no limit switches
(basically movement only occuring in the x and a axis as the b axis is being used to dispense material)

my question is this...is it possible to make my a axis home in the shortest angular direction?

now i have the shortest angular rot on GO checked...and upon the m30 rewind...the a axis is moving the shortest route

but when i estop the process and press the home switch, it moves at a crawl in the long angular direction...

my goal is to try and speed up the whole homing process...

any ideas?

thanks,
Danny A

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: homing my rotational axis
« Reply #1 on: June 20, 2008, 08:33:05 AM »
What about jogging the axis to near your home switch and then pressing the Home button? Homing speed is set in the homing and limits and you could set it to 100% for that axis if you wanted.
 Hood
Re: homing my rotational axis
« Reply #2 on: June 20, 2008, 08:44:42 AM »
Thanks Hood...totally did not think of that
That A axis was set at 30% so i was able to gain some speed by upping that value...

I was thinking about the way i have the homing switch set up....
It is configured to home in the reverse direction, and the limit switch is also configured for this setup...
I was thinking i might be able to reconfigure my limit switch and homing direction to always home positive, but this would in turn cause the same issue on a program which ended on a low angle like 20 degrees etc...

I guess my question is...is there any simple switch i can configure that performs the "shortest angular rotation on GO" but only on HOME?

If not i suppose i will just have to settle with toggling the percentages.

Thanks for the quick feedback, you guys are great!

-Danny A

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: homing my rotational axis
« Reply #3 on: June 20, 2008, 08:54:13 AM »
Dont think there is but dont have any experience with using a roational axis other than using it as a spindle on the coil winder. Hopefully someone who uses a 4th axis will jump in and let you know.

On the coil winder I just have the homing speed permanently at 100% prior to that I would just jog via the keyboard until it was near the limit then stop and press the home.
Hood

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: homing my rotational axis
« Reply #4 on: June 20, 2008, 12:44:03 PM »
Here is something you can do that will help, but you will need to get into screen designer 3 or 4 your choice.

the following Homing "Macro" will do what you want, the one I put will do a Home ALL 6 axis, take out the ones you dont want.
there are some setup conditions, and Programming conditions you will HAVE to be aware of, they are documented in the below macro.

here is the button macro:

DoButton( 24 ) 'home z
DoButton( 23 ) 'home y
DoButton( 22 ) 'home x

'Shortest path Home A Axis
'Put this inside your Home ALL button, or a seperate button or both your choice
'it will move the axis in Absolute mode, in the coordinate system you where last in.

'Below: is the position where the rotary table rapids to in degrees.
'via shortest path,from that point it will move toward your home
'switch at your homing speed you will need to set your homing direction
'as negative if you move to point, is positive in relation to your home switch
'relative to this point. I put it at 5 degrees but you edit it for what you want.

'SETUP AND USE NOTES:

'Under Config>General you will have to tick "Rot 360 rollover"
'for this to work right.
'You A axis DRO will only read 0 to +360, it will not show negatives.
'In your Gcode all A movements will need to be in the above + range
'so basically only absolute A+ moves for your G code, you can put
'(NEGATIVE -A) moves ONLY if when it moves bacwards it does NOT cross
'the 0/360 line.....!!!!!!!!!!
'You can issue negative A axid moves but it will move that many,
'negative degrees from its positive position, and the show you positive.
'i.e. if your at A0, and push A-90, when it quits moving it will show
'A90 Positive.

HomeRapidPoint = 5.0  'this is the degree location to stop above move.
CurrentPos = GetOEMDRO(86) 'current location of A axis prior to homing move
       
MoveDist = HomeRapidPoint - CurrentPos   'Calc the move distance       
 If Abs(MoveDist) >180 Then         'Find the shortest path         
    If MoveDist < 0 Then           
       MoveDist = 360 + MoveDist         
    Else           
       MoveDist = MoveDist - 360         
    End If       
 End If       
    Code "G00 G91 A" & MoveDist        'Move the A axis in Incermental the move distance         
    While IsMoving ()         
    Wend
Code "G90"           'Put back to absolute mode

DoButton( 25 ) 'home a from the 5 degree point it will move back
          'at homing speed to find your home 0 switch.
             
DoButton( 26 ) 'home b
DoButton( 27 ) 'home c

'enjoy,
'Scott
fun times
Re: homing my rotational axis
« Reply #5 on: June 20, 2008, 01:15:59 PM »
Scott,
Thanks for the reply!
Some of that programming is definitely beyond my comprehension, but I am going to take some time to try and figure it out.

Just so i have a basic understanding of what you are doing....

Basically, you are adding a command which takes the current location (DRO) of the A axis and decides whether or not it has above or below the 180 degree point...

From here...another command will execute a shortest path move to the 5 degree point, where we can then home the axis..

2 Questions:
1) Do I have that concept correct?
2) Is this code to be added to my g-code or is this something im programming within the screen designer? (sorry for my ignorance in this area...I am new to Mach 3/CNC and am learning as i go....you have definitely given me nuts and bolts of the programming...i just dont have the background to understand where i am supposed to be putting these comments....a simple clarification for dummies would make my day)

Thanks again for taking time to help me out!
-Danny A
Re: homing my rotational axis
« Reply #6 on: June 20, 2008, 02:08:12 PM »
I am currently doing some research into the proposal scott sent me to try and set up my home switch....this will be a work in progress untill i can figure out what i'm doing....

Quick question for Hood...

I set up my home speed percentages for the a axis to be 100%...
It certainly does fly around  ;D
but...it is comming into that limit switch a bit too fast for comfort

Is there a way i can set it up so it homes at 100% untill i begin approaching the limit and then slows to a lesser percentage?

Is that what the slow zone setting is?

Always looking for reassurance.... :-\
-Danny A

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: homing my rotational axis
« Reply #7 on: June 20, 2008, 02:19:00 PM »
Afraid not, what the slow zone is for is when you have softlimits set up, if your axis is moving near to the softlimit zone then it will slow down progressively from the distance you have set. This is so that the axis has a chance to decelerate beforeotherwise it would hit the hard limit before the soflimits could stop it. The distance you need to set is dependant on your motors, if their acceleration is high then the distance can be very small but if its low then the distance must be greater.
Hood
Re: homing my rotational axis
« Reply #8 on: June 20, 2008, 02:37:44 PM »
the axis in question is a stepper set at 22.222 steps (we calculated it to be about 220 and it is connected to a belt with a 1/10 conversion factor)

The velocity is set at 1300
The accelleration is set at 1000

This seems to make it run smoothly...
Everything is fully functional...I am just trying to get optimal results from my setup...
If I am forced to set the homing percentage to a lower value, that's perfectly acceptable...again, just curious as to the possibilities

Thanks Mach 3 Community for saving my job  ;)
-Danny A

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: homing my rotational axis
« Reply #9 on: June 20, 2008, 07:45:12 PM »
Danny,

Open up Mach3, goto operator>Edit button script
Some of the buttons on your screen will start blinking, that means that button has VB Script in it
Click on your "Ref All" or "Home All" what ever it is called on your screen
a VB window will pop up, in that window copy and paste the code below into it.

here is the code:

'*************************start of button script*******************
DoButton( 24 ) 'home z
DoButton( 23 ) 'home y
DoButton( 22 ) 'home x

'Shortest path Home A Axis
'Put this inside your Home ALL button, or a seperate button or both your choice
'it will move the axis in Absolute mode, in the coordinate system you where last in.

'Below: is the position where the rotary table rapids to in degrees.
'via shortest path,from that point it will move toward your home
'switch at your homing speed you will need to set your homing direction
'as negative if you move to point, is positive in relation to your home switch
'relative to this point. I put it at 5 degrees but you edit it for what you want.

'SETUP AND USE NOTES:

'Under Config>General you will have to tick "Rot 360 rollover"
'for this to work right.
'You A axis DRO will only read 0 to +360, it will not show negatives.
'In your Gcode all A movements will need to be in the above + range
'so basically only absolute A+ moves for your G code, you can put
'(NEGATIVE -A) moves ONLY if when it moves bacwards it does NOT cross
'the 0/360 line.....!!!!!!!!!!
'You can issue negative A axid moves but it will move that many,
'negative degrees from its positive position, and the show you positive.
'i.e. if your at A0, and push A-90, when it quits moving it will show
'A90 Positive.

HomeRapidPoint = 5.0  'this is the degree location to stop above move.
CurrentPos = GetOEMDRO(86) 'current location of A axis prior to homing move
       
MoveDist = HomeRapidPoint - CurrentPos   'Calc the move distance       
If Abs(MoveDist) >180 Then         'Find the shortest path         
    If MoveDist < 0 Then           
       MoveDist = 360 + MoveDist         
    Else           
       MoveDist = MoveDist - 360         
    End If       
End If       
    Code "G00 G91 A" & MoveDist        'Move the A axis in Incermental the move distance         
    While IsMoving ()         
    Wend
Code "G90"           'Put back to absolute mode

DoButton( 25 ) 'home a from the 5 degree point it will move back
          'at homing speed to find your home 0 switch.
             
'DoButton( 26 ) 'home b
'DoButton( 27 ) 'home c

'enjoy, scott
'*******************end of button script********************************

now once the above script is pasted into your VB script window, (BTW I commented out the home B, and home C axis figured you didnt have them).
got to file>Save in the VB window, (it will call it "Hidden script" DO NOT CHANGE or fool with that in any way!!!!!!)
Then close the VB window once you have saved the button code.
Then go to View>save current layout and click current layout. It will tell you "Layout saved" or something like that
NOW!!!! Listen!!!!!!!!!
Sometimes even if you do that, Mach sometimes DOES NOT save your button changes, it is just one of them things.......
So goto Operator>Edit Button, your buttons will start blinking again, Click on your: Ref all or Home all button, it will open up the VB window again that should show
that code you just pasted into it last time and saved. If you do NOT see the code you just put in there, then Redo the copy/paste/save, and save layout operations again, and RECHECK again!!!!!!!!!!

NOTE: It is CRITICAL for you to follow the set up instructions under config>general that is commented in the Button file above!! It WILL NOT work right with out those conditions
being met.

Once that code is in your button, jog your A axis to some random point, then hit the home All button, your Z, then Y, then X will home, then Your A will move the shortest route to the 5 degree mark then move at homing percent speed to your home switch on your A axis. (note 20% homing speed is a good ref speed).

NOTE2: You can use this code to also do the SAME with your X, Y, and Z axis as well, so when you hit "Home All" each Axis will Haul-Ass to some predifined point (in machine coordinates), that is just short of your Home switches, it will then switch to "Homing Mode" and sneek the rest of the way in. Kinda like when you get to Drill the Ol' Lady, you haul ass to the bed room, then come sneekin in under the covers saying that it's ok, your "Waun the Pool Boy"..........hehehehe

BTW: What do you mean we (the mach support group), saved your job, what kind of company, or situation or you in??????????

Scott
fun times