603,982 active members*
2,448 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > LinuxCNC (formerly EMC2) > Can I use the same set of offsets in two machine confugurations?
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2009
    Posts
    419

    Can I use the same set of offsets in two machine confugurations?

    I use 2 configurations with my mill, when using the 4th axis:

    - With the 4th axis in degree mode
    - With the 4th axis as a spindle, to be used as a "lathe"

    For some jobs I set up the main offsets in degree mode. All these offsets are stored in a file that is written when lincnc is closed.

    I now copy that file to the appropriate folder so that the same offsets are used when I open the lathe configuration.

    But would there be a reason why I should not use the same file for both configurations, ie, make the lathe read the file from the degree configuration and save it there as well?
    Sven
    http://www.puresven.com/?q=building-cnc-router

  2. #2
    Join Date
    Feb 2007
    Posts
    711
    not sure at all if it would work, but you could try making one of the files into a symbolic link, pointing to the other file.

    from the wikipedia page for symbolic link:

    The following command creates a symbolic link at the command-line interface (shell):

    ln -s target_path link_path

    target_path is the relative or absolute path to which the symbolic link should point. Usually the target will exist, although symbolic links may be created to non-existent targets. link_path is the path of the symbolic link.

    After creating the symbolic link, it may generally be treated as an alias for the target. Any file system management commands (e.g., cp, rm) may be used on the symbolic link. Commands which read or write file contents will access the contents of the target file. The rm (delete file) command, however, removes the link itself, not the target file.

  3. #3
    Join Date
    Jul 2009
    Posts
    419
    I think you refer to the software side of things? As far as I can see you can just change the location of the file that is used to store the offsets in the .ini file.

    My question was more about practical use. Like would you run in to practical problems when using a list of offsets in two configuration.

    I always put the machine in the home position before shut down and both configurations use the same home location.

    I use my 4th axis in both a- as well as c-configuration so I can imagine that at some point the stuff on the table/in the cnc and stuff in my head gets seriously mixed up
    Sven
    http://www.puresven.com/?q=building-cnc-router

  4. #4
    Join Date
    Feb 2007
    Posts
    711
    Sorry I misunderstood your question.

    I don't see why it would be a problem, but I dont really use any offsets, except for g54 for touching off (with the button). I always try to clear any offsets with each new job, and touch off to the part. It helps force me to know where the tool really is. Not that it matters with limits and in jog mode, but bad things can happen in MDI mode if I think I am somewhere where I am not.

    As long as you can remember that the program remembers, I think everything should be ok.

  5. #5
    Join Date
    Sep 2008
    Posts
    229
    Quote Originally Posted by CaptainVee View Post
    - With the 4th axis in degree mode
    - With the 4th axis as a spindle, to be used as a "lathe"
    It takes a bit of tinkering, but it is possible to switch between those modes in one config.

    One (of several) ways to do it is to have the spindle on a velocity-mode stepgen. You can then use a mux HAL component to switch the stepgen input from the motion.spindle-speed-out pin, or the output of a position PID.

    The man complication is persuading the PID not to try to "unwind" every prior lathe-mode revolution.

  6. #6
    Join Date
    Jul 2009
    Posts
    419
    Hi Andy, that is interesting!

    Is that a difficult thing to get my head around?
    You created my lathe configuration through the linuxcnc website and I am still very happy with the results!
    Sven
    http://www.puresven.com/?q=building-cnc-router

  7. #7
    Join Date
    Sep 2008
    Posts
    229
    Quote Originally Posted by CaptainVee View Post
    Is that a difficult thing to get my head around
    I don't think so.

    As I said, it is all easy apart from having the PID not try to unwind all the previous rotations.

    One approach is to use a G-code subroutine to change mode.
    That allows you to re-zero the A axis to prevent the PID unwinding it.
    G10 L20 P1 A0 would simply zero the A-axis wherever it was. That is OK for some sorts of work, I guess.
    G10 L20 P1 [#5224 MOD 360] _might_ leave the current part-rotation in place, (if the spindle is calibrated in degrees). I actually suspect that #5224 holds the last commanded position, so is no use for getting the actual position.

    So, I think you either need to do some stuff in HAL, or read the A-position-feedback into a G-code analog input, then MOD that to take out the full turns.

    I would probably try to do it all in HAL, but I would probably write a custom component for the job.
    That isn't necessary, though. You can do it by latching the encoder position (float) in a sample-hold, converting to int, converting back to float, then subtracting that from the encoder/stepgen feedback position before sending it to the PID as the position feedback.
    sample-hold only works with S32, but that's OK in this case as you can sample-hold the integer version.

    If the spindle has an encoder, then another approach is to set the index-enable flag before handing over to the PID. It will try to unwind the turns, but the first time it passes index the encoder will zero, and everything will just work perfectly. (But I am not sure how that plays with motion.index-enable, so threading might not work with that. As you wouldn't be threading in rotary-axis mode this is probably a very minor consideration.

Similar Threads

  1. MX2000ST Tool Offsets / Machine Options
    By H234 in forum Daewoo/Doosan
    Replies: 2
    Last Post: 06-01-2012, 08:42 AM
  2. fixture offsets vs machine home
    By ragoodale in forum CNC Machining Centers
    Replies: 10
    Last Post: 04-12-2011, 02:31 AM
  3. Replies: 4
    Last Post: 02-01-2011, 03:10 PM
  4. M15-M16 AND OFFSETS
    By littlerob in forum Okuma
    Replies: 10
    Last Post: 03-26-2009, 11:50 AM
  5. Machine Offsets
    By dee26 in forum DNC Problems and Solutions
    Replies: 0
    Last Post: 04-10-2007, 07:17 PM

Posting Permissions

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