586,103 active members*
3,763 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > G-Code Programing > How do I Orient the A-axis to follow a Path?
Results 1 to 1 of 1
  1. #1
    Join Date
    Dec 2020
    Posts
    1

    How do I Orient the A-axis to follow a Path?

    Hi,

    I'm looking to orient an object connected to the end of the z-axis to follow the path(vector) of the xy axis movement.

    Consider the following scenario. I attach a camera to the end of z-axis, that then performs a fly-thru of a terrain, or diorama. The movement follows commands in the xyz axis to chart a path, but I'd like the camera at the end of the z axis to follow the path.

    A separate A-axis will rotate the camera CW or CCW.

    But the trick is to issue the A commands so that the camera rotates at the same direction, and rate of rotation as the path to be taken.

    So, in the case of the G2 command example attached, how do I ensure the camera is oriented in the direction of the arc, throughout the travel of the arc, from the start point to the end point, then of course orients according to the next movement (likely a G1 command).

    Thanks for the help.

    Dave
    Attached Thumbnails Attached Thumbnails g02.jpg  

  2. #2
    Join Date
    Dec 2013
    Posts
    5717

    Re: How do I Orient the A-axis to follow a Path?

    I think you want the camera to maintain an angle of 0° to the vector angle of the X and Y axes. That should keep the camera pointed in the right direction.

    The The G code command would look something like this: G1 X20 Y20 Z0 A45 F20

    You could generate the path in a CAM program and just post compatible G code for whatever controller you are using. Or you could ''teach'' the path by jogging the movements and capturing the positions along the way, then just play it back, many industrial robots are programmed this way.

    In a Galil motion controller there is a built in A axis tangent function to do exactly what you want.

    Overall it should be pretty easy to do.
    Jim Dawson
    Sandy, Oregon, USA

  3. #3
    Join Date
    Jun 2015
    Posts
    4154

    Re: How do I Orient the A-axis to follow a Path?

    hy david, hello jim

    okuma has a spec for that, like shown in attached, thus such a function as you describe, allready exists for real mill applications; it was developed, because normally a block containing a spindle phase comand and a linear comand, will not result in an interpolated motion, but more than likely the spindle will finish orientation while the linear motion just begin; thus having 2 separate comands in the same block, is not a guarantee for identical execution time

    as for lathes, when milling with c axis, if your camera would be on the turret, it will always be tangent to the toolpath

    at g-code level, suposing G123 A=0..360 will orient the spindle, is needed :
    ... on g1 blocks to add g123 a=atan2[ start position, end position ]
    ... to replace g2/g3 arches with g1s, thus linear motions, so to reduce them at the previous case, but for angle calculation, use also the arch center, as to achieve a more accurate value
    *as to fragmentize a long arch into small lines, you may use the software or a macro, but i think is easier to macro it, as there you will have control also over the arguments to compute camera angle, while in software, is needed postprocessor logic edit

    as a i side note, for software applications, i use a function that takes a contour, and breaks it into segments; lets consider a segment of 1mm :
    ... normal mode : a line/arch of 3.7 mm folowed by whatever else, will be vreaked into 4 equal segments
    ... remnanat mode : the previuos line will be breaked in 3 segments of 1mm, and the next entity will have it's 1st point at a position of 0.3mm, becuase there is allready a remnant of 0.7 from the previous line
    *i guess that for what you need, the normal mode is ok

    i can help you with generic g-code; please feel free to ask anything / kindly



    ps : if your cnc does not interpolate spindle phase with linear motion, then you may use this to your advantage, like computing the small segments ( as to break arches ) at such a lenght, where overall motion looks continous ... thus don't think for the segment from the length value, but from the smooth motion resolution
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •